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
This commit is contained in:
Zane Schepke 2024-02-20 16:17:34 -05:00
parent c8205c4c59
commit ee8db0a859
7 changed files with 19 additions and 7 deletions

View File

@ -18,7 +18,7 @@ object Queries {
VALUES
('false',
'false',
'[trustedSSID1,trustedSSID2]',
'sampleSSID1,sampleSSID2',
NULL,
'false',
'false',

View File

@ -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) {

View File

@ -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
}

View File

@ -73,7 +73,7 @@
<string name="last_handshake">Last handshake</string>
<string name="name">Name</string>
<string name="restart">Restart Tunnel</string>
<string name="vpn_connection_failed">VPN Connection Failed</string>
<string name="vpn_connection_failed">Connection failed</string>
<string name="failed_connection_to">Failed connection to -</string>
<string name="initial_connection_failure_message">Attempting to connect to server after 30 seconds of no response.</string>
<string name="lost_connection_failure_message">Attempting to reconnect to server after more than one minute of no response.</string>
@ -90,7 +90,7 @@
<string name="clear_icon">Clear Icon</string>
<string name="search_icon">Search Icon</string>
<string name="attempt_connection">Attempting connection..</string>
<string name="vpn_starting">VPN Starting</string>
<string name="vpn_starting">VPN starting</string>
<string name="db_name">wg-tunnel-db</string>
<string name="scanning_qr">Scanning for QR</string>
<string name="qr_result_failed">QR scan failed</string>
@ -175,4 +175,5 @@
<string name="included">included</string>
<string name="excluded">excluded</string>
<string name="all">all</string>
<string name="always_on_disabled">Always-on VPN attempted to start a tunnel, but this feature is disabled in settings.</string>
</resources>

View File

@ -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"

View File

@ -0,0 +1,4 @@
What's new:
- Config edit UI bug fix
- Add GrapheneOS first launch AOVPN notification
- Bump versions

View File

@ -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"