diff --git a/edxp-core/src/main/cpp/main/include/android_build.h b/edxp-core/src/main/cpp/main/include/android_build.h index 4507c49b..57ad089e 100644 --- a/edxp-core/src/main/cpp/main/include/android_build.h +++ b/edxp-core/src/main/cpp/main/include/android_build.h @@ -21,6 +21,7 @@ #define ANDROID_O_MR1 27 #define ANDROID_P 28 #define ANDROID_Q 29 +#define ANDROID_R 30 static inline int32_t GetAndroidApiLevel() { char prop_value[PROP_VALUE_MAX]; diff --git a/edxp-core/src/main/cpp/main/include/art/runtime/class_linker.h b/edxp-core/src/main/cpp/main/include/art/runtime/class_linker.h index bb1e34d7..88aaeda0 100644 --- a/edxp-core/src/main/cpp/main/include/art/runtime/class_linker.h +++ b/edxp-core/src/main/cpp/main/include/art/runtime/class_linker.h @@ -44,6 +44,15 @@ namespace art { } } + CREATE_HOOK_STUB_ENTRIES(bool, ShouldUseInterpreterEntrypoint, void *art_method, const void* quick_code) { + // TODO check hooked + bool hooked = false; + if (hooked && quick_code != nullptr) { + return false; + } + return ShouldUseInterpreterEntrypointBackup(art_method, quick_code); + } + public: ClassLinker(void *thiz) : HookedObject(thiz) {} @@ -59,6 +68,10 @@ namespace art { HOOK_FUNC(FixupStaticTrampolines, "_ZN3art11ClassLinker22FixupStaticTrampolinesENS_6ObjPtrINS_6mirror5ClassEEE"); + if (GetAndroidApiLevel() >= ANDROID_R) { + HOOK_FUNC(ShouldUseInterpreterEntrypoint, + "_ZN3art11ClassLinker30ShouldUseInterpreterEntrypointEPNS_9ArtMethodEPKv"); + } } ALWAYS_INLINE void SetEntryPointsToInterpreter(void *art_method) const { diff --git a/edxp-sandhook/build.gradle b/edxp-sandhook/build.gradle index b5eed220..f873a614 100644 --- a/edxp-sandhook/build.gradle +++ b/edxp-sandhook/build.gradle @@ -28,7 +28,7 @@ dependencies { compileOnly files("${hiddenApiStubJarFilePath}") implementation project(':edxp-common') implementation project(':xposed-bridge') - implementation 'com.swift.sandhook:hooklib:4.1.7' + implementation 'com.swift.sandhook:hooklib:4.2.1' compileOnly project(':dexmaker') } diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java index eb7e80cf..a46c11fb 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java @@ -281,6 +281,7 @@ public class HookStubManager { ((XC_MethodHook) snapshot[beforeIdx]).callBeforeHookedMethod(param); } catch (Throwable t) { // reset result (ignoring what the unexpectedly exiting callback did) + XposedBridge.log(t); param.setResult(null); param.returnEarly = false; continue; @@ -304,6 +305,7 @@ public class HookStubManager { param.setResult(SandHook.callOriginMethod(originMethod, entity.backup, thiz, param.args)); } } catch (Throwable e) { + XposedBridge.log(e); param.setThrowable(e); } } @@ -317,6 +319,7 @@ public class HookStubManager { try { ((XC_MethodHook) snapshot[afterIdx]).callAfterHookedMethod(param); } catch (Throwable t) { + XposedBridge.log(t); if (lastThrowable == null) param.setResult(lastResult); else @@ -375,6 +378,7 @@ public class HookStubManager { try { param.setResult(SandHook.callOriginMethod(true, origin, backup, thiz, param.args)); } catch (Throwable e) { + XposedBridge.log(e); param.setThrowable(e); } } diff --git a/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so b/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so index 56b24621..f8ff8905 100644 Binary files a/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so and b/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so differ diff --git a/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so b/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so index 273fecdc..3e0cdc56 100644 Binary files a/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so and b/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so differ