updating the way apps are signed
This commit is contained in:
parent
34d9b27367
commit
b1a0bddc4a
|
@ -1,24 +1,10 @@
|
||||||
# Temp files
|
|
||||||
*~
|
|
||||||
*.bak
|
|
||||||
*.backup
|
|
||||||
\#*
|
|
||||||
.\#*
|
|
||||||
*\#
|
|
||||||
*.swp
|
|
||||||
*.swap
|
|
||||||
*.sav
|
|
||||||
*.save
|
|
||||||
*.autosav
|
|
||||||
*.autosave
|
|
||||||
|
|
||||||
*.iml
|
*.iml
|
||||||
|
*.aab
|
||||||
.gradle
|
.gradle
|
||||||
/local.properties
|
/local.properties
|
||||||
/gradle.properties
|
|
||||||
/.idea/
|
/.idea/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/build
|
/build
|
||||||
/captures
|
/captures
|
||||||
release.keystore
|
keystore.jks
|
||||||
signing.properties
|
keystore.properties
|
||||||
|
|
|
@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
|
|
||||||
|
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
buildToolsVersion "28.0.3"
|
buildToolsVersion "28.0.3"
|
||||||
|
@ -16,7 +20,12 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release
|
release {
|
||||||
|
keyAlias keystoreProperties['keyAlias']
|
||||||
|
keyPassword keystoreProperties['keyPassword']
|
||||||
|
storeFile file(keystoreProperties['storeFile'])
|
||||||
|
storePassword keystoreProperties['storePassword']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -43,22 +52,3 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.11.2'
|
implementation 'com.simplemobiletools:commons:5.11.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
storePassword=123456
|
||||||
|
keyPassword=abcdef
|
||||||
|
keyAlias=myAlias
|
||||||
|
storeFile=../keystore.jks
|
|
@ -1,3 +0,0 @@
|
||||||
STORE_FILE=/path/to/your.keystore
|
|
||||||
KEY_ALIAS=projectkeyalias
|
|
||||||
PASSWORD=yourkeypass
|
|
Loading…
Reference in New Issue