chore(#1161): sign from OFFBAND_KEY_PROPERTIES so worktrees need no copy

The release signing config was read only from android/key.properties
inside the checkout, so every worktree needed its own copy of a file
holding the keystore passwords. When OFFBAND_KEY_PROPERTIES is set, the
build reads that file instead. Set but missing fails the build and names
the path, so it can never fall back to debug signing. Unset, nothing
changes, and CI keeps writing android/key.properties as before.

Checked on a worktree with no key.properties: a missing path fails with
the message; the real path builds a release APK whose signer is the
release certificate (apksigner), installed over the phone's 1.8.0. The
unset case is the old line unchanged and was not rebuilt.

Agent: BrightForge (session 440fbe94)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pull/1188/head
diffwireauto 1 week ago committed by Strycher
parent 7d2c32f699
commit 59ac181926

@ -7,8 +7,19 @@ plugins {
id("dev.flutter.flutter-gradle-plugin")
}
// OFFBAND_KEY_PROPERTIES points every checkout at one signing file (#1161).
// Set but missing fails the build: it must never fall back to debug signing.
val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
val keystorePropertiesEnv = System.getenv("OFFBAND_KEY_PROPERTIES")
val keystorePropertiesFile = if (keystorePropertiesEnv.isNullOrBlank()) {
rootProject.file("key.properties")
} else {
file(keystorePropertiesEnv).also {
if (!it.exists()) {
throw GradleException("OFFBAND_KEY_PROPERTIES is set but $it does not exist")
}
}
}
if (keystorePropertiesFile.exists()) {
keystorePropertiesFile.inputStream().use { keystoreProperties.load(it) }
}

Loading…
Cancel
Save

Powered by TurnKey Linux.