From 4cd53ac92f2c2350e6689208d69d5914afb94ba5 Mon Sep 17 00:00:00 2001 From: Ishan09811 <156402647+Ishan09811@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:42:57 +0530 Subject: [PATCH] build.gradle.kts: use the custom debug key if release key isn't available --- src/pandroid/app/build.gradle.kts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/pandroid/app/build.gradle.kts b/src/pandroid/app/build.gradle.kts index b67f94198..01a96ee8e 100644 --- a/src/pandroid/app/build.gradle.kts +++ b/src/pandroid/app/build.gradle.kts @@ -20,12 +20,32 @@ android { } } + signingConfigs { + create("release") { + val keystoreAlias = System.getenv("KEYSTORE_ALIAS") ?: "androiddebugkey" + val keystorePassword = System.getenv("KEYSTORE_PASS") ?: "android" + val keystorePath = System.getenv("KEYSTORE_PATH") ?: "${project.rootDir}/debug.keystore" + + keyAlias = keystoreAlias + keyPassword = keystorePassword + storeFile = file(keystorePath) + storePassword = keystorePassword + } + + create("custom_debug") { + storeFile = file("${project.rootDir}/debug.keystore") + storePassword = "android" + keyAlias = "androiddebugkey" + keyPassword = "android" + } + } + buildTypes { getByName("release") { isMinifyEnabled = true isShrinkResources = true isDebuggable = false - signingConfig = signingConfigs.getByName("debug") + signingConfig = signingConfigs.getByName("release") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" @@ -35,6 +55,7 @@ android { isMinifyEnabled = false isShrinkResources = false isDebuggable = true + signingConfig = signingConfigs.getByName("custom_debug") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"