You've already forked ZygiskNext
mirror of
https://github.com/Dr-TSNG/ZygiskNext.git
synced 2025-08-27 23:46:34 +00:00
log if jni hook failed
This commit is contained in:
@@ -236,12 +236,14 @@ void hookJniNativeMethods(JNIEnv *env, const char *clz, JNINativeMethod *methods
|
|||||||
if (mid == nullptr) {
|
if (mid == nullptr) {
|
||||||
env->ExceptionClear();
|
env->ExceptionClear();
|
||||||
nm.fnPtr = nullptr;
|
nm.fnPtr = nullptr;
|
||||||
|
LOGE("Could not found jni method in class %s: %s(%s)", clz, nm.name, nm.signature);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto method = lsplant::JNI_ToReflectedMethod(env, clazz, mid, is_static);
|
auto method = lsplant::JNI_ToReflectedMethod(env, clazz, mid, is_static);
|
||||||
auto modifier = lsplant::JNI_CallIntMethod(env, method, member_getModifiers);
|
auto modifier = lsplant::JNI_CallIntMethod(env, method, member_getModifiers);
|
||||||
if ((modifier & MODIFIER_NATIVE) == 0) {
|
if ((modifier & MODIFIER_NATIVE) == 0) {
|
||||||
nm.fnPtr = nullptr;
|
nm.fnPtr = nullptr;
|
||||||
|
LOGE("Don't hook method because it's not native method: %s: %s(%s)", clz, nm.name, nm.signature);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto artMethod = lsplant::art::ArtMethod::FromReflectedMethod(env, method);
|
auto artMethod = lsplant::art::ArtMethod::FromReflectedMethod(env, method);
|
||||||
|
|||||||
Reference in New Issue
Block a user