fix: improve deep-link compatibility #198

Merged
PeterCxy merged 1 commit from septs/OpenEUICC:deeplink into master 2025-07-10 02:54:26 +02:00
2 changed files with 5 additions and 4 deletions

View file

@ -45,8 +45,9 @@
<!-- Accepts URIs that begin with "lpa:" --> <!-- Accepts URIs that begin with "lpa:" -->
<!-- for example: "LPA:1$..." --> <!-- for example: "LPA:1$..." -->
<!-- refs: https://www.iana.org/assignments/uri-schemes/prov/lpa --> <!-- refs: https://www.iana.org/assignments/uri-schemes/prov/lpa -->
<data android:scheme="lpa"/> <data android:scheme="lpa" />
<data android:sspPrefix="1$"/> <data android:scheme="LPA" tools:ignore="AppLinkUrlError" />
<data android:sspPrefix="1$" />
</intent-filter> </intent-filter>
</activity> </activity>

View file

@ -123,8 +123,8 @@ class DownloadWizardActivity: BaseEuiccAccessActivity() {
// If we get an LPA string from deep-link intents, extract from there. // If we get an LPA string from deep-link intents, extract from there.
// Note that `onRestoreInstanceState` could override this with user input, // Note that `onRestoreInstanceState` could override this with user input,
// but that _is_ the desired behavior. // but that _is_ the desired behavior.
val uri = intent.data val uri = intent.data ?: return
if (uri?.scheme == "lpa") { if (uri.scheme.contentEquals("lpa", ignoreCase = true)) {
val parsed = LPAString.parse(uri.schemeSpecificPart) val parsed = LPAString.parse(uri.schemeSpecificPart)
state.smdp = parsed.address state.smdp = parsed.address
state.matchingId = parsed.matchingId state.matchingId = parsed.matchingId