Android: How to get a list of all available intent filters?

后端 未结 11 1553
野趣味
野趣味 2020-11-29 02:48

I have search Android docs and for some insane reason I am not able to find the list of all available intent filters.

I am finding an intent filter, which would do s

相关标签:
11条回答
  • 2020-11-29 03:20

    Don't know how late to the party I am but below is good way

    adb shell
    dumpsys package r | grep <packagename>
    

    Change out package name of course

    0 讨论(0)
  • 2020-11-29 03:21

    There is a "database" at http://www.openintents.org/en/ that tries to collect known intent filters. Also the doumentation for Intent lists some.

    0 讨论(0)
  • 2020-11-29 03:24

    Expanding on Tom Fraser's answer, the best way is by using dumpsys with a grep and sort.

    dumpsys activity broadcasts |grep -iE ".+\.[0-9A-Z_\-]+:$" |sort
    

    The grep expression makes sure to only catch lines ending in the intent like format of ...blahblah.SOME_INTENT:. It may not catch all, but it's a good start.

    0 讨论(0)
  • 2020-11-29 03:24

    You can check the list of standard actions and categories in the sdk/platforms/android-x/data/broadcast_actions.txt

    0 讨论(0)
  • 2020-11-29 03:25

    this post is old but for anyone looking for manifest info from apps installed on a particular android dwld this GOD app:

    https://play.google.com/store/apps/details?id=jp.susatthi.ManifestViewer

    0 讨论(0)
  • 2020-11-29 03:25

    (partial answer) IntentFilters are defined in the AndroidManifest.xml file contained in the application's .apk file. (in the -> -> -> XML element, like this:

    I haven't found an API for searching all Intents defined in all .apk files stored on a device. The system searches the list of all intents in: android.content.Context.startActivity(Intent intent) Which calls a native method in android.app.ActivityManagerNative.startActivity() which uses an interprocess communication (IPC) mechanism (using a serialization of the informtation in a 'Parcel' object) to search the intents and start the Activity. So I could find how it is really done.

    It appears that you can get read access to .apk files (many are stored in /system/app/*.apk). The .apk file is a .jar file and the AndroidManifest.xml file is available in that, so a program should be able to read and parse the manifest and find the IntentFilters -- but there should be API to make this easy.

    0 讨论(0)
提交回复
热议问题