首页 » 通讯 » Android手机发送APDU给SIM卡_敕令_通道

Android手机发送APDU给SIM卡_敕令_通道

admin 2025-01-08 00:15:06 0

扫一扫用手机浏览

文章目录 [+]

权限哀求: MODIFY_PHONE_STATE 或者 hasCarrierPrivileges

public String iccTransmitApduBasicChannel (int cla, int instruction, int p1, int p2, int p3, String data)

Android手机发送APDU给SIM卡_敕令_通道 通讯

通过基本通道发送 APDU 给 ICC卡, 参数与 TS 27.007 AT+CSIM 命令相同

(实在便是对 AT+CSIM的封装)

支持AT+CSIM的基带听说很少

public String iccTransmitApduLogicalChannel (int channel, int cla, int instruction, int p1, int p2, int p3, String data)

通过逻辑通道 发送APDU给ICC卡, 参数于 TS 27.007 AT+CGLA 命令相同

claint: APDU 命令的种别

instructionint: APDU 命令的 指令码

p1int: APDU命令的P1

p2int: APDU命令的P2

p3int: APDU命令的P3. 如果 p3 是负数, 那么解释这个APDU只有4个字节(CLA+INS+P1+P2)

dataString: 这个APDU携带的数据

public boolean hasCarrierPrivileges ()

本UID下的任何包如果有 运营商 权限, 就返回true

这个权限是有 UICC 的所有者授予的,而不是 移动网络的运营商

public boolean hasIccCard ()

SIM卡存在否?

public IccOpenLogicalChannelResponse iccOpenLogicalChannel (String AID)

打开逻辑通道 (TS 27.007 AT+CCHO)

AID 运用ID,详细信息请参考 ETSI 102.221 和 101.220

public boolean iccCloseLogicalChannel (int channel)

关闭预先打开的逻辑通道 ( 封装 TS 27.007 AT+CCHC 命令)

public byte[] iccExchangeSimIO (int fileID, int command, int p1, int p2, int p3, String filePath)

得到 通过SIM_IO发出的APDU的相应

public boolean setVoiceMailNumber (String alphaTag, String number)

修正语音信箱的号码

—————

有很多方法来访问SIM卡上的文件系统。
利用AT命令接口是一种最随意马虎想到的方法,但是有一些基带没有得当得AT命令。

有三种方法来访问 Elemenary Files / Dedicated Files文件

1. 利用STK运用(也叫CAT/SAT)

https://android.googlesource.com/platform/packages/apps/Stk.git/+/master

如果这种卡是自己发行的,或者能下载SAT到usim里才可行

2. 打开 RIL socket(http://stackoverflow.com/questions/15361302/how-to-read-msisdn-from-sim-card-by-sim-io) 利用 RIL_REQUEST_SIM_IO来读写 SIM EF

发送 AT+CRSM 命令 (restricted SIM access))

requestSIM_IO ()便是调用 AT+CRSM来实现的

MTK(MediaTek)对3GPP规范遵照得更好,以是 AT+CSIM大部分可用

但是高通

AT+CSIM=10,\公众0020000100\公众

标签:

相关文章