fix(ci): stable debug keystore for Android APKs so updates install #1152

Merged
chris merged 3 commits from fix/android-stable-debug-keystore into main 2026-10-12 18:19:48 +02:00
Owner

Problem\nEvery CI debug APK was signed with a different throwaway key: the android job runs in an ephemeral gradle:8.13-jdk21 container and AGP regenerated \$HOME/.android/debug.keystore per run (verified: 3 cached CI APKs -> 3 distinct signer certs, none matching the local dev keystore). Installing any new build over an existing one failed on-device with INSTALL_FAILED_UPDATE_INCOMPATIBLE (user-facing: "App not installed").\n\n## Fix\n- Copy one persistent debug key (/home/chris/git/.android/debug.keystore, same key local dev builds use) into $HOME/.android before the Gradle build; generate it on first use if missing.\n- KNOWN_ISSUES: ISSUE-121.\n\n## Verification\n- Emulator: fresh install + install -r update with the stable key both succeed; install over an old random-key build fails as before (one-time uninstall needed on existing devices).\n- Step script executed locally with a clean $HOME -> copies the canonical key (fingerprint 3B:E7:73:...).

## Problem\nEvery CI debug APK was signed with a different throwaway key: the android job runs in an ephemeral `gradle:8.13-jdk21` container and AGP regenerated `\$HOME/.android/debug.keystore` per run (verified: 3 cached CI APKs -> 3 distinct signer certs, none matching the local dev keystore). Installing any new build over an existing one failed on-device with `INSTALL_FAILED_UPDATE_INCOMPATIBLE` (user-facing: "App not installed").\n\n## Fix\n- Copy one persistent debug key (`/home/chris/git/.android/debug.keystore`, same key local dev builds use) into `$HOME/.android` before the Gradle build; generate it on first use if missing.\n- KNOWN_ISSUES: ISSUE-121.\n\n## Verification\n- Emulator: fresh install + `install -r` update with the stable key both succeed; install over an old random-key build fails as before (one-time uninstall needed on existing devices).\n- Step script executed locally with a clean $HOME -> copies the canonical key (fingerprint `3B:E7:73:...`).
fix(ci): stable debug keystore for Android APKs so updates install
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 4s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 3m59s
8e2b1da033
CI builds ran in ephemeral containers that regenerated ~/.android/debug.keystore
per job, so every debug APK shipped a different signing key and updating over an
existing install failed on-device with INSTALL_FAILED_UPDATE_INCOMPATIBLE
("App not installed"). Copy one persistent debug key into $HOME/.android
before the build; it is the same key local dev builds use (ISSUE-121).
docs: KNOWN_ISSUES ISSUE-121 ref -> PR#1152
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 4s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 3m56s
5b502896ef
fix(ci): provision debug keystore from repo secret + fingerprint-gate APK
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 9m33s
d2310d554c
Follow the wishlist-nextcloud release pattern: decode the persistent debug
keystore from ANDROID_DEBUG_KEYSTORE_BASE64 (backed up in Bitwarden) instead
of relying on a host-local file, fail hard when the secret is missing, and
verify the built APK's SHA-256 signer fingerprint so a wrongly signed build
can never pass CI again (ISSUE-121).
chris merged commit f24abbc360 into main 2026-10-12 18:19:48 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1152
No description provided.