feat: add keystore properties pipeline

This commit is contained in:
2026-07-30 23:15:53 -04:00
parent d9b665cdca
commit bbc92278f4
3 changed files with 44 additions and 0 deletions
+5
View File
@@ -7,6 +7,11 @@ build/
*.aab *.aab
local.properties local.properties
# Release signing — NEVER commit the key or its passwords
keystore.properties
*.jks
*.keystore
# Nix # Nix
result result
result-* result-*
+28
View File
@@ -1,9 +1,21 @@
import java.util.Properties
plugins { plugins {
alias(libs.plugins.android.application) alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose) alias(libs.plugins.kotlin.compose)
} }
// Release signing is loaded from keystore.properties, which exists only on a machine
// that owns the signing key (never committed — see .gitignore). F-Droid and CI have no
// such file and build unsigned; that unsigned output is exactly what F-Droid's
// reproducible-build check compares against before re-applying our signature.
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties =
Properties().apply {
if (keystorePropertiesFile.exists()) keystorePropertiesFile.inputStream().use { load(it) }
}
android { android {
namespace = "ca.ksamad.encore" namespace = "ca.ksamad.encore"
compileSdk = 35 compileSdk = 35
@@ -21,8 +33,24 @@ android {
versionName = "0.1.0" versionName = "0.1.0"
} }
signingConfigs {
// Present only when the developer keystore is configured; absent on F-Droid/CI.
if (keystorePropertiesFile.exists()) {
create("release") {
storeFile = file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword")
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
}
}
}
buildTypes { buildTypes {
release { release {
// Sign with the release key when configured; otherwise stay unsigned so
// F-Droid can build/verify reproducibly and re-apply our signature.
signingConfig = signingConfigs.findByName("release")
// R8 code shrinking + resource shrinking. Critical with // R8 code shrinking + resource shrinking. Critical with
// material-icons-extended: it bundles thousands of vector icons, and // material-icons-extended: it bundles thousands of vector icons, and
// R8 strips everything we don't reference (debug builds can't shrink, // R8 strips everything we don't reference (debug builds can't shrink,
+11
View File
@@ -0,0 +1,11 @@
# Copy this file to `keystore.properties` (which is gitignored) and fill in your
# real values. This file — the .example — carries NO secrets and is safe to commit.
#
# `storeFile` is the path to your release keystore. Keep the keystore OUTSIDE the
# repo (e.g. ~/.keys/encore-release.jks) and back it up offline — losing it means
# you can never ship another signed update on your own channels.
storeFile=/absolute/path/to/encore-release.jks
storePassword=CHANGE_ME
keyAlias=encore
keyPassword=CHANGE_ME