Skip to content

chore: sync hotfix/v6.5.2 to x - #12969

Merged
originalix merged 55 commits into
xfrom
sync/6.5.2-hw-20260821
Aug 22, 2026
Merged

chore: sync hotfix/v6.5.2 to x#12969
originalix merged 55 commits into
xfrom
sync/6.5.2-hw-20260821

Conversation

@originalix

Copy link
Copy Markdown
Collaborator

Syncs hotfix/v6.5.2 (the shipped 6.5.2 App Shell — hardware SDK mainline) to x via per-commit cherry-pick: 50 picks + 1 reconciliation commit.

Baseline: hotfix/v6.5.2 @ 4a6cbe399e (= tag basis of the 6.5.2 release), branched from release/v6.5.0 @ 5cd0dbcf0c.

Headline changes

Deliberately skipped (8)

Commit Reason
e787ae12cb chore: v6.5.2 .env.version release bookkeeping
bf98473ce9 ip table backport (#12778) backport OF x's #12529 — already on x
14b3c6e642 hw 12641 picks (#12840) pick OF x's #12641 — already on x
f14f7eac58 / cbc95068a6 device-ready card (#12846/#12864) picks OF x's #12844 — already on x
8278f50687 / 190f274e75 / 85e4d5924c sync release/v6.5.0 → hotfix release/v6.5.0 content flows to x via the chore: sync release/v6.5.0 to x series

⚠️ NOT in this PR — needs the next release/v6.5.0 → x sync

Six release/v6.5.0 PRs that landed after sync #12882's baseline (hotfix absorbed them via #12935, this PR skips that commit): #12872 (jpush key), #12901, #12907, #12918, #12887, #12906. None are on x yet.

Judgment calls (hardware = hotfix authoritative; UI/other = case by case)

  1. Hardware files converge to the shipped hotfix state — ServiceHardware, HardwareConnectionManager, firmware, onboarding device flows, LocalDbBase device queries.
  2. x-only features preserved: identityLifecycle bootstrap recovery, KeyTag import testIDs, IBatchCreateCustomNetworkParams type refactor (kept, with the pick's oneKeyOperationLease param), app:playground script, x's newer i18n key set, x's ipTable refactor (superset of the hotfix backport).
  3. Re-grafted x's fix: correct Pro device setup step order OK-60126 #12866 (OK-60126 Pro setup step order) — pick feat(hardware): add complete OneKey Pro 2 integration #11814's whole-file replacement of DeviceSetup.tsx had dropped it.
  4. CheckAndUpdate.tsx → hotfix version wins (firmware-update flow, byte-identical to shipped 6.5.2). x's fix: correct check-and-update skip state, device name and retry UI (OK-58649) #12689 (OK-58649: skip state / device name / retry UI) refinements to this file are superseded — regression-check OK-58649 scenarios.
  5. apps/desktop/app/app.ts → hotfix shape: removed x's createTrezorBlePairingIpcMain WinRT pairing insert (Fix/electron ble OK-53916 OK-56030 OK-56052 OK-56052 OK-56559 OK-57874 OK-58233 OK-58295 OK-57896 #12641-era). Shipped 6.5.2 desktop runs SDK alpha.176 without it (SDK owns pairing). Regression-check Windows Trezor BLE pairing.
  6. DeviceVideo stays force-dark (x design): x removed the -L light video assets, so the hotfix themed-branching body would reference missing files.
  7. EarnHome banner cache (fix: cache the Earn banner list and keep rich text inline when clampe… #12938) adopted; x's EarnMobileHomeContent still requires isBannerLoading, now fed false — matches hotfix's no-skeleton behavior.

Verification

  • Full tsc (native): clean, zero errors
  • yarn agent:check --profile commit: all checks PASS (lint, format, tsc, agent-context)
  • Targeted jest: 291 tests / 5 suites pass (getCompatibleConnectId, TrezorAdapter, LocalDbBase.trezor, useAppUpdate, SimpleDbEntityBase)
  • yarn install + patch-package: clean (electron-updater / react-native-screens / collapsible-tab-view patches apply)
  • No RELEASES.json / .env.version in the diff; no conflict markers; no stray files

Included commits (in pick order)

51 commits

| 4daefc5e45 | feat(hardware): add complete OneKey Pro 2 integration (#11814) |
| 1c84b57d1b | feat(hardware): support Neo Protocol V2 devices (#12766) |
| d6893786b4 | chore: update hardware SDK to alpha.69 (#12780) |
| c5b41eb973 | feat: harden firmware upgrade pipeline (#12656) |
| bfbb41bdf7 | fix: load Protocol V2 resource archives (#12788) |
| c634641d1e | fix: pro2 bug fix (#12804) |
| fbf9d67d90 | fix: upgrade hardware SDK to 1.2.0-alpha.101 (#12808) |
| 0844092ad6 | Feat/hw fixes on hotfix652 OK-57549 OK-58650 OK-58579 (#12795) |
| 25d41f475e | fix: handle onboarding device scan errors (#12830) |
| 18d2c33c96 | fix: avoid legacy inputs in prepared firmware V3 (#12828) |
| 2fc9deacd5 | fix: harden Pro2/Neo recovery, BLE, and resource uploads (#12809) |
| f92b1b57d2 | fix: NFT collect fixes (OK-59979 OK-59980) (#12836) |
| c1a813454a | chore: upgrade sdk (#12838) |
| 33dc57bedb | fix: align firmware update device details (#12829) |
| b98acf153c | fix: close device setting select after change (#12841) |
| 580cb7d895 | fix: align prerelease firmware integrity validation (#12843) |
| 972d385436 | fix: restore Extension firmware update flow (#12851) |
| dfae70f0be | fix: avoid desktop sync IPC for time cache (#12853) |
| 0ddaf46add | fix: remove Pro 2 from USB connect device label (#12855) |
| 475f6d7fc5 | chore: upgrade hardware sdk to alpha.118 (#12856) |
| 2d46939c91 | chore: upgrade hardware sdk to alpha.119 (#12865) |
| ca383fd8a9 | fix: skip ble pairing dialog for live ble session OK-60091 (#12861) |
| 31b876ddfb | fix: correct Pro2 settings and label sync(OK-60188, OK-59745, OK-60258) (#12869) |
| 0e8a9360ab | fix: restore firmware-switch device management behavior (OK-60205) (#12877) |
| 65c2c868b2 | fix: sync portfolio on idle desktop BLE links (#12845) |
| 415bd252f9 | fix: sync V1 device-side settings changes after device operations (OK-60121) (#12879) |
| e97fb2c230 | fix: support Pro2 and Neo BLE flows (#12871) |
| 4f3240e683 | fix: sync hardware connection status after reset(OK-60117) (#12892) |
| 8c272827ac | fix: use SDK dimensions for Pro2 images (#12894) |
| 8636eec6b1 | chore: upgrade hardware SDK to alpha.129 (#12896) |
| 8434ce4440 | fix: sync Pro2 settings and send BLE cancel immediately (#12899) |
| e5486af047 | Fix/trezor ble row heal on hotfix652 OK-60092 (#12900) |
| 532ca6d91c | fix: align hardware errors, wallet state, and Pro2 workflows (#12905) |
| 1068b9d26c | fix: resolve third-party hardware wallet avatars per device model OK-60448 (#12912) |
| 43bae11f01 | fix: seed canonical device state before hidden wallet passphrase session (OK-59992) (#12908) |
| c5afee1362 | test: cover manifest-free Pro2 RESC archives (#12924) |
| 5eae8a62da | fix: correct Ledger Nano Gen5/Flex asset swap and legacy Trezor One code (#12926) |
| b9f8dcc159 | fix: let SDK own hardware Cancel and bump SDK 148 (#12917) |
| 525d64ac3d | fix: restore desktop usb routing OK-60693 (#12940) |
| 43a0b6c918 | fix: cache the Earn banner list and keep rich text inline when clampe… (#12938) |
| d7b20ffa48 | fix: detect hardware disconnect on desktop USB and BLE (OK-60486) (#12942) |
| 125dc9d410 | fix: validate Electron update package before install (OK-59014, OK-58098, OK-53765, OK-45636) (#12700) |
| 4291387901 | fix: align Pro2/Neo firmware verify, homescreen and BLE name compatibility (#12933) |
| 01ab553a19 | fix: support iOS Fabric WebView navigation (#12947) |
| d3e6a4d68e | fix: prevent iOS address list liquid glass blur (#12948) |
| fb7ea903fb | fix: align Pro2 firmware and portfolio behavior (#12950) |
| c56ce2b09a | fix: keep genuine-check verify dialog interactive on iOS retry (#12951) |
| 9313aea356 | fix: keep Android browser content above toolbar(OK-60781) (#12955) |
| 0103e4e32d | chore: upgrade hardware SDK to 1.2.0-alpha.176 (#12954) |
| 6de20508ba | fix: show Protocol V2 custom wallpapers (#12956) |
| 6e7ad6bf81 | fix: reconcile hotfix/v6.5.2 sync residuals with x |

wabicai and others added 30 commits August 21, 2026 23:27
* feat(shared): add Pro 2 device foundations

Define canonical protocol V2 device state, connection and routing helpers, firmware config sources, portfolio payload/archive utilities, and Pro 2 media helpers shared across runtimes.

* feat(hardware): integrate Pro 2 background services

Persist canonical device state across main/background runtimes and add Pro 2 USB/BLE onboarding, hidden-wallet sessions, settings, firmware, portfolio sync, NFT transfer, network capability, and WalletConnect handling.

* feat(hardware): add Pro 2 wallet user flows

Expose Pro 2 onboarding, connection state, passphrase and hidden-wallet handling, device settings, brightness, wallpaper, firmware progress, portfolio display, NFT actions, and developer controls in the wallet UI.

* feat(cli): adapt hardware commands for Pro 2

Use the unified hardware SDK queue and device discovery/session data in CLI login and signing flows, with focused regression coverage.

* docs(hardware): document Pro 2 session and portfolio flows

Describe passphrase-wallet session semantics and the implemented portfolio packaging, synchronization, and upload pipeline.

* fix: address Pro 2 review findings

* fix: address remaining Pro 2 review findings

* fix: stabilize Pro 2 device management

* fix: avoid eager hardware SDK import

* fix: sync Pro 2 label validation feedback

* fix: avoid duplicate pin during hardware onboarding

* fix: address Pro 2 review feedback

* fix: prepare Pro 2 prerelease verification

* fix: preserve legacy hardware compatibility

* fix: use SDK Pro2 update targets

* fix: harden hardware device data handling

* fix: preserve hardware settings and safe logs

* fix: tighten Pro2 integration boundaries

* fix: harden Pro2 hardware security flows

* fix: address Pro2 review feedback

* fix: stabilize Pro2 onboarding and hardware sessions

* fix: stabilize hardware account creation

* fix: stabilize Pro2 hardware communication

* perf: lazy load hardware JPEG decoder

* fix: restore Pro2 hidden wallet entry

* fix: handle Pro2 Attach PIN onboarding

* fix: finalize Pro2 production support

* chore: exclude unrelated hotfix changes

* chore: upgrade hardware SDK to alpha.53

* fix: preserve Pro2 onboarding on hotfix

* fix: address Pro2 review feedback

* feat: improve Pro2 device and firmware update flows

* chore: update hardware sdk to 1.2.0-alpha.56

* fix: address Pro2 portfolio and lint review feedback

* fix: preserve hardware device compatibility

* fix: use local database schema version 20

* fix: close final Pro 2 compatibility gaps

* fix: bound firmware recheck wait
* feat: harden firmware upgrade pipeline

Stack the firmware-only changes on the hotfix IP Table prerequisite.

* chore: update hardware sdk prerelease

* fix: restore trusted firmware catalog

* fix: remove bundled firmware catalog

* fix: keep hardware available without firmware manifest

* fix: decouple firmware probe from IP routing

* chore: bump range downloader alpha

* fix: sync verified firmware artifact receipts

* chore: update hardware SDK to alpha.72

* chore: update hardware SDK to alpha.73

* chore: update hardware SDK to alpha.74

* chore: update SNI connect to alpha.9

* chore: update hardware SDK to alpha.76

* fix: harden firmware transport boundaries

* chore: update hardware SDK to alpha.77

* fix: serialize iOS hardware dialog transitions

* fix: serialize iOS bootloader dialog handoff

* fix: keep bootloader dialog interactive on iOS
* fix: clarify Pro2 firmware update workflow guard

* refactor: migrate desktop and webembed to rspack v2 (#12427)

* refactor: migrate desktop and webembed to rspack v2

* fix: unblock rspack migration checks

* fix: add jiti loader to desktop rspack workflows

* fix: strengthen web-embed compatibility checks

* fix: restore desktop rspack defaults

* fix: match spaced script end tags

* fix: harden web-embed script extraction

* fix: harden web-embed production finalization

* fix: finalize desktop production assets

* fix: align node engine with rspack

* fix: align web embed sentry release

* fix: align rspack production config with x

* fix: correct Pro2 portfolio currency conversion

* docs: translate firmware workflow comments

* fix: address Pro2 firmware workflow review feedback

* fix: keep switched firmware wallets manageable

* fix: support manifest-driven Pro2 resources

* fix: align Pro2 and Neo firmware update titles

* fix: sync locale translations

* fix: load protocol v2 resource archives

* fix: enable remote resource archive updates

* fix: address firmware update review feedback

* chore: align hardware sdk alpha versions

* fix: show protocol v2 update versions

* fix: mark resource archive download state

* fix: show protocol v2 component versions

* fix: harden protocol v2 firmware updates

* chore: remove unrelated locale changes

* chore: align locale with hotfix base

* fix: honor protocol v2 forced update targets

* fix: handle protocol v2 resource update overrides

* chore: update hardware sdk to 1.2.0-alpha.84

* refactor: route firmware artifacts through unified downloader

* fix: validate protocol v2 plan targets exactly

* fix: bind firmware host to prepared plan

* fix: allow current firmware artifact host

* fix: compare Protocol V2 resources by default

* chore: update hardware sdk to 1.2.0-alpha.86

* chore: update hardware sdk to 1.2.0-alpha.87

* fix: allow pre-release firmware artifact hosts in developer mode (#12800)

* fix: validate Protocol V2 firmware plans early

* chore: fix firmware artifact lint wording

* fix: consume prepared plans without duplicate inputs

* style: format prepared plan assertion

* fix: address protocol v2 firmware review

* chore: fix firmware UI test import order

* fix: support serial-less protocol v2 updates

* chore: update hardware sdk to 1.2.0-alpha.92

* chore: update hardware sdk to alpha.98

* chore: update hardware sdk to alpha.99

---------

Co-authored-by: huhuanming <huanming@onekey.so>
Co-authored-by: Leon <lixiao.dev@gmail.com>
* chore: update hardware sdk to alpha.100

* fix: align Pro2 device behavior
* feat: offer a firmware update action on the generic hardware error toast

The UnknownHardwareError fallback toast tells users to keep hardware and app
up to date but gave them nothing to act on.

- UnknownHardwareError was the only hardware error class without its own
  `code`, so it fell back to the generic -99999 shared by every OneKey error
  and could not be matched. Give it ECustomOneKeyHardwareError.
  UnknownHardwareError (4033).
- Route that code to a new in-app firmware update action. The existing
  NeedFirmwareUpgradeFromWeb button stays on the web tool, which is what that
  error means.
- The SDK error payload never carries the device it came from, so stamp the
  connectId in withHardwareProcessing's catch and keep the raw payload on
  UnknownHardwareError (message resolution unchanged). Errors raised outside
  the wrapper still work: the ChangeLog page resolves the device itself.
- Add two ErrorToast gallery entries to trigger the toast manually.

* fix: move the device details danger zone below the routine settings

The danger zone sat between Security and Advanced, so a destructive wipe
action was surrounded by everyday settings and easy to hit by mistake. It is
now the last user-facing section, above only the Trezor debug block. Display
conditions are unchanged: still gated on device settings being shown and
still hidden for third-party vendors.

* chore: drop the yalc hardware SDK debug script

Local SDK work goes through the watcher in the SDK repo (dev:core to compile,
debug:watcher to copy dist into this repo's node_modules). This script drove the
older yalc flow, its package.json entry is long gone, and the publish:yalc side
it documents no longer exists either.

* feat: recognize the BLE pairing-cancelled code as a user cancel, not a connect failure

* fix: send a failed Trezor setup back to the device scan instead of retrying a dead address

* fix: keep the translated hardware error copy on the update toast

Passing `message` set normalizeErrorProps' `msg` up front, so its `!msg` i18n
branch never ran and the toast title fell back to the raw device string —
dropping the wallet_action_failed guidance the update button exists to act on.
Only `payload` is needed for the button to reach connectId.

Jest cannot catch this: the i18n branch is behind `!platformEnv.isJest`.

* feat: bridge the BLE release channel through the desktop preload

The keep-alive transport frees a link on a logical NOBLE_BLE_RELEASE signal;
without the preload bridge the idle countdown never starts and every operation
holds the device on the 10-minute busy backstop. keepSession rides the same
call so a mid-flow release keeps the long backstop. The SDK side ships in
1.2.0-alpha.101, already bumped on the base branch.

* fix: address the automated review on the firmware toast action and BLE channel list

Route CheckFirmwareUpdateButton through openChangeLogModal so the extension
popup/side-panel move to an expanded tab and device reachability is checked,
instead of pushing the modal into an ephemeral surface via rootNavigationRef.

Add NOBLE_BLE_RELEASE to the desktop cleanup list. alpha.75 self-clears its
handlers, so this is keeping the host list honest rather than a live fix.
* fix: avoid legacy inputs in prepared firmware V3

* test: align firmware self-test with prepared V3 inputs

---------

Co-authored-by: wabiwabo <68363074+wabicai@users.noreply.github.com>
* fix: refresh Pro2 and Neo state after firmware cancel

* fix: skip stale Pro2 portfolio sync OK-59765

* fix: consume normalized TON signing message

* style: translate firmware state comments to English

* fix: preserve binary payloads across offscreen bridge

* fix: satisfy offscreen lint rules

* fix: secure portfolio retries and BLE wallet creation

* fix: allow hidden-only devices in device management

* refactor: align BLE wallet creation with x branch

* fix: redact TON mismatch logs and cover device removal

* fix: route protocol v2 resource uploads through sdk

* chore: upgrade hardware sdk to alpha.104

* fix: persist selected hardware transport

* fix: resume post-update firmware recheck

* fix: add Pro2 and Neo bootloader minimum versions

* fix: harden firmware recheck and wallpaper uploads

* fix: use sdk auto shutdown options

* fix: defer wallet deprecation after device reset

* fix: handle onboarding device scan errors

* fix: allow sdk-managed protocol v2 firmware updates

* fix: reduce silent portfolio BLE sync

* fix: isolate stale device scan failures

* fix: prevent stale portfolio resume uploads

* fix: harden device scan error handling

* fix: preserve reset session on restarted scans

* fix: bind portfolio sync to connected device

* fix: defer Pro2 identity checks in bootloader

* chore: upgrade hardware sdk to 1.2.0-alpha.106

* fix: translate hardware comments to English

* fix: prevent stale portfolio identity cache reuse
* fix: restore SDK NFT size lookup in getDeviceNftConfig

* fix: localize Pro2 NFT storage limit error message

* chore: sync translations from Lokalise

* chore: translate NFT storage limit message for all locales
* fix: restore Extension firmware update route

* chore: upgrade hardware SDK to alpha.113

* chore: upgrade hardware SDK to alpha.116
* fix: skip ble pairing dialog for live ble session OK-60091

* fix: silent ble bind probe uses silentMode and bounded timeout

* fix: gate silent ble bind behind recent live traffic evidence

* fix: read probe identity from both deviceId and device_id fields

* fix: invalidate live connectId evidence on device disconnect

* chore: add hardware lease and silent ble bind diagnostic logs

* fix: pin known protocol in silent ble bind probe

* test: align firmware detect assertions with ownerName param

* chore: remove hardware diagnostic logs from hotfix

* chore: restore firmware detect test assertions

---------

Co-authored-by: wabiwabo <68363074+wabicai@users.noreply.github.com>
…8) (#12869)

* fix: correct Pro2 settings display

* fix: show Pro2 Bluetooth name

* fix: sync Pro2 device label with wallet name OK-60258

* test: cover Pro2 serial fallback OK-59745

* fix: separate alphabetic portfolio currency symbols OK-59745

* fix: persist Pro2 label through wallet sync OK-60258

* fix: align segmented slider marks OK-60188

* fix: persist Pro2 label after wallet creation OK-60258

* fix: align Pro2 brightness segment values OK-60188

* fix: correct SegmentSlider test import order
…12877)

* fix: restore firmware-switch device management behavior (OK-60205)

* chore: upgrade hardware sdk to alpha.123 (OK-60205)
* fix: sync portfolio on idle desktop BLE links

* chore: upgrade hardware sdk to alpha.115

* chore: upgrade hardware sdk to alpha.117

* chore: upgrade hardware sdk to alpha.118

* fix: preserve desktop usb portfolio sync

* fix: address desktop portfolio review feedback

* fix: scope desktop portfolio transport guard

* fix: preserve hardware transport and portfolio lease

* fix: narrow background transport pinning
…-60121) (#12879)

* fix: sync V1 device-side settings changes after device operations (OK-60121)

* chore: gate hardware debug file logging behind showDeviceDebugLogs

* chore: route hardware logs through defaultLogger with dev production-parity switch

* chore: add persist-all-logs switch to dev settings

* fix: resolve Copy Log Path via desktopApi on desktop

* fix: address review feedback on log masking, read-back scope and timeout

* fix: harden v1 settings sync per second review round

---------

Co-authored-by: wabiwabo <68363074+wabicai@users.noreply.github.com>
* fix: add Neo to hardware onboarding

* fix: handle bluetooth usb conflicts

* chore: upgrade hardware sdk to alpha.124

* chore: upgrade hardware sdk to alpha.125

* fix: preserve Pro QR wallet entry

* chore: upgrade hardware sdk to alpha.126
* fix: sync hardware connection status after reset OK-60117

* fix: clear and rebroadcast hardware connection identities on SDK reset OK-60117

* fix: remove redundant parens flagged by CI lint
wabicai and others added 2 commits August 21, 2026 23:36
* fix: support Protocol V2 wallpapers

* fix: generate Protocol V2 wallpaper data on client

* refactor: clarify wallpaper upload routing

* fix: align Protocol V2 wallpaper resource type
@socket-security

socket-security Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​onekeyfe/​hwk-ledger-connector-webhid@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17687 +161006596 +1100
Updatednpm/​@​onekeyfe/​hwk-ledger-connector-ble@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17687 +151006596 +1100
Updatednpm/​@​onekeyfe/​hwk-trezor-connector-webusb@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17688 +131007096 +1100
Updatednpm/​@​onekeyfe/​hwk-trezor-connector-rn-ble@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17689 +131007196 +1100
Updatednpm/​@​onekeyfe/​hwk-trezor-connector-electron-ble@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17688 +1210071 +196 +1100
Updatednpm/​@​onekeyfe/​hwk-trezor-adapter@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17689 +1310071 +196 +1100
Updatednpm/​@​onekeyfe/​hd-transport-usb@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17690 +1510071 +296 +1100
Addednpm/​@​types/​web-bluetooth@​0.0.211001007280100
Updatednpm/​@​onekeyfe/​hd-transport-electron@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17691 +1110072 +196100
Updatednpm/​@​onekeyfe/​hwk-adapter-core@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17692 +1510072 +196 +1100
Updatednpm/​@​onekeyfe/​hd-shared@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17695 +1310073 +296100
Updatednpm/​@​onekeyfe/​hwk-ledger-adapter@​1.1.34-alpha.2 ⏵ 1.2.0-alpha.17691 +131007396 +1100
Updatednpm/​@​onekeyfe/​react-native-range-downloader@​3.0.78 ⏵ 3.0.81-alpha.1173 +210090 +196 +1100
Updatednpm/​@​onekeyfe/​react-native-sni-connect@​3.0.78 ⏵ 3.0.81-alpha.97510010096 +2100
Updatednpm/​@​onekeyfe/​hd-ble-sdk@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17692 +1210081 +196100
Updatednpm/​@​onekeyfe/​hd-common-connect-sdk@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17691 +1110081 +196100
Updatednpm/​@​onekeyfe/​hd-transport@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17696 +1110083 +196100
Updatednpm/​@​onekeyfe/​hd-web-sdk@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17694 +810086 +196100
Updatednpm/​@​onekeyfe/​hd-core@​1.1.34-alpha.0 ⏵ 1.2.0-alpha.17695 +910086 +196100
Addednpm/​@​types/​web@​0.0.2691001008993100

View full report

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex review

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex security review

@sidmorizon

Copy link
Copy Markdown
Contributor

@cursoragent review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@cursor

cursor Bot commented Aug 21, 2026

Copy link
Copy Markdown

PR #12969 代码审查报告

审查概要 [REQUIRED]

  • 变更范围: 434 个文件, +54139 / -5182 行
  • 风险等级: High
  • 涉及平台: Extension / Mobile / Desktop / Web
  • Codex 交叉验证: ⏭️ 未启用
  • PR 评论分析: ✅ 已分析 (6 条评论, 其中 3 条来自 Bot)

评分 [REQUIRED — NEVER SKIP THIS SECTION]

维度 得分 说明
🔒 安全性 7/10 无密钥泄漏、无新的 import 越界;LOCAL_DB_VERSION 19→20 Realm/IndexedDB 对齐。Desktop firmware IPC 的 host pin 可被 renderer 用 allowPreReleaseHosts: true 关掉。
💎 代码质量 5/10 两处 High:Windows Trezor 首次 BLE 配对被卸掉、Android Discovery 首页被冻结 WebView 盖住。High bug 封顶 5。
🏛️ 架构合理性 7/10 包边界干净,硬件面按 hotfix 收敛合理。错误点是把 OS BLE bonding 当成 “SDK 已接管”。
✅ 完整性 6/10 identityLifecycle / KeyTag / i18n / ipTable / DeviceSetup 步骤顺序保留了。#12866 的 retry 清 timer、#12955 的 Android hide style 没接回来。
总分 6.3/10 ⚠️ 需修改后复审

PR 评论分析 [REQUIRED]

来源 类型 发现 判定 说明
socket-security[bot] 🤖 Bot @onekeyfe/hd-* / hwk-* 1.1.34-alpha → 1.2.0-alpha.176,另加 @types/web-bluetooth ❌ Noise 全部是 OneKey 自有 hardware SDK / types。Socket 供应链分还升了,无 CVE、无陌生 maintainer。
@sidmorizon 👤 Human @codex review / @codex security review / @cursoragent review 📋 Already Covered 纯审查触发,无代码主张。
chatgpt-codex-connector[bot] 🤖 Bot Codex security review 额度用尽 ❌ Noise 无审查内容。
cursor[bot] 🤖 Bot Taking a look ❌ Noise 本审查的占位回复。

评论误报分析

  • [socket-security] 误报: 这些包是 @onekeyfe/* 硬件栈整批升到已发货的 6.5.2 alpha.176,不是第三方突然换 maintainer。质量分子项偏低是 Socket 对 alpha 的常规扣分,不能当漏洞。
  • [Trivy CI]: 136 条(含 4 critical)是大 diff 的扫描噪声面,不是本 PR 引入的可达路径。未当作 finding。

发现的问题 [REQUIRED]

[🔴 高] [🔵 High] Windows Trezor BLE 配对层被错误卸掉

文件: apps/desktop/app/app.ts:1667
类型: 运行时 / 硬件连接
描述: PR 写 “SDK owns pairing”。@onekeyfe/hwk-trezor-connector-electron-ble@1.2.0-alpha.176initTrezorBleSupport 只走 noble connectAsync,没有 WinRT PairAsync。未接线的 trezorBlePairing.ts:24-30 仍写明:noble 在 Windows 上完不成 OS bonding,未配对会 GATT Unreachable。origin/xcreateTrezorBlePairingIpcMain 包住 SDK IPC;HEAD 只留了 sender gate。onekey-ble-pair 仍打进 Windows 包但不再调用。这是相对 x#12641 回归,不是 “SDK 已覆盖”。
修复建议: 恢复 createTrezorBlePairingIpcMain(trezorBleSenderGatedIpcMain, browserWindow)。在 SDK 真正做 WinRT pairing 并完成 Windows Safe 7 首次绑定验证之前不要再删。


[🔴 高] [🔵 High] Android Discovery 首页被冻结 WebView 盖住

文件: packages/kit/src/views/Discovery/pages/Browser/Browser.native.tsx:593
类型: 运行时
描述: #12955 把 Android 内容放进 absoluteFill + zIndex: 3webPageLayer,但只关了 pointerEvents。同文件 iOS 路径用了 iosWebPageRootLayerHiddenopacity: 0, zIndex: 0)。origin/x Android 是 in-flow <Freeze>{content}</Freeze>。Browser tab + displayHomePage 时,上一页网页仍画在 Dashboard 上面,点击穿透到首页。
Auto-fix:

 style={[styles.webPageLayer, webPageAnimatedStyle]}
+ style={[
+   styles.webPageLayer,
+   webPageAnimatedStyle,
+   shouldShowRootWebPageLayer
+     ? styles.iosWebPageRootLayerVisible
+     : styles.iosWebPageRootLayerHidden,
+ ]}

[🟡 中] [🔵 High] DeviceSetup retry 不再取消待跳转的 Finalize

文件: packages/kit/src/views/Onboardingv2/pages/DeviceSetup.tsx:133
类型: 运行时
描述: #11814 整文件替换后,reconcile 只回了 #12866 的步骤顺序。origin/x 在每次 checkDeviceInitialized 开头 clearTimeout(navigateTimeoutRef),专门防:initialized → 1.2s 导航 → useConnectDeviceError 把卡片打成 Error → 1.2s 内点 Retry。HEAD 用 hasNavigatedToFinalizeRef 一次置位,Retry 不清 timer,第一次成功的 timeout 仍会 push(FinalizeWalletSetup)(该页 mount 就会开始建钱包)。
修复建议: 每次 check 开头清 timer、复位 sticky ref;timeout 回调按当前 run id / isPageActiveRef 再决定是否 navigate。


[🟡 中] [🟠 Medium] firmwareArtifact.download 信任 renderer 的 allowPreReleaseHosts

文件: packages/kit-bg/src/desktopApis/DesktopApiFirmwareArtifact.ts:99
类型: 安全
描述: 注释说只有 bg + developer mode + “Use pre-release config” 会带这个 flag。闸门在 renderer(getGatedFirmwareUpdateDevSetting)。Main 只看 IPC 字面量 true 就跳过 common.onekey-asset.com / web.onekey-asset.com pin。firmwareArtifact.download 在 allowlist 上。DApp webview 已被 sender-id 挡住,所以需要主窗口 renderer 被污染。结构校验(https、无 port/userinfo/hash)还在,expectedSha256 仍可选。
修复建议: Main 不要信这个 flag。用 main 自己的 setting 决定是否放行 pre-release host,或 IPC 边界直接丢掉该字段。


[🟡 中] [🟠 Medium] 用户 Cancel 走 SILENT_CALL,活着的 BLE session 对不上

文件: packages/kit-bg/src/services/ServiceHardware/ServiceHardware.ts:2735
类型: 运行时
描述: cancel()getCompatibleConnectId({ hardwareCallContext: SILENT_CALL })。USB 建档、没有 bleConnectId 时,:4708-4710 直接回 USB serial,不会走 OK-60091 的 live-BLE bind。UI 关闭路径往往已经拿着 SDK 事件里的 BLE UUID,withHardwareProcessing 再按 USB dbDevice.connectId 发第二次 Cancel。Onboarding / USB 记录 + 活着的 Noble BLE(正好是 OK-60091)上,wrapper Cancel 打不到 BLE session。
修复建议: 有 hasRecentLiveConnectIdEvidence 时,Cancel 用和 USER_INTERACTION 同一套 live-BLE bind(仍然不要弹配对框),或把 UI 事件的 BLE connectId 传进 withHardwareProcessing


[🟢 低] [🔵 High] OK-58649 skip 文案被 hotfix 覆盖(PR 已声明)

文件: packages/kit/src/views/Onboardingv2/pages/CheckAndUpdate.tsx:1041
类型: 规范
描述: PR 已写明 hotfix 赢、#12689 文案被取代。代码用 ETranslations.global_skip(按钮 “Skip”)。origin/xgenuine_check_skipped_title / firmware_check_skipped_title(“You skipped verification” / “You skipped the firmware check”),这两个 key 在 HEAD locale 里还在。保留的 OK-58649 行为:Skipped ≠ genuine、1S Pure 机型名、retry 立刻进 InProgress。
修复建议: 若产品还要 OK-58649 文案,把 skip title 换回那两个 key。否则把附近 “You skipped verification” 注释改掉,避免后人当回归。

修改清单 [REQUIRED]

优先级 置信度 文件 类型 描述 Auto-fix
🔴 高 🔵 High apps/desktop/app/app.ts:1667 运行时 恢复 Windows Trezor BLE pairing wrap
🔴 高 🔵 High Browser.native.tsx:593 运行时 Android 隐藏层补 iOS hide style
🟡 中 🔵 High DeviceSetup.tsx:133 运行时 retry 时清 Finalize timer
🟡 中 🟠 Medium DesktopApiFirmwareArtifact.ts:99 安全 host pin 不要信 renderer flag
🟡 中 🟠 Medium ServiceHardware.ts:2735 运行时 Cancel 应对齐 live BLE connectId
🟢 低 🔵 High CheckAndUpdate.tsx:1041 规范 skip 文案 / 注释与 #12689 不一致

测试建议 [REQUIRED]

  1. Windows Desktop + Trezor Safe 7,系统里从未配对过:BLE 扫描 → 连接。预期能走完 WinRT bonding,而不是 GATT Unreachable。再测已配对设备重连,确认 sender gate 仍挡住 DApp webview。
  2. Android Discovery:打开网页 → 回 Browser 首页。预期看到 Dashboard,不是上一页冻结网页;点击应打到首页,不是穿透错位。键盘弹出 / 底栏显隐各走一遍。
  3. Onboarding DeviceSetup(非 Pro 2):设备已初始化 → 出现 Ready → 1.2s 内制造连接错误 → 点 Retry。预期不应再跳进 FinalizeWalletSetup。Classic/Mini/Pro 步骤顺序仍应是 fix: correct Pro device setup step order OK-60126 #12866:Classic/Mini = choose→phrase→PIN;Pro = PIN→choose→phrase。
  4. Desktop BLE + 已有 USB 记录的 Pro 2/Neo:PIN/passphrase 弹层时点关闭。设备应退出 UI,不应卡在 PIN 页。
  5. Firmware update(生产 config):Pro 2 / Neo V3 计划、资源 ZIP、缺 hash / 畸形 hash 的 plan 都应失败关闭,而不是静默跳过校验。Developer + pre-release config 才应拉非 pin host。
  6. 回归 PR 已声明的判断:OK-58649 skip ≠ genuine、1S Pure 机型名;DeviceVideo 只有 -D;Earn banner 冷启动无 skeleton;Windows 以外的 USB 路由(OK-60693)。

已核对、不构成缺陷

  • LOCAL_DB_VERSION 20:Realm 增 deviceState / connectProtocol;IndexedDB 无列 schema,同一 version 常量;connectProtocol 有 bootstrap 迁移。
  • x-only:identityLifecycle.recoverInterruptedOperations、KeyTag testID、IBatchCreateCustomNetworkParams + oneKeyOperationLeaseapp:playground、en_US 5367 key、ServiceIpTable 均在。
  • DeviceVideo force-dark:HEAD 和 origin/x 都只有 -D;OneKey -L 两边都没有。
  • 无冲突标记、无 RELEASES.json / .env.version、无 localDbInstance、无 toLocaleLowerCase、无新的 value-level import 越界。
  • Passphrase / OK-59992 隐藏钱包 seeding、Vault keyring(Lightning Pro 2 硬拦、TON signing_message)看起来是有意改动。
  • Electron installPackage 仍有 dialog + process-bound path + GPG;firmware 落盘路径 userData/firmware-artifacts/{sha256}.bin 不可 traversal。

GH 评论操作 [REQUIRED]

以下问题已直接发为 inline comments:

  • Windows Trezor BLE pairing — apps/desktop/app/app.ts:1667
  • Android Discovery overlay — Browser.native.tsx:593
  • DeviceSetup retry timer — DeviceSetup.tsx:133

达标问题已在本回合直接发为 inline comments,无需再确认。

Open in Web Open in Cursor 

@originalix

originalix commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Automated code review found blocking issues

@originalix

Reviewed commit 32547077ac2f. This report always reflects the latest reviewed changes.

Review summary

The PR introduces a cross-platform firmware-artifact pipeline that moves manifest-derived plans through leased downloads, archive materialization, integrity receipts, SDK host bindings, desktop IPC, and native background execution. It also expands persisted hardware device state, transport selection, onboarding, portfolio synchronization, and CLI hardware-session handling across desktop, mobile, extension, web, and CLI paths. The new boundaries improve privileged-operation separation and lifecycle coverage, but malformed artifact integrity metadata can still weaken the firmware trust boundary before bytes reach hardware update APIs.

What needs attention: Verify that explicitly supplied but malformed firmware-plan integrity metadata is rejected before any artifact download, materialization, or hardware SDK handoff.

Issues to address

  • P1 · Malformed artifact integrity metadata is silently discarded
    • Impact: resolveFirmwarePlanArtifact converts any explicitly supplied but invalid expectedSha256 or expectedSize into undefined. downloadFirmwareArtifact then omits those constraints, and receipt validation accepts the adapter's self-reported hash or size as if no integrity requirement existed. A malformed or tampered plan can therefore pass arbitrary downloaded firmware bytes into the hardware update path.
    • Suggested action: Fail closed when expectedSha256 or expectedSize is present but invalid; distinguish an explicitly absent optional field from malformed metadata and reject the plan before starting any download or materialization.

Validation gaps

Targeted Jest, TypeScript, desktop, and native checks were not executed in this review pass. Regression tests should cover malformed hash and size values in addition to valid optional and absent metadata cases, then exercise the firmware capability and update-workflow suites together with the relevant desktop and native checks.

Comment thread packages/kit/src/views/Discovery/pages/Browser/Browser.native.tsx
Comment thread apps/desktop/app/app.ts
Comment thread packages/kit/src/views/Onboardingv2/pages/DeviceSetup.tsx

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e7ad6bf81

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/shared/src/locale/json/en_US.json
Comment thread packages/shared/src/hardware/protocolV2DeviceSettingsSchema.test.ts
Comment thread package.json
Comment thread packages/kit-bg/src/services/ServiceHardware/ServiceHardware.ts
Comment thread packages/kit-bg/src/dbs/simple/base/SimpleDb.ts
Comment thread packages/kit/src/views/Setting/pages/Tab/CustomElement.tsx Outdated
Comment thread packages/kit-bg/src/services/ServiceSetting.desktopBluetooth.test.ts Outdated
Comment thread package.json

@originalix originalix left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@originalix

Automated code review found blocking issues

Reviewed commit 951144ef4e7a.

  • P1 · Malformed artifact integrity metadata is silently discarded

View the full review report

Comment thread apps/mobile/scripts/check-bundle-architecture.js Outdated

@originalix originalix left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@originalix

Automated code review found blocking issues

Reviewed commit 043bf6b78de7.

  • P1 · Malformed artifact integrity metadata is silently discarded

View the full review report

Comment thread apps/mobile/package.json

@originalix originalix left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@originalix

Automated code review found blocking issues

Reviewed commit 32547077ac2f.

  • P1 · Malformed artifact integrity metadata is silently discarded

View the full review report

@originalix
originalix merged commit 923d2f3 into x Aug 22, 2026
21 of 22 checks passed
@originalix
originalix deleted the sync/6.5.2-hw-20260821 branch August 22, 2026 04:41
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.

8 participants