Skip to content

Commit ee05326

Browse files
committed
updating the way app is signed
1 parent 8145a47 commit ee05326

File tree

4 files changed

+17
-26
lines changed

4 files changed

+17
-26
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
*.iml
2+
*.aab
23
.gradle
34
/local.properties
4-
/gradle.properties
55
/.idea/
66
.DS_Store
77
/build
88
/captures
9-
release.keystore
10-
signing.properties
9+
keystore.jks
10+
keystore.properties

app/build.gradle

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44

5+
def keystorePropertiesFile = rootProject.file("keystore.properties")
6+
def keystoreProperties = new Properties()
7+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
8+
59
android {
610
compileSdkVersion 28
711
buildToolsVersion "28.0.3"
@@ -16,7 +20,12 @@ android {
1620
}
1721

1822
signingConfigs {
19-
release
23+
release {
24+
keyAlias keystoreProperties['keyAlias']
25+
keyPassword keystoreProperties['keyPassword']
26+
storeFile file(keystoreProperties['storeFile'])
27+
storePassword keystoreProperties['storePassword']
28+
}
2029
}
2130

2231
buildTypes {
@@ -45,22 +54,3 @@ dependencies {
4554
implementation 'com.squareup:otto:1.3.8'
4655
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
4756
}
48-
49-
Properties props = new Properties()
50-
def propFile = new File('signing.properties')
51-
if (propFile.canRead()) {
52-
props.load(new FileInputStream(propFile))
53-
54-
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('KEY_ALIAS') && props.containsKey('PASSWORD')) {
55-
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
56-
android.signingConfigs.release.storePassword = props['PASSWORD']
57-
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
58-
android.signingConfigs.release.keyPassword = props['PASSWORD']
59-
} else {
60-
println 'signing.properties found but some entries are missing'
61-
android.buildTypes.release.signingConfig = null
62-
}
63-
} else {
64-
println 'signing.properties not found'
65-
android.buildTypes.release.signingConfig = null
66-
}

keystore.properties_sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
storePassword=123456
2+
keyPassword=abcdef
3+
keyAlias=myAlias
4+
storeFile=../keystore.jks

signing.properties_sample

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)