You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
代码如下:
Class<?> webViewClass = getClassLoader().loadClass("android.webkit.WebView");
HookManager.findAndHookMethod(webViewClass, "loadUrl", String.class, new MethodCallback() { @OverRide
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
super.beforeHookedMethod(param);
Log.d("panda", "i'm in method " +param.method.getName()+" beforeHookedMethod");
} @OverRide
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);
Log.d("panda", "i'm in method " +param.method.getName()+" afterHookedMethod");
}
});
异常如下:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.panda.hook.andhook, PID: 17591
java.lang.VerifyError: Verifier rejected class com.panda.hook.andhook.MainActivity: void com.panda.hook.andhook.MainActivity.onCreate(android.os.Bundle) failed to verify: void com.panda.hook.andhook.MainActivity.onCreate(android.os.Bundle): [0x4B] 'this' argument 'Reference: com.panda.hook.andhook.MyWebview' not instance of 'Reference: android_webkit_WebView' (declaration of 'com.panda.hook.andhook.MainActivity' appears in /data/app/com.panda.hook.andhook-jnxRzI9vY8XQW7tN8LeIQA==/split_lib_slice_0_apk.apk)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
The text was updated successfully, but these errors were encountered:
android o上尝试拦截 android.webkit.WebView的loadUrl方法
代码如下:
Class<?> webViewClass = getClassLoader().loadClass("android.webkit.WebView");
HookManager.findAndHookMethod(webViewClass, "loadUrl", String.class, new MethodCallback() {
@OverRide
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
super.beforeHookedMethod(param);
Log.d("panda", "i'm in method " +param.method.getName()+" beforeHookedMethod");
}
@OverRide
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);
Log.d("panda", "i'm in method " +param.method.getName()+" afterHookedMethod");
}
});
异常如下:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.panda.hook.andhook, PID: 17591
java.lang.VerifyError: Verifier rejected class com.panda.hook.andhook.MainActivity: void com.panda.hook.andhook.MainActivity.onCreate(android.os.Bundle) failed to verify: void com.panda.hook.andhook.MainActivity.onCreate(android.os.Bundle): [0x4B] 'this' argument 'Reference: com.panda.hook.andhook.MyWebview' not instance of 'Reference: android_webkit_WebView' (declaration of 'com.panda.hook.andhook.MainActivity' appears in /data/app/com.panda.hook.andhook-jnxRzI9vY8XQW7tN8LeIQA==/split_lib_slice_0_apk.apk)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
The text was updated successfully, but these errors were encountered: