From ee8db0a859778308ca584486a6d551a341b5b365 Mon Sep 17 00:00:00 2001 From: Zane Schepke Date: Tue, 20 Feb 2024 16:17:34 -0500 Subject: [PATCH] fix: ui bug and graphene notification Fixes a bug where save button was hidden on config screen Adds a disclaimer notification for when GrapheneOS auto enabled Always-on VPN on first app tunnel start Closes #121 #120 --- .../com/zaneschepke/wireguardautotunnel/data/Queries.kt | 2 +- .../service/foreground/WireGuardTunnelService.kt | 7 +++++++ .../wireguardautotunnel/ui/screens/config/ConfigScreen.kt | 2 +- app/src/main/res/values/strings.xml | 5 +++-- buildSrc/src/main/kotlin/Constants.kt | 4 ++-- fastlane/metadata/android/en-US/changelogs/33800.txt | 4 ++++ gradle/libs.versions.toml | 2 +- 7 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/33800.txt diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/data/Queries.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/data/Queries.kt index 62f164e3..8a77cb23 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/data/Queries.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/data/Queries.kt @@ -18,7 +18,7 @@ object Queries { VALUES ('false', 'false', - '[trustedSSID1,trustedSSID2]', + 'sampleSSID1,sampleSSID2', NULL, 'false', 'false', diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardTunnelService.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardTunnelService.kt index f4501acd..303f9c16 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardTunnelService.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardTunnelService.kt @@ -84,6 +84,8 @@ class WireGuardTunnelService : ForegroundService() { tunnelName = tunnel.name vpnService.startTunnel(tunnel) } + } else { + launchAlwaysOnDisabledNotification() } } } @@ -116,6 +118,11 @@ class WireGuardTunnelService : ForegroundService() { } } + private fun launchAlwaysOnDisabledNotification() { + launchVpnNotification(title = this.getString(R.string.vpn_connection_failed), + description = this.getString(R.string.always_on_disabled)) + } + override fun stopService(extras: Bundle?) { super.stopService(extras) lifecycleScope.launch(Dispatchers.IO) { diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt index b75a879d..d56d6385 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt @@ -311,7 +311,7 @@ fun ConfigScreen( var fobColor by remember { mutableStateOf(secondaryColor) } FloatingActionButton( modifier = - Modifier.onFocusChanged { + Modifier.padding(bottom = 90.dp).onFocusChanged { if (WireGuardAutoTunnel.isRunningOnAndroidTv()) { fobColor = if (it.isFocused) hoverColor else secondaryColor } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 75528b1f..fc071bcc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -73,7 +73,7 @@ Last handshake Name Restart Tunnel - VPN Connection Failed + Connection failed Failed connection to - Attempting to connect to server after 30 seconds of no response. Attempting to reconnect to server after more than one minute of no response. @@ -90,7 +90,7 @@ Clear Icon Search Icon Attempting connection.. - VPN Starting + VPN starting wg-tunnel-db Scanning for QR QR scan failed @@ -175,4 +175,5 @@ included excluded all + Always-on VPN attempted to start a tunnel, but this feature is disabled in settings. \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index df0f6712..4656e2dd 100644 --- a/buildSrc/src/main/kotlin/Constants.kt +++ b/buildSrc/src/main/kotlin/Constants.kt @@ -1,7 +1,7 @@ object Constants { - const val VERSION_NAME = "3.3.7" + const val VERSION_NAME = "3.3.8" const val JVM_TARGET = "17" - const val VERSION_CODE = 33700 + const val VERSION_CODE = 33800 const val TARGET_SDK = 34 const val MIN_SDK = 26 const val APP_ID = "com.zaneschepke.wireguardautotunnel" diff --git a/fastlane/metadata/android/en-US/changelogs/33800.txt b/fastlane/metadata/android/en-US/changelogs/33800.txt new file mode 100644 index 00000000..c92a8b7e --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/33800.txt @@ -0,0 +1,4 @@ +What's new: +- Config edit UI bug fix +- Add GrapheneOS first launch AOVPN notification +- Bump versions diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b2906d36..0fbac8e6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ google-services = "4.4.1" hiltAndroid = "2.50" hiltNavigationCompose = "1.1.0" junit = "4.13.2" -kotlinx-serialization-json = "1.6.2" +kotlinx-serialization-json = "1.6.3" lifecycle-runtime-compose = "2.7.0" material3 = "1.2.0" navigationCompose = "2.7.7"