diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 29ded9e..c2fdc7c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,6 +1,3 @@ -import com.android.builder.model.v2.dsl.SigningConfig -import java.util.Properties - plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) @@ -188,10 +185,10 @@ dependencies { implementation(libs.androidx.core.splashscreen) } -fun nightlyVersionCode() : Int { +fun nightlyVersionCode(): Int { return Constants.VERSION_CODE + Constants.NIGHTLY_CODE } -fun nightlyVersionName() : String { +fun nightlyVersionName(): String { return Constants.VERSION_NAME + "-${grgitService.service.get().grgit.head().abbreviatedId}" } 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 63381d8..cc1986c 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/BootReceiver.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/receiver/BootReceiver.kt @@ -30,7 +30,7 @@ class BootReceiver : BroadcastReceiver() { context?.run { applicationScope.launch { val settings = appDataRepository.settings.getSettings() - if(settings.isRestoreOnBootEnabled) { + if (settings.isRestoreOnBootEnabled) { if (settings.isAutoTunnelEnabled) { Timber.i("Starting watcher service from boot") serviceManager.startWatcherServiceForeground(context) diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/notification/WireGuardNotification.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/notification/WireGuardNotification.kt index 4259c36..78dc9a6 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/notification/WireGuardNotification.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/notification/WireGuardNotification.kt @@ -9,7 +9,6 @@ import android.content.Intent import android.graphics.Color import androidx.core.app.NotificationCompat import com.zaneschepke.wireguardautotunnel.R -import com.zaneschepke.wireguardautotunnel.ui.MainActivity import com.zaneschepke.wireguardautotunnel.ui.SplashActivity import dagger.hilt.android.qualifiers.ApplicationContext import javax.inject.Inject diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/AutoTunnelControlTile.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/AutoTunnelControlTile.kt index a70056c..c31a1cb 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/AutoTunnelControlTile.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/AutoTunnelControlTile.kt @@ -10,11 +10,8 @@ import androidx.lifecycle.lifecycleScope import com.zaneschepke.wireguardautotunnel.R import com.zaneschepke.wireguardautotunnel.data.domain.TunnelConfig import com.zaneschepke.wireguardautotunnel.data.repository.AppDataRepository -import com.zaneschepke.wireguardautotunnel.module.ApplicationScope -import com.zaneschepke.wireguardautotunnel.module.ServiceScope import com.zaneschepke.wireguardautotunnel.service.foreground.ServiceManager import dagger.hilt.android.AndroidEntryPoint -import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import timber.log.Timber @@ -47,6 +44,7 @@ class AutoTunnelControlTile : TileService(), LifecycleOwner { setTileDescription(this@AutoTunnelControlTile.getString(R.string.active)) } } + false -> { setTileDescription(this@AutoTunnelControlTile.getString(R.string.disabled)) setUnavailable() diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt index 7386912..de6f198 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt @@ -5,17 +5,14 @@ import android.service.quicksettings.Tile import android.service.quicksettings.TileService import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner -import androidx.lifecycle.LifecycleService import androidx.lifecycle.ServiceLifecycleDispatcher import androidx.lifecycle.lifecycleScope import com.zaneschepke.wireguardautotunnel.data.domain.TunnelConfig import com.zaneschepke.wireguardautotunnel.data.repository.AppDataRepository -import com.zaneschepke.wireguardautotunnel.module.ApplicationScope import com.zaneschepke.wireguardautotunnel.service.foreground.ServiceManager import com.zaneschepke.wireguardautotunnel.service.tunnel.TunnelState import com.zaneschepke.wireguardautotunnel.service.tunnel.VpnService import dagger.hilt.android.AndroidEntryPoint -import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import timber.log.Timber diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/common/RowListItem.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/common/RowListItem.kt index 1cfd7d0..af570b4 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/common/RowListItem.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/common/RowListItem.kt @@ -38,7 +38,8 @@ fun RowListItem( ) { Box( modifier = - Modifier.focusRequester(focusRequester) + Modifier + .focusRequester(focusRequester) .animateContentSize() .clip(RoundedCornerShape(30.dp)) .combinedClickable( diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt index afdc099..8156ad4 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt @@ -539,7 +539,7 @@ fun MainScreen( onHold = {}, expanded = false, statistics = null, - focusRequester = focusRequester + focusRequester = focusRequester, ) } } diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt index 828ed32..704cd91 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt @@ -250,8 +250,8 @@ constructor( fun onToggleRestartAtBoot() = viewModelScope.launch { saveSettings( uiState.value.settings.copy( - isRestoreOnBootEnabled = !uiState.value.settings.isRestoreOnBootEnabled - ) + isRestoreOnBootEnabled = !uiState.value.settings.isRestoreOnBootEnabled, + ), ) } } diff --git a/buildSrc/src/main/kotlin/Extensions.kt b/buildSrc/src/main/kotlin/Extensions.kt index 5f92fc2..9c2ba06 100644 --- a/buildSrc/src/main/kotlin/Extensions.kt +++ b/buildSrc/src/main/kotlin/Extensions.kt @@ -40,7 +40,7 @@ fun Project.isGeneralFlavor(gradle: Gradle): Boolean { } -fun Project.getSigningProperties() : Properties { +fun Project.getSigningProperties(): Properties { return Properties().apply { // created local file for signing details try { @@ -51,7 +51,7 @@ fun Project.getSigningProperties() : Properties { } } -fun Project.getStoreFile() : File { +fun Project.getStoreFile(): File { return file( System.getenv() .getOrDefault( @@ -61,7 +61,7 @@ fun Project.getStoreFile() : File { ) } -fun Project.getSigningProperty(property: String) : String { +fun Project.getSigningProperty(property: String): String { // try to get secrets from env first for pipeline build, then properties file for local return System.getenv() .getOrDefault( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5c66f20..761c67a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -29,7 +29,7 @@ composeBom = "2024.06.00" compose = "1.6.8" zxingAndroidEmbedded = "4.3.0" coreSplashscreen = "1.0.1" -gradlePlugins-grgit="5.2.2" +gradlePlugins-grgit = "5.2.2" #plugins material = "1.12.0"