Conversation
There was a problem hiding this comment.
Pull request overview
This PR refines the public LibXposed API toward a “final stable” shape by introducing an explicit module-load callback, restructuring hook handle types around Executable, and raising the Android minSdk accordingly.
Changes:
- Add
onModuleLoaded(ModuleLoadedParam)callback to separate “module attached” from instantiation timing. - Redesign hooking APIs: replace
Member/MethodUnhookerwithExecutable-based generics and new hook handle types. - Raise
apimoduleminSdkfrom 24 → 26 to supportjava.lang.reflect.Executablein the public surface.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| api/src/main/java/io/github/libxposed/api/XposedModuleInterface.java | Adds onModuleLoaded callback and related Javadoc. |
| api/src/main/java/io/github/libxposed/api/XposedModule.java | Removes constructor-based initialization and updates guidance to use onModuleLoaded. |
| api/src/main/java/io/github/libxposed/api/XposedInterfaceWrapper.java | Switches to late attachment (attachFramework) and updates wrapper methods to new hook APIs. |
| api/src/main/java/io/github/libxposed/api/XposedInterface.java | Updates core API types to Executable, introduces hook handle interfaces, and adjusts invocation/deoptimize APIs. |
| api/build.gradle.kts | Bumps minSdk to 26 to match new Executable usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I see that #15 has been closed but it does not look to me like it was implemented in this pull request. Have the plans to implement it been scrapped? |
The side effects of individual hooker class are too severe while introducing minimum advantage. Because dsl and lambda becomes impossible, every module would implement its own hook dispatchers, making cooperation impossible and destroy hook dump readability.
|
Hi, |
Resource hooks are removed in new API because of already low compatibility with new Android versions. We may offer a more modern resource hook solution in the future, but it is not currently part of the API 100 initiative. |
|
It would be nice if you updated the example repo so we can see how using the new api would look like |
|
|
This: is betterr than: Previously (rovo api), I could pass an instantiated object with data into variables, but now, within the class, in the before/after methods, I have to invoke get* methods each time to get the values I need, because I no longer have an object but a static class. |
Thank you for your suggestion. For your concern, I don't understand fully because there isn't a static class but a hooker object. We currently redesigned a new OkHttp style interceptor interface to replace the old AOP style one. You can have a look at the example repo to see if this meets your need. |
sorry my fault, I analyzed the patch badly, I'll wait for the merge to try it |
|
@programminghoch10 Resource hooks have been replaced by SDK API, we will redesign resource hooks based on runtime resource overlay. |
Sure, a resource hook overlay mechanism similar to or using More importantly however, resource overlays do not enable layout hooking, programmatically modifying the layout after inflation but before it is inserted into the view tree is very useful for many UI modification modules. |
After the merge, the release will be prepared for MavenCentral, and no further breaking changes are permitted.
Key changes:
getFrameworkPrivilegewithgetFrameworkCapabilitieshookmethod renamed toHookHandle. Abandoned AOP style interface. Use OkHttp style interceptor for method hooks.XposedModule, useattachFrameworkmethod similar to Android SDK code styleonModuleLoadedinterface, which is guaranteed to be called exactly once for a process