AOSP file paths are given without line numbers. Paths are stable across releases; line numbers
are not, and a wrong line number is worse than no line number because it looks authoritative. Open
the file and search for the named symbol.
No CVE identifier is invented. Where a vulnerability class matters but the specific identifier is
not something this chapter verified, the class is described by its shape — which is what you match
against in the field anyway.
You need to know where an external path comes from. UserEnvironment builds every one of them from environment variables set at fork time, which is why they differ per user and why hardcoding /storage/emulated/0 breaks on a work profile
Tracing getFilesDir(), getCacheDir(), getNoBackupFilesDir(). ensurePrivateDirExists is why those directories do not exist until first use; getDataDir() is the fork between credential- and device-encrypted storage
Understanding apply() versus commit(), the .bak file left behind by a crash mid-write, and the FileUtils.setPermissions call that produces -rw-rw---- on every preference file
The scoped-storage policy itself. Who may see whose files, the owner checks, and the bypass conditions. This is application logic, not kernel policy, which is why shared-storage behaviour varies by release
The FUSE upcall handler that sits in the path of every shared-storage syscall. Read it when you need to know why an open on /sdcard behaved differently from one on /data
system/vold/FsCrypt.cpp
How credential- and device-encrypted keys are installed into the kernel keyring and bound to directories
system/vold/KeyStorage.cpp
How those keys are wrapped with the user's credential and a Keymaster/KeyMint-held secret. This is what makes offline brute-forcing of the lock screen infeasible
Why it is worth reading, and what it will not tell you
Data and file storage overview
The canonical map of every storage option. The one page to hand a developer who asks where something should go. It does not discuss reachability by other principals
Storage updates in Android 11
The definitive statement of what scoped storage enforced and of the requestLegacyExternalStorage behaviour change. Read it alongside a measurement — it describes intent, and OEM builds vary
Direct Boot
Credential- versus device-encrypted storage, directBootAware, LOCKED_BOOT_COMPLETED, and createDeviceProtectedStorageContext(). It is clear on the mechanism and silent on the security trade-off, which is section 3.3 of this chapter
File-Based Encryption (AOSP, Security)
The CE/DE key hierarchy, what each key is bound to, and metadata encryption. The place to check before claiming anything about what encryption at rest does or does not buy
Access documents and other files using SAF
ACTION_OPEN_DOCUMENT, ACTION_CREATE_DOCUMENT, ACTION_OPEN_DOCUMENT_TREE, and takePersistableUriPermission. The persistence semantics are the part that matters for an audit
MediaStore reference
The collections, IS_PENDING, OWNER_PACKAGE_NAME, RELATIVE_PATH and createWriteRequest. OWNER_PACKAGE_NAME is documented as an attribution feature and is equally a privacy surface
Back up user data with Auto Backup
dataExtractionRules, fullBackupContent, the domain names, and the 25 MB cap. It does not emphasise that shipping only the newer attribute leaves an app unprotected below API 31
Save data in a local database using Room
Relevant because Room changes nothing on disk: same SQLite file, same WAL, same defaults
Android Keystore system
Where the key that makes crypto-shredding possible lives. Depth is in 49-KeyStore
The authoritative description of why <db>-wal exists, when a checkpoint occurs, and why the file is deleted on a clean close — which is why the WAL's absence proves nothing
PRAGMA secure_delete
What it costs and what it does not cover. Note explicitly that it is not retroactive
PRAGMA wal_checkpoint
The difference between PASSIVE, FULL, RESTART and TRUNCATE. Only TRUNCATE resets the file to zero length
VACUUM
Why it is the only way to reclaim residue from deletions made before secure_delete was enabled, and why it needs temporary space roughly equal to the database
The SQLite file format
Page structure and the freelist — the basis of every carving tool that recovers deleted rows from the main database file
Described by shape rather than by identifier, for the reason given at the top of this file.
Class
Shape
Where it is covered
World-readable or world-writable app files
MODE_WORLD_READABLE / MODE_WORLD_WRITEABLE, or a native component calling chmod directly and bypassing the framework entirely. The framework modes throw from API 24; the native path does not
allowBackup enabled with no exclusion rules, or rules that exclude x.db and miss x.db-wal, or that set only dataExtractionRules and are therefore inert below API 31
Pre-scoped-storage devices where one broad permission reached every app's Android/data, plus the enumerable list of installed packages that came with it
Google I/O and Android Dev Summit sessions on scoped storage — the clearest statements of the
intent behind the FUSE migration and the API 29/30 split. Useful for understanding why the
behaviour is inconsistent across releases rather than merely cataloguing that it is.
The Android Security Paper (Google) — the platform's own account of the application sandbox and
file-based encryption. Read it for the threat model the platform designers held, which is the
yardstick your findings are implicitly measured against.
Mobile forensics literature on SQLite recovery — the WAL and free-page carving techniques used
in §5.5 were developed in the
forensics community and predate Android. They apply unchanged, which is worth knowing because the
best material on residual data is not in the mobile-security literature at all.
f2fs design documentation (kernel.org) — why a log-structured filesystem allocates new blocks
for an overwrite, and therefore why "overwrite the file before deleting it" is a gesture rather
than an erase.
FUSE documentation (kernel.org) — the protocol between the kernel and the userspace daemon.
Read it if you need to reason about what a hook inside the app process can and cannot observe.
Snapshot and diff an app's whole on-disk footprint across six roots; classifies every change and computes DAC reachability, while stating explicitly that it does not compute the SELinux gate
Type-aware credential hunting across preferences, SQLite (including -wal), JSON, text and binaries — with a numbered false-positive list that is not optional reading
Chapter 09 owns the data directory's identity — uid assignment, packages.list, the supplementary-GID table, the CE/DE API surface and pm clear semantics; this chapter owns what is inside those directories and who can reach it
Owns sandbox enforcement and what scoped storage is, including the allowBackup extraction chain; this chapter owns the storage mechanisms and the testing method. Read 21 §3.11 first
Owns the permission string and its grant state, including the measured retirement of the legacy storage GIDs on modern releases; this chapter owns what the filesystem does once a grant exists, and what it does when there is none
The second reachability gate. Its MCS arithmetic decides whether a world-readable file is readable in practice, and this chapter's §5.3 is a worked instance of that
Owns whether the ciphertext is sound, and EncryptedSharedPreferences / EncryptedFile / Tink; this chapter owns where that output landed and what landed beside it. 34 lists 33 as a prerequisite