Compare commits

..

1 commit

Author SHA1 Message Date
c343074839
feat: discovery 2025-03-10 10:00:01 +08:00

View file

@ -3,7 +3,6 @@ package net.typeblog.lpac_jni.impl
import android.util.Log import android.util.Log
import net.typeblog.lpac_jni.LpacJni import net.typeblog.lpac_jni.LpacJni
import net.typeblog.lpac_jni.ApduInterface import net.typeblog.lpac_jni.ApduInterface
import net.typeblog.lpac_jni.EuiccConfiguredAddresses
import net.typeblog.lpac_jni.EuiccInfo2 import net.typeblog.lpac_jni.EuiccInfo2
import net.typeblog.lpac_jni.HttpInterface import net.typeblog.lpac_jni.HttpInterface
import net.typeblog.lpac_jni.HttpInterface.HttpResponse import net.typeblog.lpac_jni.HttpInterface.HttpResponse
@ -95,7 +94,7 @@ class LocalProfileAssistantImpl(
LpacJni.euiccSetMss(contextHandle, mss) LpacJni.euiccSetMss(contextHandle, mss)
} }
override fun getEuiccConfiguredAddresses(): EuiccConfiguredAddresses = override fun getEuiccConfiguredAddresses() =
LpacJni.es10aGetEuiccConfiguredAddresses(contextHandle) LpacJni.es10aGetEuiccConfiguredAddresses(contextHandle)
override val valid: Boolean override val valid: Boolean
@ -217,21 +216,20 @@ class LocalProfileAssistantImpl(
callback callback
) )
if (res != 0) { if (res == 0) return
// Construct the error now to store any error information we _can_ access // Construct the error now to store any error information we _can_ access
val err = LocalProfileAssistant.ProfileDownloadException( val err = LocalProfileAssistant.ProfileDownloadException(
lpaErrorReason = LpacJni.downloadErrCodeToString(-res), lpaErrorReason = LpacJni.downloadErrCodeToString(-res),
httpInterface.lastHttpResponse, httpInterface.lastHttpResponse,
httpInterface.lastHttpException, httpInterface.lastHttpException,
apduInterface.lastApduResponse, apduInterface.lastApduResponse,
apduInterface.lastApduException, apduInterface.lastApduException,
) )
// Cancel sessions if possible. This will overwrite recorded errors from HTTP and APDU interfaces. // Cancel sessions if possible. This will overwrite recorded errors from HTTP and APDU interfaces.
LpacJni.cancelSessions(contextHandle) LpacJni.cancelSessions(contextHandle)
throw err throw err
}
} }
override fun discoveryProfile(smds: String, imei: String?, callback: ProfileDiscoveryCallback) { override fun discoveryProfile(smds: String, imei: String?, callback: ProfileDiscoveryCallback) {