Compare commits

..

3 Commits

Author SHA1 Message Date
Zane Schepke 85316bec3f build: change flavor name to improve clarity 2025-04-29 04:59:22 -04:00
Zane Schepke 1935653309 chore(deps): bump compose, datastore 2025-04-29 04:45:11 -04:00
Zane Schepke e3e24b4a06 fix: cleanup logs on update 2025-04-29 04:37:32 -04:00
9 changed files with 27 additions and 21 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ on:
default: fdroid
options:
- fdroid
- full
- standalone
secrets:
SIGNING_KEY_ALIAS:
required: false
+7 -7
View File
@@ -34,17 +34,17 @@ on:
type: choice
description: "Product flavor"
required: true
default: full
default: standalone
options:
- fdroid
- full
- standalone
workflow_call:
inputs:
flavor:
type: string
description: "Product flavor"
required: false
default: full
default: standalone
env:
UPLOAD_DIR_ANDROID: android_artifacts
@@ -80,18 +80,18 @@ jobs:
build_type: ${{ inputs.release_type == '' && 'nightly' || inputs.release_type }}
flavor: fdroid
build-full:
if: ${{ inputs.release_type == 'release' || inputs.release_type == 'nightly' || inputs.release_type == 'prerelease' || inputs.flavor == 'full' }}
build-standalone:
if: ${{ inputs.release_type == 'release' || inputs.release_type == 'nightly' || inputs.release_type == 'prerelease' || inputs.flavor == 'standalone' }}
uses: ./.github/workflows/build.yml
secrets: inherit
with:
build_type: ${{ inputs.release_type == '' && 'nightly' || inputs.release_type }}
flavor: full
flavor: standalone
publish:
needs:
- check_commits
- build-full
- build-standalone
if: ${{ needs.check_commits.outputs.has_new_commits > 0 && inputs.release_type != 'none' }}
name: publish-github
runs-on: ubuntu-latest
+4 -1
View File
@@ -103,7 +103,10 @@ android {
dimension = "type"
buildConfigField("String", "FLAVOR", "\"google\"")
}
create("full") { dimension = "type" }
create("standalone") {
dimension = "type"
buildConfigField("String", "FLAVOR", "\"standalone\"")
}
}
compileOptions {
-1
View File
@@ -168,7 +168,6 @@
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
@@ -3,12 +3,12 @@ package com.zaneschepke.wireguardautotunnel.core.broadcast
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.zaneschepke.logcatter.LogReader
import com.zaneschepke.wireguardautotunnel.core.service.ServiceManager
import com.zaneschepke.wireguardautotunnel.core.tunnel.TunnelManager
import com.zaneschepke.wireguardautotunnel.di.ApplicationScope
import com.zaneschepke.wireguardautotunnel.di.IoDispatcher
import com.zaneschepke.wireguardautotunnel.domain.repository.AppDataRepository
import com.zaneschepke.wireguardautotunnel.util.extensions.isRunningOnTv
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
@@ -26,13 +26,12 @@ class RestartReceiver : BroadcastReceiver() {
@Inject lateinit var tunnelManager: TunnelManager
@Inject lateinit var logReader: LogReader
@Inject @IoDispatcher lateinit var ioDispatcher: CoroutineDispatcher
override fun onReceive(context: Context, intent: Intent) {
Timber.d("RestartReceiver triggered with action: ${intent.action}")
// screen on for Android TV only to help with sleep shutdowns
val isTv = context.isRunningOnTv()
if (intent.action == Intent.ACTION_USER_PRESENT && !isTv) return
serviceManager.updateTunnelTile()
serviceManager.updateAutoTunnelTile()
applicationScope.launch(ioDispatcher) {
@@ -50,6 +49,7 @@ class RestartReceiver : BroadcastReceiver() {
} else {
Timber.d("Restore on boot disabled, skipping")
}
if (intent.action == Intent.ACTION_MY_PACKAGE_REPLACED) logReader.deleteAndClearLogs()
}
}
}
@@ -23,6 +23,7 @@ import com.zaneschepke.wireguardautotunnel.ui.common.label.GroupLabel
import com.zaneschepke.wireguardautotunnel.ui.screens.support.components.ContactSupportOptions
import com.zaneschepke.wireguardautotunnel.ui.screens.support.components.GeneralSupportOptions
import com.zaneschepke.wireguardautotunnel.ui.screens.support.components.UpdateSection
import com.zaneschepke.wireguardautotunnel.util.Constants
import com.zaneschepke.wireguardautotunnel.util.extensions.canInstallPackages
import com.zaneschepke.wireguardautotunnel.util.extensions.openWebUrl
import com.zaneschepke.wireguardautotunnel.util.extensions.requestInstallPackagesPermission
@@ -54,7 +55,7 @@ fun SupportScreen(viewModel: SupportViewModel = hiltViewModel(), appViewModel: A
InfoDialog(
onDismiss = { viewModel.handleUpdateShown() },
onAttest = {
if (BuildConfig.FLAVOR != "full") {
if (BuildConfig.FLAVOR != Constants.STANDALONE_FLAVOR) {
uiState.appUpdate?.apkUrl?.let { context.openWebUrl(it) }
return@InfoDialog
}
@@ -86,7 +87,7 @@ fun SupportScreen(viewModel: SupportViewModel = hiltViewModel(), appViewModel: A
},
confirmText = {
Text(
if (BuildConfig.FLAVOR != "full") stringResource(R.string.download)
if (BuildConfig.FLAVOR != Constants.STANDALONE_FLAVOR) stringResource(R.string.download)
else stringResource(R.string.download_and_install)
)
},
@@ -124,7 +125,7 @@ fun SupportScreen(viewModel: SupportViewModel = hiltViewModel(), appViewModel: A
if (
BuildConfig.DEBUG ||
BuildConfig.VERSION_NAME.contains("beta") ||
BuildConfig.FLAVOR == "google"
BuildConfig.FLAVOR == Constants.GOOGLE_PLAY_FLAVOR
)
return@UpdateSection context.showToast(R.string.update_check_unsupported)
context.showToast(R.string.checking_for_update)
@@ -85,7 +85,7 @@ fun ContactSupportOptions(context: android.content.Context) {
),
)
)
if (BuildConfig.FLAVOR == Constants.FDROID_FLAVOR) {
if (BuildConfig.FLAVOR != Constants.GOOGLE_PLAY_FLAVOR) {
add(
SelectionItem(
leadingIcon = Icons.Filled.Favorite,
@@ -35,5 +35,7 @@ object Constants {
const val QR_CODE_NAME_PROPERTY = "# Name ="
const val FDROID_FLAVOR = "fdroid"
const val GOOGLE_PLAY_FLAVOR = "google"
const val STANDALONE_FLAVOR = "standalone"
const val RELEASE = "release"
}
+4 -3
View File
@@ -6,7 +6,7 @@ androidx-junit = "1.2.1"
appcompat = "1.7.0"
biometricKtx = "1.2.0-alpha05"
coreKtx = "1.16.0"
datastorePreferences = "1.1.4"
datastorePreferences = "1.2.0-alpha01"
desugar_jdk_libs = "2.1.5"
espressoCore = "3.6.1"
hiltAndroid = "2.56.2"
@@ -28,7 +28,8 @@ androidGradlePlugin = "8.9.2"
kotlin = "2.1.20"
ksp = "2.1.20-2.0.0"
composeBom = "2025.04.01"
compose = "1.7.8"
compose = "1.8.0"
icons = "1.7.8"
workRuntimeKtxVersion = "2.10.1"
zxingAndroidEmbedded = "4.3.0"
coreSplashscreen = "1.0.1"
@@ -95,7 +96,7 @@ ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorCli
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktorClientCore" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktorClientCore" }
lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycle-runtime-compose" }
material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" }
material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "icons" }
pin-lock-compose = { module = "com.zaneschepke:pin_lock_compose", version.ref = "pinLockCompose" }
qrcode-kotlin = { module = "io.github.g0dkar:qrcode-kotlin", version.ref = "qrcodeKotlin" }