From 470fa0191b95acf37f0df9fa4d290040b64f8c6f Mon Sep 17 00:00:00 2001 From: Zane Schepke Date: Sun, 28 Jul 2024 02:13:18 -0400 Subject: [PATCH] fix: signing issue (#279) --- app/build.gradle.kts | 27 ++++++++++--------- .../ui/screens/config/ConfigViewModel.kt | 2 +- buildSrc/src/main/kotlin/Constants.kt | 2 +- gradle/libs.versions.toml | 2 +- logcatter/build.gradle.kts | 4 +-- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 215ea3d..29ded9e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,6 @@ +import com.android.builder.model.v2.dsl.SigningConfig +import java.util.Properties + plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) @@ -11,7 +14,6 @@ plugins { android { namespace = Constants.APP_ID compileSdk = Constants.TARGET_SDK - compileSdkPreview = "VanillaIceCream" androidResources { generateLocaleConfig = true @@ -49,16 +51,6 @@ android { listOf("libwg-go.so", "libwg-quick.so", "libwg.so"), ) - applicationVariants.all { - val variant = this - variant.outputs - .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } - .forEach { output -> - val outputFileName = - "${Constants.APP_NAME}-${variant.flavorName}-${variant.buildType.name}-${variant.versionName}.apk" - output.outputFileName = outputFileName - } - } release { isDebuggable = false isMinifyEnabled = true @@ -72,10 +64,21 @@ android { debug { isDebuggable = true } create(Constants.NIGHTLY) { - initWith(getByName("release")) + initWith(buildTypes.getByName(Constants.RELEASE)) defaultConfig.versionName = nightlyVersionName() defaultConfig.versionCode = nightlyVersionCode() } + + applicationVariants.all { + val variant = this + variant.outputs + .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } + .forEach { output -> + val outputFileName = + "${Constants.APP_NAME}-${variant.flavorName}-${variant.buildType.name}-${variant.versionName}.apk" + output.outputFileName = outputFileName + } + } } flavorDimensions.add(Constants.TYPE) productFlavors { diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigViewModel.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigViewModel.kt index 223f79c..22ba494 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigViewModel.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigViewModel.kt @@ -111,7 +111,7 @@ constructor( } fun getPackageLabel(packageInfo: PackageInfo): String { - return packageInfo.applicationInfo.loadLabel(packageManager).toString() + return packageInfo.applicationInfo?.loadLabel(packageManager).toString() } private fun getAllInternetCapablePackages(): List { diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index 2c3b2b0..b524fc2 100644 --- a/buildSrc/src/main/kotlin/Constants.kt +++ b/buildSrc/src/main/kotlin/Constants.kt @@ -2,7 +2,7 @@ object Constants { const val VERSION_NAME = "3.4.8" const val JVM_TARGET = "17" const val VERSION_CODE = 34800 - const val TARGET_SDK = 34 + const val TARGET_SDK = 35 const val MIN_SDK = 26 const val APP_ID = "com.zaneschepke.wireguardautotunnel" const val APP_NAME = "wgtunnel" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7fd32b4..5c66f20 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ activityCompose = "1.9.1" amneziawgAndroid = "1.2.0" androidx-junit = "1.2.1" appcompat = "1.7.0" -biometricKtx = "1.4.0-alpha01" +biometricKtx = "1.2.0-alpha05" coreGoogleShortcuts = "1.1.0" coreKtx = "1.13.1" datastorePreferences = "1.1.1" diff --git a/logcatter/build.gradle.kts b/logcatter/build.gradle.kts index 5767c3e..0678d7e 100644 --- a/logcatter/build.gradle.kts +++ b/logcatter/build.gradle.kts @@ -5,10 +5,10 @@ plugins { android { namespace = "com.zaneschepke.logcatter" - compileSdk = 34 + compileSdk = Constants.TARGET_SDK defaultConfig { - minSdk = 26 + minSdk = Constants.MIN_SDK testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro")