From 9dee00333cf7e02d59f4c47a84f49d8e64b003ce Mon Sep 17 00:00:00 2001 From: Simone Sestito Date: Mon, 22 Oct 2018 11:47:07 +0200 Subject: [PATCH] Add APK signature --- .gitignore | 1 + android/app/build.gradle | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 47e0b4d..c1017ee 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ build/ **/android/gradlew.bat **/android/local.properties **/android/**/GeneratedPluginRegistrant.java +**/android/key.properties # iOS/XCode related **/ios/**/*.mode1v3 diff --git a/android/app/build.gradle b/android/app/build.gradle index 63d961e..324e71f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -25,6 +25,10 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def keystorePropertiesFile = rootProject.file("key.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { compileSdkVersion 27 @@ -45,11 +49,19 @@ android { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + } + buildTypes { - release { - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } + release { + signingConfig signingConfigs.release + } } }