开发者

List intent filters for installed packages

I want to list out the activity intent filters for the packages installed on my phone. This is just for a learning experience, I want to understand what apps can be started with implicit intents and how the intent filters are set up.

Google provides a table for the applications they provide at http://developer.android.com/guide/appendix/g-app-intents.html. I’m looking to create a similar list for other applications.

Can I use the PackageManager and dig this info up in code? Does anyone know of an existing app that can do this? Can anyone point me to an existing example to do 开发者_StackOverflowwhat I want?

Sorry if this is a duplicate of similar questions like Listing an application's activity and intent-filters? and Android -- How to get a list of all available intent filters ?


AFAIK there is no way to list all intents that a specific application can receive. However, you can get similar (albeit not as expansive) information by creating some intents yourself then using PackageManager's queryIntentActivities, queryIntentservices, and queryBroadcastReceivers to see what applications are installed that will react to that intent.


Let me recommend the app "ManifestViewer". It lists intents for each installed app. https://play.google.com/store/apps/details?id=jp.susatthi.ManifestViewer

Have a nice day !!


Using the following command with my Nexus 6 on Nougat 7.0 I got the list of all intents:

adb shell pm dump * | grep ' filter' | cut -d ' ' -f 12 | sort | uniq

  • First the command opens a shell into your device and does a PackageManager dump of every package.
  • Then pipe that output to grep which only selects lines with the word 'filter.'
  • Then pipe that output to cut which gives the text found at the 12th position of any spaces on that line.
  • Then pipe that output to sort which sorts that list from A to Z.
  • Then pipe that output to uniq which clears up duplicated Intents.

YMMV - give these a try one at a time. Add the next pipe as you see the results you want. Not sure if prior versions of adb will give you different numbers of spaces for cut, for example.

And, if you wanted the results for just one package like Chrome you could use:

adb shell pm dump com.android.chrome | grep ' filter' | cut -d ' ' -f 12 | sort | uniq


adb shell dumpsys package <packagename> provides the list of activities and the corresponding intents of an application.


The easiest way is to download the APK for the app you're interested in (there are loads of totally trustworthy sites for this). Then install apktool (e.g. brew install apktool) then

apktool d The.apk

Then check in the AndroidManifest.xml.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜