android-permissions-security
Installation
SKILL.md
Guidelines for auditing permission vulnerabilities, enforcing least privilege, securing IPC boundaries, and handling runtime permissions across the Android ecosystem.
Glossary
- Runtime Permission: Dangerous permission (e.g., Camera, Location) that must be granted by the user at runtime on Android 6.0+ (API 23+).
- Custom Permission: A permission defined by an app (
<permission>) to restrict access to its exported components. - Protection Level: Attribute defining how the OS grants the permission (
normal,dangerous,signature,knownSigner). - knownSigner: Protection flag (API 31+) granting signature-level access to partner apps matching trusted certificate digests.
- SigningInfo: Object (API 28+) providing signing history and multiple signer certificates for an application.
- Binder Calling Identity: Reliable UID representing the calling process obtained using
Binder.getCallingUid(). - URI Permission: Temporary, granular access granted to a content URI using
grantUriPermissionsand intent flags.
Prerequisites
- Add
androidx.core:core-ktxandandroidx.activity:activity-ktx(orandroidx.fragment:fragment-ktx) dependencies to the app-levelbuild.gradlefile forContextCompatandActivityResultContracts. - For
knownSignerpartner permissions (android:knownCerts), ensure the projectcompileSdkandtargetSdkare at least 31 (Android 12). - For broadcast identity sharing (
BroadcastOptions.setShareIdentityEnabled), ensurecompileSdkandtargetSdkare at least 34 (Android 14).