diff --git a/core/src/main/cpp/external/yahfa/src/HookMain.cpp b/core/src/main/cpp/external/yahfa/src/HookMain.cpp index b1e050a4..dac18d11 100644 --- a/core/src/main/cpp/external/yahfa/src/HookMain.cpp +++ b/core/src/main/cpp/external/yahfa/src/HookMain.cpp @@ -42,7 +42,8 @@ namespace { uint32_t access_flags = read32((char *) method + OFFSET_access_flags_in_ArtMethod); LOGI("setNonCompilable: access flags is 0x%x", access_flags); access_flags |= kAccCompileDontBother; - access_flags &= ~kAccPreCompiled; + if (SDKVersion >= __ANDROID_API_R__) + access_flags &= ~kAccPreCompiled; write32((char *) method + OFFSET_access_flags_in_ArtMethod, access_flags); }