rovo89 / XposedBridge

The Java part of the Xposed framework.
3.89k stars 1.1k forks source link

How can I hook a anonymous class like .... #152

Closed shiqwang closed 7 years ago

shiqwang commented 7 years ago

Hi, I got a trouble .. really really hassle me I wanna hook class blablabla's method, anyone knows it ? Class a { public void onCreate(Bundle b) { ... this.xxx.setOnClickListener( new blablabla () { method A, method B }); ... } }

rovo89 commented 7 years ago

The class names for anonymous classes are generated by the Java compiler. So you'll need to decompile the APK to find out the name (probably something like a$1) and then hook the method with that.