Commit e0845316 authored by swift_gan's avatar swift_gan

Merge remote-tracking branch 'origin/master' into method_stubs

parents 14327145 465929e1
......@@ -155,6 +155,16 @@ XposedHelpers.findAndHookMethod(Activity.class, "onResume", new XC_MethodHook()
```
# Notice
!!!!!!!!
when OS >= 8.0
you must call backup method in hook method, if you want call it in other method, please call SandHook.compileMethod(otherMethod) before call backup method.
because when ART trigger JIT from profiling, JIT will invoke -> ResolveCompilingMethodsClass -> ClassLinker::ResolveMethod -> CheckIncompatibleClassChange -> ThrowIncompatibleClassChangeError finally!!!
# References
......
......@@ -279,7 +279,9 @@ Java_com_swift_sandhook_SandHook_compileMethod(JNIEnv *env, jclass type, jobject
if (method != nullptr && !method->isCompiled()) {
SandHook::StopTheWorld stopTheWorld;
method->compile(env);
if (!method->compile(env) && SDK_INT >= ANDROID_N) {
method->disableCompilable();
}
}
}
......
......@@ -228,6 +228,8 @@ public class HookerDexMaker {
mHookMethod = mHookClass.getMethod(METHOD_NAME_HOOK, mActualParameterTypes);
mBackupMethod = mHookClass.getMethod(METHOD_NAME_BACKUP, mActualParameterTypes);
mCallBackupMethod = mHookClass.getMethod(METHOD_NAME_CALL_BACKUP, mActualParameterTypes);
SandHook.resolveStaticMethod(mCallBackupMethod);
SandHook.compileMethod(mCallBackupMethod);
mHookClass.getMethod(METHOD_NAME_SETUP, Member.class, Method.class, XposedBridge.AdditionalHookInfo.class).invoke(null, mMember, mBackupMethod, mHookInfo);
return new HookWrapper.HookEntity(mMember, mHookMethod, mBackupMethod);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment