Skip to content

fix: verify resource headers after protocol v2 writes - #927

Closed
wabicai wants to merge 1 commit into
onekeyfrom
fix/firmware-resource-diagnostics
Closed

wabicai wants to merge 1 commit into
onekeyfrom
fix/firmware-resource-diagnostics

Conversation

@wabicai

@wabicai wabicai commented Sep 8, 2026

Copy link
Copy Markdown
Member

Protocol V2 resource writes currently check transfer acknowledgements and file size, but do not read back the written package header. Read it back in loader mode and reuse the existing size/version/payload-hash/header-hash comparison, including forced updates and the actual staging path.

Successful calls containing resources return resourceVerification: "header-verified"; unchanged resources must pass the existing comparison. Resource write or read-back failures carry params.resourceVerification: "failed" while preserving existing hardware error codes. Calls without resources omit the field.

This checks package headers, not a fresh hash of the full on-device payload or resource mounting after reboot. It reuses the filesystem commands supported by bootloader 1.0.0 and does not change reboot orchestration or device permissions. Read-back adds 24,464 bytes per written package, using the existing transport read limits.

Companion App reporting: OneKeyHQ/app-monorepo#13255

Validation: yarn agent:check --profile commit and --profile pr passed, including Core tests (1,306 passed; 4 skipped), full lint/tests/build and package version consistency. Focused regression cases cover forced writes, staging-path read-back, matching headers and stale headers. No physical-device run.

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