Compare commits
1 commit
eb44882498
...
baf717ccfc
Author | SHA1 | Date | |
---|---|---|---|
baf717ccfc |
2 changed files with 6 additions and 21 deletions
|
@ -69,12 +69,8 @@ class TelephonyManagerApduInterface(
|
||||||
|
|
||||||
override val atr: ByteArray?
|
override val atr: ByteArray?
|
||||||
get() = try {
|
get() = try {
|
||||||
tm.iccGetAtr(slotIndex)?.decodeHex()
|
tm.iccGetATR(port.card.physicalSlotIndex)
|
||||||
} catch (e: NoSuchMethodException) {
|
|
||||||
try {
|
|
||||||
tm.getAtrUsingSlotId(slotIndex)
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -64,18 +64,12 @@ private val getITelephony: Method by lazy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun TelephonyManager.getAtrUsingSlotId(slotId: Int): ByteArray? {
|
fun TelephonyManager.iccGetATR(slotId: Int): ByteArray? {
|
||||||
val telephony = getITelephony.invoke(this)
|
val telephony = getITelephony.invoke(this)
|
||||||
val getAtrUsingSlotId = telephony.javaClass.getMethod("getAtrUsingSlotId", Int::class.java)
|
val getAtrUsingSlotId = telephony.javaClass.getMethod("getAtrUsingSlotId", Int::class.java)
|
||||||
return getAtrUsingSlotId.invoke(telephony, slotId) as ByteArray?
|
return getAtrUsingSlotId.invoke(telephony, slotId) as ByteArray?
|
||||||
}
|
}
|
||||||
|
|
||||||
fun TelephonyManager.iccGetAtr(slotId: Int): String? {
|
|
||||||
val telephony = getITelephony.invoke(this)
|
|
||||||
val iccGetAtr = telephony.javaClass.getMethod("iccGetAtr", Int::class.java)
|
|
||||||
return iccGetAtr.invoke(telephony, slotId) as String?
|
|
||||||
}
|
|
||||||
|
|
||||||
fun TelephonyManager.iccOpenLogicalChannelBySlot(
|
fun TelephonyManager.iccOpenLogicalChannelBySlot(
|
||||||
slotId: Int, appletId: String?, p2: Int
|
slotId: Int, appletId: String?, p2: Int
|
||||||
): IccOpenLogicalChannelResponse =
|
): IccOpenLogicalChannelResponse =
|
||||||
|
@ -113,15 +107,10 @@ fun TelephonyManager.iccTransmitApduLogicalChannelByPort(
|
||||||
|
|
||||||
var TelephonyManager.simSlotMapping: Collection<UiccSlotMapping>
|
var TelephonyManager.simSlotMapping: Collection<UiccSlotMapping>
|
||||||
get() = getSimSlotMapping.invoke(this) as Collection<UiccSlotMapping>
|
get() = getSimSlotMapping.invoke(this) as Collection<UiccSlotMapping>
|
||||||
set(new) {
|
set(new) { setSimSlotMapping.invoke(this, new) }
|
||||||
setSimSlotMapping.invoke(this, new)
|
|
||||||
}
|
|
||||||
|
|
||||||
private val requestEmbeddedSubscriptionInfoListRefresh: Method by lazy {
|
private val requestEmbeddedSubscriptionInfoListRefresh: Method by lazy {
|
||||||
SubscriptionManager::class.java.getMethod(
|
SubscriptionManager::class.java.getMethod("requestEmbeddedSubscriptionInfoListRefresh", Int::class.java)
|
||||||
"requestEmbeddedSubscriptionInfoListRefresh",
|
|
||||||
Int::class.java
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun SubscriptionManager.requestEmbeddedSubscriptionInfoListRefresh(cardId: Int) {
|
fun SubscriptionManager.requestEmbeddedSubscriptionInfoListRefresh(cardId: Int) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue