fix(android): 对齐应用内更新 minisign 并修复凭据 vault - #1061
Merged
H-Chris233 merged 10 commits intoSep 12, 2026
Merged
H-Chris233 merged 10 commits into
H-Chris233 merged 10 commits into
Conversation
… can open Android updater called PublicKey::from_base64 on the wrapped tauri.conf pubkey, so install died before installApk. Also keep vault envelope failures from looking like an unconfigured Volcengine ASR provider. Co-authored-by: Cursor <cursoragent@cursor.com>
Release Linux egui 在 beta 上因 RemoteInputStatus 缺字段、match 臂类型不一致,以及门禁要求 ensure_fcitx5_ready(?) 而失败;安装调用本身已在监听器之前,错误会展示在 UI 里。 Co-authored-by: Cursor <cursoragent@cursor.com>
Core.start() 会走 configuration_snapshot → load_credentials_for_update;信封读失败若返回 Err,setup hook 直接 SIGABRT。改为记录 last_read_error 并返回未缓存默认值,应用可以启动。 Co-authored-by: Cursor <cursoragent@cursor.com>
Core.start() 在 setup 成功后还会被 event bridge 和 get_startup_snapshot 再调一次;此时 last_read_error 已记下,require_readable_vault 把 Persistence 抛成「暂时无法启动」。握手改为降级空凭据状态继续运行。 Co-authored-by: Cursor <cursoragent@cursor.com>
启动时信封暂时读失败后,require_readable_vault 会在真正 load 之前短路,导致添加提供商一直操作失败。改为每次读写都重试 Keystore;读失败返回 Persistence 且不缓存/不写入默认空根;前端展示后端具体错误。 Co-authored-by: Cursor <cursoragent@cursor.com>
添加提供商已会重试信封,但 Keystore 仍返回 temporarily unavailable。JNI 原先丢掉 Kotlin 异常与 JNI 失败路径,无法区分 class load、status 3 还是 BackendBusy。 Co-authored-by: Cursor <cursoragent@cursor.com>
真机 open 稳定抛出 InvalidKeyException(非 UserNotAuthenticated)。继续当成 temporarily unavailable 会让已保存凭据永远读不出来。改为走密钥缺失路径,删除无法解密的信封后可以重新配置提供商。 Co-authored-by: Cursor <cursoragent@cursor.com>
清掉失效信封后,增加提供商仍在 seal 上失败(ProviderException/KeyStoreException)。HyperOS 上 Keystore2 从 JNI 后台线程调用常失败;改为主线程执行,并换用未损坏的 v3 别名,失败时删除别名再生成一次。 Co-authored-by: Cursor <cursoragent@cursor.com>
HyperOS 上 seal 稳定返回 KeyStoreException 10,主线程与 v3 别名仍无法写信封。Keystore 不可用时改用 UID 私有软件 AES-GCM,避免增加提供商失败。 Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
现在已经不再依赖那把会突然坏掉的硬件密钥。 KeyMint 再抽风,一般不会再把听写打成「没配置」;应用也不会再因为读密钥失败而闪退。 这次保存成功之后,设备上会留下 还可能出问题的,只有这几类,新代码都能处理,但结果不一样:
|
Collaborator
|
开始审查 |
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.
摘要
Fixes #1054。
修复 Android 应用内更新的 minisign 验签,以及凭据信封在 HyperOS KeyMint 失败时无法读写、进而挡住启动和「增加提供商」的问题。
修复 / 新增 / 改进
Invalid encoding in minisign data让安装器根本打不开。Core.start()/ Tauri setup abort,也不再用第二次start()的门禁挡住 2.0 握手。for_update失败禁止用空根覆盖信封;无法用于 Cipher 的密钥按失效信封恢复。KeyStoreException:10时,回退到应用私有目录的软件 AES-GCM(credentials.sw.key),migration 标记同步走文件。[agent-dbg]埋点(H7/H9/H12/H14 等),导出日志即可区分 Keystore 异常码、信封是否落盘、软件回退是否生效。不把密钥/明文打进日志。兼容
files/OpenLess/credentials.sw.key。[agent-dbg]WARN,便于后续真机排障;不含密钥。测试计划
node scripts/android-credential-keystore-contract.test.mjs(在openless-all/app)Android APK (debug)@fix/android-updater-minisign-and-vault-error(ee0761ea)adb install -r后可启动;设置里增加提供商成功;听写 + DeepSeek 润色成功openless-2026-09-11T09-08-02.logH1 core start ok/running:trueH9 seal/open/markMigrationComplete→status_ok(不再出现KeyStoreException:10)H14 keystore_seal ok(packetLen 212→257,信封在增长)H7ok:true, lastReadError:false[llm] polish_streaming provider=deepseek且stream done