diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 4d23ca3..733d184 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -89,6 +89,30 @@ jobs: draft: false prerelease: true files: ${{ github.workspace }}/${{ steps.apk-path.outputs.path }} + + - name: Install apksigner + run: | + sudo apt-get update + sudo apt-get install -y apksigner + + - name: Get checksum + id: checksum + run: echo "checksum=$(apksigner verify -print-certs ${{ steps.apk-path.outputs.path }} | grep -Po "(?<=SHA-256 digest:) .*")" | awk '{$1=$1};1' >> $GITHUB_OUTPUT + + - name: Append checksum + id: append_checksum + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + body: > +
SHA256 Checksum:
```${{ steps.checksum.outputs.checksum }}``` + tag_name: ${{ github.ref_name }} + name: ${{ github.ref_name }} + draft: false + prerelease: true + append_body: true + - name: Deploy with fastlane uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3eec328..7137c1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,6 +95,30 @@ jobs: draft: false prerelease: false files: ${{ github.workspace }}/${{ steps.apk-path.outputs.path }} + + - name: Install apksigner + run: | + sudo apt-get update + sudo apt-get install -y apksigner + + - name: Get checksum + id: checksum + run: echo "checksum=$(apksigner verify -print-certs ${{ steps.apk-path.outputs.path }} | grep -Po "(?<=SHA-256 digest:) .*")" | awk '{$1=$1};1' >> $GITHUB_OUTPUT + + - name: Append checksum + id: append_checksum + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + body: > +
SHA256 Checksum:
```${{ steps.checksum.outputs.checksum }}``` + tag_name: ${{ github.ref_name }} + name: ${{ github.ref_name }} + draft: false + prerelease: false + append_body: true + - name: Deploy with fastlane uses: ruby/setup-ruby@v1 with: diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 58fea87..04618c5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -52,7 +52,7 @@ startService(intent.extras) - Action.STOP.name -> stopService(intent.extras) Constants.ALWAYS_ON_VPN_ACTION -> { Timber.i("Always-on VPN starting service") startService(intent.extras) @@ -45,6 +44,7 @@ open class ForegroundService : LifecycleService() { override fun onDestroy() { super.onDestroy() Timber.d("The service has been destroyed") + stopService() } protected open fun startService(extras: Bundle?) { @@ -53,7 +53,7 @@ open class ForegroundService : LifecycleService() { isServiceStarted = true } - protected open fun stopService(extras: Bundle?) { + protected open fun stopService() { Timber.d("Stopping ${this.javaClass.simpleName}") try { stopForeground(STOP_FOREGROUND_REMOVE) diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/ServiceManager.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/ServiceManager.kt index 5bf7700..0d240fe 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/ServiceManager.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/ServiceManager.kt @@ -23,15 +23,9 @@ class ServiceManager(private val appDataRepository: AppDataRepository) { intent.component?.javaClass try { when (action) { - Action.START_FOREGROUND -> { - context.startForegroundService(intent) - } - - Action.START -> { - context.startService(intent) - } - - Action.STOP -> context.startService(intent) + Action.START_FOREGROUND -> context.startForegroundService(intent) + Action.START -> context.startService(intent) + Action.STOP -> context.stopService(intent) } } catch (e: Exception) { Timber.e(e.message) @@ -54,7 +48,7 @@ class ServiceManager(private val appDataRepository: AppDataRepository) { suspend fun stopVpnService(context: Context, isManualStop: Boolean = false) { if (isManualStop) onManualStop() - Timber.d("Stopping vpn service action") + Timber.i("Stopping vpn service") actionOnService( Action.STOP, context, diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/ServiceState.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/ServiceState.kt deleted file mode 100644 index 3cddee8..0000000 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/ServiceState.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.zaneschepke.wireguardautotunnel.service.foreground - -enum class ServiceState { - STARTED, - STOPPED, -} 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 90cc3a0..ddcee0b 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 @@ -74,6 +74,11 @@ class WireGuardConnectivityWatcherService : ForegroundService() { } } + override fun onDestroy() { + super.onDestroy() + stopService() + } + override fun startService(extras: Bundle?) { super.startService(extras) try { @@ -86,8 +91,8 @@ class WireGuardConnectivityWatcherService : ForegroundService() { } } - override fun stopService(extras: Bundle?) { - super.stopService(extras) + override fun stopService() { + super.stopService() wakeLock?.let { if (it.isHeld) { it.release() 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 3dd987f..5f9dc63 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 @@ -49,6 +49,11 @@ class WireGuardTunnelService : ForegroundService() { } } + override fun onDestroy() { + super.onDestroy() + + } + override fun startService(extras: Bundle?) { super.startService(extras) cancelJob() @@ -117,8 +122,8 @@ class WireGuardTunnelService : ForegroundService() { ) } - override fun stopService(extras: Bundle?) { - super.stopService(extras) + override fun stopService() { + super.stopService() lifecycleScope.launch(Dispatchers.IO) { vpnService.stopTunnel() didShowConnected = false 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 a25c866..969c0af 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 @@ -53,6 +53,11 @@ class AutoTunnelControlTile : TileService() { } } + override fun onTileAdded() { + super.onTileAdded() + onStartListening() + } + override fun onDestroy() { super.onDestroy() scope.cancel() 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 8109ad7..c62e423 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 @@ -69,13 +69,21 @@ class TunnelControlTile : TileService() { scope.cancel() } + override fun onTileAdded() { + super.onTileAdded() + onStartListening() + } + override fun onClick() { super.onClick() unlockAndRun { scope.launch { try { if (vpnService.getState() == Tunnel.State.UP) { - serviceManager.stopVpnService(this@TunnelControlTile, isManualStop = true) + serviceManager.stopVpnService( + this@TunnelControlTile, + isManualStop = true, + ) } else { serviceManager.startVpnServiceForeground( this@TunnelControlTile, manualStartConfig?.id, isManualStart = true, diff --git a/app/src/main/res/drawable-xhdpi/ic_banner.png b/app/src/main/res/drawable-xhdpi/ic_banner.png new file mode 100644 index 0000000..691291a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_banner.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon.png b/app/src/main/res/drawable-xhdpi/icon.png new file mode 100644 index 0000000..e5d8e99 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon.png differ diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_channel.xml b/app/src/main/res/mipmap-anydpi-v26/ic_channel.xml new file mode 100644 index 0000000..c5ef2b7 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_channel.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-xhdpi/ic_channel.png b/app/src/main/res/mipmap-xhdpi/ic_channel.png new file mode 100644 index 0000000..9f9bd29 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_channel.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_channel_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_channel_foreground.png new file mode 100644 index 0000000..b991fd6 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_channel_foreground.png differ diff --git a/app/src/main/res/values/ic_channel_background.xml b/app/src/main/res/values/ic_channel_background.xml new file mode 100644 index 0000000..382b88e --- /dev/null +++ b/app/src/main/res/values/ic_channel_background.xml @@ -0,0 +1,4 @@ + + + #1D1A20 + \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index 3ba8f1f..6d3d4f4 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.4.0" + const val VERSION_NAME = "3.4.1" const val JVM_TARGET = "17" - const val VERSION_CODE = 34000 + const val VERSION_CODE = 34100 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/34100.txt b/fastlane/metadata/android/en-US/changelogs/34100.txt new file mode 100644 index 0000000..d940104 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/34100.txt @@ -0,0 +1,5 @@ +What's new: +- Improved auto tunnel reliability +- Improved tile sync +- Added AndroidTV assets +- Added apk fingerprint diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6dffeea..3aee43f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ pinLockCompose = "1.0.3" roomVersion = "2.6.1" timber = "5.0.1" tunnel = "1.0.20230706" -androidGradlePlugin = "8.3.1" +androidGradlePlugin = "8.4.0-rc01" kotlin = "1.9.23" ksp = "1.9.23-1.0.19" composeBom = "2024.03.00" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8be2d76..34bae8c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,8 @@ #Wed Oct 11 22:39:21 EDT 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip -distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists