fix(android): rotate the helper signing key to a CI-only release key
TH
7m ago+262+262+012345678901234567890123456789-96-96-01234567890123456789
Summary
The repository held the private key that signs Android helper APKs, so anyone could sign an APK that Android accepts as a helper update. This PR removes it. Releases are signed with a new key held only by the protected release environment. Devices with an old-key helper stay exposed until agent-device reinstalls the helper.
Merge order: #5352 on main first, then this PR. The reverse order lets a nightly publish a throwaway-signed helper.
Before / after
- Before: every helper APK used the committed keystore.
- After:
scripts/build-android-helper.shsigns withAGENT_DEVICE_ANDROID_KEYSTOREwhen set. A publishing job that setsAGENT_DEVICE_ANDROID_HELPER_RELEASE=1fails without it. Local builds use a throwaway keystore. - Only publishing jobs reach the secrets, and
secrets: inheritis gone. The signing action loads from the workflow commit. - One installer serves all helpers. On an incompatible signature it uninstalls and retries once. A failed retry keeps the uninstall stderr.
- Reinstalling the active IME helper keeps the user's keyboard as the restore target.
Validation
- Head 5517dba034, rebased on
0.22; CI pending. Prod delta: about +135 / -80 lines. - Platform-android IME, release-workflow and release-assets tests pass.
- Android 16 emulator run of the key-rotation route (Case A, Case A with a non-fallback target, Case B): all pass (run comment on this PR).
- The helper release workflow builds only
github.ref;checkout_refis removed. - Maintainer steps before release: create the GitHub environment
releasewith protection rules, and add its secretsANDROID_HELPER_KEYSTORE_BASE64andANDROID_HELPER_KEYSTORE_PASSWORD.