Skip to content

Fix/ledger 3rdparty ux OK-53907 OK-53916 OK-53969 OK-53970 OK-53973 OK-53977 OK-53981 OK-54115 OK-54131 OK-54130 OK-54148 OK-54169 OK-54171 #11512

Merged
ByteZhang1024 merged 13 commits into
xfrom
fix/ledger-3rdparty-ux
May 8, 2026
Merged

Fix/ledger 3rdparty ux OK-53907 OK-53916 OK-53969 OK-53970 OK-53973 OK-53977 OK-53981 OK-54115 OK-54131 OK-54130 OK-54148 OK-54169 OK-54171 #11512
ByteZhang1024 merged 13 commits into
xfrom
fix/ledger-3rdparty-ux

Conversation

@ByteZhang1024
Copy link
Copy Markdown
Contributor

@ByteZhang1024 ByteZhang1024 commented May 8, 2026

…cy skip, BTC 100+ gate, SDK-driven searching)

- portfolio "create address": surface every per-network failure verbatim. Was silently swallowed for HW wallets (only QR throw path handled).
- legacy xfp data update banner: skip for third-party HW. Ledger identifies via chain fingerprint + BLE hex id and never has a valid xfp by design, so the prompt can't be satisfied.
- BTC App returns 6a82 for account index ≥ 100 unless display=true. SDK now gates via REQUEST_BTC_HIGH_INDEX_CONFIRM ui-request: prompt the user once per adapter session, then auto-promote checkOnDevice for the rest of that session (the device itself still requires per-call physical confirmation).
- "searching" UI state is now SDK-driven via EConnectorInteraction.Searching emitted at every _doConnect loop iteration. Removed the monorepo-side primers in ServiceHardwareUI and kit-bg LedgerAdapter so the toast reappears after the device-not-found dialog instead of staying silent for ~7s.
- thirdPartyHardwareUiResponse is now a pure passthrough — caller passes the SDK-shaped IAdapterUiResponse, service no longer interprets the action and chooses the response type.
- Move toast cancel from <Toast.Close> wrapper to explicit close-button
  onPress so only user intent rejects in-flight SDK _uiRegistry.wait;
  programmatic atom transitions no longer trip cancel.
- handleToastUserClose wraps thirdPartyHardwareCancel in try/finally so
  the UI atom always clears even if the cancel RPC throws.
- Subscribe ShowThirdPartyHardwarePermissionDialog and route BLE
  permission errors (bluetoothTurnedOff vs others) to the matching
  HardwareDialog component.
- Reset the 8s close-button delay on action change so each new toast
  slice gets its own grace window.
- Switch Ledger onboarding orphan cleanup from setWalletTempStatus
  soft-hide to removeFailedOnboardingHwWallet hard-delete; eligibility
  list moves from local LEDGER_ORPHAN_HIDE_CODES to the SDK-exported
  ORPHAN_ELIGIBLE_ERROR_CODES so the set stays in lockstep with the SDK.
- Fix ThirdPartyAppNotInstalled.code which was wrongly AppNotOpen; sync
  the AppNotInstalled mapping in convertThirdPartyDeviceError and the
  AppNotInstalled filter in addAccountsForAllNetwork.
- Carry permissionDeniedReason through the error pipeline (params hop
  in deviceErrorUtils -> convertThirdPartyDeviceError ->
  ThirdPartyDevicePermissionDenied) so reason-aware copy lands in the UI
  and the BLE permission dialog can branch on it.
- Add EThirdPartyDevicePermissionDeniedReason enum and pick the i18n
  default key by reason (bluetoothTurnedOff vs permissionDenied).
- Add ThirdPartyBlePairingTimeout for the SDK BLE SMP 30s window so
  generic OperationTimeout does not swallow pairing failures.
- Add ShowThirdPartyHardwarePermissionDialog appEventBus event and a
  checkBLEState helper for early state probing.
- @onekeyfe/hwk-adapter-core
- @onekeyfe/hwk-ledger-adapter
- @onekeyfe/hwk-ledger-connector-ble
- @onekeyfe/hwk-ledger-connector-webhid
- Extract device->SearchDevice mapping into thirdPartyDeviceMapping.ts
  so ServiceHardware.searchDevices can hand off the BLE/USB/bridge
  branching to a single helper. The helper rejects BLE devices without
  a stable 4-hex connectId and applies the UUID-like fallback for USB
  labels in one place.
- Surface BLE state vs permission separately in the adapter registry:
  checkBLEPermissions denied -> permissionDenied, BLE turned off ->
  bluetoothTurnedOff. Carry the reason in RECEIVE_DEVICE_PERMISSION
  payload and emit ShowThirdPartyHardwarePermissionDialog so the UI
  routes to the matching dialog.
- Drop the third-party USB<->BLE compatibility branch in
  getDeviceConnectIdSwitched: third-party connectId already matches the
  active transport.
- Trim verbose comments across LedgerAdapter / atoms / ServiceHardwareUI
  to keep the SDK-driven contracts terse; behaviour unchanged.
- Allow empty connectId for non-USB third-party transports in both
  LocalDbBase.createHwWallet and ServiceAccount.createHWWalletBase;
  Ledger BLE has a stable id, USB/bridge does not, so the guard now
  only applies to vendors with persistent USB connectId.
- ServiceBatchCreateAccount: source third-party batch-abort error codes
  from the SDK-exported ORPHAN_ELIGIBLE_ERROR_CODES instead of an
  open-coded UserAborted/DeviceDisconnected/DeviceAppStuck list, so the
  set tracks the SDK.
- vaults/factory: replace synchronous ThirdPartyChainNotSupported
  throws with a ThirdPartyUnsupportedKeyringStub that defers the error
  until a keyring method actually runs, letting vault-level lookups
  (e.g. network selector) survive on unsupported chains.
- KeyringHardwareLedger: i18n the BIP-322 NotImplemented error.
- ConnectionFlowLedger: drop the duplicate RequireBlePermissionDialog;
  the ShowThirdPartyHardwarePermissionDialog event from the registry
  now drives this dialog from a single place in
  ThirdPartyHardwareUiStateContainer.
@revan-zhang
Copy link
Copy Markdown
Contributor

revan-zhang commented May 8, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

ByteZhang1024 and others added 4 commits May 8, 2026 17:31
SDK ConnectionType union is 'usb' | 'ble' only — 'bridge' was never a
runtime value (bridge transport is a runtime construct created via
createBridgedConnector, not a ConnectionType). TS check on x flagged
the unreachable case.
@ByteZhang1024 ByteZhang1024 changed the title Fix/ledger 3rdparty ux Fix/ledger 3rdparty ux OK-53907 OK-53916 OK-53969 OK-53970 OK-53973 OK-53977 OK-53981 OK-54115 OK-54131 OK-54130 OK-54148 OK-54169 OK-54171 May 8, 2026
@socket-security
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
Added@​aptos-labs/​ts-sdk@​1.39.09710010050100
Added@​babel/​plugin-proposal-class-properties@​7.18.61001006550100
Added@​babel/​plugin-proposal-class-static-block@​7.21.01001007150100
Added@​babel/​plugin-proposal-nullish-coalescing-operator@​7.18.61001007050100
Added@​babel/​plugin-proposal-private-methods@​7.18.61001006550100
Added@​babel/​plugin-proposal-private-property-in-object@​7.21.111001007350100
Added@​babel/​plugin-transform-numeric-separator@​7.25.91001006793100
Added@​alephium/​web3@​1.5.292100779670
Added@​cowprotocol/​contracts@​1.7.0881001008470
Added@​expo/​plist@​0.1.37410071100100
Added@​magiceden-oss/​open_creator_protocol@​0.3.5921007281100
Added@​types/​node-fetch@​2.6.91001007281100
Added@​aptos-labs/​siwa@​0.4.0771007387100
Added@​babel/​preset-typescript@​7.27.11001007393100
Addedesbuild@​0.27.2911007390100
Added@​keystonehq/​keystone-sdk@​0.4.1841007490100
Updated@​babel/​plugin-transform-optional-chaining@​7.27.1 ⏵ 7.25.9100 +110074 +193100
Added@​formatjs/​intl-pluralrules@​4.3.31001007497100
Addedexpo-keep-awake@​14.1.47410082100100
Added@​formatjs/​intl-locale@​2.4.471001007596100
Added@​aivenio/​tsc-output-parser@​2.1.19910010075100
Added@​formatjs/​intl-getcanonicallocales@​1.9.21001007696100
Added@​babel/​preset-env@​7.28.6971007797100
Added@​glif/​filecoin-rpc-client@​3.0.27710010081100
Added@​benfen/​bfc.js@​0.2.7821007784100
Added@​babel/​core@​7.27.1971008094100
Added@​glif/​filecoin-message@​2.0.44801008184100
Added@​electron/​remote@​2.1.110010010081100
Added@​cityofzion/​neon-core@​5.7.0861008186100
Added@​ckb-lumos/​ckb-indexer@​0.23.08110010083100
Added@​backpackapp-io/​react-native-toast@​0.14.09910010082100
Added@​electron/​notarize@​2.3.210010010082100
Added@​emurgo/​cardano-message-signing-nodejs@​1.0.1911008285100
See 11 more rows in the dashboard

View full report

@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @emurgo/cardano-message-signing-asmjs is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/@emurgo/cardano-message-signing-asmjs@1.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@emurgo/cardano-message-signing-asmjs@1.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm @ledgerhq/device-management-kit is 93.0% likely obfuscated

Confidence: 0.93

Location: Package overview

From: ?npm/@ledgerhq/device-management-kit@1.2.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@ledgerhq/device-management-kit@1.2.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@ByteZhang1024 ByteZhang1024 enabled auto-merge (squash) May 8, 2026 12:17
@ByteZhang1024 ByteZhang1024 merged commit c4d5a48 into x May 8, 2026
12 checks passed
@ByteZhang1024 ByteZhang1024 deleted the fix/ledger-3rdparty-ux branch May 8, 2026 12:57
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.

4 participants