You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YAHFA depends on dlfunc after commit 5b60df8 for calling MakeInitializedClassesVisiblyInitialized explicitly on Android R, and Android Gradle Plugin version 4.1+ is required for that native library dependency.
where backup would be a placeholder for invoking the target method. Set backup to null or just use HookMain.hook(Method target, Method hook) if the original code is not needed.
Both hook and backup are static methods, and their parameters should match the ones of target. Please take a look at demoPlugin on how these methods are defined.
Workaround for Method Inlining
Hooking would fail for methods that are compiled to be inlined. For example:
Here the value of register lr is hardcoded instead of reading from entry point field of ArtMethod.
A simple workaround is to build the APP with debuggable option on, in which case the inlining optimization will not apply. However the option --debuggable of dex2oat is not available until API 23. So please take a look at machine instructions of the target when the hook doesn't work.