Skip to content Skip to sidebar Skip to footer

What Intent Filter Can I Use To Capture Intent Calls To The Permissions Screen On The Android Market?

I am creating an app that warns users about strange permission requests before they download an app from the Android Market (such as a wallpaper app that requests to read a user's

Solution 1:

There's no way of doing this that I know of. You can show the user your dialog right after the user installs the app instead (in most cases, before they run it):

AndroidManifest.xml

<receiverandroid:name=".Receiver"><intent-filter><actionandroid:name="android.intent.action.PACKAGE_ADDED" /><actionandroid:name="android.intent.action.PACKAGE_CHANGED"/><dataandroid:scheme="package"/></intent-filter></receiver>

Receiver.java

publicclassReceiverextendsBroadcastReceiver {
    @OverridepublicvoidonReceive(Context context, Intent intent) {
          try {
              PackageManagermanager=this.getPackageManager();
              PackageInfoinfo= manager.getPackageInfo(
                  intent.getData().getSchemeSpecificPart(), 0);
              Toast.makeText(context, "Look at these suspicious permissions:"+
                  info.permissions, Toast.LENGTH_LONG).show();
          } catch (Exception e) {}
    }
}

Post a Comment for "What Intent Filter Can I Use To Capture Intent Calls To The Permissions Screen On The Android Market?"