Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Split Inkay into a module and a plugin #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DaniElectra
Copy link
Member

Resolves #XXX

Changes:

This is necessary for a future Aroma feature. This also makes more clear the immutability of the patches that Pretendo requires, since they cannot be reverted easily.

All patching code is now managed inside the module, which the plugin triggers by calling an exported function from it. The WWP reset code remains within the plugin as it isn't strictly tied to the patches.

The language files haven't been moved for backwards compatibility with Weblate.

This is necessary for a future Aroma feature. This also makes more clear
the immutability of the patches that Pretendo requires, since they
cannot be reverted easily.

All patching code is now managed inside the module, which the plugin
triggers by calling an exported function from it. The WWP reset code
remains within the plugin as it isn't strictly tied to the patches.
Copy link
Member

@ashquarky ashquarky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested it yet but generally seems ok. I still find the whole split kinda strange since removing the plugin would just mean users can't control what's going on anymore, but I like that the module calls into ShowNotification too so they're still informed about what's up


CXXFLAGS := $(CFLAGS) -std=c++20

ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-gc-sections is useful to reduce binary size (which is a concern for us as a project listed on aroma.foryour.cafe) - any particular reason to yoink it here?

Copy link
Member Author

@DaniElectra DaniElectra Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no particular reason, I had just imported the Makefile from the example module and adapted what I saw. I will add it back


if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast<void * *>(&moduleInitialize)) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE("Failed to find initialization function");
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to call ShowNotification on these error paths


#include <kernel/kernel.h>
#include <mocha/mocha.h>
#include <function_patcher/function_patching.h>
#include "patches/account_settings.h"
#include "patches/dns_hooks.h"
#include "patches/eshop_applet.h"
#include "patches/olv_applet.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ones are arguably mutable where the IOSU-side ones aren't
Probably better to keep it all together though to prevent weird half-patched failure modes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants