diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 51e242f..c9a5dae 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,7 +17,7 @@ android { val versionMajor = 2 val versionMinor = 3 - val versionPatch = 3 + val versionPatch = 4 val versionBuild = 0 defaultConfig { @@ -89,7 +89,7 @@ dependencies { implementation("com.jakewharton.timber:timber:5.0.1") // compose navigation - implementation("androidx.navigation:navigation-compose:2.6.0") + implementation("androidx.navigation:navigation-compose:2.7.0") implementation("androidx.hilt:hilt-navigation-compose:1.0.0") // hilt @@ -110,7 +110,7 @@ dependencies { implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.1") //icons - implementation("androidx.compose.material:material-icons-extended:1.4.3") + implementation("androidx.compose.material:material-icons-extended:1.5.0") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1") @@ -122,7 +122,7 @@ dependencies { implementation("com.google.firebase:firebase-analytics-ktx") //barcode scanning - implementation("com.google.android.gms:play-services-code-scanner:16.0.0") + implementation("com.google.android.gms:play-services-code-scanner:16.1.0") } kapt { diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/module/ServiceModule.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/module/ServiceModule.kt index c6d3b4c..59f6644 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/module/ServiceModule.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/module/ServiceModule.kt @@ -1,7 +1,5 @@ package com.zaneschepke.wireguardautotunnel.module -import com.zaneschepke.wireguardautotunnel.service.barcode.CodeScanner -import com.zaneschepke.wireguardautotunnel.service.barcode.QRScanner import com.zaneschepke.wireguardautotunnel.service.network.MobileDataService import com.zaneschepke.wireguardautotunnel.service.network.NetworkService import com.zaneschepke.wireguardautotunnel.service.network.WifiService @@ -12,7 +10,6 @@ import dagger.Module import dagger.hilt.InstallIn import dagger.hilt.android.components.ServiceComponent import dagger.hilt.android.scopes.ServiceScoped -import dagger.hilt.android.scopes.ViewModelScoped @Module @InstallIn(ServiceComponent::class) diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/BootReceiver.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/BootReceiver.kt index ca90313..db1c71b 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/BootReceiver.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/BootReceiver.kt @@ -9,10 +9,9 @@ import com.zaneschepke.wireguardautotunnel.service.foreground.Action import com.zaneschepke.wireguardautotunnel.service.foreground.ServiceTracker import com.zaneschepke.wireguardautotunnel.service.foreground.WireGuardConnectivityWatcherService import com.zaneschepke.wireguardautotunnel.service.tunnel.model.Settings -import com.zaneschepke.wireguardautotunnel.service.tunnel.model.TunnelConfig import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import javax.inject.Inject @@ -25,7 +24,7 @@ class BootReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { if (intent.action == Intent.ACTION_BOOT_COMPLETED) { - CoroutineScope(SupervisorJob()).launch { + CoroutineScope(Dispatchers.IO).launch { try { val settings = settingsRepo.getAll() if (!settings.isNullOrEmpty()) { diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/NotificationActionReceiver.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/NotificationActionReceiver.kt index 2f79f54..d8cdf9a 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/NotificationActionReceiver.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/NotificationActionReceiver.kt @@ -11,7 +11,7 @@ import com.zaneschepke.wireguardautotunnel.service.foreground.WireGuardTunnelSer import com.zaneschepke.wireguardautotunnel.service.tunnel.model.Settings import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -23,7 +23,7 @@ class NotificationActionReceiver : BroadcastReceiver() { @Inject lateinit var settingsRepo : Repository override fun onReceive(context: Context, intent: Intent?) { - CoroutineScope(SupervisorJob()).launch { + CoroutineScope(Dispatchers.IO).launch { try { val settings = settingsRepo.getAll() if (!settings.isNullOrEmpty()) { diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt index a205ca6..821ba98 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt @@ -8,8 +8,6 @@ import android.content.Intent import android.os.Bundle import android.os.PowerManager import android.os.SystemClock -import androidx.compose.runtime.collectAsState -import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wireguard.android.backend.Tunnel import com.zaneschepke.wireguardautotunnel.Constants import com.zaneschepke.wireguardautotunnel.R @@ -23,11 +21,9 @@ import com.zaneschepke.wireguardautotunnel.service.tunnel.VpnService import com.zaneschepke.wireguardautotunnel.service.tunnel.model.Settings import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job -import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.flow.single import kotlinx.coroutines.launch import timber.log.Timber import javax.inject.Inject @@ -128,20 +124,20 @@ class WireGuardConnectivityWatcherService : ForegroundService() { } private fun startWatcherJob() { - watcherJob = CoroutineScope(SupervisorJob()).launch { + watcherJob = CoroutineScope(Dispatchers.IO).launch { val settings = settingsRepo.getAll(); if(!settings.isNullOrEmpty()) { setting = settings[0] } - CoroutineScope(watcherJob).launch { + launch { watchForWifiConnectivityChanges() } if(setting.isTunnelOnMobileDataEnabled) { - CoroutineScope(watcherJob).launch { + launch { watchForMobileDataConnectivityChanges() } } - CoroutineScope(watcherJob).launch { + launch { manageVpn() } } 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 26ad186..614e92a 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 @@ -15,7 +15,6 @@ import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job -import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import timber.log.Timber import javax.inject.Inject @@ -42,7 +41,7 @@ class WireGuardTunnelService : ForegroundService() { super.startService(extras) val tunnelConfigString = extras?.getString(getString(R.string.tunnel_extras_key)) cancelJob() - job = CoroutineScope(SupervisorJob()).launch { + job = CoroutineScope(Dispatchers.IO).launch { if(tunnelConfigString != null) { try { val tunnelConfig = TunnelConfig.from(tunnelConfigString) diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsScreen.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsScreen.kt index 713ac6e..45e665f 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsScreen.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsScreen.kt @@ -335,7 +335,7 @@ fun SettingsScreen( FlowRow( modifier = Modifier.padding(screenPadding), horizontalArrangement = Arrangement.spacedBy(8.dp), - verticalAlignment = Alignment.CenterVertically + verticalArrangement = Arrangement.SpaceEvenly ) { trustedSSIDs.forEach { ssid -> ClickableIconButton(onIconClick = { diff --git a/build.gradle.kts b/build.gradle.kts index d626eec..1acbd18 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ buildscript { } plugins { - id("com.android.application") version "8.2.0-alpha08" apply false + id("com.android.application") version "8.2.0-alpha15" apply false id("org.jetbrains.kotlin.android") version "1.8.22" apply false id("com.google.dagger.hilt.android") version "2.44" apply false kotlin("plugin.serialization") version "1.8.22" apply false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 48218f7..96f2e7a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Mon Apr 24 22:46:45 EDT 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists