Skip to content

Commit

Permalink
updating to the new way of signing apps
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed Mar 10, 2019
1 parent 7b845bd commit c50887a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
6 changes: 4 additions & 2 deletions .gitignore
@@ -1,9 +1,11 @@
*.iml
*.aab
.gradle
/local.properties
/gradle.properties
/.idea/
.DS_Store
/build
/captures
release.keystore
signing.properties
keystore.jks
keystore.properties
30 changes: 10 additions & 20 deletions app/build.gradle
Expand Up @@ -3,6 +3,10 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
Expand All @@ -17,7 +21,12 @@ android {
}

signingConfigs {
release
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
Expand Down Expand Up @@ -51,22 +60,3 @@ dependencies {
implementation "androidx.room:room-runtime:2.0.0"
annotationProcessor "androidx.room:room-compiler:2.0.0"
}

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
}
4 changes: 4 additions & 0 deletions keystore.properties_sample
@@ -0,0 +1,4 @@
storePassword=123456
keyPassword=abcdef
keyAlias=myAlias
storeFile=../keystore.jks
3 changes: 0 additions & 3 deletions signing.properties_sample

This file was deleted.

0 comments on commit c50887a

Please sign in to comment.