Update jni hooks

This commit is contained in:
topjohnwu
2021-10-14 02:43:56 -07:00
parent b0198dab6c
commit e8ae103d5f
3 changed files with 5 additions and 8 deletions

View File

@@ -303,14 +303,12 @@ unique_ptr<JNINativeMethod[]> hookAndSaveJNIMethods(const char *className, const
}
auto &class_map = (*jni_method_map)[className];
for (int i = 0; i < numMethods; ++i) {
class_map[methods[i].name][methods[i].signature] = methods[i].fnPtr;
if (hook_cnt == 0) continue;
if (clz_id == 0) {
if (hook_cnt && clz_id == 0) {
HOOK_JNI(nativeForkAndSpecialize)
HOOK_JNI(nativeSpecializeAppProcess)
HOOK_JNI(nativeForkSystemServer)
continue;
}
class_map[methods[i].name][methods[i].signature] = methods[i].fnPtr;
}
return newMethods;
}