android-security-hardening
Step 6 of the pipeline (WORKFLOW.md), for what an Android app exposes to other apps on the same device and what it
may believe about the device it runs on. The three sections share one premise: everything that arrives from outside
the process (an intent, an extra, a URI, a caller, an integrity token) is input from a stranger, so each one is
declared, checked or verified on purpose, and a verdict is evidence about the environment, not a guarantee. Server-side input, output and access-control rules are in security-hardening; session and token handling
is in auth-session-conventions.
When
- Adding or editing an activity, service, receiver or provider, or its intent filter, in the manifest.
- Launching an intent, a URI grant or a
PendingIntent that carries data a caller supplied.
- Using the device's integrity as input to a decision, or storing a key on the device.
Steps
Read only the section the task meets. They are independent.
| § |
Covers |
Read it when |
File |
| 1 |
Components and callers: explicit exported, intent filters, signature permissions, intent redirection, URI grant flags |
a manifest component is added or an intent is forwarded |
01-components-and-intents.md |
| 2 |
PendingIntent: mutability, explicit targets, single use |
a notification, alarm or widget hands out a PendingIntent |
02-pending-intents.md |
| 3 |
Device integrity and keys: Play Integrity verdicts on the server, Keystore, StrongBox, authentication-bound keys |
a decision depends on the device or on a stored secret |
03-integrity-and-keystore.md |
Output / checkpoint
The merged manifest was read (the library manifests included), every component shows an explicit exported value
and each exported one names its reason (§1); each forwarded intent is sanitised or resolved against an allow-list (§1);
every PendingIntent has an immutability flag and an explicit target (§2); every integrity decision compares the verdict's
request details first (§3). A manifest read only in the source tree, without the merge, is not verified.
Guardrails
- Never leave
exported implicit, and never export a component without a stated reason (§1).
- Never launch an intent taken from an extra without sanitising it or checking where it resolves (§1).
- Never use
FLAG_MUTABLE or an implicit intent in a PendingIntent unless the field is meant to be filled in (§2).
- Never act on an integrity verdict whose request details (package, request binding, timestamp) were not compared with
the original request (§3).
- This block states Android behaviour as of the developer.android.com pages read on the date in
references/origin.md; no code was run while writing it.
- Raising
targetSdk or changing the signing configuration is the user's step; this block names it and stops.
Origin
Rewritten from the Android developer pages on android:exported, intent redirection, pending intents, Play Integrity
verdicts and the Keystore (read 2026-10-08). 🟡: never run by us; open points are in references/origin.md. Overlaps with skills/security-hardening (2026-10-19); cross-referenced, not merged.
1---2name: android-security-hardening3description: "Use when writing or reviewing the attack surface of an Android app: a component that other apps can start, android:exported on activities services receivers and providers, intent filters that make a component public, signature permissions, an intent received through an extra and launched again (intent redirection), IntentSanitizer, URI permission flags forwarded by mistake, PendingIntent mutability and implicit intents inside it, FLAG_ONE_SHOT, deciding who the caller is, Play Integrity verdict fields checked on the server, requestHash and nonce binding, device integrity labels, and Android Keystore keys with StrongBox, user authentication and invalidation by biometric enrolment."4metadata:5 source: https://skillmd.com/skills/techmefr/android-security-hardening6---78# android-security-hardening910Step 6 of the pipeline (`WORKFLOW.md`), for what an Android app exposes to other apps on the same device and what it11may believe about the device it runs on. The three sections share one premise: **everything that arrives from outside12the process (an intent, an extra, a URI, a caller, an integrity token) is input from a stranger, so each one is13declared, checked or verified on purpose, and a verdict is evidence about the environment, not a guarantee**. Server-side input, output and access-control rules are in `security-hardening`; session and token handling14is in `auth-session-conventions`.1516## When17- Adding or editing an activity, service, receiver or provider, or its intent filter, in the manifest.18- Launching an intent, a URI grant or a `PendingIntent` that carries data a caller supplied.19- Using the device's integrity as input to a decision, or storing a key on the device.2021## Steps2223**Read only the section the task meets.** They are independent.2425| § | Covers | Read it when | File |26|---|---|---|---|27| 1 | Components and callers: explicit `exported`, intent filters, signature permissions, intent redirection, URI grant flags | a manifest component is added or an intent is forwarded | [`01-components-and-intents.md`](./references/01-components-and-intents.md) |28| 2 | `PendingIntent`: mutability, explicit targets, single use | a notification, alarm or widget hands out a `PendingIntent` | [`02-pending-intents.md`](./references/02-pending-intents.md) |29| 3 | Device integrity and keys: Play Integrity verdicts on the server, Keystore, StrongBox, authentication-bound keys | a decision depends on the device or on a stored secret | [`03-integrity-and-keystore.md`](./references/03-integrity-and-keystore.md) |3031## Output / checkpoint32The merged manifest was read (the library manifests included), every component shows an explicit `exported` value33and each exported one names its reason (§1); each forwarded intent is sanitised or resolved against an allow-list (§1);34every `PendingIntent` has an immutability flag and an explicit target (§2); every integrity decision compares the verdict's35request details first (§3). A manifest read only in the source tree, without the merge, is not verified.3637## Guardrails38- Never leave `exported` implicit, and never export a component without a stated reason (§1).39- Never launch an intent taken from an extra without sanitising it or checking where it resolves (§1).40- Never use `FLAG_MUTABLE` or an implicit intent in a `PendingIntent` unless the field is meant to be filled in (§2).41- Never act on an integrity verdict whose request details (package, request binding, timestamp) were not compared with42 the original request (§3).43- This block states Android behaviour as of the developer.android.com pages read on the date in44 [`references/origin.md`](./references/origin.md); no code was run while writing it.45- Raising `targetSdk` or changing the signing configuration is the user's step; this block names it and stops.4647## Origin48Rewritten from the Android developer pages on `android:exported`, intent redirection, pending intents, Play Integrity49verdicts and the Keystore (read 2026-10-08). 🟡: never run by us; open points are in [`references/origin.md`](./references/origin.md). Overlaps with `skills/security-hardening` (2026-10-19); cross-referenced, not merged.