Project

General

Profile

import iPhone sms into replicant 4.2 0003 on Samsung » doc android MMS-SMS DB (english).txt

Fil Lupin, 05/03/2015 12:32 PM

 
1
source :
2
https://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android
3
http://minhdanh2002.blogspot.de/2012/02/raw-access-to-sms-database-on-android.html
4
https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/jb-release/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
5
http://www.etsi.org/deliver/etsi_gts/03/0340/05.03.00_60/gsmts_0340v050300p.pdf
6
SMS type 0 (SMS ping, SMS furtifs): https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/issues/69
7
https://github.com/domi007/silentSMS
8
http://forum.xda-developers.com/showthread.php?t=1422969
9
http://rednaxela.net/pdu.php
10
localisation GSM: http://blog.ptsecurity.com/2014/04/search-and-neutralize-how-to-determine.html
11
http://events.ccc.de/congress/2008/Fahrplan/attachments/1262_25c3-locating-mobile-phones.pdf
12
carte GSM: http://gsmmap.org/
13

    
14
The /data/data/com.android.providers.telephony/databases/mmssms.db 
15
file use sqlite format and is accessible into root mode ont the phone.
16

    
17

    
18

    
19
table addr
20
----------
21
_id: INTEGER (primary key)	ID
22
msg_id: INTEGER			The ID of MM which this Address entry belongs to
23
contact_id: INTEGER		The ID of contact entry in Phone Book
24
address: TEXT			The address text
25
type: INTEGER			Type of address,must be one of PduHeaders.BCC,
26
				PduHeaders.CC, PduHeaders.FROM, PduHeaders.TO
27
charset: INTEGER		Character set of entry
28

    
29
table android_metadata
30
----------------------
31
locale: TEXT
32

    
33
table SMS (info on SMS)
34
----------------------------
35
This table is used by the SMS dispatcher to hold incomplete partial messages
36
until all the parts arrive.
37

    
38
_id: INTEGER (primary key)	SMS ID
39
thread_id: INTEGER		The thread ID of the message
40
address: TEXT			The address of the other party
41
person: INTEGER
42
date: INTEGER			The date the message was received
43
date_sent: INTEGER		The date the message was sent
44
protocol: INTEGER		The protocol identifier code
45
read: INTEGER			Has the message been read? (boolean)
46
status: INTEGER			a TP-Status value or -1 if it status hasn't been 
47
				received (default)
48
				STATUS_COMPLETE=0 	TP-Status: complete.
49
				STATUS_FAILED=64 	TP-Status: failed.
50
				STATUS_NONE=-1 		TP-Status: no status received.
51
				STATUS_PENDING=32 	TP-Status: pending. 
52
				http://www.etsi.org/deliver/etsi_gts/03/0340/05.03.00_60/gsmts_0340v050300p.pdf
53
type: INTEGER			The type of message
54
				unsure sense ?
55
				1 if sent
56
				2 if receiverd
57
				3 if ?
58
reply_path_present: INTEGER
59
subject: TEXT			The subject of the message, if present
60
body: TEXT			The body of the message
61
service_center: TEXT		The service center (SC) through which to send the 
62
				message, if present
63
locked: INTEGER			Is the message locked?  (default 0)
64
error_code: INTEGER		Error code associated with sending or receiving this message
65
				(default 0)
66
seen: INTEGER			Indicates whether this message has been seen by
67
				the user. The "seen" flag will be used to figure
68
				out whether we need to throw up a statusbar 
69
				notification or not (default 0)
70

    
71
table sr_pending
72
----------------
73
This table is used by the SMS dispatcher to hold pending delivery status report
74
intents.
75

    
76
reference_number: INTEGER
77
action: TEXT
78
data: TEXT
79

    
80
table threads
81
-------------
82
This table maps the subject and an ordered set of recipient
83
IDs, separated by spaces, to a unique thread ID. The IDs
84
come from the canonical_addresses table. This works
85
because messages are considered to be part of the same
86
thread if they have the same subject (or a null subject)
87
and the same set of recipients.
88

    
89
_id: INTEGER PRIMARY KEY	identifier autoincremented
90
date: INTEGER			The date at which the thread was created
91
				(default 0)
92
message_count: INTEGER		The message count of the thread (default 0)
93
recipient_ids: TEXT		A string encoding of the recipient IDs of the
94
				recipients of the message, in numerical order and
95
				separated by spaces
96
				= canonical_addresses
97
snippet: TEXT			The snippet of the latest message in the thread
98
snippet_cs: INTEGER		The charset of the snippet (default 0)
99
read: INTEGER			Indicates whether all messages of the thread have
100
				been read (default 1)
101
type: INTEGER			Type of the thread, either Threads.COMMON_THREAD=0
102
				or Threads.BROADCAST_THREAD=1
103
error: INTEGER			Indicates whether there is a transmission error
104
				in the thread (default 0)
105
has_attachment: INTEGER		Indicates whether this thread contains any
106
				attachments (1), or 0 (default) if pure text
107

    
108
table words (FTS3)
109
------------------
110
_id				(2<<32)+source_id
111
index_text
112
source_id
113
table_to_use			1 or 2
114

    
115
table words_content
116
-------------------
117
docid: INTEGER PRIMARY KEY
118
c0_id				(2<<32)+ c2source_id
119
c1index_text
120
c2source_id
121
c3table_to_use			1 or 2
122

    
123
table words_segments
124
--------------------
125
blockid: INTEGER PRIMARY KEY
126
block: BLOB
127

    
128
table words_segdir
129
------------------
130
level: INTEGER PRIMARY KEY
131
idx: INTEGER
132
start_block: INTEGER
133
leaves_end_block: INTEGER
134
end_block: INTEGER
135
root: BLOB
136

    
137
table attachments
138
-----------------
139
sms_id: INTEGER			ID
140
content_url: TEXT		URL
141
offset: INTEGER			
142

    
143
table canonical_addresses
144
-------------------------
145
This table maps the first instance seen of any particular
146
MMS/SMS address to an ID, which is then used as its
147
canonical representation. If the same address or an
148
equivalent address (as determined by our Sqlite
149
PHONE_NUMBERS_EQUAL extension) is seen later, this same ID
150
will be used. The _id is created with AUTOINCREMENT so it
151
will never be reused again if a recipient is deleted.
152

    
153
_id: INTEGER PRIMARY KEY
154
address: TEXT			An address used in MMS or SMS. Email addresses
155
				are converted to lower case and are compared by
156
				string equality. Other addresses are compared
157
				using PHONE_NUMBERS_EQUAL
158

    
159
table drm
160
---------
161
_id: INTEGER PRIMARY KEY
162
_data: TEXT
163

    
164
table part
165
----------
166
_id: INTEGER PRIMARY KEY
167
mid: INTEGER		The identifier of the message which this part belongs to
168
			part._id = pdu._id
169
seq: INTEGER		The order of the part
170
ct: TEXT		type MIME (cf. https://fr.wikipedia.org/wiki/Type_MIME)
171
			text/plain, image/jpeg, image/bmp, image/gif,
172
			image/jpg, image/png
173
			if text/plain or application/smil, MMS is not pure text
174
			and there is some attachment (has_attachment=1
175
			in the thread from threads table)
176
name: TEXT		The name of the part
177
chset: INTEGER		The charset of the part
178
cd: TEXT		The content disposition of the part
179
fn: TEXT		The file name of the part
180
cid: TEXT		The content ID of the part
181
cl: TEXT		The content location of the part
182
ctt_s: INTEGER		The start of content-type of the message
183
ctt_t: TEXT		The type of content-type of the message
184
_data: TEXT		The location(on filesystem) of the binary data of the part
185
			(empty if text)
186
text: TEXT		content if text, empty else
187

    
188
table pdu (info on MMS)
189
----------------------------
190
http://www.xuebuyuan.com/1068475.html
191
https://developer.android.com/reference/android/provider/Telephony.BaseMmsColumns.html1
192
_id: INTEGER PRIMARY KEY
193
thread_id: INTEGER		thread id
194
date: INTEGER			The date the message was received (unix format)
195
date_sent: INTEGER		The date the message was sent (default 0)
196
msg_box: INTEGER		The box which the message belong to
197
				MESSAGE_BOX_ALL = 0
198
				MESSAGE_BOX_INBOX = 1
199
				MESSAGE_BOX_SENT   = 2
200
				MESSAGE_BOX_DRAFTS = 3
201
				MESSAGE_BOX_OUTBOX = 4
202
read: INTEGER			Has the message been read? (boolean)
203
m_id: TEXT			The Message-ID of the message
204
sub: TEXT			The subject of the message, if present
205
sub_cs: INTEGER			The character set of the subject, if present
206
ct_t: TEXT			The Content-Type of the message
207
ct_l: TEXT			The Content-Location of the message
208
exp: INTEGER			The expiry time of the message
209
m_cls: TEXT			The class of the message
210
m_type: INTEGER			The type of the message defined by MMS spec
211
				128 if sent
212
				130 if to send again
213
				132 if resent
214
v: INTEGER			The version of specification that this message
215
				conform
216
m_size: INTEGER			The size of the message
217
pri: INTEGER			The priority of the message
218
rr: INTEGER			The read-report of the message
219
rpt_a: INTEGER			Whether the report is allowed
220
resp_st: INTEGER		The response-status of the message
221
st: INTEGER			The status of the message
222
tr_id: TEXT			The transaction-id of the message
223
retr_st: INTEGER		The retrieve-status of the message
224
retr_txt: TEXT			The retrieve-text of the message
225
retr_txt_cs: INTEGER		The character set of the retrieve-text
226
read_status: INTEGER		The read-status of the message
227
ct_cls: INTEGER			The content-class of the message
228
resp_txt: TEXT			The response-text of the message
229
d_tm: INTEGER			The delivery-time of the message
230
d_rpt: INTEGER			The delivery-report of the message
231
locked: INTEGER			Has the message been locked?
232
seen: INTEGER			Indicates whether this message has been seen by
233
				the user. The "seen" flag will be used to figure
234
				out whether we need to throw up a statusbar
235
				notification or not (default 0)
236

    
237
table pending_msgs
238
------------------
239
This table stores the queue of messages to be sent/downloaded.
240

    
241
_id: INTEGER PRIMARY KEY	ID
242
proto_type: INTEGER		The type of transport protocol(MMS or SMS)
243
msg_id: INTEGER			The ID of the message to be sent or downloaded
244
msg_type: INTEGER		The type of the message to be sent or downloaded
245
err_type: INTEGER		The type of the error code
246
err_code: INTEGER		The error code of sending/retrieving process
247
retry_index: INTEGER		How many times we tried to send or download the
248
				message
249
due_time: INTEGER		The time to do next retry
250
last_try: INTEGER		The time we last tried to send or download the
251
				message
252

    
253
table rate
254
----------
255
sent_time: INTEGER		When a message was successfully sent
256

    
257
table raw
258
---------
259
_id: INTEGER PRIMARY KEY
260
date: INTEGER
261
reference_number: INTEGER	one per full message
262
count: INTEGER			the number of parts
263
sequence: INTEGER		the part number of this message
264
destination_port: INTEGER
265
address: TEXT
266
pdu: TEXT			the raw PDU for this part
267
	 
268

    
269

    
270
sqlite_autoindex_words_segdir_1
271
typeThreadIdIndex
(2-2/2)