From 23204c204ae9886f2681693639ffed6b2b747488 Mon Sep 17 00:00:00 2001 From: kotori0 Date: Fri, 11 Dec 2020 00:10:18 +0800 Subject: [PATCH] Remove native flag --- .../main/cpp/external/yahfa/src/HookMain.c | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/edxp-core/src/main/cpp/external/yahfa/src/HookMain.c b/edxp-core/src/main/cpp/external/yahfa/src/HookMain.c index b59db555..d8268691 100644 --- a/edxp-core/src/main/cpp/external/yahfa/src/HookMain.c +++ b/edxp-core/src/main/cpp/external/yahfa/src/HookMain.c @@ -113,28 +113,6 @@ void setNonCompilable(void *method) { LOGI("setNonCompilable: change access flags from 0x%x to 0x%x", old_flags, access_flags); } -bool setNativeFlag(void *method, bool isNative) { - uint32_t access_flags = getFlags(method); - uint32_t old_flags = access_flags; - LOGI("setNativeFlag: access flags is 0x%x", access_flags); - uint32_t old_access_flags = access_flags; - if (isNative) { - access_flags |= kAccNative; - if (SDKVersion >= __ANDROID_API_Q__) { - // On API 29 whether to use the fast path or not is cached in the ART method structure - access_flags &= ~kAccFastInterpreterToInterpreterInvoke; - } - } else { - access_flags &= ~kAccNative; - } - if (access_flags != old_access_flags) { - setFlags(method, access_flags); - LOGI("change access flags from 0x%x to 0x%x", old_flags, access_flags); - return true; - } - return false; -} - void *getEntryPoint(void* method) { return readAddr((char *) method + OFFSET_entry_point_from_quick_compiled_code_in_ArtMethod); } @@ -188,12 +166,6 @@ static int replaceMethod(void *fromMethod, void *toMethod, int isBackup) { pointer_size); } - // set the target method to native so that Android O wouldn't invoke it with interpreter - // for Q or above, we use ShouldUseInterpreterEntrypoint - if (SDKVersion >= __ANDROID_API_O__ && SDKVersion < __ANDROID_API_Q__) { - setNativeFlag(fromMethod, true); - } - hookCount += 1; return 0; }