Android artifacts · Lesson 3 of 7
Contacts, calls and SMS/MMS
11 min read
Contacts, call logs and text messages are the oldest artifacts in mobile forensics and still among the most requested. On Android they are not stored by the apps the user sees, but by system content providers that any authorized app can read and write. That design has consequences an examiner must understand: a single database can hold records written by several apps, the default messaging app may keep its own richer copy elsewhere, and the location of each database depends on the Android version and the manufacturer. This lesson covers contacts2.db, calllog.db and mmssms.db, the Google Messages and Samsung Messages databases, and the timestamps they use.
Providers and the apps that use them
A content provider is a system component that owns a database and exposes it to apps through an interface protected by permissions. Two providers matter here:
- The contacts provider (package com.android.providers.contacts in AOSP; on Samsung devices com.samsung.android.providers.contacts) owns contacts2.db and calllog.db.
- The telephony provider (com.android.providers.telephony) owns mmssms.db, which holds SMS and MMS, and telephony.db, which holds SIM and carrier information.
The dialer app writes call records to the contacts provider, and the default SMS app writes messages to the telephony provider. The user chooses these apps, and they can change. Record which apps held the phone and SMS roles at acquisition. The role records are in /data/misc_de/n/apexdata/com.android.permission/roles.xml on Android 11 and later (/data/system/users/n/roles.xml on Android 10), where the roles android.app.role.DIALER and android.app.role.SMS name the holding packages; ALEAPP parses the file.
Contacts: contacts2.db
On current versions contacts2.db is in CE storage at /data/user/0/com.android.providers.contacts/databases/contacts2.db, or under com.samsung.android.providers.contacts on Samsung devices. Its main tables are:
| Table | Content |
|---|---|
| accounts | The accounts that own contacts, by account_name and account_type (a Google account, a Samsung account, a messaging app, the phone itself) |
| raw_contacts | One row per contact per account, with display_name, account_id, a deleted flag and sync fields |
| contacts | Aggregated contacts that join raw contacts believed to be the same person; contact_last_updated_timestamp is Unix milliseconds |
| data | The details: one row per phone number, email, name, photo or note, typed by mimetype_id and stored in data1 to data15 |
| mimetypes | The type names, such as vnd.android.cursor.item/phone_v2 and vnd.android.cursor.item/email_v2 |
| deleted_contacts | contact_id and contact_deleted_timestamp (Unix milliseconds); the platform may remove entries older than 30 days |
The account matters. A contact synced from a Google account was probably created elsewhere and downloaded. A raw contact added by a messaging app records that the app matched a phone number to an account on its service, not that the user typed anything. A raw contact with deleted set to 1 is waiting to be removed after a sync and can still be read.
Do not rely on contact "affinity" columns. Since Android 10, times_contacted and last_time_contacted are always 0, and the underlying database no longer holds that data. A contact entry shows that a name and number were stored, not that the two people ever communicated.
Calls: calllog.db
Since Android 7.0, the call log has its own database, calllog.db, in the same provider folder (before that, the calls table was inside contacts2.db). The CE copy is /data/user/0/com.android.providers.contacts/databases/calllog.db. The provider also keeps calllog_shadow.db in DE storage, in the same provider folder under /data/user_de/0/, to hold calls logged before the first unlock; when the user unlocks, the provider copies them into calllog.db and deletes them from the shadow.
The calls table holds one row per call:
- number, as dialed or as presented by the network, and presentation, which records whether the number was allowed, restricted or unknown;
- date, when the call was placed or began to ring (not when it was answered), in Unix milliseconds;
- duration, the connected time in whole seconds (0 for missed and rejected calls);
- type: 1 incoming, 2 outgoing, 3 missed, 4 voicemail, 5 rejected, 6 blocked, 7 answered on another device;
- name, a contact name cached when the call was logged, which can differ from the current contact name;
- geocoded_location and countryiso, derived from the number;
- subscription_id (the phone account ID) and subscription_component_name, which identify the SIM or calling service that handled the call;
- features, a bit field that marks, among other things, video calls.
The phone account ID links a call to a SIM. Depending on the version, it holds the SIM's ICCID or its subscription ID, which you resolve through the siminfo table of /data/user_de/0/com.android.providers.telephony/databases/telephony.db. On a dual-SIM phone this is how you show which line was used.
Calls placed through apps such as WhatsApp are normally not in calllog.db; they are in the app's own database (Module 5). AOSP also trims the log: when a call is added, entries beyond the 500 most recent for the same phone account are deleted. Manufacturers can change that limit, so an absence of older calls may be routine housekeeping rather than deliberate deletion.
Samsung and Google variants
The Samsung paths here are confirmed on ALEAPP's test images up to Android 16 (One UI 8); as of November 2026 none of those images runs One UI 9. On Samsung devices the calls table also carries rows that are not calls: its logtype column marks SMS log rows (300) and MMS log rows (200), each pointing to a telephony provider message. ALEAPP separates them from real calls. Older Samsung devices used a separate logs.db under com.sec.android.provider.logsprovider. The Google Phone app keeps its own copy, annotated_call_log.db, and caller-ID caches; compare them with calllog.db, because the two stores need not match.
SMS and MMS: mmssms.db
Since Android 7.0 the telephony provider stores its databases in DE storage, so mmssms.db is at /data/user_de/0/com.android.providers.telephony/databases/mmssms.db. On earlier versions it was under /data/data/com.android.providers.telephony/databases/. Because it is DE storage, the SMS database is readable before the first unlock by a method that can reach /data, a point worth remembering when the phone is in BFU.
| Table | Key columns |
|---|---|
| sms | address, body, date (received or stored, Unix ms), date_sent (Unix ms), type (1 inbox, 2 sent, 3 draft, 4 outbox, 5 failed, 6 queued), read, seen, thread_id, sub_id |
| threads and canonical_addresses | Conversations and the normalized addresses in them |
| pdu | One row per MMS, with date in Unix seconds, msg_box (1 inbox, 2 sent, 3 drafts, 4 outbox, 5 failed) and the message type |
| part | MMS parts: content type, text, and _data, the path of the attachment file under app_parts |
| addr | MMS addresses by message, with type 137 (0x89) for From, 151 (0x97) for To, 130 for Cc and 129 for Bcc |
For a received SMS, date is when the phone stored it and date_sent is the service center time stamp carried in the message, set by the network when it accepted the message. A gap between them can show delayed delivery or a wrong clock on one side.
Worked example: three units in one extraction
These values are illustrative and are not from the Corvane case. A received SMS has date 1779306130250 and date_sent 1779306128000. As Unix milliseconds, date is 2026-05-20 19:42:10.250 UTC, and date_sent is 2.25 seconds earlier. If the phone's time zone was UTC−3, the user saw 16:42. An MMS in the same thread has pdu.date 1779306130. That value is in seconds; read wrongly as milliseconds it gives 1970-01-21 14:15:06.130 UTC, an obviously impossible date that signals a unit error. Multiply MMS dates by 1,000 before sorting them with SMS dates, as the provider itself does. A call log row with date 1779306130250 and duration 94 was placed or began to ring at 19:42:10.250 UTC and was connected for 94 seconds. Ringing time is not recorded, so the call ended no earlier than 19:43:44 UTC. Allow for that gap when you compare the row with carrier records.
The default SMS app: Google Messages and Samsung Messages
On Pixel phones and many other devices the default SMS app is Google Messages (com.google.android.apps.messaging). It writes SMS and MMS to the telephony provider, but it also keeps its own database, bugle_db, in CE storage at /data/user/0/com.google.android.apps.messaging/databases/bugle_db. Its main tables are conversations, messages, parts and participants. Message parts carry the text, content type, attachment size and local cache path, with timestamps in Unix milliseconds. In the open-source AOSP Messaging app, from which bugle_db derives, the messages table holds sent_timestamp and received_timestamp, message_status (values from 1 for outgoing states, from 100 for incoming ones) and message_protocol (0 for SMS, 1 for MMS). Google Messages is closed source and its values for RCS are not documented, so establish them with test messages on the same app version. In AOSP's messaging code a participant whose sub_id is -2 is someone other than the device user; ALEAPP applies the same rule to set direction.
The important difference is RCS (Rich Communication Services), the carrier messaging standard that adds typing indicators, read receipts, high-resolution media and, in Google Messages, end-to-end encryption. RCS chats are kept by the messaging app, not in mmssms.db, so a report built only from the telephony provider can miss them entirely.
Samsung is moving its phones to Google Messages too. Samsung's US support pages state that Samsung Messages is no longer supported on Galaxy devices with Android 12 or later from July 2026 and cannot send messages, except to emergency numbers, after 6 July 2026. Elsewhere, and on older phones, Samsung Messages (com.samsung.android.messaging) may still be in use, and its database can remain after a switch. It keeps message_content.db in its CE folder. In ALEAPP's tests, each SMS and MMS row in message_content.db points to the matching message in mmssms.db through a provider URI. Rows of other types appear to be RCS chats and file transfers. Their text was not in mmssms.db. A device can also have both apps installed with history in each, because users switch default apps. Check every messaging app present, not only the current default.
Deleted records and what survives
Contacts and telephony databases are framework databases, so secure delete and auto-vacuum normally apply (lesson 3.2): deleted rows are zeroed in the main file. The best local sources are -wal files where a database uses WAL (in AOSP, contacts2.db does and mmssms.db does not), the messaging app's own database (a message deleted in one store may remain in the other), the deleted_contacts table, Samsung's message log rows in calllog.db, notification records (lesson 3.4) and backups. Report each recovered item with its source.
Applying this to the Corvane case
On the evening of Day 1, Lena makes a short call to Victor. In the illustrative extraction of Victor's Galaxy A phone, the Samsung contacts provider's calllog.db holds a row with Lena's number, type 1 (incoming), date 1773165930000 and a duration under a minute, on the SIM identified through telephony.db. The date converts to 2026-03-10 18:05:30 UTC, which is 19:05:30 in the phone's zone, UTC+01:00. AOSP sets date when an incoming call begins to ring (Samsung's own code was not checked), so the examiner allows a few seconds when comparing it with Lena's iPhone call history (lesson 4.3) and, if the court orders them, the carrier's records (lesson 1.4). Ten weeks have passed since Day 1, but the call log is trimmed by count, not by age, so the row can still be present. The contact entry for Lena in contacts2.db shows which account it belongs to, which can indicate whether Victor saved her number himself or it was synced from elsewhere. Neither record shows what was said; the call log proves only that a call between the two lines was logged.
Exam focus: Know the paths of contacts2.db, calllog.db, calllog_shadow.db and mmssms.db and which storage class each uses since Android 7.0. Know the call and SMS type values, that SMS and call dates are Unix milliseconds while MMS pdu.date is in seconds, that a call's date is when it was placed or began to ring, why RCS messages are found only in the messaging app's database, and that Android 10 and later no longer record contact affinity, so times_contacted and last_time_contacted are always 0.
Practice questions
Check your understanding. These questions do not count towards the exam.
Sign in to save your progress and continue where you left off. It is free. Sign in