From 92f5ccf980bdb66ce5214d5de269842c534dc2ec Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 7 Apr 2019 22:54:30 +0200 Subject: [PATCH] updating the way the app is signed --- .gitignore | 5 ++-- app/build.gradle | 30 +++++++------------ .../calculator/activities/MainActivity.kt | 3 +- keystore.properties_sample | 4 +++ signing.properties_sample | 3 -- 5 files changed, 19 insertions(+), 26 deletions(-) create mode 100644 keystore.properties_sample delete mode 100644 signing.properties_sample diff --git a/.gitignore b/.gitignore index dc267ae..4cd1c5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ *.iml +*.aab .gradle /local.properties /.idea/ .DS_Store /build /captures -release.keystore -signing.properties +keystore.jks +keystore.properties diff --git a/app/build.gradle b/app/build.gradle index 0f27a50..142681a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,10 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' +def keystorePropertiesFile = rootProject.file("keystore.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -18,7 +22,12 @@ android { } signingConfigs { - release + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } } buildTypes { @@ -54,22 +63,3 @@ dependencies { androidTestImplementation 'androidx.test:rules:1.1.0-beta02' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta02' } - -Properties props = new Properties() -def propFile = new File('signing.properties') -if (propFile.canRead()) { - props.load(new FileInputStream(propFile)) - - if (props != null && props.containsKey('STORE_FILE') && props.containsKey('KEY_ALIAS') && props.containsKey('PASSWORD')) { - android.signingConfigs.release.storeFile = file(props['STORE_FILE']) - android.signingConfigs.release.storePassword = props['PASSWORD'] - android.signingConfigs.release.keyAlias = props['KEY_ALIAS'] - android.signingConfigs.release.keyPassword = props['PASSWORD'] - } else { - println 'signing.properties found but some entries are missing' - android.buildTypes.release.signingConfig = null - } -} else { - println 'signing.properties not found' - android.buildTypes.release.signingConfig = null -} diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt index 5befdcd..7e5ffad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt @@ -125,7 +125,8 @@ class MainActivity : SimpleActivity(), Calculator { FAQItem(R.string.faq_1_title, R.string.faq_1_text), FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons), FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons), - FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons) + FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons), + FAQItem(R.string.faq_2_title_commons, R.string.faq_6_text_commons) ) startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true) diff --git a/keystore.properties_sample b/keystore.properties_sample new file mode 100644 index 0000000..569edd7 --- /dev/null +++ b/keystore.properties_sample @@ -0,0 +1,4 @@ +storePassword=123456 +keyPassword=abcdef +keyAlias=myAlias +storeFile=../keystore.jks diff --git a/signing.properties_sample b/signing.properties_sample deleted file mode 100644 index cf8e239..0000000 --- a/signing.properties_sample +++ /dev/null @@ -1,3 +0,0 @@ -STORE_FILE=/path/to/your.keystore -KEY_ALIAS=projectkeyalias -PASSWORD=yourpass