Skip to content

macOS persistence - #23

Draft
gBasil wants to merge 9 commits into
extendify-mod:masterfrom
gBasil:macos/persistence
Draft

gBasil wants to merge 9 commits into
extendify-mod:masterfrom
gBasil:macos/persistence

Conversation

@gBasil

@gBasil gBasil commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Adds persistence for macOS by patching the downloaded app binary before an update is applied.

Also introduces the concept of an Extendify data directory. This would be for storing the native library, js/css (to not have to refetch it on launch), configs, plugins, and whatnot. It's currently only used as part of the persistence system.

macOS install instructions have to be updated. I was thinking of writing an installer to automate this, as installation now consists of injecting the dylib into the binary.

Comment thread crates/extendify-native/src/lib.rs Resolved

// When swizzling a class method, we need to use the metaclass here instead
let success = class_addMethod(metaclass, swizzled_selector, swizzled_relaunch, method_getTypeEncoding(original_method));
assert!(success.as_bool(), "failed to add method");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

design question: do we want to crash if we can't install persistence or do we want to just log an error and continue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably return an error and then have it be logged in the persistence ctor bit. But class_addMethod shouldn't be causing issues in the first place, unless the actual classes are null, for which I've added checks.

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.

3 participants