From 80816f805d9246d96e7cc7b4e31f701eebeb4911 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 11 Dec 2024 16:08:53 +0100 Subject: [PATCH] Sign release version of app --- android/app/build.gradle | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index a591d44..314b06d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -5,6 +5,12 @@ plugins { id "dev.flutter.flutter-gradle-plugin" } +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + android { namespace = "de.swgross.calorimeter" compileSdk = flutter.compileSdkVersion @@ -27,11 +33,18 @@ android { versionName = "1.0.1" } + signingConfigs { + release { + keyAlias = keystoreProperties['keyAlias'] + keyPassword = keystoreProperties['keyPassword'] + storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword = keystoreProperties['storePassword'] + } + } + buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.debug + signingConfig = signingConfigs.release } } }