From 80740d951eba23eb182bc075e9193651280ead38 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 14 Apr 2020 13:52:46 +0200 Subject: [PATCH] adding some app signing related things --- app/build.gradle | 24 ++++++++++++++++++++++-- keystore.properties_sample | 4 ++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 keystore.properties_sample diff --git a/app/build.gradle b/app/build.gradle index 7b2fcf06..5f8287f8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,12 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' +def keystorePropertiesFile = rootProject.file("keystore.properties") +def keystoreProperties = new Properties() +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + android { compileSdkVersion 29 buildToolsVersion "29.0.3" @@ -11,8 +17,19 @@ android { minSdkVersion 21 targetSdkVersion 29 versionCode 1 - versionName "1.0" - vectorDrawables.useSupportLibrary = true + versionName "5.0.0" + setProperty("archivesBaseName", "sms-messenger") + } + + signingConfigs { + if (keystorePropertiesFile.exists()) { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + } } buildTypes { @@ -22,6 +39,9 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + if (keystorePropertiesFile.exists()) { + signingConfig signingConfigs.release + } } } diff --git a/keystore.properties_sample b/keystore.properties_sample new file mode 100644 index 00000000..569edd73 --- /dev/null +++ b/keystore.properties_sample @@ -0,0 +1,4 @@ +storePassword=123456 +keyPassword=abcdef +keyAlias=myAlias +storeFile=../keystore.jks