Compare commits

..

1 commit

Author SHA1 Message Date
6680b94562
feat: add eastcompeace supports 2025-03-24 19:58:27 +08:00

View file

@ -132,16 +132,17 @@ private class Eastcompeace : EuiccVendor {
override fun tryParseEuiccVendorInfo(channel: EuiccChannel): EuiccVendorInfo? { override fun tryParseEuiccVendorInfo(channel: EuiccChannel): EuiccVendorInfo? {
if (!channel.lpa.eID.startsWith(EID_PREFIX)) return null if (!channel.lpa.eID.startsWith(EID_PREFIX)) return null
return channel.apduInterface.withLogicalChannel(PRODUCT_AID) { transmit -> return channel.apduInterface.withLogicalChannel(PRODUCT_AID, ::parseSCID)
val scid = decodeResponse(transmit(COMMAND))?.let(::SCID) }
?: return@withLogicalChannel null
Log.i(TAG, "Eastcompeace SCID: $scid") fun parseSCID(transmit: (ByteArray) -> ByteArray): EuiccVendorInfo? {
EuiccVendorInfo( val scid = decodeResponse(transmit(COMMAND))?.let(::SCID) ?: return null
skuName = "Eastcompeace", Log.i(TAG, "Eastcompeace SCID: $scid")
serialNumber = scid.uniquelyIdentify.encodeHex(), EuiccVendorInfo(
bootloaderVersion = scid.bootloaderVersion.encodeHex(), skuName = "Eastcompeace",
firmwareVersion = scid.cosVersion.encodeHex(), serialNumber = scid.uniquelyIdentify.encodeHex(),
) bootloaderVersion = scid.bootloaderVersion.encodeHex(),
} firmwareVersion = scid.cosVersion.encodeHex(),
)
} }
} }