From f2050b29dc2545aa355c7a18b2e2f14bbc130da7 Mon Sep 17 00:00:00 2001 From: kari-ts <135075563+kari-ts@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:14:30 -0800 Subject: [PATCH] android: show hex code for TV log in (#557) Remove flag gating the display of a hex code for Android TV users, now that the change allowing hex code input in the admin console is merged. Fixes tailscale/tailscale#13277 Signed-off-by: kari-ts --- Makefile | 2 +- .../ipn/ui/viewModel/LoginQRViewModel.kt | 21 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index b1f2c5d..1ceb0fb 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,7 @@ tailscale-test.apk: gradle-dependencies (cd android && ./gradlew assembleApplicationTestAndroidTest) install -C ./android/build/outputs/apk/androidTest/applicationTest/android-applicationTest-androidTest.apk $@ -tailscale.version: go.mod go.sum $(wildcard .git/HEAD) +tailscale.version: go.mod go.sum .git/HEAD .git/refs .git/packed-refs .git/index $(shell ./tool/go run tailscale.com/cmd/mkversion > tailscale.version) .PHONY: version diff --git a/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt b/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt index 7499fc0..36c1cbc 100644 --- a/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt +++ b/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt @@ -23,7 +23,6 @@ class LoginQRViewModel : IpnViewModel() { val numCode: StateFlow = MutableStateFlow(null) val qrCode: StateFlow = MutableStateFlow(null) // Remove this once changes to admin console allowing input code to be entered are made. - val codeEnabled = false init { viewModelScope.launch { @@ -31,17 +30,15 @@ class LoginQRViewModel : IpnViewModel() { url?.let { qrCode.set(generateQRCode(url, 200, 0)) - if (codeEnabled) { - // Extract the string after "https://login.tailscale.com/a/" - val prefix = "https://login.tailscale.com/a/" - val code = - if (it.startsWith(prefix)) { - it.removePrefix(prefix) - } else { - null - } - numCode.set(code) - } + // Extract the string after "https://login.tailscale.com/a/" + val prefix = "https://login.tailscale.com/a/" + val code = + if (it.startsWith(prefix)) { + it.removePrefix(prefix) + } else { + null + } + numCode.set(code) } ?: run { qrCode.set(null)