Android artifacts · Lesson 1 of 7
Android file system layout and app sandboxes
11 min read
Every Android artifact in this module lives at a path, and the path tells you more than where to look. It tells you which storage class protects the file, which Android user it belongs to, which app wrote it and whether it should survive a reboot before the first unlock. This lesson gives you a working map of the user data partition on current Android versions (Android 16 and 17, with notes where older versions differ), explains the package records that let you turn numbers into app names, and shows how app sandboxes, shared storage and multiple users and profiles appear in an extraction. Later lessons assume this map. This module often cites ALEAPP, a free, open-source Android parser (lesson 3.7). Its parsers carry notes on the test images and versions they were checked against, and the course uses those notes as evidence for fields that are not officially documented.
Partitions and where the evidence is
Most partitions of an Android phone hold the operating system and firmware: system, vendor, product and similar partitions are read-only, signed and verified at boot, as lesson 1.3 described. They identify the build but hold no user activity. Almost everything an examiner wants is on the user data partition, mounted at /data and protected by file-based encryption (FBE). Some manufacturers add partitions of their own; Samsung's efs partition, for example, holds a recovery history file used in lesson 3.7. A full file system extraction (lesson 2.6) may or may not include such extra partitions, so check what yours contains before concluding that an artifact is absent.
A map of /data
The table lists the directories you will use most. The letter n is an Android user ID; 0 is the primary user. CE is Credential Encrypted and DE is Device Encrypted storage (lesson 1.3). System DE is the name AOSP gives to device-wide data that is not tied to one user and opens at boot.
| Path | What it holds | Storage class |
|---|---|---|
| /data/app/ | Installed APK files of user-installed apps and updates | System DE |
| /data/user/n/<package> | Each app's private data for user n (/data/data is the same folder for user 0) | CE |
| /data/user_de/n/<package> | Each app's Device Encrypted (DE) data for user n | DE |
| /data/media/n | Shared storage for user n, shown as /sdcard or /storage/emulated/n | CE |
| /data/system/ | Package records, per-user settings and user records, sync and lock settings | System DE |
| /data/system_ce/n | Per-user system data such as accounts_ce.db, usage stats, recent tasks and notification history | CE |
| /data/system_de/n | Per-user system data available before unlock, such as accounts_de.db | DE |
| /data/misc/ | Wi-Fi and Bluetooth configuration, boot statistics and other service data | System DE |
| /data/misc_ce/n, /data/misc_de/n | Per-user service data, such as user-specific Wi-Fi stores | CE and DE |
| /data/property/ | persistent_properties, the system properties kept across reboots | System DE |
Two details matter. First, /data/data and /data/user/0 are two names for the same folder, so the same file can appear under both paths in an extraction. On Android 11 and later the system also bind-mounts app data under /data_mirror, at the root of the file system (for example /data_mirror/data_ce/null/0/<package>), and some extractions include this third view of the same files. A tool that does not recognize these duplicates may report every record twice. Second, the storage class column predicts what a BFU acquisition can reach: only the per-user DE locations and the device-wide System DE locations open before the first unlock. Both are still encrypted at rest with hardware-bound keys, so a raw image or a removed chip does not expose them.
Where APKs are installed
On Android 11 and later, each installed app gets a randomized two-level folder such as /data/app/~~<random>/<package>-<random>/, containing base.apk and any split APKs. Preinstalled apps live on the read-only partitions; their updates go under /data/app. The APK identifies the exact app version and can be installed on a test device to learn how the app stores data, a method lesson 5.4 develops.
Package records
The package manager keeps its records in /data/system/. Three files are central.
packages.xml. One package element per installed package, with its name, code path, app ID or shared user ID, installer and signing certificate references. AOSP sets the ft attribute from the last-modified time of the package's code path, so it is a file time of the installed code, not an install time; ut is the last update time. Both are Unix milliseconds written as hexadecimal. On Android 12 and earlier, the first install time was the it attribute of packages.xml. On Android 13 and later it is stored per user, as first-install-time in /data/system/users/n/package-restrictions.xml. Granted permissions are not in packages.xml on Android 12 and later. They are kept per user under /data/misc_de/n/apexdata/com.android.permission/: in runtime-permissions.xml up to Android 14 and, in AOSP since Android 15, in access.abx, a file in the binary XML format described below. A phone on Android 15 or later can still hold a runtime-permissions.xml (one of ALEAPP's Samsung test images does), so check which file is current.
package-restrictions.xml. One file per user, recording the per-user state of every package: whether it is installed for that user, enabled, hidden, stopped or suspended, and the first install time on current versions. Because an app can be installed for one user and not another, this file, not packages.xml, answers the question "was this app available to this user".
packages.list. A plain text file with one line per app: package name, UID, a debuggable flag, data directory, SELinux label (seinfo), supplementary group IDs and, on current versions, profileable flags, version code and the installing package (or @system for preinstalled apps). It is the quickest way to translate a UID found in another artifact into a package name.
Since Android 12, packages.xml, package-restrictions.xml and most other system XML files are stored in Android Binary XML (ABX). A text editor shows unreadable bytes, but the file is not corrupt: convert it first with an ABX converter such as abx2xml or the open-source ccl_abx module.
Worked example: from UID to app and user
Android assigns each app an app ID of 10000 or higher. The Linux UID that appears in logs and databases combines the app ID with the user: UID = user ID × 100,000 + app ID. A Wi-Fi record created by UID 1010245 therefore belongs to user 10 (1010245 ÷ 100,000 = 10, remainder 10245) and to the app whose app ID is 10245, which you look up in packages.list. A UID below 10000, such as 1000, belongs to a core system component.
Worked example: a hexadecimal install time
An illustrative package-restrictions.xml on Android 14, unrelated to the Corvane case, contains first-install-time="19a49003895" after conversion from ABX. Converting the hexadecimal value gives 1,762,161,342,613, which as Unix milliseconds is 2025-11-03 09:15:42.613 UTC. Confirm whether your converter prints hexadecimal or decimal before converting; a date decades away from the case usually means a wrong base or unit.
What package records do and do not show
Package records show the current state. Uninstalling an app normally removes its package element and private folder, but traces can survive in usage statistics (lesson 3.4), Google Play's databases, leftover legacy domain verification entries in packages.xml and shared storage folders. Absence from packages.xml shows only that the app is not installed now.
App sandboxes
Every app runs as its own Linux UID, and SELinux adds rules that stop one app from reading another's files. Inside /data/user/n/<package>, most apps use the same standard subfolders:
- databases/ for SQLite databases and their -wal, -shm or -journal companions (lesson 3.2);
- shared_prefs/ for small XML files of settings, often holding account names, feature flags and last-sync times;
- files/ for other files, including protobuf, JSON and app-specific formats;
- cache/ for temporary data such as thumbnails, which the system may delete when storage is low;
- app_<name>/ folders the app creates for its own purposes; Chrome's profile, for example, is in app_chrome.
Some apps also keep a DE folder under /data/user_de/n/<package> so that they can work before the first unlock. It is usually small, but a Direct Boot aware app may write events there while the phone is locked.
Apps can also write to app-specific folders in shared storage: Android/data/<package>/ and Android/media/<package>/ under /data/media/n. Since Android 11, other apps cannot browse Android/data, but these folders are still shared storage, so a copy of the unlocked phone's shared storage may reach them when it cannot reach the private sandbox. Messaging apps often keep received media here, apart from their databases.
A file inside an app's sandbox was written by that app or by the system on its behalf, for example when data is restored from a backup or a device-to-device transfer (lesson 3.7). Keep that alternative in mind before stating that a user created something on this device.
Shared storage
Shared storage, /data/media/n, is what the user sees as "Internal storage": DCIM/Camera, Pictures, Download, Documents and folders created by apps. The media provider indexes these files in its own database, covered in lesson 6.2; Samsung adds a second media database of its own (lesson 3.7). A microSD card used as portable storage is mounted under /storage/<volume ID>, usually formatted with FAT32 or exFAT and not covered by FBE; a card adopted as internal storage is encrypted with keys held by the phone.
Multiple users and profiles
Android supports several users on one device, and each has its own copy of almost everything above. The user records are in /data/system/users/: userlist.xml lists the users, and one n.xml file per user records its name, type and flags, with three times in decimal Unix milliseconds: created, lastLoggedIn (when the user was last started) and, on recent versions, lastEnteredForeground (when the device last switched to that user). Each user n has its own /data/user/n, /data/user_de/n, /data/media/n, /data/system_ce/n and /data/system/users/n/ settings.
You will meet several kinds of additional users:
- Secondary users, created in Settings, mainly on tablets, usually numbered from 10.
- Work profiles, managed by an organization's device management app. They run alongside the personal profile under their own user ID, and may share the device screen lock or use a separate one.
- Private space, added in Android 15, a separate profile within the personal profile, behind an additional layer of authentication. When it is locked, Android stops the profile and hides its apps from recents, notifications, settings and other apps.
- Samsung Secure Folder, a Knox-based profile that on the devices tested by ALEAPP's authors uses user ID 150. Lesson 3.7 covers it.
Each profile has its own CE keys. A profile whose CE keys are not loaded at acquisition behaves like a phone in BFU even when the main user is unlocked (lesson 2.6). Always list the users from userlist.xml first and check every user's folders: a second WhatsApp inside a work profile or Secure Folder is easy to miss if you only look at user 0.
Applying this to the Corvane case
Victor Hale's Galaxy A phone, running Android 16 with One UI 8, is produced in the civil proceedings about ten weeks after Day 1. The first step is to read userlist.xml. In the illustrative extraction it lists user 0 and user 150, so a Secure Folder exists as a separate user. packages.list shows WhatsApp (package com.whatsapp) with an app ID in user 0, and package-restrictions.xml for user 0 gives its first install time. WhatsApp's database is in its CE sandbox under /data/user/0/com.whatsapp/databases (lesson 5.2), while the three images that WhatsApp downloaded should be in shared storage under /data/media/0. The examiner records that Victor unlocked user 0, so its CE storage was available. The court-ordered protocol does not cover the Secure Folder, which stays locked: for user 150 the extraction holds only encrypted file names and contents (lesson 2.6), and the report states that user 150 exists and was not examined.
Exam focus: Know the main /data paths and which storage class protects each, including /data/user/n, /data/user_de/n, /data/media/n, /data/system_ce/n and /data/system_de/n. Be able to read packages.xml, package-restrictions.xml and packages.list, convert a UID into user and app ID, recognize ABX files, and explain why each user, work profile, private space and Secure Folder must be examined separately.