简体   繁体   中英

Xposed Abstract Methods and Interfaces

Is Xposed able to hook abstract methods and/or methods defined in interfaces? I am trying to hook a method defined in an interface with the usual findAndHookMethod, but it returns

java.lang.IllegalArgumentException: Cannot hook interfaces: public abstract void com.angrydoughnuts.android.alarmclock.MediaListView$OnItemPickListener.onItemPick(android.net.Uri,java.lang.String)

This is my method call:

findAndHookMethod("com.angrydoughnuts.android.alarmclock.MediaListView$OnItemPickListener", lpparam.classLoader, "onItemPick", "android.net.Uri", "java.lang.String", new XC_MethodHook() {

OnItemPickListener is the interface.

Xposed is not able to hook abstract methods or interfaces. Only methods and constructors can be hooked.

You cannot hook an interface, but you can hook every implementation if needed. You can find out what classes implement an interface in Android using resources such as http://grepcode.com/search/?query=google+android&entity=project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM