Allow more control over debug and staging signing.
This commit is contained in:
parent
4c43b0d1e3
commit
49e1ccea28
2 changed files with 38 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,6 +1,8 @@
|
||||||
.classpath
|
.classpath
|
||||||
captures/
|
captures/
|
||||||
project.properties
|
project.properties
|
||||||
|
keystore.debug.properties
|
||||||
|
keystore.staging.properties
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
bin/
|
bin/
|
||||||
|
|
|
@ -90,6 +90,9 @@ def abiPostFix = ['universal' : 0,
|
||||||
'x86' : 3,
|
'x86' : 3,
|
||||||
'x86_64' : 4]
|
'x86_64' : 4]
|
||||||
|
|
||||||
|
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties'),
|
||||||
|
'staging': loadKeystoreProperties('keystore.staging.properties')]
|
||||||
|
|
||||||
android {
|
android {
|
||||||
flavorDimensions "none"
|
flavorDimensions "none"
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
|
@ -101,11 +104,22 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
staging {
|
if (keystores['debug'] != null) {
|
||||||
storeFile file("${project.rootDir}/dev.keystore")
|
debug {
|
||||||
storePassword 'android'
|
storeFile file("${project.rootDir}/${keystores['debug']['storeFile']}")
|
||||||
keyAlias 'staging'
|
storePassword keystores['debug']['storePassword']
|
||||||
keyPassword 'android'
|
keyAlias keystores['debug']['keyAlias']
|
||||||
|
keyPassword keystores['debug']['keyPassword']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keystores['staging'] != null) {
|
||||||
|
staging {
|
||||||
|
storeFile file("${project.rootDir}/${keystores['staging']['storeFile']}")
|
||||||
|
storePassword keystores['staging']['storePassword']
|
||||||
|
keyAlias keystores['staging']['keyAlias']
|
||||||
|
keyPassword keystores['staging']['keyPassword']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,6 +194,9 @@ android {
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
|
if (keystores['debug'] != null) {
|
||||||
|
signingConfig signingConfigs.debug
|
||||||
|
}
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
||||||
'proguard/proguard-firebase-messaging.pro',
|
'proguard/proguard-firebase-messaging.pro',
|
||||||
|
@ -206,7 +223,9 @@ android {
|
||||||
staging {
|
staging {
|
||||||
initWith debug
|
initWith debug
|
||||||
applicationIdSuffix ".staging"
|
applicationIdSuffix ".staging"
|
||||||
signingConfig signingConfigs.staging
|
if (keystores['staging'] != null) {
|
||||||
|
signingConfig signingConfigs.staging
|
||||||
|
}
|
||||||
|
|
||||||
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
|
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
|
||||||
buildConfigField "String", "STORAGE_URL", "\"https://storage-staging.signal.org\""
|
buildConfigField "String", "STORAGE_URL", "\"https://storage-staging.signal.org\""
|
||||||
|
@ -490,3 +509,14 @@ tasks.withType(Test) {
|
||||||
showStackTraces true
|
showStackTraces true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def loadKeystoreProperties(filename) {
|
||||||
|
def keystorePropertiesFile = file("${project.rootDir}/${filename}")
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
return keystoreProperties;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue