Compare commits

...

2 commits

Author SHA1 Message Date
d3a04b94a9 Set MSS on es10x commands to 60 for OMAPI channels
All checks were successful
/ build-debug (push) Successful in 4m59s
This seems to help a LOT with 6601 checksum errors on phones like Pixel
7 Pro. I am seeing virtually none with MSS = 60.
2024-10-10 22:08:32 -04:00
19dc215b3f lpac-jni: Update lpac 2024-10-10 21:52:57 -04:00
6 changed files with 24 additions and 2 deletions

View file

@ -41,7 +41,10 @@ open class DefaultEuiccChannelFactory(protected val context: Context) : EuiccCha
context.preferenceRepository.verboseLoggingFlow context.preferenceRepository.verboseLoggingFlow
), ),
context.preferenceRepository.verboseLoggingFlow context.preferenceRepository.verboseLoggingFlow
) ).also {
Log.i(DefaultEuiccChannelManager.TAG, "Is OMAPI channel, setting MSS to 60")
it.lpa.setEs10xMss(60)
}
} catch (e: IllegalArgumentException) { } catch (e: IllegalArgumentException) {
// Failed // Failed
Log.w( Log.w(

View file

@ -8,6 +8,13 @@ interface LocalProfileAssistant {
// Extended EuiccInfo for use with LUIs, containing information such as firmware version // Extended EuiccInfo for use with LUIs, containing information such as firmware version
val euiccInfo2: EuiccInfo2? val euiccInfo2: EuiccInfo2?
/**
* Set the max segment size (mss) for all es10x commands. This can help with removable
* eUICCs that may run at a baud rate too fast for the modem.
* By default, this is set to 60 by libeuicc.
*/
fun setEs10xMss(mss: Byte)
// All blocking functions in this class assume that they are executed on non-Main threads // All blocking functions in this class assume that they are executed on non-Main threads
// The IO context in Kotlin's coroutine library is recommended. // The IO context in Kotlin's coroutine library is recommended.
fun enableProfile(iccid: String, refresh: Boolean = true): Boolean fun enableProfile(iccid: String, refresh: Boolean = true): Boolean

View file

@ -9,6 +9,7 @@ internal object LpacJni {
external fun destroyContext(handle: Long) external fun destroyContext(handle: Long)
external fun euiccInit(handle: Long): Int external fun euiccInit(handle: Long): Int
external fun euiccSetMss(handle: Long, mss: Byte)
external fun euiccFini(handle: Long) external fun euiccFini(handle: Long)
// es10c // es10c

View file

@ -30,6 +30,10 @@ class LocalProfileAssistantImpl(
httpInterface.usePublicKeyIds(pkids) httpInterface.usePublicKeyIds(pkids)
} }
override fun setEs10xMss(mss: Byte) {
LpacJni.euiccSetMss(contextHandle, mss)
}
override val valid: Boolean override val valid: Boolean
get() = !finalized && apduInterface.valid && try { get() = !finalized && apduInterface.valid && try {
// If we can read both eID and euiccInfo2 properly, we are likely looking at // If we can read both eID and euiccInfo2 properly, we are likely looking at

@ -1 +1 @@
Subproject commit 0011ea6cc4c045c84f7aac839c1cce7804422355 Subproject commit a5a0516f084936e7e87cf7420fb99283fa3052ef

View file

@ -75,6 +75,13 @@ Java_net_typeblog_lpac_1jni_LpacJni_euiccFini(JNIEnv *env, jobject thiz, jlong h
euicc_fini(ctx); euicc_fini(ctx);
} }
JNIEXPORT void JNICALL
Java_net_typeblog_lpac_1jni_LpacJni_euiccSetMss(JNIEnv *env, jobject thiz, jlong handle,
jbyte mss) {
struct euicc_ctx *ctx = (struct euicc_ctx *) handle;
ctx->es10x_mss = (uint8_t) mss;
}
jstring toJString(JNIEnv *env, const char *pat) { jstring toJString(JNIEnv *env, const char *pat) {
jbyteArray bytes = NULL; jbyteArray bytes = NULL;
jstring encoding = NULL; jstring encoding = NULL;