By including the following <intent> element within the <queries> tag in the AndroidManifest.xml file, I can access a list of all installed apps on a device:
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
Since most Android apps have a launcher activity, doing the following returns all the apps installed in an android device:
getPackageManager().queryIntentActivities(new Intent(Intent.ACTION_MAIN), PackageManager.MATCH_ALL)
Isn't this a potential privacy loophole and almost equivalent to the very sensitive QUERY_ALL_PACKAGES permission? I see so many apps with this intent element under the queries element in their manifest files.
doing the following returns all the apps installed in an android device:
FWIW, that code returns activities, not apps.
Isn't this a potential privacy loophole and almost equivalent to the very sensitive
QUERY_ALL_PACKAGESpermission?
Yes, which is why I and others wrote about this years ago.
Bear in mind that Google (and other app distributors) could penalize developers for having overly-broad <queries> requests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With