CDMA PDU parsing on Android

人盡茶涼 提交于 2019-12-04 17:25:49

See the javadoc from $SDK/sources/android-16/com/android/internal/telephony/cdma/SmsMessage:

/**
 * Creates byte array (pseudo pdu) from SMS object.
 * Note: Do not call this method more than once per object!
 */

...so it's not following any particular CDMA standard. You can decode it however; so in fine ASCII art:-

000000000000100200000000000000000A36373839313031363734000000000000000000001B000310864D000306120624205611010B104C2CF9F3F5EBD73E7000
--------messageType     --digitMode                   --------bearerReply   ------------------------------------------------------bearer data
        --------teleService --ton --------------------src     --replySeqNo  --messageID --msts          --userdata
                --------serviceCategory                         --errorClass  --len   --XX--len           --len
                          --numberMode                            --causeCode   ------      ------------2012/06/24 20:56:11
                              --npi                                 --------bearerDataLength                ----------------------userdata
                                --len                                           

Note that I think you made a cut/paste error in your message - the 00 byte marked 'XX' I think shouldn't be there - luckily it's easy to spot the date and work backwards. So this is a message from 6789101674 with userdata:

104C2CF9F3F5EBD73E7000, the first five bits of which show that it's 7-bit encoded (0x02). Having shifted the remainder of the userdata 5 bits to the left, we're left with:

09859f3e7ebd7ae7ce00
--len(septets) 9 septets == 63 bits, so we expect 8 bytes of body
  ----------------7bit-body

So your 7bit-body decoded is "Bggguuugg".

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!