Allow more control over debug and staging signing.

fork-5.53.8
Greyson Parrelli 2020-11-02 08:18:50 -05:00
rodzic 4c43b0d1e3
commit 49e1ccea28
2 zmienionych plików z 38 dodań i 6 usunięć

2
.gitignore vendored
Wyświetl plik

@ -1,6 +1,8 @@
.classpath
captures/
project.properties
keystore.debug.properties
keystore.staging.properties
.project
.settings
bin/

Wyświetl plik

@ -90,6 +90,9 @@ def abiPostFix = ['universal' : 0,
'x86' : 3,
'x86_64' : 4]
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties'),
'staging': loadKeystoreProperties('keystore.staging.properties')]
android {
flavorDimensions "none"
compileSdkVersion 29
@ -101,11 +104,22 @@ android {
}
signingConfigs {
staging {
storeFile file("${project.rootDir}/dev.keystore")
storePassword 'android'
keyAlias 'staging'
keyPassword 'android'
if (keystores['debug'] != null) {
debug {
storeFile file("${project.rootDir}/${keystores['debug']['storeFile']}")
storePassword keystores['debug']['storePassword']
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 {
debug {
if (keystores['debug'] != null) {
signingConfig signingConfigs.debug
}
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard/proguard-firebase-messaging.pro',
@ -206,7 +223,9 @@ android {
staging {
initWith debug
applicationIdSuffix ".staging"
signingConfig signingConfigs.staging
if (keystores['staging'] != null) {
signingConfig signingConfigs.staging
}
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
buildConfigField "String", "STORAGE_URL", "\"https://storage-staging.signal.org\""
@ -490,3 +509,14 @@ tasks.withType(Test) {
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;
}
}