AID(Application IDentifier)应用标识符,即2F00的B2记录中的一段,这是在SIM卡与模块保持心跳的主要数据,如果不对可能会导致掉线
2F00-EFDIR应用目录
该EF包含应用标识符(AID)和应用标签作为必选项。
USIM应用只能通过AID选择方式进行选择。对于应用选择EFDIR入口不包括路径对象。
建议应用标签内容长度不超过32字节。
先读取一段移动卡的2F00数据看下
=>00 A4 00 04 02
<=A4
=>3F 00
<=61 2F
=>00 A4 00 04 02
<=A4
=>2F 00
<=61 1C
=>00 C0 00 00 1C
<=C0 621A8205422100260183022F008A01058B032F0601800200268801F0
=>00 B2 01 04 26
<=B2 61244F10A0000000871002FF86FFFF89FFFFFFFF5010434D43434354444D503176322E302020 90 00
再读取一段电信卡的2F00数据看下
=>00 A4 00 04 02
<=A4
=>3F 00
<=61 2F
=>00 A4 00 04 02
<=A4
=>2F 00
<=61 1C
=>00 C0 00 00 1C
<=C0 621A8205422100300483022F008A01058B032F0601800200C08801F0
=>00 B2 01 04 30
<=B2 61184F10A0000003431002FF86FF0389FFFFFFFF50044353494DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 90 00
=>00 B2 02 04 30
<=B2 61184F10A0000000871002FF86FF0389FFFFFFFF50045553494DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 90 00
=>00 B2 03 04 30
<=B2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 90 00
=>00 B2 04 04 30
<=B2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 90 00
因为电信3G使用的是CDMA2000简称C网跟普通的GSM的G网是不一样的。4G为了兼容3G所以一张USIM卡里面其实是有两张卡的信息,一张CSIM一张USIM,则有两个记录。
而移动卡是标准的USIM,协议已经兼容SIM卡,则只有一个记录
移动卡的AID为:A0000000871002FF86FFFF89FFFFFFFF
电信卡的AID为:A0000003431002FF86FF0389FFFFFFFF和A0000000871002FF86FF0389FFFFFFFF
回顾下SIM的文件结构图
image.png可以看到2F00(EFDIR)是决定ADF个数的,决定因素就是2F00下面记录的个数,所以我们下面读取下ADF(7FF*)文件。
移动卡ADF
=>00 A4 00 04 02
<=A4
=>3F 00
<=61 2F
=>00 A4 00 04 02
<=A4
=>7F F0
<=61 2E
=>00 C0 00 00 2E
<=C0 622C820278218410A0000000871002FF86FFFF89FFFFFFFF8A01058B032F0602C60C90016083010183018183010A
=>00 A4 00 04 02
<=A4
=>7F F1
<=6A 82 //文件找不到
电信卡ADF
=>00 A4 00 04 02
<=A4
=>3F 00
<=61 2F
=>00 A4 00 04 02
<=A4
=>7F F0
<=61 2E
=>00 C0 00 00 2E
<=C0 622C820278218410A0000000871002FF86FF0389FFFFFFFF8A01058B032F0602C60C90016083010183018183010A
=>00 A4 00 04 02
<=A4
=>7F F1
<=61 2E
=>00 C0 00 00 2E
<=C0 622C820278218410A0000003431002FF86FF0389FFFFFFFF8A01058B032F0602C60C90016083010183018183010A
=>00 A4 00 04 02
<=A4
=>7F F2
<=6A 82 //文件找不到
另一种选择ADF的方式
用04直接指定DF的名称A0000000871002FF86FFFF89FFFFFFFF
=>00 A4 00 04 02
<=A4
=>3F 00
<=61 2F
=>00 A4 04 04 10
<=A4
=>A0000000871002FF86FFFF89FFFFFFFF
<=61 2E
=>00 C0 00 00 2E
<=C0 622C820278218410A0000000871002FF86FFFF89FFFFFFFF8A01058B032F0602C60C90016083010183018183010A
网友评论