I. Contacts and call logs: Database file/data/data/com.android.providers.contacts/databases/contacts2.db
The data of the call record exists in the calls table; Contact data is stored in the Raw_contacts and data tables, and two tables form the master-slave table relationship.
1. Contact person (contacts2.db)
Each contact has a record in the Raw_contacts table, but the address \ name \email\ phone and so on are stored in the data table.
(1) Mimetypes table
_id mimetype
1 VND.ANDROID.CURSOR.ITEM/EMAIL_V2
2 Vnd.android.cursor.item/im
3 Vnd.android.cursor.item/nickname
4 vnd.android.cursor.item/organization
5 VND.ANDROID.CURSOR.ITEM/PHONE_V2
6 vnd.android.cursor.item/sip_address
7 Vnd.android.cursor.item/name
8 VND.ANDROID.CURSOR.ITEM/POSTAL-ADDRESS_V2
9 vnd.android.cursor.item/identity
Ten Vnd.android.cursor.item/photo
Vnd.android.cursor.item/group_membership
Vnd.android.cursor.item/website
Vnd.android.cursor.item/note
(2) Data table
Field List: _id package_id mimetype_id raw_contact_id is_read_only is_primary is_super_primary data_version data1 data2 data3 da TA4 data5 data6 data7 data8 data9 data10 data11 data12 data13 data14 data15 data_sync1 data_sync2 data_sync3 Data_sync4
RAW_CONTACT_ID: This value corresponds to the _id value of the Raw_contacts table. Each contact in the data table has more than one row of data, and the same value is the same for the same contact person.
MIMETYPE_ID: Corresponds to the type of the Mimetypes table. By Mimetypes table, the data table, if the mimetype_id value of 7 means that the name is stored, 5 means that the number is stored.
Other information needs to be analyzed according to the type of mimetype_id instruction
Name data: Uri (Content://com.android.contacts/data)
The macros corresponding to the URI are: Android.provider.ContactsContract.Data.CONTENT_URI
Data1 field: Name Full name
data2 field: Name Given_name
Data3 field: Last Name Family_name
data4 field: Name prefix prefix
Data5 field: middle name mid_name
data6 field: Name suffix sufix
Data7 field: name Pinyin Sufix_pinyin
Data8 field: middle name Pinyin Mid_pinyin
data9 field: surname Pinyin Family_name_pinyin
Phone data: Uri (Content://com.android.contacts/data/phones)
The macros corresponding to the URI are: Android.provider.ContactsContract.CommonDataKinds.Phone.CONTENT_URI
data1 field: Full phone number
data2 field: Phone type
Phone type information is as follows
Type_custom = 0;
Type_home = 1;
Type_mobile = 2;
Type_work = 3;
Type_fax_work = 4;
Type_fax_home = 5;
Type_pager = 6;
Type_other = 7;
Email data: Uri (content://com.android.contacts/data/emails)
The macros corresponding to the URI are: Android.provider.ContactsContract.CommonDataKinds.Email.CONTENT_URI
Data1 field: e-mail address
data2 field: Email type
Email type information is as follows
Type_custom = 0;
Type_home = 1;
Type_work = 2;
Type_other = 3;
Type_mobile = 4;
Address data: Uri (content://com.android.contacts/data/postals)
data2 field: Address Type
data4 field: Street
Data7 field: state
Data8 field: City
DATA9 field: Postal code
Address type information is as follows
Type_custom = 0;
Type_home = 1;
Type_work = 2;
Type_other = 3;
(3) Raw_contacts table
_id field: Each row represents a contact, corresponding to the data table raw_contact_id field.
Sort_key field: Represents the information for the sort of name. There is a corresponding pinyin in Chinese. The data format that may be displayed is: Li Li CUN village
2. Call History (CONTACTS2.DB)
The corresponding macro for the Uri (content://call_log/calls) is: Android.provider.CallLog.Calls.CONTENT_URI
Name field: Contact person name CallLog.Calls.CACHED_NAME
Number field: Phone CallLog.Calls.NUMBER
Date field: Day CallLog.Calls.DATE
Type field: CallLog.Calls.TYPE
DURATION field: Length of call CallLog.Calls.DURATION
Android Database data