Repository navigation
fix(#62): sign the Android installer with one permanent release key (0.4.2) - #71
Merged
Merged
Conversation
…0.4.2) Every published DisplayXR-Installer-<ver>.apk was signed with the CI runner's throwaway debug key, a different key per run, so a tablet could never update the installer in place (INSTALL_FAILED_UPDATE_INCOMPATIBLE). - One RSA-4096 release key (CN=DisplayXR Installer, O=DisplayXR, valid to 2126), held in the android-installer-release environment (deployable from main only). Its certificate SHA-256 is pinned in android-installer/release-signing-cert.sha256. - app/build.gradle.kts: a v2-only `release` signingConfig from env vars; without them the release variant falls back to the debug key, so forks/PRs still build. - CI builds assembleRelease. scripts/verify-release-signature.sh passes only an APK whose sole signer is the pinned cert. It is required by publish-bundle.yml (build job + again on the downloaded bytes before the release is created) and by build-android-bundle.yml when publishing; every build also proves it refuses a throwaway-key APK. Debug-signed CI artifacts are named ...-DEBUGKEY.apk. - Release notes, README, INSTALL.md: one-time "uninstall the old installer" when coming from 0.4.1 or older; the "different key for now" wording is gone. - installerVersionName 0.4.2 / versionCode 7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build-tools <= 34 print 'Signer #1 certificate SHA-256 digest:'; newer ones (the ubuntu-latest runner's) print 'V2 Signer: certificate SHA-256 digest:'. The gate saw 0 signers on the runner and refused a correctly signed APK. Count from 'Number of signers' and require every signer-certificate digest, in either format, to be the pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
CI evidence for both signing paths
Not exercised: |
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.
Problem
Every published
DisplayXR-Installer-<ver>.apkwas signed with the CI runner's throwaway debug key, a different key on every run (v2.4.4 signerb7d95335…, v2.4.5bec29699…). Android refuses to update an app across a key change, so a tablet could never upgrade the installer in place.Fix: one release key, forever
CN=DisplayXR Installer, O=DisplayXR, valid 2026-09-30 → 2126-09-067df5e3233c76abf9544311268e76d57e1240c83805a5fd33ac91a4ab5371f8ce→android-installer/release-signing-cert.sha256android-installer-release(deployment branch:mainonly) —ANDROID_INSTALLER_KEYSTORE_B64,…_KEYSTORE_PASSWORD,…_KEY_ALIAS,…_KEY_PASSWORD; offline backup held by the repo ownerreleasesigningConfig read from env vars (ANDROID_INSTALLER_KEYSTORE_FILE+ passwords/alias). Without them, the release variant is signed with the debug key, so fork PRs and local builds still compile, test and install. Minification stays off; R8 can't be validated without a tablet run.assembleRelease. The key is decoded only in runs onmain. The environment's branch policy also blocks a workflow edited on a branch.scripts/verify-release-signature.sh <apk>passes only an APK whose single signer's cert equals the pin (it also checks for a v2/v3 signature and packagecom.displayxr.installer).publish-bundle.ymlrequires it in the build job (require_release_key: true) and runs it again on the downloaded bytes right before the release is created.build-android-installer.ymlmakes it required when attaching (release_tag) or when the key was present.build-android-bundle.ymlrequires it whenpublishis on.…-DEBUGKEY.apk.installerVersionName0.4.2 /installerVersionCode7.Coordinates with #70: both touch
.github/release-notes/bundle.mdin different hunks, andgit merge-treeshows no conflict.Verification (local, no tablet)
:app:testDebugUnitTest: 94 tests, 0 failures (1 skipped, already skipped on main).apksigner verify --print-certsandaapt2 dump badging:0.4.2(versionCode 7): v2 only, 1 signer,CN=DisplayXR Installer, O=DisplayXR,7df5e323…71f8ce. Gate PASS.0.4.2-test(versionCode 8, built with-PinstallerVersionName/-Code): same cert7df5e323…71f8ce. Gate PASS. Because the package and cert match and the versionCode is higher, Android will install it in place over the first one.91f2d749…): FAIL rc=1.DisplayXR-Installer-0.4.1.apk(debug certbec29699…): FAIL rc=1.Not verified
main(the environment is main-only). See the CI comment below for what was exercised.🤖 Generated with Claude Code