[英]Hook to BroadcastReceiver using Xposed Framework
How to hook a onReceive method inside BroadcastReceiver? 如何在BroadcastReceiver内挂钩onReceive方法?
public class RecentsActivity extends Activity
{
mIntentReceiver = new BroadcastReceiver()
{
public void onReceive(Context context, Intent intent)
{
...
}
};
}
Since the BroadcastReceiver is an abstract class and this is an inline class definition, perhaps you can retrieve this BroadcastReceiver this way: 由于BroadcastReceiver是一个抽象类,并且这是一个内联类定义,因此您可以通过以下方式检索此BroadcastReceiver:
for(Class<?> cls : <package_name>.RecentsActivity.class.getDeclaredClasses()){
if(BroadcastReceiver.isAssignableFrom(cls)){
//hook onReceive
}
}
Otherwise try to check the application smali code using the apktool . 否则,尝试使用apktool检查应用程序的smali代码。
There probably is a file named RecentsActivity$N (where N is a number). 可能有一个名为LatestsActivity $ N的文件(其中N是数字)。 Just do
Class.forName("<packagename>.RecentsActivity$N")
and hook this class onReceive method. 只需执行
Class.forName("<packagename>.RecentsActivity$N")
并将该类挂接到onReceive方法即可。
Good luck! 祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.