Fix ShouldUseInterpreterEntrypoint in Android 13

This commit is contained in:
LoveSy 2022-02-12 15:29:08 +08:00 committed by LoveSy
parent dcd29b8751
commit 2b70e64e6d
1 changed files with 11 additions and 1 deletions

View File

@ -104,6 +104,14 @@ namespace art {
CREATE_FUNC_SYMBOL_ENTRY(void, art_quick_to_interpreter_bridge, void*) {}
CREATE_FUNC_SYMBOL_ENTRY(void, art_quick_generic_jni_trampoline, void*) {}
CREATE_HOOK_STUB_ENTRIES("_ZN3art11interpreter29ShouldStayInSwitchInterpreterEPNS_9ArtMethodE",
bool, ShouldStayInSwitchInterpreter ,(void* art_method), {
if (lspd::isHooked(art_method) || lspd::IsMethodPending(art_method)) [[unlikely]] {
return false;
}
return backup(art_method);
});
public:
ClassLinker(void *thiz) : HookedObject(thiz) {}
@ -120,7 +128,9 @@ namespace art {
RETRIEVE_MEM_FUNC_SYMBOL(SetEntryPointsToInterpreter,
"_ZNK3art11ClassLinker27SetEntryPointsToInterpreterEPNS_9ArtMethodE");
if (api_level < __ANDROID_API_T__) {
if (api_level >= __ANDROID_API_T__) {
lspd::HookSyms(handle, ShouldStayInSwitchInterpreter);
} else {
lspd::HookSyms(handle, ShouldUseInterpreterEntrypoint);
}