From 53ae307c84c6b6e946f75951ffcec699b5a6d355 Mon Sep 17 00:00:00 2001
From: Timothy <6560631+TimoPtr@users.noreply.github.com>
Date: Thu, 7 May 2026 10:31:11 +0200
Subject: [PATCH 1/8] Support next.home-assistant.io in Debug
---
app/src/debug/AndroidManifest.xml | 15 +++++++++++++++
.../companion/android/util/UrlUtil.kt | 17 +++++++++++++----
2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/app/src/debug/AndroidManifest.xml b/app/src/debug/AndroidManifest.xml
index 80d6119de46..78fe161e414 100644
--- a/app/src/debug/AndroidManifest.xml
+++ b/app/src/debug/AndroidManifest.xml
@@ -28,6 +28,21 @@
android:theme="@android:style/Theme.Material.Light.NoActionBar"
android:name="io.homeassistant.companion.android.HiltComponentActivity"
/>
+
+
+
+
+
+
+
+
+
+
diff --git a/common/src/main/kotlin/io/homeassistant/companion/android/util/UrlUtil.kt b/common/src/main/kotlin/io/homeassistant/companion/android/util/UrlUtil.kt
index 6769c2b9b1a..e79cce328c4 100644
--- a/common/src/main/kotlin/io/homeassistant/companion/android/util/UrlUtil.kt
+++ b/common/src/main/kotlin/io/homeassistant/companion/android/util/UrlUtil.kt
@@ -1,6 +1,7 @@
package io.homeassistant.companion.android.util
import android.net.Uri
+import io.homeassistant.companion.android.common.BuildConfig
import io.homeassistant.companion.android.common.data.MalformedHttpUrlException
import io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationService
import java.net.InetAddress
@@ -121,11 +122,19 @@ object UrlUtil {
userInfo == other.userInfo
}
+ /**
+ * Matches `https://www.home-assistant.io/tag/` URLs in production. Debug builds also
+ * accept `next.home-assistant.io` so the tag flow can be exercised against the next branch
+ * of the documentation site.
+ */
+ private val nfcTagUrlRegex: Regex = if (BuildConfig.DEBUG) {
+ Regex("^https?://(?:www|next)\\.home-assistant\\.io/tag/(.*)")
+ } else {
+ Regex("^https?://www\\.home-assistant\\.io/tag/(.*)")
+ }
+
fun splitNfcTagId(it: Uri?): String? {
- val matches =
- Regex("^https?://www\\.home-assistant\\.io/tag/(.*)").find(
- it.toString(),
- )
+ val matches = nfcTagUrlRegex.find(it.toString())
return matches?.groups?.get(1)?.value
}
}
From 6d0e8b83810ed3f7d8f11feb24909f4a3db29761 Mon Sep 17 00:00:00 2001
From: Timothy <6560631+TimoPtr@users.noreply.github.com>
Date: Thu, 7 May 2026 10:31:50 +0200
Subject: [PATCH 2/8] Make TagReaderActivity standalone and translucent
---
app/src/main/AndroidManifest.xml | 9 +++++++--
app/src/main/res/values/styles.xml | 2 +-
automotive/src/main/AndroidManifest.xml | 5 +++--
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index e52257f3228..6b2907fb176 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -469,7 +469,12 @@
+ android:launchMode="singleTask"
+ android:taskAffinity="io.homeassistant.companion.android.tag.reader"
+ android:autoRemoveFromRecents="true"
+ android:showWhenLocked="true"
+ android:exported="true"
+ android:theme="@style/Theme.HomeAssistant.TranslucentOverlay">
@@ -519,7 +524,7 @@
android:taskAffinity="io.homeassistant.companion.android.assist"
android:autoRemoveFromRecents="true"
android:showWhenLocked="true"
- android:theme="@style/Theme.HomeAssistant.Assist">
+ android:theme="@style/Theme.HomeAssistant.TranslucentOverlay">
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 8a1187b396e..edccfff7225 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -29,7 +29,7 @@
- @bool/isLightMode
-