Repository navigation
build(android): sign release APKs with a stable keystore from secrets - #15
Merged
Merged
Conversation
Release APKs were signed with the debug key, which differs per machine/CI run — so every build was a different app and Android refused updates over a previous install (INSTALL_FAILED_UPDATE_INCOMPATIBLE). The gradle template now reads android/key.properties into signingConfigs.release (falling back to debug signing when absent, so dev/unsigned builds still work), and the release workflow stages the keystore + credentials from GitHub Actions secrets (ANDROID_KEYSTORE_BASE64/PASSWORD, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORD), failing loudly if they are missing. Published APKs are now signed with the same stable key, so users can update in place.
BlackPool25
added a commit
that referenced
this pull request
Aug 3, 2026
PR #15 accidentally changed the Linux 'Rust release codec' step from working-directory flutter_app/rust to flutter_app, so cargo build --release ran in the wrong directory and the release workflow failed with 'could not find Cargo.toml'. Restored flutter_app/rust (the Windows job already used the correct path).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & Why
Problem: every release APK was signed with the debug keystore, which is different on every machine and every CI run. Android requires the signing key to match to install an update over an existing app (
INSTALL_FAILED_UPDATE_INCOMPATIBLE) — so users could never update in place (they had to uninstall first). Verified: the v1.0.0 and v1.0.1 APKs have differentSHA-256digests despite both showingCN=Android Debug.Fix — stable release signing:
build.gradle.kts.templatenow readsandroid/key.propertiesinto asigningConfigs.releaseblock and signs the release buildType with it. When nokey.propertiesexists it falls back to the debug key, soflutter run --releaseand unsigned CI dry-runs keep working.release.ymlstages the keystore + credentials from GitHub Actions secrets (ANDROID_KEYSTORE_BASE64/ANDROID_KEYSTORE_PASSWORD/ANDROID_KEY_ALIAS/ANDROID_KEY_PASSWORD) after scaffolding, verifies the staged keystore withkeytool, and fails loudly if the secrets are missing — publishing a debug-signed APK would silently reintroduce the update-conflict bug.key.propertiesstay out of git (under the already-ignoredandroid/; confirmed withgit check-ignore).How it was tested
Built the APK locally with the keystore staged: signer is
CN=QRStream(SHA-2566319bb8a...), matching the keystore — notCN=Android Debug.Built again without
key.properties: falls back to debug signing (dev path intact).flutter analyze+flutter testunaffected (no Dart changes).flutter analyze+flutter testManually verified: release APK signed with the stable key; update-over-previous now possible
Checklist
Notes for maintainer
The 4 secrets are already set in repo Settings → Secrets → Actions. The keystore itself (and its password) is a backup item — keep a copy outside the repo; losing it means future releases can no longer update over 1.0.1.