Skip to content

Added QUERY_ALL_PACKAGES to fix NameNotFoundException on getPackageInfo#2

Open
savsch wants to merge 3 commits into
aimardcr:masterfrom
savsch:master
Open

Added QUERY_ALL_PACKAGES to fix NameNotFoundException on getPackageInfo#2
savsch wants to merge 3 commits into
aimardcr:masterfrom
savsch:master

Conversation

@savsch

@savsch savsch commented Dec 14, 2023

Copy link
Copy Markdown

The Issue

Tested on a device running Android 13: the getPackageInfo call throws a android.content.pm.PackageManager$NameNotFoundException for most package names.
To be specific, the issue seems to affect only user applications (unlike com.android.vending).
image

This results in nothing happening upon tapping the Get Sign button even when the user inputs a valid package name.

Explanation and Fix

https://developer.android.com/training/package-visibility#intent-signature

Simply adding the QUERY_ALL_PACKAGES permission does the trick, and the application then works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant