Skip to content

Commit 94cda44

Browse files
committed
update ios xcode preject;
1 parent 2097ce3 commit 94cda44

File tree

6 files changed

+107
-28
lines changed

6 files changed

+107
-28
lines changed

ios/RCTPushy.xcodeproj/project.pbxproj

+54
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
249F2F50261C577300A1E60E /* HDiffPatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 249F2F4E261C577300A1E60E /* HDiffPatch.m */; };
11+
249F2F55261C584900A1E60E /* hpatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 249F2F54261C584900A1E60E /* hpatch.c */; };
12+
249F2F59261C586900A1E60E /* file_for_patch.c in Sources */ = {isa = PBXBuildFile; fileRef = 249F2F58261C586900A1E60E /* file_for_patch.c */; };
13+
249F2F5E261C589D00A1E60E /* patch.c in Sources */ = {isa = PBXBuildFile; fileRef = 249F2F5C261C589D00A1E60E /* patch.c */; };
14+
249F2F64261C58C700A1E60E /* Lzma2Dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 249F2F60261C58C700A1E60E /* Lzma2Dec.c */; };
15+
249F2F65261C58C700A1E60E /* LzmaDec.c in Sources */ = {isa = PBXBuildFile; fileRef = 249F2F62261C58C700A1E60E /* LzmaDec.c */; };
1016
91C5F0031C76ECA90037E727 /* RCTPushy.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 91C5F0021C76ECA90037E727 /* RCTPushy.h */; };
1117
91C5F0051C76ECA90037E727 /* RCTPushy.m in Sources */ = {isa = PBXBuildFile; fileRef = 91C5F0041C76ECA90037E727 /* RCTPushy.m */; };
1218
9F1BCB1D1CAE5937000EF2CB /* RCTPushyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1BCB1C1CAE5937000EF2CB /* RCTPushyManager.m */; };
@@ -43,6 +49,19 @@
4349
/* End PBXCopyFilesBuildPhase section */
4450

4551
/* Begin PBXFileReference section */
52+
249F2F4E261C577300A1E60E /* HDiffPatch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HDiffPatch.m; sourceTree = "<group>"; };
53+
249F2F4F261C577300A1E60E /* HDiffPatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HDiffPatch.h; sourceTree = "<group>"; };
54+
249F2F53261C584900A1E60E /* hpatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hpatch.h; path = ../../../android/jni/hpatch.h; sourceTree = "<group>"; };
55+
249F2F54261C584900A1E60E /* hpatch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hpatch.c; path = ../../../android/jni/hpatch.c; sourceTree = "<group>"; };
56+
249F2F57261C586900A1E60E /* file_for_patch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_for_patch.h; path = ../../../android/jni/HDiffPatch/file_for_patch.h; sourceTree = "<group>"; };
57+
249F2F58261C586900A1E60E /* file_for_patch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = file_for_patch.c; path = ../../../android/jni/HDiffPatch/file_for_patch.c; sourceTree = "<group>"; };
58+
249F2F5B261C589C00A1E60E /* patch_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = patch_types.h; path = ../../../android/jni/HDiffPatch/libHDiffPatch/HPatch/patch_types.h; sourceTree = "<group>"; };
59+
249F2F5C261C589D00A1E60E /* patch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = patch.c; path = ../../../android/jni/HDiffPatch/libHDiffPatch/HPatch/patch.c; sourceTree = "<group>"; };
60+
249F2F5D261C589D00A1E60E /* patch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = patch.h; path = ../../../android/jni/HDiffPatch/libHDiffPatch/HPatch/patch.h; sourceTree = "<group>"; };
61+
249F2F60261C58C700A1E60E /* Lzma2Dec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Lzma2Dec.c; path = ../../../android/jni/lzma/C/Lzma2Dec.c; sourceTree = "<group>"; };
62+
249F2F61261C58C700A1E60E /* Lzma2Dec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Lzma2Dec.h; path = ../../../android/jni/lzma/C/Lzma2Dec.h; sourceTree = "<group>"; };
63+
249F2F62261C58C700A1E60E /* LzmaDec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = LzmaDec.c; path = ../../../android/jni/lzma/C/LzmaDec.c; sourceTree = "<group>"; };
64+
249F2F63261C58C700A1E60E /* LzmaDec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LzmaDec.h; path = ../../../android/jni/lzma/C/LzmaDec.h; sourceTree = "<group>"; };
4665
91C5EFFF1C76ECA90037E727 /* libRCTPushy.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTPushy.a; sourceTree = BUILT_PRODUCTS_DIR; };
4766
91C5F0021C76ECA90037E727 /* RCTPushy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTPushy.h; sourceTree = "<group>"; };
4867
91C5F0041C76ECA90037E727 /* RCTPushy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTPushy.m; sourceTree = "<group>"; };
@@ -102,6 +121,34 @@
102121
/* End PBXFrameworksBuildPhase section */
103122

104123
/* Begin PBXGroup section */
124+
249F2F4D261C56E100A1E60E /* HDiffPatch */ = {
125+
isa = PBXGroup;
126+
children = (
127+
249F2F52261C581200A1E60E /* hpatch */,
128+
249F2F4F261C577300A1E60E /* HDiffPatch.h */,
129+
249F2F4E261C577300A1E60E /* HDiffPatch.m */,
130+
);
131+
path = HDiffPatch;
132+
sourceTree = "<group>";
133+
};
134+
249F2F52261C581200A1E60E /* hpatch */ = {
135+
isa = PBXGroup;
136+
children = (
137+
249F2F60261C58C700A1E60E /* Lzma2Dec.c */,
138+
249F2F61261C58C700A1E60E /* Lzma2Dec.h */,
139+
249F2F62261C58C700A1E60E /* LzmaDec.c */,
140+
249F2F63261C58C700A1E60E /* LzmaDec.h */,
141+
249F2F5B261C589C00A1E60E /* patch_types.h */,
142+
249F2F5C261C589D00A1E60E /* patch.c */,
143+
249F2F5D261C589D00A1E60E /* patch.h */,
144+
249F2F58261C586900A1E60E /* file_for_patch.c */,
145+
249F2F57261C586900A1E60E /* file_for_patch.h */,
146+
249F2F54261C584900A1E60E /* hpatch.c */,
147+
249F2F53261C584900A1E60E /* hpatch.h */,
148+
);
149+
name = hpatch;
150+
sourceTree = "<group>";
151+
};
105152
91C5EFF61C76ECA90037E727 = {
106153
isa = PBXGroup;
107154
children = (
@@ -121,6 +168,7 @@
121168
91C5F0011C76ECA90037E727 /* RCTPushy */ = {
122169
isa = PBXGroup;
123170
children = (
171+
249F2F4D261C56E100A1E60E /* HDiffPatch */,
124172
9F1BCB381CAF6B3E000EF2CB /* BSDiff */,
125173
9F394D571C7C25DC00C794C0 /* SSZipArchive */,
126174
91C5F0021C76ECA90037E727 /* RCTPushy.h */,
@@ -272,19 +320,25 @@
272320
9F394D871C7C25DC00C794C0 /* mztools.c in Sources */,
273321
9F394D821C7C25DC00C794C0 /* hmac.c in Sources */,
274322
9F394D881C7C25DC00C794C0 /* unzip.c in Sources */,
323+
249F2F65261C58C700A1E60E /* LzmaDec.c in Sources */,
275324
9F1BCB1D1CAE5937000EF2CB /* RCTPushyManager.m in Sources */,
325+
249F2F5E261C589D00A1E60E /* patch.c in Sources */,
276326
9F1BCB4F1CAF6B68000EF2CB /* BSDiff.m in Sources */,
277327
9F394D7E1C7C25DC00C794C0 /* aeskey.c in Sources */,
278328
9F394D7F1C7C25DC00C794C0 /* aestab.c in Sources */,
279329
9F394D7D1C7C25DC00C794C0 /* aescrypt.c in Sources */,
280330
9F394D801C7C25DC00C794C0 /* entropy.c in Sources */,
281331
9F292F7D1C7C44290095945D /* RCTPushyDownloader.m in Sources */,
332+
249F2F64261C58C700A1E60E /* Lzma2Dec.c in Sources */,
333+
249F2F55261C584900A1E60E /* hpatch.c in Sources */,
282334
9F394D831C7C25DC00C794C0 /* prng.c in Sources */,
283335
9F394D861C7C25DC00C794C0 /* ioapi.c in Sources */,
284336
9F1BCB461CAF6B3E000EF2CB /* bspatch.c in Sources */,
285337
9F394D8A1C7C25DC00C794C0 /* SSZipArchive.m in Sources */,
338+
249F2F50261C577300A1E60E /* HDiffPatch.m in Sources */,
286339
9F394D891C7C25DC00C794C0 /* zip.c in Sources */,
287340
9F394D841C7C25DC00C794C0 /* pwd2key.c in Sources */,
341+
249F2F59261C586900A1E60E /* file_for_patch.c in Sources */,
288342
91C5F0051C76ECA90037E727 /* RCTPushy.m in Sources */,
289343
);
290344
runOnlyForDeploymentPostprocessing = 0;

ios/RCTPushy/BSDiff/BSDiff.h

-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@
1414
origin:(NSString *)origin
1515
toDestination:(NSString *)destination;
1616

17-
+ (BOOL)hdiffPatch:(NSString *)path
18-
origin:(NSString *)origin
19-
toDestination:(NSString *)destination;
20-
2117
@end

ios/RCTPushy/BSDiff/BSDiff.m

-23
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#import "BSDiff.h"
1010
#include "bspatch.h"
11-
#include "../../../android/jni/hpatch.h"
1211

1312
@implementation BSDiff
1413

@@ -34,26 +33,4 @@ + (BOOL)bsdiffPatch:(NSString *)patch
3433
return YES;
3534
}
3635

37-
+ (BOOL)hdiffPatch:(NSString *)patch
38-
origin:(NSString *)origin
39-
toDestination:(NSString *)destination
40-
{
41-
if (![[NSFileManager defaultManager] fileExistsAtPath:patch]) {
42-
return NO;
43-
}
44-
if (![[NSFileManager defaultManager] fileExistsAtPath:origin]) {
45-
return NO;
46-
}
47-
48-
if ([[NSFileManager defaultManager] fileExistsAtPath:destination]) {
49-
[[NSFileManager defaultManager] removeItemAtPath:destination error:nil];
50-
}
51-
52-
int err = hpatch_by_file([origin UTF8String], [destination UTF8String], [patch UTF8String]);
53-
if (err) {
54-
return NO;
55-
}
56-
return YES;
57-
}
58-
5936
@end

ios/RCTPushy/HDiffPatch/HDiffPatch.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// HDiffPatch.h
3+
// RCTPushy
4+
//
5+
// Created by HouSisong, All rights reserved.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
10+
@interface HDiffPatch : NSObject
11+
12+
+ (BOOL)hdiffPatch:(NSString *)path
13+
origin:(NSString *)origin
14+
toDestination:(NSString *)destination;
15+
16+
@end

ios/RCTPushy/HDiffPatch/HDiffPatch.m

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// BSDiff.m
3+
// RCTPushy
4+
//
5+
// Created by HouSisong, All rights reserved.
6+
//
7+
8+
#import "HDiffPatch.h"
9+
#include "../../../android/jni/hpatch.h"
10+
11+
@implementation HDiffPatch
12+
13+
+ (BOOL)hdiffPatch:(NSString *)patch
14+
origin:(NSString *)origin
15+
toDestination:(NSString *)destination
16+
{
17+
if (![[NSFileManager defaultManager] fileExistsAtPath:patch]) {
18+
return NO;
19+
}
20+
if (![[NSFileManager defaultManager] fileExistsAtPath:origin]) {
21+
return NO;
22+
}
23+
24+
if ([[NSFileManager defaultManager] fileExistsAtPath:destination]) {
25+
[[NSFileManager defaultManager] removeItemAtPath:destination error:nil];
26+
}
27+
28+
int err = hpatch_by_file([origin UTF8String], [destination UTF8String], [patch UTF8String]);
29+
if (err) {
30+
return NO;
31+
}
32+
return YES;
33+
}
34+
35+
@end

ios/RCTPushy/RCTPushyManager.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "RCTPushyManager.h"
1010
#import "ZipArchive.h"
1111
#import "BSDiff.h"
12+
#import "HDiffPatch.h"
1213
#import "bspatch.h"
1314

1415
@implementation RCTPushyManager {
@@ -94,7 +95,7 @@ - (void)hdiffFileAtPath:(NSString *)path
9495
completionHandler:(void (^)(BOOL success))completionHandler
9596
{
9697
dispatch_async(_opQueue, ^{
97-
BOOL success = [BSDiff hdiffPatch:path origin:origin toDestination:destination];
98+
BOOL success = [HDiffPatch hdiffPatch:path origin:origin toDestination:destination];
9899
if (completionHandler) {
99100
completionHandler(success);
100101
}

0 commit comments

Comments
 (0)