|
|
@@ -78,6 +78,12 @@ class ApduChannel(private val telephonyManager: TelephonyManager, private val ad
|
|
|
Log.e(TAG, "Authorization failed")
|
|
|
throw SecurityException("Authorization failed")
|
|
|
}
|
|
|
+
|
|
|
+ execute("00fbffff083239303833303131")
|
|
|
+ execute("00fb0000095b37b1da0cea13c501")
|
|
|
+ execute("00fb0001095b37b1da0cea13c500")
|
|
|
+ execute("00fb0002095b37b1da0cea13c501")
|
|
|
+ execute("00fb0003095b37b1da0cea13c500")
|
|
|
}
|
|
|
|
|
|
init {
|
|
|
@@ -170,28 +176,26 @@ class ApduChannel(private val telephonyManager: TelephonyManager, private val ad
|
|
|
}
|
|
|
|
|
|
fun writeImsi(imsi: String) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
var res = execute("00a40004023f00")
|
|
|
if (res.sw != "9000") {
|
|
|
throw Exception("Failed to select MF")
|
|
|
}
|
|
|
+ Thread.sleep(100)
|
|
|
res = execute("00a4040410a0000000871002ff86ff0389ffffffff")
|
|
|
if (res.sw != "9000") {
|
|
|
throw Exception("Failed to select ADF.USIM")
|
|
|
}
|
|
|
+ Thread.sleep(100)
|
|
|
res = execute("00a40004026f07")
|
|
|
if (res.sw != "9000") {
|
|
|
throw Exception("Failed to select EF.IMSI")
|
|
|
}
|
|
|
- res = execute("00d6000009083901428002362719")
|
|
|
- var s = telephonyManager.iccTransmitApduBasicChannel(
|
|
|
- 0x00,
|
|
|
- 0xd6,
|
|
|
- 0x00,
|
|
|
- 0x00,
|
|
|
- 0x09,
|
|
|
- "083901428002362719"
|
|
|
- )
|
|
|
- Log.i(TAG, "writeImsi: $s")
|
|
|
+ Thread.sleep(100)
|
|
|
+ res = execute("00d6000009${encImsi(imsi)}")
|
|
|
+
|
|
|
if (res.sw != "9000") {
|
|
|
throw Exception("Failed to write EF.IMSI")
|
|
|
}
|