Skip to content

Fix missing hash verification - #49

Draft
ofalvai wants to merge 1 commit into
masterfrom
push-uzwkruuvynnv
Draft

Fix missing hash verification#49
ofalvai wants to merge 1 commit into
masterfrom
push-uzwkruuvynnv

Conversation

@ofalvai

@ofalvai ofalvai commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Why

Android and iOS skipped hash verification entirely for a full (non-diff), unsigned update — the most common deployment setup — so a corrupted or tampered download could install with no integrity check. Diff updates were still verified in the same unsigned config, so the gap was specific to full updates.

The e2e suite never caught this because the mock update server sent a random package_hash disconnected from the actual bundle it served.

What

  • Android (CodePushUpdateManager.java) and iOS (CodePushPackage.m): hash verification now always runs, regardless of diff/full or signing status. Signature verification still only runs when a public key is configured.
  • Mock test server: now computes and serves the real hash of each update archive it builds, so the e2e suite exercises real verification instead of a random placeholder.
Public key Signature in bundle Update type Before After
Yes Yes Any Verified Unchanged
Yes No Any Rejected Unchanged
No Yes Any Verified (+warning) Unchanged
No No Diff Verified Unchanged
No No Full Not verified Verified (this PR)

Decisions

  • Rewrote localPackage.install.revert.dorevert to match actual native rollback behavior (rejected on the first revert, not the second) — it only passed before because the mock's random hash bug made a re-served identical package look like a different one on retry.
  • No new hash-mismatch/signing test scenarios added; scoped to fixing the gap.
  • Verified: Android e2e (44/44) and iOS e2e (44/44) both passing, with real hash checks exercised on every install/download scenario.

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