From 12f57d6e8ca57c59905e0a326009d257bf90b4e2 Mon Sep 17 00:00:00 2001 From: 5ec1cff Date: Tue, 12 Dec 2023 13:12:58 +0800 Subject: [PATCH] log if jni hook failed --- loader/src/injector/hook.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/src/injector/hook.cpp b/loader/src/injector/hook.cpp index be3193e..ddf3ea8 100644 --- a/loader/src/injector/hook.cpp +++ b/loader/src/injector/hook.cpp @@ -236,12 +236,14 @@ void hookJniNativeMethods(JNIEnv *env, const char *clz, JNINativeMethod *methods if (mid == nullptr) { env->ExceptionClear(); nm.fnPtr = nullptr; + LOGE("Could not found jni method in class %s: %s(%s)", clz, nm.name, nm.signature); continue; } auto method = lsplant::JNI_ToReflectedMethod(env, clazz, mid, is_static); auto modifier = lsplant::JNI_CallIntMethod(env, method, member_getModifiers); if ((modifier & MODIFIER_NATIVE) == 0) { nm.fnPtr = nullptr; + LOGE("Don't hook method because it's not native method: %s: %s(%s)", clz, nm.name, nm.signature); continue; } auto artMethod = lsplant::art::ArtMethod::FromReflectedMethod(env, method);