How to hook a onReceive method inside BroadcastReceiver?
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:
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.
There probably is a file named RecentsActivity$N (where N is a number). Just do Class.forName("<packagename>.RecentsActivity$N") and hook this class onReceive method.
Class.forName("<packagename>.RecentsActivity$N")
Good luck!
Since the BroadcastReceiver is an abstract class and this is an inline class definition, perhaps you can retrieve this BroadcastReceiver this way:
Otherwise try to check the application smali code using the apktool.
There probably is a file named RecentsActivity$N (where N is a number). Just do
Class.forName("<packagename>.RecentsActivity$N")
and hook this class onReceive method.Good luck!