diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 202213f..873409a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -48,6 +48,19 @@ android { versionName = (project.findProperty("versionName") as String?)?.takeIf { it.isNotBlank() } ?: "0.1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + + // Android App Links host (docs/android/APP_LINKS.md). autoVerify needs a + // *literal* host at build time, so a single multi-tenant APK cannot verify + // open-ended shard domains: App Links are a build-time opt-in. Left empty for + // the generic build (custom scheme only); a white-label/first-party build + // bakes one host with `-PappLinkHost=play.myshard.com`. + // • BuildConfig.APP_LINK_HOST — SsoAuthManager reads it to pick the redirect. + // • manifestPlaceholder appLinkHost — substituted into the intent-filter host; + // empty falls back to the reserved `.invalid` sentinel so the autoVerify + // filter is inert (matches no real link, never verifies). + val appLinkHost = (project.findProperty("appLinkHost") as String?)?.trim().orEmpty() + buildConfigField("String", "APP_LINK_HOST", "\"$appLinkHost\"") + manifestPlaceholders["appLinkHost"] = appLinkHost.ifBlank { "runic-gateway.invalid" } } signingConfigs { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 11822b2..27b167e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,8 +39,8 @@ + MOBILE_AUTH_REDIRECT_URIS allowlist exactly. This is the permanent + fallback on every build (docs/android/APP_LINKS.md). --> @@ -50,6 +50,22 @@ android:host="auth" android:path="/callback" /> + + + + + + + +