如何通过SIM_IO从SIM卡读取MSISDN? [英] How to read MSISDN from sim card by SIM_IO?
问题描述
我需要在android中阅读MSISDN,但是我们必须使用.c来完成它.我打开一个套接字,将 RIL_REQUEST_SIM_IO
发送给ril.这是日志.
I need to read MSISDN in android, but we must use .c to finish it.
I open a socket to send RIL_REQUEST_SIM_IO
to ril. Here is the log.
D/RILC ( 106): [0004]> SIM_IO (cmd=0xB2,efid=0x6F40,path=3F007F10,1,4,30,(null),pin2=(null),aid=(null))
...
D/RILC ( 106): [0004]< SIM_IO {sw1=0x90,sw2=0x0,ffffffffffffffffffffffffffff0891684125205260f5ffffffffff}
我是否使用了正确的参数(P1 = 1,P2 = 4,P3 = 30)?
Did I use the right parameters (P1 = 1, P2 = 4, P3 = 30)?
如何通过响应获取手机号码?
And how can I get the mobile phone number by response?
谢谢!☺
推荐答案
您对此有何困惑?您想知道您告诉卡片的内容吗?所有这些信息均在ISO 7816-4和其他一些规范中提供,但这是您执行操作的详细信息:
What is your confusion here? You wanted to know what you told the card? All this information is in ISO 7816-4 and a few other specs, but here's the details of what you did:
您已向SIM卡发送了一条读取记录命令(0xB2)您要求输入路径:
You sent a read record command to the SIM (0xB2) You asked for the Path:
3F00 -> (MF)
7F10 -> (DF_TELECOMM)
6F40 -> (MSISDN)
您设置参数:
P1 (record) = 1 (record 1)
P2 (reference control) = 4 (this mean use record number set in P1)
P3 (Le meaning bytes to read) = 30 (bytes)
您获得了成功(SW代表状态字,您得到SW1/SW2 = 0x9000表示成功)和数据(0xffffffffffffffffffffffffffffff0891684125205260f5ffffffffff)
and you got back success (SW stands for status word, you got SW1/SW2 = 0x9000 which means success) and the data (0xffffffffffffffffffffffffffff0891684125205260f5ffffffffff)
在解析时结帐 E.164 您的MSISDN.
Checkout E.164 on parsing your MSISDN.
这篇关于如何通过SIM_IO从SIM卡读取MSISDN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!