Handling invalid/zero EID #26

Closed
opened 2024-05-06 18:44:44 +02:00 by SkewedZeppelin · 6 comments

Happy Monday

About 6 months ago I integrated the old/previous version of OpenEUICC into my DivestOS.
There was an issue with it crashing on an invalid EID on the Pixel 6a.
Log:

java.lang.RuntimeException: Invalid EID response, unable to retrieve EID
	at com.truphone.lpad.worker.GetEidLpadWorker.convertGetEuiccData(GetEidLpadWorker.java:90)
	at com.truphone.lpad.worker.GetEidLpadWorker.run(GetEidLpadWorker.java:55)
	at com.truphone.lpa.impl.LocalProfileAssistantImpl.getEID(LocalProfileAssistantImpl.java:91)
	at im.angry.openeuicc.ui.MainActivity$init$2.invokeSuspend(MainActivity.kt:98)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:233)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@f92d5fb, Dispatchers.Main.immediate]

I fixed it with this patch: https://codeberg.org/divested-mobile/divestos-build/src/branch/master/Patches/LineageOS-20.0/android_packages_apps_OpenEUICC/0001-hacky-fix.patch

Today I tried updating to the latest OpenEUICC, but I'm getting a very similar error:

java.lang.NullPointerException
	at net.typeblog.lpac_jni.impl.LocalProfileAssistantImpl.getEID(LocalProfileAssistantImpl.kt:52)
	at im.angry.openeuicc.ui.MainActivity$init$2.invokeSuspend(MainActivity.kt:102)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:233)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@34de810, Dispatchers.Main.immediate]

Any help appreciated.
Thank you.

edit:
for context, this issue is caused by the presence of a traditional sim, and it's eid from the system is all zeroes

Happy Monday About 6 months ago I integrated the old/previous version of OpenEUICC into my DivestOS. There was an issue with it crashing on an invalid EID on the Pixel 6a. Log: ``` java.lang.RuntimeException: Invalid EID response, unable to retrieve EID at com.truphone.lpad.worker.GetEidLpadWorker.convertGetEuiccData(GetEidLpadWorker.java:90) at com.truphone.lpad.worker.GetEidLpadWorker.run(GetEidLpadWorker.java:55) at com.truphone.lpa.impl.LocalProfileAssistantImpl.getEID(LocalProfileAssistantImpl.java:91) at im.angry.openeuicc.ui.MainActivity$init$2.invokeSuspend(MainActivity.kt:98) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:233) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@f92d5fb, Dispatchers.Main.immediate] ``` I fixed it with this patch: https://codeberg.org/divested-mobile/divestos-build/src/branch/master/Patches/LineageOS-20.0/android_packages_apps_OpenEUICC/0001-hacky-fix.patch Today I tried updating to the latest OpenEUICC, but I'm getting a very similar error: ``` java.lang.NullPointerException at net.typeblog.lpac_jni.impl.LocalProfileAssistantImpl.getEID(LocalProfileAssistantImpl.kt:52) at im.angry.openeuicc.ui.MainActivity$init$2.invokeSuspend(MainActivity.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:233) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@34de810, Dispatchers.Main.immediate] ``` Any help appreciated. Thank you. edit: for context, this issue is caused by the presence of a traditional sim, and it's eid from the system is all zeroes
Owner

How does this even happen? Does this "traditional SIM" present itself as an eSIM somehow? Does the system UiccPortInfo for that slot show as isEuicc = true?

How does this even happen? Does this "traditional SIM" present itself as an eSIM somehow? Does the system UiccPortInfo for that slot show as `isEuicc = true`?
Owner

Also, for this to even happen, this slot needs to first pass this check:

so the eID was not null somehow when the LPA is created, but then became null?

Also, for this to even happen, this slot needs to first pass this check: https://gitea.angry.im/PeterCxy/OpenEUICC/src/commit/043dff0f0a4e5f0378fb4b449af39f5cdfe72676/libs/lpac-jni/src/main/java/net/typeblog/lpac_jni/impl/LocalProfileAssistantImpl.kt#L32 so the eID was not null somehow when the LPA is created, but then became null?
Owner

Could you please check whether this first call to eID results in null or just an all-zero string?

Could you please check whether this first call to `eID` results in null or just an all-zero string?
Owner

Ah wait, I just realized maybe we are missing a valid check when we first open the channel...

Ah wait, I just realized maybe we are missing a `valid` check when we first open the channel...
Owner

Could you try out the latest commit? I added a check for validity across the board during the enumeration stage.

Could you try out the latest commit? I added a check for validity across the board during the enumeration stage.
Author

that worked! thank you!

that worked! thank you!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: PeterCxy/OpenEUICC#26
No description provided.