Introduction
Android is the world's most popular mobile operating system, powering approximately 70% of smartphones globally, including a dominant market share in India. Understanding Android's architecture, file system, and data storage mechanisms is essential for effective mobile forensics.
By the end of this part, you will understand Android's layered architecture, navigate the Android file system structure, analyze SQLite databases common in Android apps, and use ADB commands for forensic data extraction.
Android Architecture
Android is built on a modified Linux kernel and consists of multiple layers, each with forensic significance.
Key Forensic Implications
- App Sandboxing: Each app has a unique UID and isolated storage at /data/data/<package>/
- Content Providers: Inter-app data sharing mechanism - contacts, calendar, SMS are shared this way
- SELinux: Security-Enhanced Linux enforces mandatory access control, affecting forensic access
- Encryption: File-Based Encryption (FBE) encrypts user data with credentials-derived keys
Android File System Structure
Android uses a hierarchical file system based on Linux. Understanding the directory structure is crucial for locating forensic artifacts.
Key Forensic Locations
| Data Type | Location | File/Database |
|---|---|---|
| Contacts | /data/data/com.android.providers.contacts/databases/ | contacts2.db |
| SMS/MMS | /data/data/com.android.providers.telephony/databases/ | mmssms.db |
| Call Logs | /data/data/com.android.providers.contacts/databases/ | calllog.db or contacts2.db |
| Browser History | /data/data/com.android.chrome/app_chrome/Default/ | History |
| Wi-Fi Networks | /data/misc/wifi/ | WifiConfigStore.xml |
| User Accounts | /data/system/ | accounts_ce.db, accounts_de.db |
| /data/data/com.whatsapp/databases/ | msgstore.db, wa.db |
SQLite Database Analysis
SQLite is Android's primary database format. Most app data, system settings, and communication records are stored in SQLite databases.
SQLite databases in Android use the .db extension and can contain multiple tables. Key forensic data includes messages, contacts, call logs, browsing history, and app-specific data. Deleted records may still exist until the database is vacuumed.
SMS/MMS Database Schema (mmssms.db)
Contacts Database Schema (contacts2.db)
SQLite Analysis Commands
Android typically stores timestamps in Unix epoch format with millisecond precision. To convert: divide by 1000 for standard Unix time. Many SQLite tools and forensic software handle this automatically, but always verify timestamp interpretation.
ADB for Forensic Extraction
Android Debug Bridge (ADB) is a command-line tool for communicating with Android devices. It's essential for forensic data extraction when device access is available.
Enabling ADB Access
- Developer Options: Settings > About Phone > Tap Build Number 7 times
- USB Debugging: Settings > Developer Options > Enable USB Debugging
- Authorization: Device must authorize the computer's RSA key
- Connection: Connect via USB cable to forensic workstation
Essential ADB Forensic Commands
Starting with Android 12, adb backup functionality is heavily restricted. Many apps opt out of backup, and system data is excluded. For comprehensive extraction, forensic tools with exploit capabilities or root access are typically required.
Important Android Artifacts
Beyond databases, Android stores valuable forensic artifacts in various locations and formats.
Key Artifact Locations
- Wi-Fi Networks: /data/misc/wifi/WifiConfigStore.xml - Contains saved network names, passwords (on older versions), and connection history
- Bluetooth Pairings: /data/misc/bluedroid/bt_config.conf - Paired device MAC addresses and names
- Location Cache: Various locations depending on apps - Google Maps timeline, photo EXIF data
- User Dictionary: /data/data/com.android.providers.userdictionary/databases/ - Custom words added by user
- Clipboard: Stored in memory, may persist in some custom keyboards
- Notifications: /data/system/notification_policy.xml and app-specific logs
Media File Metadata
Images and videos on Android contain valuable EXIF metadata:
- GPS coordinates (if location enabled when captured)
- Timestamp of creation
- Device make and model
- Camera settings
- Thumbnail images
For comprehensive Android forensics, consider using tools like Cellebrite UFED, Oxygen Forensic Detective, MSAB XRY, or Magnet AXIOM. Open-source options include Autopsy with the Android Analyzer module, and ADB-based scripted extractions for accessible data.
- Android architecture consists of five layers: Applications, Framework, Runtime, HAL, and Linux Kernel
- User data is primarily stored in /data/data/ with each app in its own sandboxed directory
- SQLite is the primary database format - master understanding of schema and query techniques
- Key databases: mmssms.db (SMS), contacts2.db (contacts), and app-specific databases
- ADB is essential for extraction but has limitations on modern Android versions
- Timestamps are typically Unix epoch in milliseconds - always verify conversion
- Root access significantly expands forensic capabilities but may raise legal questions
- Consider media metadata, Wi-Fi logs, and Bluetooth pairings as valuable artifacts