iOS: apply bsdiff patches during package install - #48
Draft
ofalvai wants to merge 1 commit into
Draft
Conversation
ofalvai
force-pushed
the
ios-apply-patches
branch
from
August 28, 2026 14:20
c9f5d13 to
5aefe55
Compare
ofalvai
force-pushed
the
ios-apply-patches
branch
from
August 31, 2026 12:10
5aefe55 to
2a740c0
Compare
ofalvai
force-pushed
the
ios-apply-patches
branch
from
September 3, 2026 10:48
2a740c0 to
316a439
Compare
ofalvai
force-pushed
the
ios-apply-patches
branch
from
September 8, 2026 10:22
316a439 to
221514a
Compare
ofalvai
force-pushed
the
ios-apply-patches
branch
from
September 8, 2026 10:50
221514a to
f86f490
Compare
ofalvai
commented
Sep 8, 2026
| NSArray *deletedFiles = manifestJSON[@"deletedFiles"]; | ||
| for (NSString *deletedFileName in deletedFiles) { | ||
| NSString *absoluteDeletedFilePath = [newUpdateFolderPath stringByAppendingPathComponent:deletedFileName]; | ||
| if (error) { |
Collaborator
Author
There was a problem hiding this comment.
Bug: unhandled error from [NSJSONSerialization JSONObjectWithData] :)
ofalvai
removed this pull request from stack #41
September 9, 2026 06:38
ofalvai
force-pushed
the
ios-apply-patches
branch
from
September 9, 2026 06:47
f86f490 to
80a906d
Compare
ofalvai
changed the base branch from
ios-sha256-refactor
to
ios-binary-diff-patcher
September 9, 2026 06:47
ofalvai
added this pull request to stack #57
September 9, 2026 06:47
ofalvai
force-pushed
the
ios-apply-patches
branch
from
September 9, 2026 15:37
80a906d to
813d75f
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Duplicate Xcode object IDs, a breaking public selector change, and missing install-orchestration coverage must be addressed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds opt-in iOS support for applying bsdiff patches during package installation.
Changes:
- Parses and validates diff manifests before safely applying binary patches.
- Adds the
CodePushEnableDeltaUpdatesconfiguration flag. - Updates iOS project wiring and setup documentation.
File summaries
| File | Description |
|---|---|
ios/CodePush/CodePushPackage.m |
Integrates manifest validation and binary patch application. |
ios/CodePush/CodePushConfig.m |
Reads the delta-update flag from Info.plist. |
ios/CodePush/CodePush.m |
Passes the configuration into package downloads. |
ios/CodePush/CodePush.h |
Exposes the flag and updated download method. |
ios/CodePush.xcodeproj/project.pbxproj |
Adds binary patcher test-target references. |
docs/setup-ios.md |
Documents enabling delta updates. |
Review details
Suppressed comments (1)
ios/CodePush.xcodeproj/project.pbxproj:204
- This PBXFileReference uses the same object ID as the existing definition at line 207. Duplicate PBX object keys can be collapsed or rejected by Xcode tooling; remove the duplicate definition so the test file has one reference object.
F42FA68BF21AED765F55E71A /* CodePushBinaryDiffPatcherTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CodePushBinaryDiffPatcherTests.swift; sourceTree = "<group>"; };
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /* Begin PBXBuildFile section */ | ||
| 08B8B3B8260E70B7ECA85451 /* bspatch_bridge.c in Sources */ = {isa = PBXBuildFile; fileRef = A430CBE260F09A3233110E28 /* bspatch_bridge.c */; }; | ||
| BBC7F97A68E454FB38953FC4 /* CodePushDiffManifestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9645879798B46D35D8D824F8 /* CodePushDiffManifestTests.swift */; }; | ||
| 3643F3729205426163367671 /* CodePushBinaryDiffPatcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F42FA68BF21AED765F55E71A /* CodePushBinaryDiffPatcherTests.swift */; }; |
| + (void)downloadPackage:(NSDictionary *)updatePackage | ||
| expectedBundleFileName:(NSString *)expectedBundleFileName | ||
| publicKey:(NSString *)publicKey | ||
| enableDeltaUpdates:(BOOL)enableDeltaUpdates |
Comment on lines
+45
to
+49
| if (diffManifest.version > 2 || diffManifest.version < 1) { | ||
| *error = [CodePushErrorUtils errorWithMessage: | ||
| [NSString stringWithFormat:@"Diff manifest version %ld is not supported by this SDK version.", (long)diffManifest.version]]; | ||
| return NO; | ||
| } else if (diffManifest.version == 2 && !enableDeltaUpdates) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
iOS counterpart of #42 and #43. Builds on top of #44 and #47.
Summary of changes
Existing package install code in
CodePushPackage.mhas a lot of questionable untrusted file path handling code, as well as a few bugs that I fixed along the way. Unfortunately, the iOS SDK has no equivalent of Java'sso this PR is a bit bigger than what I expected.