Skip to content

fix(android): rotate the helper signing key to a CI-only release key - #5341

Open
thymikee wants to merge 4 commits into
0.22from
t3/android-helper-signing-identity
Open

thymikee wants to merge 4 commits into
0.22from
t3/android-helper-signing-identity

Conversation

@thymikee

@thymikee thymikee commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

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.

Before / after

  • Before: every helper APK used the committed keystore.
  • After: scripts/build-android-helper.sh signs with AGENT_DEVICE_ANDROID_KEYSTORE when set. A publishing job that sets AGENT_DEVICE_ANDROID_HELPER_RELEASE=1 fails without it. Local builds use a throwaway keystore.
  • Only publishing jobs reach the secrets, and secrets: inherit is gone.
  • 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 1dda4ff; hosted CI green. Prod delta: about +132 / -80 lines.
  • Platform-android, release-workflow and release-assets tests pass. Revert proofs failed the pinned tests.
  • Android 16 emulator run of the key-rotation route (Case A, Case A with a non-fallback target, Case B): all pass. See the run comment on this PR.
  • The helper release workflow builds only github.ref. Its checkout_ref dispatch input is removed.
  • Maintainer steps before release: create the GitHub environment release with protection rules, and add its secrets ANDROID_HELPER_KEYSTORE_BASE64 and ANDROID_HELPER_KEYSTORE_PASSWORD. Merge ci(release): sign Android helper releases from the protected release environment #5352 on main first, or a nightly signs with a throwaway key.

@thymikee

thymikee commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Compatibility notice: base PR #5339 advanced to 6ebda4e7a56de3504a3ab5fdecdc4bb86d9ce0fd to fix clipped-prefix acceptance by normal is text. Shared contracts snapshot-text admission now serves predicate evaluation, get fallback and Android fill/read completeness checks; existing reason android_text_clipped is retained. Complete live get reads remain supported. No helper identity, signing, IME restore or wire changes were introduced. Modified focused files pass 67 tests; broad CI and independent review remain pending. Please incorporate the updated base through the owning worker's normal branch update. This notice does not modify your branch or body.

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch from 104fc20 to c7be147 Compare December 2, 2026 17:54
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.29 MB 5.29 MB -40 B
Package (unpacked) 5.29 MB 5.29 MB -40 B
Package (download) 1.62 MB 1.62 MB -107 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 18.1 ms 14.7 ms -3.5 ms
CLI --help 38.7 ms 24.2 ms -14.6 ms

Affected plugins

Plugin Installed (including dependencies) Unpacked Download
@agent-device/limrun 3.08 MB → 3.08 MB (0 B) 432.5 kB → 432.5 kB (0 B) 129.0 kB → 129.0 kB (-1 B)

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch 4 times, most recently from 88c33f3 to 498f98b Compare December 2, 2026 18:39
@blacksmith-sh

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch 3 times, most recently from 476d4d2 to f079bb8 Compare December 2, 2026 19:15
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on f079bb8. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The code at 376dc6a has two problems to fix before merge. All 31 checks pass, but CI does not exercise a real legacy-to-v2 IME migration.

The PR changes device-facing routes (IME activation and restore, text admission, v2 package install, instrumentation naming), and its stated invariant is that legacy IME restore still works after upgrade (ime-activation.ts:117). The proof is unit tests with fake adb plus hosted checks, and the PR body says there is no device evidence at this head. The earlier live run (#5260 at eea4c26) predates f079bb8 and the restack. docs/agents/device-verification.md requires running the changed route on a device. If the real IME manager does not read back the new fully qualified service component, a user can stay stranded on a helper keyboard. Please run this once on an Android 16 emulator at 376dc6a, with disposable signing inputs, and attach the output. (1) Install the base-built legacy IME helper, make it the default IME, and set agent_device_ime_helper_previous_ime to the Gboard component. (2) With the head daemon, open a session: settings get secure default_input_method must equal the exact v2 service component, and a typed Unicode string must arrive through the helper. (3) After close, default_input_method must equal the original Gboard component, previous_ime must be deleted, and the recovery marker must be cleared. (4) Leave the legacy helper active with its record, restart the daemon, and show that startup recovery restores Gboard. (5) snapshot -i --json must show androidSnapshot.backend as android-helper through the v2 instrumentation. (6) With the legacy IME active and no previous_ime record, fill and type must fail with reason android_ime_helper_retired and dispatched no.

The PR makes pnpm build:android (and build:android-*, package:android-*, prepack) exit 1 before compilation unless the four AGENT_DEVICE_ANDROID_KEYSTORE* inputs are set. Only the two helper READMEs say so. These sites still tell callers to run a bare pnpm build:android: cli-help-workflows.ts:344, the runtime hint at snapshot.ts:866, website/docs/docs/commands.md:895, website/docs/docs/snapshots.md:332, CONTRIBUTING.md:70 and docs/agents/device-verification.md:9. The android-helpers gate at checks.ts:103 and the help-conformance plans hit the same wall locally. Agents act on CLI help and error hints, so the freshness gate and the "helper unavailable" recovery path worked on the base and now fail with a keystore message and no way to produce one. Every site that tells a caller to run pnpm build:android should state the requirement once; grep build:android enumerates them. Either add one clause naming the four values, a disposable key and the README Build section, or, smaller, let build-android-helper.sh create a throwaway keystore under .tmp when none is supplied and the build is not a release, so every existing sentence stays true.

Not blocking, and fine to take or leave: the runner fallback in snapshot-helper-capture.ts:256 branches on the package name, although the artifact manifest already carries the exact runner for every production caller, so resolving the runner from the artifact would remove the branch; the IME service class literal is copied across the manifest, ime-helper.ts:34, the package script and test fixtures, so one exported constant or a drift assertion would keep them in sync; and in ime-activation.ts:129 the retired-helper refusal reuses persistFailed although nothing failed to persist, so open succeeds silently and the user learns only at the first fill or type, which a distinct typed outcome would fix.

The earlier inline thread on the legacy component names is fixed at this head and can be resolved: #5341 (comment)

Not verified here: the IME manager read-back of the fully qualified v2 service component, the install-beside behavior of the .v2 packages, and the real startup-recovery marker path on a device. No tests were re-run locally. Git history still contains the old key, and whether that needs a history rewrite or only the documented "uninstall legacy packages" guidance is a maintainer call.

Before merge, the pnpm build:android instructions need updating at each site above, or local builds need to create a throwaway key. The live migration evidence at 376dc6a is also required before merge.

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch from 376dc6a to 98e6d43 Compare December 3, 2026 07:32
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 98e6d43. The verdict and the full list are in the summary comment.

@thymikee
thymikee removed this pull request from stack #5345 December 3, 2026 07:57
@thymikee
thymikee changed the base branch from t3/android-daybreak-output-identity to 0.22 December 3, 2026 07:57
@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The earlier review at 376dc6a (#5341 (comment)) asked for Android 16 migration evidence for the .v2 route. The rebuild at 98e6d43 drops .v2, and the legacy-name code in ime-helper.ts is gone. The remaining problem is that the new key-rotation route has no device run.

The IME helper install now runs adb uninstall com.callstack.agentdevice.imehelper on INSTALL_FAILED_UPDATE_INCOMPATIBLE (helper-package-install.ts:44). That happens inside activateAndroidTestImeAfterStartupRecovery (ime-activation.ts:92-93), before the default IME and the previous_ime record are read (ime-activation.ts:99-110). Every device that holds an old-key helper takes this route on its first open after the first release signed with the new key. If the old helper is the default IME at that moment, Android picks a fallback keyboard when the package disappears. Then activationRestoreTarget (ime-activation.ts:279-286) records that fallback as previous_ime and overwrites the earlier record. Close then restores the fallback, which may not be the user's original keyboard. Only fake-adb unit tests cover this, and the PR body says "No device runs". Please run it once on an Android 16 emulator with the head daemon (pnpm build, pnpm build:android, pnpm clean:daemon) and attach the output. First, build the base (a23c532) helpers with the committed key, install both, and record the signing digest from adb shell dumpsys package com.callstack.agentdevice.imehelper. Case A: make the old helper the active IME, set agent_device_ime_helper_previous_ime to the Gboard component, then open a session with the head daemon. Case B: leave Gboard active and run the same open and close. In both cases the output must show the installer calls and the changed signing digest. It must show settings get secure default_input_method equal to com.callstack.agentdevice.imehelper/.TestInputMethodService after open, and a Unicode string typed through the helper. After close, it must show default_input_method back at the original Gboard component, previous_ime deleted, and the recovery marker cleared. Last, snapshot -i --json must show androidSnapshot.backend as android-helper with a helperVersion equal to package.json. If Case A ends on a different keyboard, the activation order needs a fix: restore the recorded target before the uninstall, or read the record before the ensure step. This run is required before merge.

Not blocking, and these can be taken or left: the PR title and the Summary line "nobody can sign an APK that Android accepts as an update" still describe the larger .v2 contract, but the code rotates only the signing key under the same package names. A device that already holds an old-key helper can still take an update from the leaked key with a higher versionCode, and inspectInstalledAndroidHelper treats it as current (helper-package-install.ts:105-110) until #5339 lands. If the maintainer confirms the issue contract is key rotation only, please retitle and qualify that sentence. If the .v2 contract stays, this becomes required. Also, the uninstall result is dropped at helper-package-install.ts:63-67. When the retry also fails, the caller sees only the retry's stderr. The base snapshot path appended the uninstall stderr (a23c532 snapshot-helper-install.ts:284). Appending it to the failed retry result would restore that.

No high-priority inline thread still applies. One lower-priority thread still applies, and it is the uninstall-result point above. The thread on the legacy component names in ime-helper.ts no longer applies, because that file has no diff against the base at this head, so it can be resolved: #5341 (comment)

Checks are pending at 98e6d43, and the PR is a draft. The hosted unit, Android emulator, repo-guard and release-workflow jobs that ran at 376dc6a (31 checks) have not reported on this head, and none of them failed. The diff touches what those jobs exercise: the release-assets build fixture now stubs keytool, ime-helper.test.ts changed, the Android emulator lane runs pnpm build:android with the new throwaway key, and size.yml applies. Not verified here: keytool, apksigner, the build script, vitest and any device run. The throwaway-keystore path and the apksigner default of using the store password as the key password were checked by reading only. Not verified here: how the Android IME manager chooses a fallback after the active IME package is uninstalled, and the installer text for INSTALL_FAILED_UPDATE_INCOMPATIBLE on API 36. Not verified here: whether git history needs a rewrite for the old committed key, the ANDROID_HELPER_KEYSTORE_BASE64 and _PASSWORD secrets, the single-alias release keystore, or a release dry-run. The PR body lists the last three as maintainer actions.

Before merge, the Android 16 emulator run above must be attached, the maintainer must confirm key-only rotation, and hosted checks must pass at this head.

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch from 98e6d43 to 8504541 Compare December 3, 2026 08:27
@thymikee
thymikee changed the base branch from 0.22 to t3/android-daybreak-output-identity December 3, 2026 08:27
@thymikee thymikee changed the title fix(android): rotate helper identity and preserve legacy IME restore fix(android): rotate the helper signing key to a CI-only release key Dec 3, 2026
@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch from 8504541 to d0029d3 Compare December 3, 2026 09:13
@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch 3 times, most recently from 7b14aef to d3116ac Compare December 3, 2026 10:42
@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The order bug from the earlier review (98e6d43) is fixed in code at d3116ac: the restore target is now kept when the install displaced the helper, and the uninstall stderr is kept after a failed retry. One finding remains, and it needs a device run.

The key-rotation route this PR adds is device-facing. On the first open of a device with an old-key helper, the installer uninstalls and reinstalls the helper (helper-package-install.ts:75-79). Then activation reads the default IME and the previous_ime record and switches the IME (ime-activation.ts:92-126). The invariant "legacy IME restoration keeps working" still rests on fake-adb unit tests. Three device behaviors decide it, and no fake shows them. First, adb install -r of a new-key APK over an old-key helper must return a typed INSTALL_FAILED_UPDATE_INCOMPATIBLE on API 36. Second, after the uninstall, settings get secure default_input_method must read a fallback keyboard or empty, not the stale helper component. If it reads the stale component, claimAlreadyActiveTestIme (:102-103) skips ime enable and ime set for a package whose enabled-IME entry is gone. Third, the reinstalled helper must be registered and enabled again. Every device with an old-key helper takes this route once, on its first open after the first release signed with the new key. A wrong result leaves the user on a fallback or an unenabled helper keyboard after close. The PR body still says "No device runs", and nothing has been attached since the first request.

Please attach one Android 16 emulator run at d3116ac with the head daemon (pnpm build, pnpm build:android, pnpm clean:daemon, driven with node bin/agent-device.mjs). Build the helpers at the merge-base with the committed key, install both with adb, and record the signing digest from adb shell dumpsys package com.callstack.agentdevice.imehelper. In Case A (old helper active), run ime enable and ime set on the helper service component, set agent_device_ime_helper_previous_ime to the Gboard component, then open a session. The output must show the uninstall and reinstall (daemon diagnostics or logcat PackageManager) and the changed signing digest. After open, settings get secure default_input_method must equal com.callstack.agentdevice.imehelper/.TestInputMethodService and ime list -s must contain it. A Unicode string must type through the helper, and the android_test_ime_activated diagnostic must show previousIme equal to the Gboard component. After close, default_input_method must be back at the Gboard component, previous_ime deleted and the recovery marker cleared. Case B (old helper installed, Gboard active) uses the same open and close with the same expectations. Then snapshot -i --json must show androidSnapshot.backend android-helper and helperVersion equal to package.json. A run that skips the old-key install, or starts with the old helper not active, does not reach Case A. If Case A ends on a different keyboard, restore the recorded target before the uninstall, or read the record before the ensure step.

Of the open inline threads, neither still applies. The uninstall-stderr thread is fixed at d3116ac (thread). The ime-helper.ts thread has no diff against the base at this head, and the legacy component strings are gone with the .v2 contract (thread). Both can be resolved.

On CI, Coverage was cancelled at the 30-minute job limit inside the "Run coverage" step, with no assertion failure in the log. Output stops at 10:45:58 and an adb process was still alive at cancel. The changed-line coverage and CRAP steps were skipped, so they are not evidenced at this head. The base PR #5339 at fb33027, which does not contain this change, had its Coverage cancelled the same way, and this PR's Coverage passed at 8504541 with the same ime tests. So the failure looks unrelated, but a rerun is needed to clear it because the diff touches tests Coverage runs. One other check is a queued review check, not a failure. The 25 other reported checks pass.

Not verified here: the three device behaviors above (checked by reading only), vitest, keytool, apksigner, the build script, and the release workflows. Also not verified: that the release environment secrets resolve inside release-android-snapshot-helper.yml, that apksigner uses the keystore password as the key password, and that the release keystore has a single alias. The PR body lists these as maintainer-run steps. Whether git history needs a rewrite to remove the old committed key is a maintainer decision.

Before merge, the Android 16 emulator run for Case A and Case B is required, and Coverage must finish green on a rerun.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on d3116ac. The verdict and the full list are in the summary comment.

@thymikee
thymikee added this pull request to stack #5360 December 3, 2026 11:33
@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Android 16 emulator run: helper key rotation (Case A, Case B)

Device: Pixel_7_CI emulator-5554, ro.build.version.sdk = 36. Runtime code at d3116ac (head b7c3ffd adds only a workflow change). Daemon from this branch: pnpm build, pnpm build:android, pnpm clean:daemon with a private AGENT_DEVICE_STATE_DIR, then node bin/agent-device.mjs ... --platform android --serial emulator-5554 --session <name>.

Old helpers: built from merge-base 2ff26e8 (archive extracted into a scratch dir), signed with the committed android/snapshot-helper/debug.keystore, same package names, same version 0.22.0-dev / versionCode 22000. Nothing from the scratch dir is committed.

apksigner verify --print-certs
old ime helper: certificate SHA-256 digest: f5dc3a7bf83a1b17312c222cd89a2f781230f34a7a407e6033fa28adf0b3cf48
new ime helper: certificate SHA-256 digest: b6fc1c952224e4c20cd4121d3afda8dc41a0bfd649e7463d806a34651cc7f570   (head build, throwaway local key)

Setup for each case (adb only for installs and IME settings):

adb uninstall com.callstack.agentdevice.{imehelper,snapshothelper}
adb install --no-incremental <old>/agent-device-android-{ime,snapshot}-helper-0.22.0-dev.apk
# Case A only:
adb shell ime enable com.callstack.agentdevice.imehelper/.TestInputMethodService
adb shell ime set    com.callstack.agentdevice.imehelper/.TestInputMethodService
adb shell settings put secure agent_device_ime_helper_previous_ime com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME

Device behavior 1: typed incompatible-update failure on API 36

$ adb install -r --no-incremental <head>/agent-device-android-ime-helper-0.22.0-dev.apk   # over the old-key helper
adb: failed to install ...: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package com.callstack.agentdevice.imehelper signatures do not match newer version; ignoring!]
exit=1

Device behaviors 2 and 3: settings after the uninstall, and reinstall registration (manual adb probe, helper active before)

before:          default_input_method=com.callstack.agentdevice.imehelper/.TestInputMethodService
adb uninstall -> default_input_method=com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME   (fallback, not the stale component)
                 ime list -s: LatinIME, VoiceInputMethodService   (helper gone)
adb install   -> default_input_method=LatinIME; helper is NOT in ime list -s

So the system does not enable the reinstalled helper. claimAlreadyActiveTestIme is not reached, because default_input_method no longer equals the helper. Activation then runs ime enable and ime set. The open runs below show that it enables and selects the helper again.

Case A: old helper active, previous_ime = Gboard

before open:
  imehelper:      signatures=PackageSignatures{... version:3, signatures:[e5a3fc65]}
  snapshothelper: signatures=PackageSignatures{... version:3, signatures:[e5a3fc65]}
  default_input_method=com.callstack.agentdevice.imehelper/.TestInputMethodService
  previous_ime=com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME

$ node bin/agent-device.mjs open com.callstack.agentdevicelab --debug ...   -> rc=0
logcat (installer / ActivityManager / IMMS / PackageManager):
  12:32:04.280 PackageInstallerSession: ... failed: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package com.callstack.agentdevice.imehelper signatures do not match newer version
  12:32:04.382 ActivityManager: Force stopping com.callstack.agentdevice.imehelper ...: deletePackageX
  12:32:04.426 InputMethodManagerService: Current input method removed: com.callstack.agentdevice.imehelper/.TestInputMethodService
  12:32:04.709 PackageManager: installation completed:com.callstack.agentdevice.imehelper
daemon request record:
  android_test_ime_activated {"device":"emulator-5554","previousIme":"com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME"}

after open:
  default_input_method=com.callstack.agentdevice.imehelper/.TestInputMethodService
  ime list -s: LatinIME, VoiceInputMethodService, com.callstack.agentdevice.imehelper/.TestInputMethodService
  imehelper: signatures=PackageSignatures{... version:4, signatures:[c1d7539f]}   (changed)

$ snapshot -i            # first snapshot: the snapshot helper takes the same route (INCOMPATIBLE -> deletePackageX -> installation completed)
  snapshothelper: signatures=PackageSignatures{... version:4, signatures:[c1d7539f]}
$ fill @e5 "zażółć 日本 🚀"   -> Filled 11 chars
  @e5 [text-field] "zażółć 日本 🚀" [focused] [editable]
$ fill @e5 "Ünïcødé ✓ 中文"  -> android_text_injection {"action":"fill","backend":"android-helper","textLength":12}
  @e5 [text-field] "Ünïcødé ✓ 中文"
$ snapshot -i --json     -> androidSnapshot: {"backend":"android-helper","helperVersion":"0.22.0-dev","helperApiVersion":"2",...}   (package.json version 0.22.0-dev)

$ close                  -> Closed: pr5341-a2
  default_input_method=com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
  previous_ime=null
  android-test-ime-pending/: empty (recovery marker cleared)

Case A with a discriminating target: Gboard is also the system fallback after the uninstall, so Case A alone cannot show which value became the restore target. I repeated Case A with previous_ime set to com.google.android.tts/com.google.android.apps.speech.tts.googletts.settings.asr.voiceime.VoiceInputMethodService. The same uninstall/reinstall logcat appeared. android_test_ime_activated showed previousIme = VoiceInputMethodService, not the LatinIME fallback. After close, default_input_method = VoiceInputMethodService and previous_ime=null. So the restore target is the recorded keyboard, not the fallback that the uninstall selects.

Case B: old helper installed, Gboard active, no previous_ime

before open: both helpers signatures:[e5a3fc65]; default_input_method=LatinIME; previous_ime=null
$ open com.callstack.agentdevicelab --debug   -> rc=0
  logcat: INSTALL_FAILED_UPDATE_INCOMPATIBLE (imehelper) -> deletePackageX -> installation completed:com.callstack.agentdevice.imehelper
  android_test_ime_activated {"device":"emulator-5554","previousIme":"com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME"}
after open: default_input_method=com.callstack.agentdevice.imehelper/.TestInputMethodService; helper in ime list -s; imehelper signatures:[c1d7539f]
$ snapshot -i   -> snapshothelper INSTALL_FAILED_UPDATE_INCOMPATIBLE -> deletePackageX -> installation completed; signatures:[c1d7539f]
$ fill @e5 "zażółć 日本 🚀" -> Filled 11 chars; @e5 "zażółć 日本 🚀"
$ snapshot -i --json -> {"backend":"android-helper","helperVersion":"0.22.0-dev","helperApiVersion":"2"}
$ close -> default_input_method=LatinIME, previous_ime=null, android-test-ime-pending/ empty

Result

  • Case A: pass. Case A with VoiceIME as the target: pass. Case B: pass. The restore order needs no code change.
  • Not run: release-key signing. The new-key side here is the local throwaway key, which takes the same incompatible-signature route. Also not run: physical devices, other API levels, and Coverage. A Coverage rerun is requested after this push.
  • dumpsys package prints the short signature hash (e5a3fc65 -> c1d7539f). The apksigner lines above give the full certificate digests.
  • The Case B fill request record did not keep an android_text_injection line, so for Case B the helper backend is shown only by the typed Unicode text.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch 2 times, most recently from eb1fa55 to 1dda4ff Compare December 3, 2026 12:14
@apex-sentinel-staging

This comment has been minimized.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The code at 1dda4ff looks correct, and the earlier findings from #5341 (comment) are fixed. The release workflow now checks out ${{ github.ref }} and the checkout_ref input is gone (#5341 (comment)). The failed-retry uninstall stderr is kept in helper-package-install.ts, so #5341 (comment) can be resolved. ime-helper.ts has no diff against the base, so #5341 (comment) does not apply and can be resolved.

All 28 checks pass at this commit, including Coverage, which was cancelled on the earlier heads. There are no conflicts.

Not verified here: that the release environment's deployment rule restricts refs, that its keystore secrets resolve in the reusable workflow, and the release keystore alias and password layout. The device run is the author's log and used a throwaway local key for the new-key side, which is fine because the signature mismatch does not depend on the key. Vitest, keytool, apksigner and the workflows were not run here. Whether git history needs a rewrite to purge the old committed key is a maintainer decision.

Nothing in the code blocks this PR. It is still a draft. Before the first release, the maintainer must create the release environment with its secrets and merge #5352.

Base automatically changed from t3/android-daybreak-output-identity to 0.22 December 3, 2026 13:20
@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch from 1dda4ff to abd320c Compare December 3, 2026 13:20
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of abd320c

Since the review of 1dda4ff: 0 new · 0 still open · 0 no longer raised

The changes are the same as on b7c3ffd, so this is that review, not a new one. Comment @apex-sentinel-staging review to review again.

No open findings.

Not in the reviewers' scope (1 file)
  • android/snapshot-helper/debug.keystore: no text diff (a binary, empty or mode-only change)

2 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (64dd30eae755).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee
thymikee marked this pull request as ready for review December 3, 2026 13:40

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 15 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/platform-android/src/ime-activation.ts">

<violation number="1" location="packages/platform-android/src/ime-activation.ts:92">
P2: `helperWasActive` is sampled before `ensureAndroidImeHelper`, but installation can wait for IME registration. If the user switches keyboards during that wait, `helperDisplacedByInstall` still forces `record.previousIme`, so activation overwrites the newer choice and close restores the stale keyboard. Recheck that the helper was still active at the displacement point, or preserve `currentIme` when it changed externally.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/release.yml Resolved
- Release builds sign with a keystore from the protected release environment;
  AGENT_DEVICE_ANDROID_HELPER_RELEASE=1 makes a missing keystore fail the build.
  Other builds, including PR dry runs, use a throwaway local key.
- One helper installer handles the typed newer state and a signature-incompatible
  update, reading the transport's typed failure when present and keeping the
  uninstall stderr on a failed retry.
- Activation keeps the recorded user keyboard as the restore target when the
  install displaced the active helper.
The release environment's deployment rule gates github.ref. A checkout_ref
input let a dispatcher build any other ref with the release signing key.
@thymikee
thymikee force-pushed the t3/android-helper-signing-identity branch from abd320c to 5517dba Compare December 3, 2026 13:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant