mirror of
https://github.com/vide/matedroid.git
synced 2026-01-20 00:03:17 +08:00
fix: handle empty env vars in release signing config
The signing config now properly falls back to debug keystore when KEYSTORE_BASE64 is set but empty (as happens in CI without secrets). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
63ca2295b0
commit
1939b69698
@@ -22,14 +22,15 @@ android {
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
// CI: use secrets from environment variables
|
||||
// Local: fall back to debug keystore
|
||||
val keystorePath = System.getenv("KEYSTORE_BASE64")?.let { "release.keystore" }
|
||||
?: "${System.getProperty("user.home")}/.android/debug.keystore"
|
||||
// CI: use secrets from environment variables (if non-empty)
|
||||
// Local/CI without secrets: fall back to debug keystore
|
||||
val keystoreBase64 = System.getenv("KEYSTORE_BASE64")?.takeIf { it.isNotEmpty() }
|
||||
val keystorePath = if (keystoreBase64 != null) "release.keystore"
|
||||
else "${System.getProperty("user.home")}/.android/debug.keystore"
|
||||
storeFile = file(keystorePath)
|
||||
storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "android"
|
||||
keyAlias = System.getenv("KEY_ALIAS") ?: "androiddebugkey"
|
||||
keyPassword = System.getenv("KEY_PASSWORD") ?: "android"
|
||||
storePassword = System.getenv("KEYSTORE_PASSWORD")?.takeIf { it.isNotEmpty() } ?: "android"
|
||||
keyAlias = System.getenv("KEY_ALIAS")?.takeIf { it.isNotEmpty() } ?: "androiddebugkey"
|
||||
keyPassword = System.getenv("KEY_PASSWORD")?.takeIf { it.isNotEmpty() } ?: "android"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user