Skip to content

Android: opt-in flag for bsdiff patches - #43

Open
ofalvai wants to merge 1 commit into
android-apply-patchesfrom
android-opt-in-bsdiff
Open

Android: opt-in flag for bsdiff patches#43
ofalvai wants to merge 1 commit into
android-apply-patchesfrom
android-opt-in-bsdiff

Conversation

@ofalvai

@ofalvai ofalvai commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

It's probably a good idea to make #42 an opt-in behavior, at least initially.

@ofalvai
ofalvai force-pushed the android-opt-in-bsdiff branch from fa5c3fb to 0c6be11 Compare August 24, 2026 15:49
@ofalvai ofalvai changed the title android opt in bsdiff Android: opt-in flag for bsdiff patches Aug 24, 2026
@ofalvai
ofalvai requested a balanced review from Copilot August 25, 2026 10:08

Copilot AI 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.

Pull request overview

Adds opt-in Android support for applying bsdiff patches during CodePush differential updates.

Changes:

  • Adds v2 diff-manifest parsing, SHA-256 validation, safe path resolution, and binary patch application.
  • Introduces the CodePushEnableBinaryDiffUpdates Android resource flag.
  • Adds unit tests, fixtures, and documentation.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/api-android.md Documents the opt-in flag.
android/app/build.gradle Adds JSON test dependency.
android/app/src/main/java/com/microsoft/codepush/react/CodePush.java Reads the resource flag.
android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java Defines the patch directory.
android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java Integrates v2 patch handling.
android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java Uses parsed manifests and shared hashing.
android/app/src/main/java/com/microsoft/codepush/react/diffpatch/BinaryDiffPatcher.kt Validates and applies patches.
android/app/src/main/java/com/microsoft/codepush/react/diffpatch/DiffManifest.kt Parses diff manifests.
android/app/src/main/java/com/microsoft/codepush/react/diffpatch/DiffPatch.kt Adds an injectable patch interface.
android/app/src/main/java/com/microsoft/codepush/react/diffpatch/Sha256.kt Implements SHA-256 helpers.
android/app/src/test/java/com/microsoft/codepush/react/diffpatch/BinaryDiffPatcherTest.kt Tests patching behavior and safety.
android/app/src/test/java/com/microsoft/codepush/react/diffpatch/DiffManifestTest.kt Tests manifest parsing.
android/app/src/test/java/com/microsoft/codepush/react/diffpatch/Sha256Test.kt Tests hashing behavior.
android/app/src/test/resources/binarydiff/basic/old.dat Provides the source fixture.
android/app/src/test/resources/binarydiff/basic/new.dat Provides the expected fixture.
android/app/src/test/resources/binarydiff/basic/patch.bsdiff Provides the binary patch fixture.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java Outdated
Comment thread android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java Outdated
@ofalvai
ofalvai force-pushed the android-opt-in-bsdiff branch from 0c6be11 to 36ca242 Compare August 25, 2026 10:20
@ofalvai
ofalvai force-pushed the android-opt-in-bsdiff branch from 36ca242 to 4b8a0e1 Compare August 25, 2026 10:22
@ofalvai
ofalvai marked this pull request as ready for review August 25, 2026 10:22
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.

2 participants