Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing detection of priviledged protection level of SEED_VAULT_IMPL permission #118

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

J909
Copy link
Contributor

@J909 J909 commented Feb 14, 2023

Currently, the detection of the privileged protection level of com.solanamobile.seedvault.SEED_VAULT_IMPL always fails.
This change queries the protection level of this permission to detect its implementation on the system image.
Fixes #115

@@ -49,7 +51,7 @@ public static boolean isAvailable(@NonNull Context context, boolean allowSimulat

for (PermissionInfo permission : pi.permissions) {
if (WalletContractV1.PERMISSION_SEED_VAULT_IMPL.equals(permission.name) &&
((permission.flags & PermissionInfo.PROTECTION_FLAG_PRIVILEGED) != 0)) {
((permission.getProtectionFlags() & PROTECTION_FLAG_PRIVILEGED) != 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/home/runner/work/seed-vault-sdk/seed-vault-sdk/seedvault/src/main/java/com/solanamobile/seedvault/SeedVault.java:54: Error: Call requires API level 28 (current min is 23): android.content.pm.PermissionInfo#getProtectionFlags [NewApi]
                    ((permission.getProtectionFlags() & PROTECTION_FLAG_PRIVILEGED) != 0)) {
                                 ~~~~~~~~~~~~~~~~~~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J909 J909 force-pushed the fix-impl-detection branch from f427b89 to c784011 Compare February 14, 2023 23:11
@J909 J909 force-pushed the fix-impl-detection branch from 63e1113 to 4700cce Compare February 14, 2023 23:18
@sdlaver sdlaver merged commit 53f0c51 into solana-mobile:main Feb 15, 2023
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.

Detection of privileged SEED_VAULT_IMPL permission fails
2 participants