Passive intent sniffing via the activity manager
A good way to proliferate information about application and their components is to eavesdrop on inter-application communication. One way you could do this is by requesting information about the most recent intents from the activity manager.
This is pretty straightforward and, as it turns out, can be done via drozer (which was introduced in Chapter 3, Android Security Assessment Tools) if you're willing to do some Python scripting. The folks at iSec Partners have developed an Android application that is capable of doing this, and most of the inspiration for the drozer module discussed in the following recipe comes from their app. To find out how to get your hands on this app see the See also section of this recipe.
Getting ready
Before we actually write this module, we need to modify the drozer Agent a little so it has the required permissions to actually request information about intents from the activity manager. The simplest way to do this...