Android 短信模块分析(七) MMS数据库定义及结构整理
一. mmssms.db
数据库mmssms.db中表的定义见表4.1至4.18所示:
表4.1 addr(彩信地址)
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
msg_id |
INTEGER |
The ID of MM whcich this Address entry belongs to. |
Pdu主键关联 |
|
contact_id |
INTEGER |
The ID of contact entry in Phone Book |
|
|
address |
TEXT |
The address text |
|
|
type |
INTEGER |
Type of address,must be one Of PduHeaders.BCC, PduHeaders.CC, PduHeaders.FROM, PduHeaders.TO. |
|
|
charset |
INTEGER |
Character set of entry |
表4.2 android_metadata(语言)
|
字段名 |
类型 |
描述 |
备注 |
|
locale |
TEXT |
本地采用语言 |
例如:zh_CN |
表4.3 attachments (附件)
|
字段名 |
类型 |
描述 |
备注 |
|
sms_id |
INTEGER |
短信id |
FK,短信表主键 |
|
content_url |
TEXT |
url |
|
|
offset |
INTEGER |
偏移量 |
表4.4 canonical_addresses(所以短信删除,此数据依然存在)
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
address |
TEXT |
发送或接收的电话号码 |
表4.5 drm()
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
_data |
TEXT |
处理加密解密的数据 |
表4.6 part(存储了彩信内容(文本、音乐、图象)的文件名(即在parts下面的文件名)、文件类型信息)
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
mid |
INTEGER |
The identifier of the message which this part belongs to. |
Pdu主键关联 |
|
seq |
INTEGER |
The order of the part 所发送Part的顺序 |
|
|
ct |
TEXT |
The content type of the part 彩信数据类型 |
|
|
name |
TEXT |
The name of the part Part名称 |
|
|
chset |
INTEGER |
The charset of the part. 字符集 |
|
|
cd |
TEXT |
The content disposition of the part. 内容配置 |
|
|
fn |
TEXT |
The file name of the part. 文件名称 |
|
|
cid |
TEXT |
The content ID of the part |
|
|
cl |
TEXT |
The content location of the part |
|
|
ctt_s |
INTEGER |
The start of content-type of the message |
|
|
ctt_t |
TEXT |
The type of content-type of the message |
|
|
_data |
TEXT |
The location(on filesystem) of the binary data of the part. 数据的位置 如:/data/data/com.providers.telephony/app_parts/PART_1300271462558 |
这个字段基本没什么用,不能直接读取这个文件,读取同样需要通过ContentProvider,URI为”conteng://mms/part” |
|
text |
TEXT |
表4.7 pdu(彩信)
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
thread_id |
INTEGER |
Threads 的PK |
FK |
|
date |
INTEGER |
The date the message was sent. 发送日期 |
|
|
read |
INTEGER |
Has the message been read 已读为1,未读为0 |
|
|
m_id |
TEXT |
The Message-ID of the message. |
|
|
sub |
TEXT |
The subject of the message, if present 主题 |
|
|
sub_cs |
INTEGER |
The character set of the subject, if present 主题所用字符集 |
|
|
ct_t |
TEXT |
The Content-Type of the message |
|
|
ct_l |
TEXT |
The Content-Location of the message. |
|
|
exp |
INTEGER |
The expiry time of the message. 过期时间 |
|
|
m_cls |
TEXT |
The class of the message. |
|
|
m_type |
INTEGER |
The type of the message defined by MMS spec |
|
|
v |
INTEGER |
The version of specification that this message conform. |
|
|
m_size |
INTEGER |
The size of the message 彩信大小 |
|
|
pri |
INTEGER |
The priority of the message. |
|
|
rr |
INTEGER |
The read-report of the message. |
|
|
rpt_a |
INTEGER |
Whether the report is allowed. |
|
|
resp_st |
INTEGER |
The response-status of the message. |
|
|
st |
INTEGER |
The status of the message. |
|
|
tr_id |
TEXT |
The transaction-id of the message. |
|
|
retr_st |
INTEGER |
The retrieve-status of the message. |
|
|
retr_txt |
TEXT |
The retrieve-text of the message. |
|
|
retr_txt_cs |
INTEGER |
The character set of the retrieve-text. |
|
|
read_status |
INTEGER |
The read-status of the message. |
|
|
ct_cls |
INTEGER |
The content-class of the message. |
|
|
resp_txt |
TEXT |
The response-text of the message. |
|
|
d_tm |
INTEGER |
The delivery-time of the message. |
|
|
d_rpt |
INTEGER |
The delivery-report of the message. |
|
|
locked |
INTEGER |
Has the message been locked? |
|
|
sim_id |
INTEGER |
||
|
seen |
INTEGER |
Indicates whether this message has been seen by the user. The "seen" flag will be used to figure out whether we need to throw up a statusbar notification or not. |
有看为1,否则为0 |
表4.8 pending_msgs
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
proto_type |
INTEGER |
The type of transport protocol(MMS or SMS). |
|
|
msg_id |
INTEGER |
The ID of the message to be sent or downloaded. |
|
|
msg_type |
INTEGER |
The type of the message to be sent or downloaded. This field is only valid for MM. For SM, its value is always |
|
|
err_type |
INTEGER |
The type of the error code. |
|
|
err_code |
INTEGER |
The error code of sending/retrieving process. |
|
|
retry_index |
INTEGER |
How many times we tried to send or download the message. |
|
|
due_time |
INTEGER |
The time to do next retry. |
|
|
pending_sim_id |
INTEGER |
||
|
last_try |
INTEGER |
The time we last tried to send or download the message. |
表4.9 rate(彩信发送时间)
|
字段名 |
类型 |
描述 |
备注 |
|
sent_time |
INTEGER |
When a message was successfully sent. |
表4.10 raw(This table is used by the SMS dispatcher to hold incomplete partial messages until all the parts arrive.)
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
_data |
INTEGER |
处理加密解密的数据 |
|
|
reference_number |
INTEGER |
one per full message |
|
|
count |
INTEGER |
the number of parts |
|
|
sequence |
INTEGER |
the part number of this message |
|
|
destination_port |
INTEGER |
||
|
address |
TEXT |
||
|
sim_id |
INTEGER |
||
|
pdu |
TEXT |
the raw PDU for this part |
表4.11 sms(短信)
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
thread_id |
INTEGER |
Threads 的PK |
FK 在短信界面里显示在第一组的第一行 |
|
address |
TEXT |
对方短信号码 |
|
|
person |
INTEGER |
存在电话薄里的名字,不存在的为空 |
|
|
date |
INTEGER |
日期 |
|
|
protocol |
INTEGER |
发送短信为空,收到为0 |
|
|
read |
INTEGER |
已读未读 |
已读为1,未读为0 |
|
status |
INTEGER |
a TP-Status value or -1 if it status hasn't been received |
|
|
type |
INTEGER |
发短信为2,收到短信为1 |
|
|
reply_path_present |
INTEGER |
发短信为空,收到的为0 |
|
|
subject |
TEXT |
主题 |
|
|
body |
TEXT |
短信内容 |
|
|
service_center |
TEXT |
运营商服务电话 |
|
|
locked |
INTEGER |
是否锁掉了。 |
0为未锁,1已锁 |
|
sim_id |
INTEGER |
||
|
error_code |
INTEGER |
The error code of sending/retrieving process. |
|
|
seen |
INTEGER |
Indicates whether this message has been seen by the user. The "seen" flag will be used to figure out whether we need to throw up a statusbar notification or not. |
有看为1,否则为0 |
表4.12 sr_pending(This table is used by the SMS dispatcher to hold pending delivery status
|
字段名 |
类型 |
描述 |
备注 |
|
reference_number |
INTEGER |
||
|
action |
TEXT |
||
|
data |
TEXT |
表4.13 threads(在ConversationList.java中显示的当前短信)
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
date |
INTEGER |
The date at which the thread was created. 日期 |
|
|
message_count |
INTEGER |
The message count of the thread. 短信总条数 |
|
|
recipient_ids |
TEXT |
canonical_addresses的主键 |
FK |
|
snippet |
TEXT |
The snippet of the latest message in the thread. 在最前面显示的短信 |
|
|
snippet_cs |
INTEGER |
The charset of the snippet. |
|
|
read |
INTEGER |
Indicates whether all messages of the thread have been read. |
已读为1,未读为0 |
|
type |
INTEGER |
Type of the thread, either Threads.COMMON_THREAD or Threads.BROADCAST_THREAD. |
push的短信为0 |
|
error |
INTEGER |
Indicates whether there is a transmission error in the thread. |
有错误为1,没有为0 |
|
has_attachment |
INTEGER |
Indicates whether this thread contains any attachments. |
没有为1,有为0 |
表4.15 words
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER |
如果是短信则与source_id相同;如果为彩信则是: (2<<32)+source_id |
|
|
index_text |
TEXT |
存储的信息内容 |
|
|
source_id |
INTEGER |
如果是短信则表示sms的_id 如果是彩信则表示pdu的_id |
|
|
table_to_use |
INTEGER |
短信为1,彩信为2 |
表4.16 words_content
|
字段名 |
类型 |
描述 |
备注 |
|
docid |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
c0_id |
INTEGER |
如果是短信则与source_id相同;如果为彩信则是: (2<<32)+ c2source_id |
|
|
c1index_text |
TEXT |
存储的信息内容 |
|
|
c2source_id |
INTEGER |
如果是短信则表示sms的_id 如果是彩信则表示pdu的_id |
|
|
c3table_to_use |
INTEGER |
短信为1,彩信为2 |
表4.17 words_segdir
|
字段名 |
类型 |
描述 |
备注 |
|
level |
INTEGER PRIMARY_KEY |
主键ID |
|
|
idx |
INTEGER PRIMARY_KEY |
主键ID |
|
|
start_block |
INTEGER |
开始块 |
|
|
leaves_end_block |
INTEGER |
||
|
end_block |
INTEGER |
结束块 |
|
|
root |
BLOB |
表4.18 word_segments
|
字段名 |
类型 |
描述 |
备注 |
|
blockid |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
block |
BLOB |
simcontacts.db 中的表相对较少,只有三个:
数据库simcontacts.db中表的定义见表4.19至4.21所示:
表4.19 android_metadata
|
字段名 |
类型 |
描述 |
备注 |
|
locale |
TEXT |
本地采用语言 |
例如:zh_CN |
表4.20 simPeople
|
字段名 |
类型 |
描述 |
备注 |
|
_id |
INTEGER PRIMARY_KEY |
主键ID |
系统生成 |
|
name |
TEXT |
||
|
number |
TEXT |
||
|
simid |
INTEGER |
||
|
|
TEXT |
||
|
pinyin |
TEXT |
拼音 |
表4.21 simPeopleLookup
|
字段名 |
类型 |
描述 |
备注 |
|
token |
TEXT |
||
|
source |
INTEGER |
与simPeople的_id进行关联 |
Android 短信模块分析(七) MMS数据库定义及结构整理的更多相关文章
- Android 短信模块分析(三) MMS入口分析
MMS入口分析: 在Mms中最重要的两个Activity,一个是conversationList(短信列表) ,另一个就是ComposeMessageActivity(单个对话或者短信).每 ...
- Android 短信模块分析(二) MMS中四大组件核心功能详解
接下来的分析先从MMS中四大组件(Activity ,BroadCastReceiver,Service,ContentProvider),也是MMS中最核心的部分入手: 一. Activity 1 ...
- Android 短信模块分析(四) MMS之短信的发送与接收
MMS之短信的发送与接收分析: 一.信息发送: com.android.mms.data.WorkingMessage.java 类 send()函数: public void send() { . ...
- Android Telephony分析(七) ---- 接口扩展(异步转同步)
本文是基于上一篇<Android Telephony分析(六) —- 接口扩展(实践篇)>来写的.上一篇介绍的接口扩展的方法需要实现两部分代码:1. 从APP至RIL,发送请求:2. 从R ...
- android上引入七牛 上传图片或者文件 最终整理版本(可用)
前言: 以下是引入七牛的步骤,以及在七牛中上传文件和获取文件private 私密地址. 生成上传凭证和获取下载凭证 具体如果使用过程有什么疑问可以加QQ(备注:七牛问题). 1:导入相关的包(注意是4 ...
- Android MMS数据库存储说明
数据表 MMS模块总共包含17张表:addr.android_metadata.attachments.canonical_addresses.drm.part.pdu.pending_msgs.ra ...
- 我的Android 4 学习系列之数据库和Content Provider
目录 创建数据库和使用SQLite 使用Content Provider.Cusor和Content Value来存储.共享和使用应用程序数据 使用Cursor Loader异步查询Content P ...
- Android群英传笔记——第五章:Android Scroll分析
Android群英传笔记--第五章:Android Scroll分析 滑动事件算是Android比较常用的效果了,而且滑动事件他本身也是有许多的知识点,今天,我们就一起来耍耍Scroll吧 一.滑动效 ...
- Android进阶:七、Retrofit2.0原理解析之最简流程【下】
紧接上文Android进阶:七.Retrofit2.0原理解析之最简流程[上] 一.请求参数整理 我们定义的接口已经被实现,但是我们还是不知道我们注解的请求方式,参数类型等是如何发起网络请求的呢? 这 ...
随机推荐
- Codeforces Global Round 3:B. Born This Way
Born This Way原文链接:[传送门] 题目大意:潇洒哥想乘坐飞机从A地到达C地,但是没有直达的航班,在A地和B地之间有一个可以中转的航班B,潇洒哥想早点到达C地(有航班就坐),但是很不幸他得 ...
- 如何用navicat连接linux服务器上的mysql以及重启服务
1,开启mysql权限:https://www.cnblogs.com/NaughtyCat/p/how-to-connect-to-mysql-on-linux-by-navicat.html my ...
- [爬坑日记] 安卓模拟器1903蓝屏 没开hyper-v
先说解决方案: 我在升级完1903之后短短几个小时蓝屏了两次 还是不同原因,不由得开始怀疑这个版本的稳定性,随后发现只有启动安卓模拟器的时候必然蓝屏(还有一次蓝屏实在安装驱动的时候) 经过百度得知需要 ...
- Python 之路
Python之路[第一篇]:Python简介和入门 Python之路[第二篇]:Python基础(一) Python之路[第三篇]:Python基础(二) Python之路[第四篇]:模块 Pytho ...
- selenium+python自动化用例登陆界面模板
一.基本逻辑 1.自动填写用户名和密码登录成功后跳转到相应页面 2.验证相应页面的url与给定的url是否一致,如果一致则测试通过,如果不一致则不通过 二.以jenkins登陆界面为例,代码如下 fr ...
- Azure IoT Hub 十分钟入门系列 (2)- 使用模拟设备发送设备到云(d2c)的消息
本文主要分享一个案例: 10分钟- 使用Python 示例代码和SDK向IoT Hub 发送遥测消息 本文主要有如下内容: 了解C2D/D2C消息: 了解IoT Hub中Device的概念 了解并下载 ...
- Oracle中trunc()函数用法
SQL表达式 注释 SELECT SYSDATE FROM dual --当前系统时间,24小时制 SELECT TO_CHAR(SYSDATE,'yyyy-mm-dd hh24:mi:ss') FR ...
- 剑指offer系列——62.二叉搜索树的第k个结点
Q:给定一棵二叉搜索树,请找出其中的第k小的结点.例如, (5,3,7,2,4,6,8) 中,按结点数值大小顺序第三小结点的值为4. T: 中序遍历,递归: int count = 0; public ...
- 什么是DO / DTO / BO / VO /AO ?
转载:https://blog.csdn.net/ouzhuangzhuang/article/details/86644476 POJO 是 DO / DTO / BO / VO 的统称. DO(D ...
- Yii2.0如何建立公共方法
yii2-advanced版本 common 目录为公共资源目录,我们可以把定义的方法放在这个目录下,在此目录下我们随意建立一个文件比如”helps”目录,因为考虑到公共方法可能会有功能上的划分类,所 ...