This is a method hook framework for Android ART. It provides an implementation of Lens IHookFrameWork
to support Lens advanced functions. OS versions greater than 5.0 are supported currently .
1.yhook:https://github.com/Tencent/GT/tree/master/android/GT_SDK/yhook
2.YAHFA: https://github.com/PAGalaxyLab/YAHFA GPL3.0
- Support method hook on OS greater than 5.0.
- Support loading hook plug-in under
assets
directory. - Support loading hook plug-ins with specific paths.
As method hook may not be stable , and
YAHFA
is GPL 3.0 license , we suggest using this in debug mode.
dependencies {
implementation 'carl.lee.lens:lens-yhook:1.0.5'
}
- Generate hook plug-in:
- Please refer to
ViewTouchHook
inhookapi
model for instance. - You may use hook plug-in model to compile hook
apk
.
- Please refer to
- Use hook plug-in:
- Build-In plug-in :Put the plug-in
apk
under assets directory,and rename it tohookplugin.apk
. - Outside plug-in :
Java HookWrapper.addCustomHookPluginPath(String path);
- Build-In plug-in :Put the plug-in
- Support Lens hook:
Please refer to
HookFrameworkImpl
underapp
model. CallLensUtil.buildConfig().setHookFrameWorkImpl(new HookFramework())
to set HookFramework for Lens.
GNU GPL V3