Unverified Commit abfb3bb3 authored by LoveSy's avatar LoveSy Committed by GitHub

Fix always log hook fails

parent e184eb4a
...@@ -78,7 +78,8 @@ JNINativeInterface *new_functions; ...@@ -78,7 +78,8 @@ 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; \
for (; j < method##_methods_num; ++j) { \
if (strcmp(methods[i].signature, method##_methods[j].signature) == 0) { \ if (strcmp(methods[i].signature, method##_methods[j].signature) == 0) { \
jni_hook_list->try_emplace(className).first->second.push_back(methods[i]); \ jni_hook_list->try_emplace(className).first->second.push_back(methods[i]); \
method##_orig = methods[i].fnPtr; \ method##_orig = methods[i].fnPtr; \
...@@ -88,7 +89,9 @@ if (methods[i].name == #method##sv) { \ ...@@ -88,7 +89,9 @@ if (methods[i].name == #method##sv) { \
break; \ break; \
} \ } \
} \ } \
if (j == method##_methods_num) { \
ZLOGE("unknown signature of %s#" #method ": %s\n", className, methods[i].signature); \ ZLOGE("unknown signature of %s#" #method ": %s\n", className, methods[i].signature); \
} \
continue; \ continue; \
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment