android-permissions-security
Audits, detects gaps, and remediates Android permissions and IPC component
Install / Use
npx skills add android/skills --skill android-permissions-securityInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
SecuritySupported Platforms
Our assessment of android-permissions-security
android-permissions-security scores 93/100 on our quality scale, 355th of 1,108 Security skills we index (top 33%).
Its SKILL.md is 27 KB long, well organised into 27 sections with 15 code examples: a thorough specification that gives an agent plenty to work with.
With 7,514 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so android-permissions-security is actively maintained.
- Our last check on 2026-10-26 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-27. Automated pattern scan on 2026-09-27. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
android-permissions-security compared with similar skills
All 4 of these similar skills score higher than android-permissions-security; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| android-permissions-security (this skill)by android | 93 | 7.5k | 54d ago | SKILL.md |
| x402by browser-use | 100 | 121.0k | 3d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 55d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 55d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 149.0k | 6d ago | SKILL.md |
Frequently asked questions
- How do I install android-permissions-security?
- Run
npx skills add android/skills --skill android-permissions-security. The install tabs above show the steps for each supported agent. - Which AI agents does android-permissions-security work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is android-permissions-security safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is android-permissions-security still maintained?
- The repository was last updated about 2 months ago, so android-permissions-security is actively maintained.
Skill content
View source on GitHubname: android-permissions-security description: Audits, detects gaps, and remediates Android permissions and IPC component security vulnerabilities. Use when reviewing AndroidManifest.xml, defining custom permissions, securing Services, Receivers, and Providers, verifying caller signatures and UID using Binder, or implementing runtime permission flows. license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-09-25' keywords:
- recipe
- Android
- Security
- Permissions
- IPC
- Binder
- UID
- Caller Verification
- knownSigner
- signature
- ContentProvider
- Service
- Receiver
- Broadcast
- UriPermission
- runtime permissions
- SecurityException
- Photo Picker
- Vulnerability
- Remediation
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).
1. Security audit and permission gap detection playbook
When auditing an Android project for permission and IPC security vulnerabilities, systematically inspect each area:
| Vulnerability Area | Search In / Pattern | Risk | Remediation Action |
|---|---|---|---|
| Weak Custom Permission Protection | AndroidManifest.xml with android:protectionLevel="normal", "dangerous", or "signatureOrSystem" | Unauthorized apps request or claim permission without restriction | Upgrade to signature or signature|knownSigner with android:knownCerts. |
| Overly Broad URI Permission Grants | <grant-uri-permission android:pathPrefix="/" /> or pathPrefix="" in <provider> | Leaks all provider data to third parties | Replace with explicit scoped subpath (e.g. android:pathPrefix="/shared/"). Retain android:grantUriPermissions="true". Remove any wildcard pathPrefix="/". |
| Missing ContentProvider Split Permissions | <provider> with only generic android:permission or missing android:readPermission and android:writePermission | Read-only callers execute write operations or write-only callers access read operations | Configure granular android:readPermission="...READ_DATA" and android:writePermission="...WRITE_DATA", AND declare the custom <permission> tags with android:protectionLevel="signature" (or signature|knownSigner) at the <manifest> root. |
| Spoofable Caller Identity Checks | intent.getStringExtra("calling_package"), intent.getStringExtra("sender"), callingPackage == "..." in Services | Malicious callers forge intent extras or strings | Remove string checks; authenticate caller UID cryptographically using Binder.getCallingUid() and pm.hasSigningCertificate(). |
| Bound Service Permission Bypass | checkCallingOrSelfPermission() or enforceCallingOrSelfPermission() in Binder AIDL stubs | Falls back to host app UID outside IPC or when identity is cleared, causing Confused Deputy bypass | Replace with enforceCallingPermission("...WRITE_DATA", ...) or checkCallingPermission("...WRITE_DATA"). |
| Missing Method-Level Checks in Bound Services | Bound Service AIDL methods mutating state without enforcing write permissions | Callers with read-only binding access invoke mutating write operations | Add enforceCallingPermission("...WRITE_DATA", "Caller lacks WRITE_DATA permission") inside mutating AIDL methods. |
| Flawed Runtime Permission Flow | Missing shouldShowRequestPermissionRationale(), missing permanent denial handling, or re-requesting in loops | Poor user experience, infinite loops, or inability to recover permissions | Implement 3-state flow: check grant -> check rationale dialog -> launch contract. On permanent denial, redirect to Settings.ACTION_APPLICATION_DETAILS_SETTINGS. |
| Simultaneous Location Requests | arrayOf(ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION) in one request | Rejected by Android 11+ (API 30+) | Request foreground location (ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION) first. Request ACCESS_BACKGROUND_LOCATION only after foreground is granted in a separate user step. |
| Broad Storage Permissions for Media | Requesting READ_EXTERNAL_STORAGE or READ_MEDIA_IMAGES for user image selection | Over-privilege, user privacy violation | Migrate to zero-permission Photo Picker (ActivityResultContracts.PickVisualMedia). |
| Cached Permission State | Storing permission status in var cachedLocationPermissionGranted = ... | Fails when permission is revoked or expires | Query ContextCompat.checkSelfPermission() dynamically at invocation time and wrap protected calls in try-catch blocks catching SecurityException. |
| Insecure Broadcasts | sendBroadcast(intent) without package target or receiver permission; receiver without sender authentication | Data interception or command spoofing | Set explicit package (intent.setPackage(...)), pass receiver permission, and enable BroadcastOptions.setShareIdentityEnabled(true) (API 34+) to verify sentFromPackage. |
2. Custom permissions and protection levels
When declaring custom permissions or partner certificates in the manifest, you
must follow the instructions in the <permission> element guide.
signature: Restricts access to apps signed with the same developer key.signature|knownSigner(API 31+): Restricts access to partner apps whose signing certificate digests match declared hashes inandroid:knownCerts.normalordangerous: Do not use for private inter-app IPC.signatureOrSystem: Deprecated (API 23). Upgrade deprecatedsignatureOrSystempermissions tosignature. Avoid in non-system apps.
Manifest snippets
Signature-level custom permission
Use signature permissions when restricting component access exclusively to
apps signed with the same developer certificate by declaring the <permission>
in the manifest and applying android:permission to the target component.
<permission
android:name="com.example.snippets.permission.ACCESS_SECURE_API"
android:protectionLevel="signature" />
<br />
KnownSigner partner permission (API 31+)
Use signature|knownSigner permissions when granting access to specific
external partner apps by declaring the <permission> in the manifest with
android:knownCerts referencing a resource array of trusted SHA-256
certificate digests.
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- SHA-256 fingerprints of trusted partner certificates (lowercase, no colons) -->
<string-array name="trusted_partner_certs" tools:ignore="Typos">
<item>103938ee4537e59e8ee792f654504fb8346fc6b346d0bbc4415fc339fcfc8ec1</item>
</string-array>
</resources>
<br />
<permission
android:name="com.example.snippets.permission.PARTNER_API"
android:protectionLevel="signature|knownSigner"
android:knownCerts="@array/trusted_partner_certs" />
<br />
3. Exported component protection and URI permissions
- Private components : Always set
android:exported="false". - Exported components : Require permissions (
android:permission,android:readPermission,android:writePermission). - Granular URI Grants : Retain
android:grantUriPermissions="true"for secure sharing, but scope grants to specific sub-paths. Never use wildcardpathPrefix="/". - Custom Permission Declarations : When splitting read and write permissions on a provider, you MUST declare the
<permission>tags withandroid:protectionLevel="signature"(orsignature|knownSigner) at the<manifest>root level. - Remediating Existing Wildcard Grants : You MUST find and remove any existing
<grant-uri-permission android:pathPrefix="/" />orpathPrefix=""and replace it with an explicit scoped subpath (e.g.android:pathPrefix="/shared/"). - Granular
UriPermissionManagement : Instead of broad manifest grants, use runtimeandroid.content.UriPermissiontokens for least-privilege per-URI sharing:- Grant temporary access :
context.grantUriPermission(targetPackage, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION)or attachIntent.FLAG_GRANT_READ_URI_PERMISSIONto outgoing intents. - Persist access : The receiving app calls
contentResolver.takePersistableUriPermission(uri, modeFlags)for durable access across reboots. - Audit active grants : Inspect
contentResolver.persistedUriPermissions(List<UriPermission>) to verify granted URIs (uriPermission.uri,uriPermission.isReadPermission(),uriPermission.isWritePermission()). - Revoke access : Call
context.revokeUriPermission(uri, modeFlags)orcontentResolver.releasePersistableUriPermission(uri, modeFlags)as soon as operations conclude.
- Grant temporary access :
Manifest snippet: Complete secure ContentProvider declaration
Declare the split read and write permissions at the <manifest> root:
<permission
android:name="com.example.snippets.permission.READ_DATA"
android:protectionLevel="signature" />
<permission
android:name="com.example.snippets.permission.WRITE_DATA"
android:protectionLevel="signature" />
<br />
Then configure the provider with those permissions and a scoped URI grant:
<provider
android:name=".permissions.SecureDataProvider"
android:authorities="com.example.snippets.partnerprovider"
android:exported="true"
android:readPermission="com.example.snippets.permission.READ_DATA"
android:writePermission="com.example.snippets.permission.WRITE_DATA"
android:grantUriPermissions="true">
<grant-uri-permission android:pathPrefix="/shared/" />
</provider>
<br />
Runtime granular UriPermission management snippet
object UriPermissionManager {
/** Grants temporary read access to a specific URI for a partner package. */
fun grantScopedUriAccess(context: Context, targetPackage: String, uri: Uri) {
context.grantUriPermission(
targetPackage,
uri,
Intent.FLAG_GRANT_READ_URI_PERMISSION
)
}
/** Audits active persisted URI permissions held by the application. */
fun getActivePersistedPermissions(context: Context): List<UriPermission> {
return context.contentResolver.persistedUriPermissions
}
/** Revokes temporary URI access when data transfer completes. */
fun revokeScopedUriAccess(context: Context, uri: Uri) {
context.revokeUriPermission(
Truncated for display — read the full file on GitHub.
Related Skills
x402
121.0kSet up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
149.0kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
