mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-05-16 19:48:20 +00:00
Fix always log hook fails
This commit is contained in:
parent
e184eb4a23
commit
abfb3bb3bb
@ -76,20 +76,23 @@ HookContext *g_ctx;
|
|||||||
const JNINativeInterface *old_functions;
|
const JNINativeInterface *old_functions;
|
||||||
JNINativeInterface *new_functions;
|
JNINativeInterface *new_functions;
|
||||||
|
|
||||||
#define HOOK_JNI(method) \
|
#define HOOK_JNI(method) \
|
||||||
if (methods[i].name == #method##sv) { \
|
if (methods[i].name == #method##sv) { \
|
||||||
for (int j = 0; j < method##_methods_num; ++j) { \
|
int j = 0; \
|
||||||
if (strcmp(methods[i].signature, method##_methods[j].signature) == 0) { \
|
for (; j < method##_methods_num; ++j) { \
|
||||||
jni_hook_list->try_emplace(className).first->second.push_back(methods[i]); \
|
if (strcmp(methods[i].signature, method##_methods[j].signature) == 0) { \
|
||||||
method##_orig = methods[i].fnPtr; \
|
jni_hook_list->try_emplace(className).first->second.push_back(methods[i]); \
|
||||||
newMethods[i] = method##_methods[j]; \
|
method##_orig = methods[i].fnPtr; \
|
||||||
ZLOGI("replaced %s#" #method "\n", className); \
|
newMethods[i] = method##_methods[j]; \
|
||||||
--hook_cnt; \
|
ZLOGI("replaced %s#" #method "\n", className); \
|
||||||
break; \
|
--hook_cnt; \
|
||||||
} \
|
break; \
|
||||||
} \
|
} \
|
||||||
ZLOGE("unknown signature of %s#" #method ": %s\n", className, methods[i].signature); \
|
} \
|
||||||
continue; \
|
if (j == method##_methods_num) { \
|
||||||
|
ZLOGE("unknown signature of %s#" #method ": %s\n", className, methods[i].signature); \
|
||||||
|
} \
|
||||||
|
continue; \
|
||||||
}
|
}
|
||||||
|
|
||||||
// JNI method hook definitions, auto generated
|
// JNI method hook definitions, auto generated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user