I searched a lot of articles on PDU parsing on the Internet, but I had no clue. Finally, I made some progress after referring to the Google Code.
Sodino has not obtained the formal MMS specification, and everything comes from Google search. I hope that the majority of users will pick up and correct the mistakes. I am very grateful.
After the mobile phone receives the text message, Android (Android 2.2.1 from cyanogenmod for G6) will output the following in logcat:
12-17 16:24:16. 425: Debug/wap push (230): RX: Pushed [data: Pushed] 3133353935373330313133 [tag1: 2f545950453d504c4d4e00] 8a808e020d0c
Note: "[data:]" "[tag1]" is manually added.
The MMS tool classes in Android are all "@ hide", but you can still register broadcastreceiver to receive the data in "[data.
Obtain the binary data of MMS from intent. The method is as follows:
Byte [] DATA = intent. getbytearrayextra ("data ");
Well, let's talk about what information can be obtained after parsing binary data. Let's pick several important points:
1. content_location, that is.
2. letter number.
3. MMS size.
The resolution details are as follows:
AE 06 246170706c69 63617469 6f6e2f limit B4 87 af 84 <br/> AE: Transaction ID/push ID (which is unknown? Is the transaction ID different from the transaction ID in data ?) <Br/> 06: type, indicating the PDU type and function. The push message is encoded as 0x06. <Br/> 24: length (36 bytes later). It ends at the end of af84 (which is different from that described in the document. This document is 22, which is 34 bytes and does not contain af84 ). <Br/> 6170706c696f6e2f766e642e7761702e6d6d732d6d65737361676500: applicon/vnd. WAP. MMS-message (here the three-byte value indicating "ATI" is missing. The reason is unknown. The normal bytecode sequence should be: Accept, "application/vnd. WAP. MMS-message ") <br/> b487: there are two more bytes. sodino is not clear. <Br/> AF: the WSP compression encoding of the header information "X-wap-Application-ID. <Br/> 84: X-wap-Application-ID, indicating "X-wap-Application: mms. ua ". <Br/> data: <br/> [8C 82 98 5251594278686467766b2b4100 8d 90 83 <br/> Issue <br/> 88 05810302a300 <br/> 891780] <br/> 8c: x-MMS-message-type <br/> 82: message_type_icationication_ind (refer to from mmssms. DB/PDU "ct_l" value: 130, that is, the hexadecimal 0x82 and aosp COM/Google/Android/MMS/PDU/pduheader) <br/> 98: x-MMS-transaction-id <br/> 5251594278686467766b2b4100: rqybxhdgvk + a (tr _ Id, that is, transaction-ID reference from mmssms. DB/PDU) <br/> 8d: X-MMS-version <br/> 90: the value of MMS version is 1.0 (from the network, refer to mmssms. the dB/PDU "v" value is 16 (1 <4) | 0), and the value is named mms_version_1_0) <br/> 83: content_location (refer to from mmssms. DB/PDU "ct_l" and aosp COM/Google/Android/MMS/PDU/pduheader) <br/> Protocol: http: // 211.136.221.75/rqybxhdgvk + a (00: NULL character) <br/> 88: Expiry <br/> 05: length of the value, that is, 5 bytes <br /> 81: the subsequent time is in the relative time format. <br/> 03: the time value is 3 bytes. <br/> 02a300: 172800 seconds, that is, the validity period of 48 hours is consistent with the "information" application prompt. <Br/> 89: from <br/> 17: "from", that is, 23 bytes <br/> 80: from_address_present_token, 1st bytes <br/> 3133353935373330313133: 13595730113, 2nd ~ 12 bytes <br/> 2f545950453d504c4d4e00:/type = plmn <00> (<00> indicates no obvious meaning, as is), 13th ~ 23 bytes <br/> 8A: message_class <br/> 80: message_class_personal (refer to: mmssms. DB/PDU "m_cls" value is personal) <br/> 8e: message_size <br/> 02: read two bytes later <br/> 0d0c: (the simplest form reserved after a long is converted to byte []. The actual value is 3340)
Important references: establishment of the Communications Commission mmsc(test platform of the color information center documentation. Doc
This article is owned by sodino, A csdn blog blogger.
Reprinted please indicate the source: http://blog.csdn.net/sodino/archive/2010/12/19/6084697.aspx