-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hook java static method #14
Comments
What is the exception ? What does logcat say?
|
Thanks for your prompt reply. In the log of DDI, the function "_Z20dvmDecodeIndirectRefP6ThreadP8_jobject" can be not resolved. So, the function "_Z20dvmDecodeIndirectRefP7_JNIEnvP8_jobject" is added. The follow is the concrete output. I wonder whether the problem is caused by the "dvmDecodeIndirectRef", where the logcat also gives some prompts. However, after searching the source code of Android, I don't find the dependency between "CallStatic###Method" and "dvmDecodeIndirectRef". The follow is the output of logcat. I/DEBUG ( 33): r0 00000000 r1 000a0ac0 r2 00000000 r3 00000000 |
i find solution first void sb_test(JNIEnv env) and dalvik_hook_setup(&sb, "Ltest/test/test", "test", 0, sb_test); |
Hi,
I try to hook the static method. But, when the original method is invoked, some exceptions are thrown. The example is as follow.
Java static method: Lexample;->test()V
My hook method:
void sb_test(JNIEnv _env) {
dalvik_prepare(&d, &sb, env);
(_env)->CallStaticVoidMethod(env, sb.cls, sb.mid); // Exception is here!!
dalvik_postcall(&d, &sb);
}
Is there any problem? Thank for very much!
The text was updated successfully, but these errors were encountered: