chore: sn click copied
This commit is contained in:
parent
95fcbcb933
commit
4a6d381b9e
4 changed files with 7 additions and 14 deletions
|
@ -110,20 +110,14 @@ class EuiccInfoActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker {
|
|||
)
|
||||
getESTKmeInfo(channel.forkApduInterface())?.let {
|
||||
add(Item(R.string.euicc_info_sku, it.skuName))
|
||||
add(Item(R.string.euicc_info_sn, it.serialNumber))
|
||||
add(Item(R.string.euicc_info_sn, it.serialNumber, copiedToastResId = R.string.toast_sn_copied))
|
||||
add(Item(R.string.euicc_info_bl_ver, it.bootloaderVersion))
|
||||
add(Item(R.string.euicc_info_fw_ver, it.firmwareVersion))
|
||||
}
|
||||
getNineVersion(channel.lpa.eID, channel.lpa.euiccInfo2)?.let {
|
||||
add(Item(R.string.euicc_info_sku, "9eSIM $it"))
|
||||
}
|
||||
add(
|
||||
Item(
|
||||
R.string.euicc_info_eid,
|
||||
channel.lpa.eID,
|
||||
copiedToastResId = R.string.toast_eid_copied
|
||||
)
|
||||
)
|
||||
add(Item(R.string.euicc_info_eid, channel.lpa.eID, copiedToastResId = R.string.toast_eid_copied))
|
||||
channel.lpa.euiccInfo2.let { info ->
|
||||
add(Item(R.string.euicc_info_sgp22_version, info?.sgp22Version.toString()))
|
||||
add(Item(R.string.euicc_info_firmware_version, info?.euiccFirmwareVersion.toString()))
|
||||
|
|
|
@ -35,10 +35,8 @@ fun getESTKmeInfo(iface: ApduInterface): ESTKmeInfo? {
|
|||
}
|
||||
}
|
||||
|
||||
private fun isSuccessResponse(b: ByteArray) =
|
||||
b.size >= 2 && b[b.size - 2] == 0x90.toByte() && b[b.size - 1] == 0x00.toByte()
|
||||
|
||||
private fun decode(b: ByteArray): String? {
|
||||
if (!isSuccessResponse(b)) return null
|
||||
return b.dropLast(2).toByteArray().decodeToString()
|
||||
if (b.size < 2) return null
|
||||
if (b[b.size - 2] != 0x90.toByte() || b[b.size - 1] != 0x00.toByte()) return null
|
||||
return b.sliceArray(0 until b.size - 2).decodeToString()
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<string name="toast_profile_enable_failed">Cannot switch to new eSIM profile.</string>
|
||||
<string name="toast_profile_delete_confirm_text_mismatched">Confirmation string mismatch</string>
|
||||
<string name="toast_iccid_copied">ICCID copied to clipboard</string>
|
||||
<string name="toast_sn_copied">Serial Number copied to clipboard</string>
|
||||
<string name="toast_eid_copied">EID copied to clipboard</string>
|
||||
<string name="toast_atr_copied">ATR copied to clipboard</string>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ data class Version(
|
|||
val patch: Int,
|
||||
) {
|
||||
constructor(version: String) : this(version.split('.').map(String::toInt))
|
||||
constructor(parts: List<Int>) : this(parts[0], parts[1], parts[2])
|
||||
private constructor(parts: List<Int>) : this(parts[0], parts[1], parts[2])
|
||||
|
||||
operator fun compareTo(other: Version): Int {
|
||||
if (major != other.major) return major - other.major
|
||||
|
|
Loading…
Add table
Reference in a new issue