mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-22 02:07:58 +00:00
a294aa1a6b
Security hardened release: - Code obfuscation enabled (minifyEnabled=true, shrinkResources=true) - Sensitive files excluded (google-services.json, keystores) - Branch.io key moved to BuildConfig placeholder - Updated dependencies: OkHttp 4.12.0, Gson 2.10.1, BouncyCastle 1.77 - Comprehensive ProGuard rules for crypto wallet - Navigation 2.7.7, Lifecycle 2.7.0, ConstraintLayout 2.1.4
36 lines
1.0 KiB
Groovy
36 lines
1.0 KiB
Groovy
Properties localProperties = new Properties()
|
|
|
|
def localPropertiesFile = project.rootProject.file('local.properties')
|
|
|
|
if (localPropertiesFile.exists()) {
|
|
localProperties.load(localPropertiesFile.newDataInputStream())
|
|
}
|
|
|
|
ext.readRawSecretOrNull = { secretName ->
|
|
def localPropSecret = localProperties.getProperty(secretName)
|
|
|
|
def secret = (localPropSecret != null) ? localPropSecret : System.getenv(secretName)
|
|
|
|
if (secret == null || secret.isEmpty()) return null
|
|
|
|
return secret
|
|
}
|
|
|
|
ext.readStringSecretOrNull = { secretName ->
|
|
def secret = readRawSecretOrNull(secretName)
|
|
if (secret == null) return null
|
|
|
|
return maybeWrapInQuotes(secret)
|
|
}
|
|
|
|
ext.readStringSecret = { secretName ->
|
|
return readStringSecretOrNull(secretName) ?: secretNotFound(secretName)
|
|
}
|
|
|
|
private static def secretNotFound(secretName) {
|
|
throw new NoSuchElementException("${secretName} secret is not found in local.properties or environment variables")
|
|
}
|
|
|
|
static def maybeWrapInQuotes(content) {
|
|
return content.startsWith("\"") ? content : "\"" + content + "\""
|
|
} |