@revopush/react-native-code-push 1.5.0 → 2.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CodePush.js +8 -5
- package/CodePush.podspec +9 -0
- package/android/build.gradle +52 -40
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +3 -1
- package/android/gradle.properties +1 -1
- package/android/libs/revopush-diff-release-v0.0.1.aar +0 -0
- package/android/settings.gradle +31 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePush.java +8 -4
- package/android/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +11 -7
- package/android/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +48 -41
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +67 -175
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +7 -244
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +16 -51
- package/android/src/main/java/com/microsoft/codepush/react/FileUtils.java +1 -130
- package/ios/CodePush/CodePush.h +1 -30
- package/ios/CodePush/CodePush.m +23 -7
- package/ios/CodePush/CodePushPackage.m +363 -294
- package/ios/CodePush/CodePushUpdateUtils.m +77 -28
- package/ios/CodePush.xcodeproj/project.pbxproj +0 -18
- package/ios/Frameworks/DiffUpdates.xcframework/Info.plist +44 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64/DiffUpdates.framework/DiffUpdates +0 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64/DiffUpdates.framework/Headers/DiffUpdates.h +61 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64/DiffUpdates.framework/Info.plist +0 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64/DiffUpdates.framework/Modules/module.modulemap +6 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/DiffUpdates +0 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/Headers/DiffUpdates.h +61 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/Info.plist +0 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/Modules/module.modulemap +6 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/_CodeSignature/CodeRequirements +0 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/_CodeSignature/CodeResources +132 -0
- package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64_x86_64-simulator/DiffUpdates.framework/_CodeSignature/CodeSignature +0 -0
- package/package.json +2 -2
- package/request-fetch-adapter.js +2 -2
- package/scripts/generateBundledResourcesHash.js +102 -65
- package/android/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +0 -72
- package/ios/CodePush/CodePushDownloadHandler.m +0 -130
- package/ios/CodePush/CodePushErrorUtils.m +0 -20
- package/ios/CodePush/CodePushUtils.m +0 -9
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#import "CodePush.h"
|
|
2
2
|
#include <CommonCrypto/CommonDigest.h>
|
|
3
3
|
#import "JWT.h"
|
|
4
|
+
#import <DiffUpdates/DiffUpdates.h>
|
|
4
5
|
|
|
5
6
|
@implementation CodePushUpdateUtils
|
|
6
7
|
|
|
7
8
|
NSString * const AssetsFolderName = @"assets";
|
|
8
9
|
NSString * const BinaryHashKey = @"CodePushBinaryHash";
|
|
10
|
+
NSString * const BinaryAssetsHashKey = @"CodePushBinaryAssetsHash";
|
|
9
11
|
NSString * const ManifestFolderPrefix = @"CodePush";
|
|
10
12
|
NSString * const BundleJWTFile = @".codepushrelease";
|
|
11
13
|
|
|
@@ -36,16 +38,16 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
36
38
|
if (!folderFiles) {
|
|
37
39
|
return NO;
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
|
|
40
42
|
for (NSString *fileName in folderFiles) {
|
|
41
43
|
|
|
42
44
|
NSString *fullFilePath = [folderPath stringByAppendingPathComponent:fileName];
|
|
43
45
|
NSString *relativePath = [pathPrefix stringByAppendingPathComponent:fileName];
|
|
44
|
-
|
|
46
|
+
|
|
45
47
|
if([self isHashIgnoredFor:relativePath]){
|
|
46
48
|
continue;
|
|
47
49
|
}
|
|
48
|
-
|
|
50
|
+
|
|
49
51
|
BOOL isDir = NO;
|
|
50
52
|
if ([[NSFileManager defaultManager] fileExistsAtPath:fullFilePath
|
|
51
53
|
isDirectory:&isDir] && isDir) {
|
|
@@ -62,7 +64,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
62
64
|
[manifest addObject:[[relativePath stringByAppendingString:@":"] stringByAppendingString:fileContentsHash]];
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
|
-
|
|
67
|
+
|
|
66
68
|
return YES;
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -87,7 +89,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
87
89
|
if (!manifestData) {
|
|
88
90
|
return nil;
|
|
89
91
|
}
|
|
90
|
-
|
|
92
|
+
|
|
91
93
|
NSString *manifestString = [[NSString alloc] initWithData:manifestData
|
|
92
94
|
encoding:NSUTF8StringEncoding];
|
|
93
95
|
// The JSON serialization turns path separators into "\/", e.g. "CodePush\/assets\/image.png"
|
|
@@ -104,7 +106,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
104
106
|
for (int i = 0; i < CC_SHA256_DIGEST_LENGTH; i++) {
|
|
105
107
|
[inputHash appendFormat:@"%02x", digest[i]];
|
|
106
108
|
}
|
|
107
|
-
|
|
109
|
+
|
|
108
110
|
return inputHash;
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -118,7 +120,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
118
120
|
if (!files) {
|
|
119
121
|
return NO;
|
|
120
122
|
}
|
|
121
|
-
|
|
123
|
+
|
|
122
124
|
for (NSString *fileName in files) {
|
|
123
125
|
NSString * fullFilePath = [sourceFolder stringByAppendingPathComponent:fileName];
|
|
124
126
|
BOOL isDir = NO;
|
|
@@ -150,7 +152,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
150
152
|
return NO;
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
|
-
|
|
155
|
+
|
|
154
156
|
BOOL result = [[NSFileManager defaultManager] copyItemAtPath:fullFilePath toPath:destFileName error:error];
|
|
155
157
|
if (!result) {
|
|
156
158
|
return NO;
|
|
@@ -170,7 +172,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
170
172
|
if (!folderFiles) {
|
|
171
173
|
return nil;
|
|
172
174
|
}
|
|
173
|
-
|
|
175
|
+
|
|
174
176
|
for (NSString *fileName in folderFiles) {
|
|
175
177
|
NSString *fullFilePath = [folderPath stringByAppendingPathComponent:fileName];
|
|
176
178
|
BOOL isDir = NO;
|
|
@@ -186,7 +188,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
186
188
|
return fileName;
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
|
-
|
|
191
|
+
|
|
190
192
|
return nil;
|
|
191
193
|
}
|
|
192
194
|
|
|
@@ -212,15 +214,15 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
212
214
|
return binaryHash;
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
|
-
|
|
217
|
+
|
|
216
218
|
binaryHashDictionary = [NSMutableDictionary dictionary];
|
|
217
219
|
NSMutableArray *manifest = [NSMutableArray array];
|
|
218
|
-
|
|
220
|
+
|
|
219
221
|
// If the app is using assets, then add
|
|
220
222
|
// them to the generated content manifest.
|
|
221
223
|
NSString *assetsPath = [CodePush bundleAssetsPath];
|
|
222
224
|
if ([[NSFileManager defaultManager] fileExistsAtPath:assetsPath]) {
|
|
223
|
-
|
|
225
|
+
|
|
224
226
|
BOOL result = [self addContentsOfFolderToManifest:assetsPath
|
|
225
227
|
pathPrefix:[NSString stringWithFormat:@"%@/%@", [self manifestFolderPrefix], @"assets"]
|
|
226
228
|
manifest:manifest
|
|
@@ -229,12 +231,12 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
229
231
|
return nil;
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
|
-
|
|
234
|
+
|
|
233
235
|
[self addFileToManifest:binaryBundleUrl manifest:manifest];
|
|
234
236
|
[self addFileToManifest:[binaryBundleUrl URLByAppendingPathExtension:@"meta"] manifest:manifest];
|
|
235
237
|
|
|
236
238
|
binaryHash = [self computeFinalHashFromManifest:manifest error:error];
|
|
237
|
-
|
|
239
|
+
|
|
238
240
|
// Cache the hash in user preferences. This assumes that the modified date for the
|
|
239
241
|
// JS bundle changes every time a new bundle is generated by the packager.
|
|
240
242
|
[binaryHashDictionary setObject:binaryHash forKey:binaryModifiedDate];
|
|
@@ -243,6 +245,53 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
243
245
|
return binaryHash;
|
|
244
246
|
}
|
|
245
247
|
|
|
248
|
+
+ (NSString *)getHashForBinaryAssets:(NSError **)error
|
|
249
|
+
{
|
|
250
|
+
NSString *assetsPath = [CodePush bundleAssetsPath];
|
|
251
|
+
if (assetsPath == nil || ![[NSFileManager defaultManager] fileExistsAtPath:assetsPath]) {
|
|
252
|
+
return nil;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
|
|
256
|
+
NSMutableDictionary *assetsHashDictionary = [preferences objectForKey:BinaryAssetsHashKey];
|
|
257
|
+
|
|
258
|
+
NSString *assetsModifiedDate = [self modifiedDateStringOfFileAtURL:
|
|
259
|
+
[NSURL fileURLWithPath:assetsPath isDirectory:YES]];
|
|
260
|
+
|
|
261
|
+
if (assetsHashDictionary != nil) {
|
|
262
|
+
NSString *cached = [assetsHashDictionary objectForKey:assetsModifiedDate];
|
|
263
|
+
if (cached != nil) {
|
|
264
|
+
return cached;
|
|
265
|
+
} else {
|
|
266
|
+
[preferences removeObjectForKey:BinaryAssetsHashKey];
|
|
267
|
+
[preferences synchronize];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
assetsHashDictionary = [NSMutableDictionary dictionary];
|
|
271
|
+
|
|
272
|
+
NSMutableArray *manifest = [NSMutableArray array];
|
|
273
|
+
BOOL ok = [self addContentsOfFolderToManifest:assetsPath
|
|
274
|
+
pathPrefix:[NSString stringWithFormat:@"%@/%@",
|
|
275
|
+
[self manifestFolderPrefix],
|
|
276
|
+
[self assetsFolderName]]
|
|
277
|
+
manifest:manifest
|
|
278
|
+
error:error];
|
|
279
|
+
if (!ok) {
|
|
280
|
+
return nil;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
NSString *assetsHash = [self computeFinalHashFromManifest:manifest error:error];
|
|
284
|
+
if (assetsHash == nil) {
|
|
285
|
+
return nil;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
[assetsHashDictionary setObject:assetsHash forKey:assetsModifiedDate];
|
|
289
|
+
[preferences setObject:assetsHashDictionary forKey:BinaryAssetsHashKey];
|
|
290
|
+
[preferences synchronize];
|
|
291
|
+
|
|
292
|
+
return assetsHash;
|
|
293
|
+
}
|
|
294
|
+
|
|
246
295
|
+ (NSString *)manifestFolderPrefix
|
|
247
296
|
{
|
|
248
297
|
return ManifestFolderPrefix;
|
|
@@ -264,15 +313,15 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
264
313
|
error:(NSError **)error
|
|
265
314
|
{
|
|
266
315
|
CPLog(@"Verifying hash for folder path: %@", finalUpdateFolder);
|
|
267
|
-
|
|
316
|
+
|
|
268
317
|
NSMutableArray *updateContentsManifest = [NSMutableArray array];
|
|
269
318
|
BOOL result = [self addContentsOfFolderToManifest:finalUpdateFolder
|
|
270
319
|
pathPrefix:@""
|
|
271
320
|
manifest:updateContentsManifest
|
|
272
321
|
error:error];
|
|
273
|
-
|
|
322
|
+
|
|
274
323
|
CPLog(@"Manifest string: %@", updateContentsManifest);
|
|
275
|
-
|
|
324
|
+
|
|
276
325
|
if (!result) {
|
|
277
326
|
return NO;
|
|
278
327
|
}
|
|
@@ -282,9 +331,9 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
282
331
|
if (!updateContentsManifestHash) {
|
|
283
332
|
return NO;
|
|
284
333
|
}
|
|
285
|
-
|
|
334
|
+
|
|
286
335
|
CPLog(@"Expected hash: %@, actual hash: %@", expectedHash, updateContentsManifestHash);
|
|
287
|
-
|
|
336
|
+
|
|
288
337
|
return [updateContentsManifestHash isEqualToString:expectedHash];
|
|
289
338
|
}
|
|
290
339
|
|
|
@@ -323,7 +372,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
323
372
|
error:(NSError **)error
|
|
324
373
|
{
|
|
325
374
|
id <JWTAlgorithmDataHolderProtocol> verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithmName(@"RS256").secret(publicKey);
|
|
326
|
-
|
|
375
|
+
|
|
327
376
|
JWTCodingBuilder *verifyBuilder = [JWTDecodingBuilder decodeMessage:jwt].addHolder(verifyDataHolder);
|
|
328
377
|
JWTCodingResultType *verifyResult = verifyBuilder.result;
|
|
329
378
|
if (verifyResult.successResult) {
|
|
@@ -341,9 +390,9 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
341
390
|
error:(NSError **)error
|
|
342
391
|
{
|
|
343
392
|
NSLog(@"Verifying signature for folder path: %@", folderPath);
|
|
344
|
-
|
|
393
|
+
|
|
345
394
|
NSString *publicKey = [self getKeyValueFromPublicKeyString: publicKeyString];
|
|
346
|
-
|
|
395
|
+
|
|
347
396
|
NSError *signatureVerificationError;
|
|
348
397
|
NSString *signature = [self getSignatureFor: folderPath
|
|
349
398
|
error: &signatureVerificationError];
|
|
@@ -352,7 +401,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
352
401
|
*error = signatureVerificationError;
|
|
353
402
|
return false;
|
|
354
403
|
}
|
|
355
|
-
|
|
404
|
+
|
|
356
405
|
NSError *payloadDecodingError;
|
|
357
406
|
NSDictionary *envelopedPayload = [self verifyAndDecodeJWT:signature withPublicKey:publicKey error:&payloadDecodingError];
|
|
358
407
|
if(payloadDecodingError){
|
|
@@ -360,16 +409,16 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
|
|
|
360
409
|
*error = payloadDecodingError;
|
|
361
410
|
return false;
|
|
362
411
|
}
|
|
363
|
-
|
|
412
|
+
|
|
364
413
|
CPLog(@"JWT signature verification succeeded, payload content: %@", envelopedPayload);
|
|
365
|
-
|
|
414
|
+
|
|
366
415
|
if(![envelopedPayload objectForKey:@"contentHash"]){
|
|
367
416
|
CPLog(@"The update could not be verified because the signature did not specify a content hash.");
|
|
368
417
|
return false;
|
|
369
418
|
}
|
|
370
|
-
|
|
419
|
+
|
|
371
420
|
NSString *contentHash = envelopedPayload[@"contentHash"];
|
|
372
|
-
|
|
421
|
+
|
|
373
422
|
return [contentHash isEqualToString:newUpdateHash];
|
|
374
423
|
}
|
|
375
424
|
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
10
|
13BE3DEE1AC21097009241FE /* CodePush.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* CodePush.m */; };
|
|
11
11
|
1B23B9141BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B23B9131BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m */; };
|
|
12
|
-
1B762E901C9A5E9A006EF800 /* CodePushErrorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */; };
|
|
13
12
|
1BCC09A71CC19EB700DDC0DD /* RCTConvert+CodePushUpdateState.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BCC09A61CC19EB700DDC0DD /* RCTConvert+CodePushUpdateState.m */; };
|
|
14
13
|
3221E4512C8ABE1300268379 /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = 3221E42A2C8ABE1300268379 /* ZipArchive.h */; };
|
|
15
14
|
3221E4522C8ABE1300268379 /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = 3221E42A2C8ABE1300268379 /* ZipArchive.h */; };
|
|
@@ -79,13 +78,8 @@
|
|
|
79
78
|
3221E4922C8ABE1400268379 /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 3221E44F2C8ABE1300268379 /* SSZipArchive.m */; };
|
|
80
79
|
540D20121C7684FE00D6EF41 /* CodePushUpdateUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 540D20111C7684FE00D6EF41 /* CodePushUpdateUtils.m */; };
|
|
81
80
|
5421FE311C58AD5A00986A55 /* CodePushTelemetryManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5421FE301C58AD5A00986A55 /* CodePushTelemetryManager.m */; };
|
|
82
|
-
5498D8F61D21F14100B5EB43 /* CodePushUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 5498D8F51D21F14100B5EB43 /* CodePushUtils.m */; };
|
|
83
|
-
54FFEDE01BF550630061DD23 /* CodePushDownloadHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 54FFEDDF1BF550630061DD23 /* CodePushDownloadHandler.m */; };
|
|
84
|
-
6463C82D1EBA0CFB0095B8CD /* CodePushUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 5498D8F51D21F14100B5EB43 /* CodePushUtils.m */; };
|
|
85
81
|
6463C82E1EBA0CFB0095B8CD /* CodePush.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* CodePush.m */; };
|
|
86
82
|
6463C82F1EBA0CFB0095B8CD /* CodePushConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 81D51F391B6181C2000DA084 /* CodePushConfig.m */; };
|
|
87
|
-
6463C8301EBA0CFB0095B8CD /* CodePushDownloadHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 54FFEDDF1BF550630061DD23 /* CodePushDownloadHandler.m */; };
|
|
88
|
-
6463C8311EBA0CFB0095B8CD /* CodePushErrorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */; };
|
|
89
83
|
6463C8321EBA0CFB0095B8CD /* CodePushPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 810D4E6C1B96935000B397E9 /* CodePushPackage.m */; };
|
|
90
84
|
6463C8331EBA0CFB0095B8CD /* CodePushTelemetryManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5421FE301C58AD5A00986A55 /* CodePushTelemetryManager.m */; };
|
|
91
85
|
6463C8341EBA0CFB0095B8CD /* CodePushUpdateUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 540D20111C7684FE00D6EF41 /* CodePushUpdateUtils.m */; };
|
|
@@ -175,7 +169,6 @@
|
|
|
175
169
|
13BE3DEC1AC21097009241FE /* CodePush.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CodePush.h; path = CodePush/CodePush.h; sourceTree = "<group>"; };
|
|
176
170
|
13BE3DED1AC21097009241FE /* CodePush.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePush.m; path = CodePush/CodePush.m; sourceTree = "<group>"; };
|
|
177
171
|
1B23B9131BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RCTConvert+CodePushInstallMode.m"; path = "CodePush/RCTConvert+CodePushInstallMode.m"; sourceTree = "<group>"; };
|
|
178
|
-
1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushErrorUtils.m; path = CodePush/CodePushErrorUtils.m; sourceTree = "<group>"; };
|
|
179
172
|
1BCC09A61CC19EB700DDC0DD /* RCTConvert+CodePushUpdateState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RCTConvert+CodePushUpdateState.m"; path = "CodePush/RCTConvert+CodePushUpdateState.m"; sourceTree = "<group>"; };
|
|
180
173
|
3221E42A2C8ABE1300268379 /* ZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipArchive.h; sourceTree = "<group>"; };
|
|
181
174
|
3221E42C2C8ABE1300268379 /* mz_strm_os_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_os_posix.c; sourceTree = "<group>"; };
|
|
@@ -216,8 +209,6 @@
|
|
|
216
209
|
3221E4502C8ABE1300268379 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
217
210
|
540D20111C7684FE00D6EF41 /* CodePushUpdateUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushUpdateUtils.m; path = CodePush/CodePushUpdateUtils.m; sourceTree = "<group>"; };
|
|
218
211
|
5421FE301C58AD5A00986A55 /* CodePushTelemetryManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushTelemetryManager.m; path = CodePush/CodePushTelemetryManager.m; sourceTree = "<group>"; };
|
|
219
|
-
5498D8F51D21F14100B5EB43 /* CodePushUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushUtils.m; path = CodePush/CodePushUtils.m; sourceTree = "<group>"; };
|
|
220
|
-
54FFEDDF1BF550630061DD23 /* CodePushDownloadHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushDownloadHandler.m; path = CodePush/CodePushDownloadHandler.m; sourceTree = "<group>"; };
|
|
221
212
|
810D4E6C1B96935000B397E9 /* CodePushPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushPackage.m; path = CodePush/CodePushPackage.m; sourceTree = "<group>"; };
|
|
222
213
|
81D51F391B6181C2000DA084 /* CodePushConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushConfig.m; path = CodePush/CodePushConfig.m; sourceTree = "<group>"; };
|
|
223
214
|
F85736731F4F03BF00C9C00A /* MF_Base64Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MF_Base64Additions.h; sourceTree = "<group>"; };
|
|
@@ -375,12 +366,9 @@
|
|
|
375
366
|
isa = PBXGroup;
|
|
376
367
|
children = (
|
|
377
368
|
FF90DEF92C5A808600CA8692 /* PrivacyInfo.xcprivacy */,
|
|
378
|
-
5498D8F51D21F14100B5EB43 /* CodePushUtils.m */,
|
|
379
369
|
13BE3DEC1AC21097009241FE /* CodePush.h */,
|
|
380
370
|
13BE3DED1AC21097009241FE /* CodePush.m */,
|
|
381
371
|
81D51F391B6181C2000DA084 /* CodePushConfig.m */,
|
|
382
|
-
54FFEDDF1BF550630061DD23 /* CodePushDownloadHandler.m */,
|
|
383
|
-
1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */,
|
|
384
372
|
810D4E6C1B96935000B397E9 /* CodePushPackage.m */,
|
|
385
373
|
5421FE301C58AD5A00986A55 /* CodePushTelemetryManager.m */,
|
|
386
374
|
540D20111C7684FE00D6EF41 /* CodePushUpdateUtils.m */,
|
|
@@ -752,7 +740,6 @@
|
|
|
752
740
|
F886646A1F4AD1EE0036D01B /* JWTClaimsSetVerifier.m in Sources */,
|
|
753
741
|
3221E45B2C8ABE1300268379 /* mz_strm_zlib.c in Sources */,
|
|
754
742
|
3221E46B2C8ABE1300268379 /* mz_strm_mem.c in Sources */,
|
|
755
|
-
54FFEDE01BF550630061DD23 /* CodePushDownloadHandler.m in Sources */,
|
|
756
743
|
3221E4672C8ABE1300268379 /* mz_crypt_apple.c in Sources */,
|
|
757
744
|
3221E4912C8ABE1400268379 /* SSZipArchive.m in Sources */,
|
|
758
745
|
F88664551F4AD1EE0036D01B /* JWTAlgorithmDataHolder.m in Sources */,
|
|
@@ -767,7 +754,6 @@
|
|
|
767
754
|
F88664641F4AD1EE0036D01B /* JWTClaim.m in Sources */,
|
|
768
755
|
F88664741F4AD1EE0036D01B /* JWTCoding.m in Sources */,
|
|
769
756
|
3221E45D2C8ABE1300268379 /* mz_zip.c in Sources */,
|
|
770
|
-
1B762E901C9A5E9A006EF800 /* CodePushErrorUtils.m in Sources */,
|
|
771
757
|
F886645B1F4AD1EE0036D01B /* JWTAlgorithmRSBase.m in Sources */,
|
|
772
758
|
3221E4832C8ABE1400268379 /* mz_strm_split.c in Sources */,
|
|
773
759
|
F886647A1F4AD1EF0036D01B /* JWTErrorDescription.m in Sources */,
|
|
@@ -775,7 +761,6 @@
|
|
|
775
761
|
F88664591F4AD1EE0036D01B /* JWTAlgorithmHSBase.m in Sources */,
|
|
776
762
|
F88664771F4AD1EE0036D01B /* JWTBase64Coder.m in Sources */,
|
|
777
763
|
F88664511F4AD1EE0036D01B /* JWTAlgorithmNone.m in Sources */,
|
|
778
|
-
5498D8F61D21F14100B5EB43 /* CodePushUtils.m in Sources */,
|
|
779
764
|
3221E4612C8ABE1300268379 /* mz_zip_rw.c in Sources */,
|
|
780
765
|
810D4E6D1B96935000B397E9 /* CodePushPackage.m in Sources */,
|
|
781
766
|
3221E4552C8ABE1300268379 /* mz_strm_pkcrypt.c in Sources */,
|
|
@@ -794,11 +779,8 @@
|
|
|
794
779
|
3221E4922C8ABE1400268379 /* SSZipArchive.m in Sources */,
|
|
795
780
|
3221E4822C8ABE1400268379 /* mz_strm_buf.c in Sources */,
|
|
796
781
|
3221E45E2C8ABE1300268379 /* mz_zip.c in Sources */,
|
|
797
|
-
6463C82D1EBA0CFB0095B8CD /* CodePushUtils.m in Sources */,
|
|
798
782
|
6463C82E1EBA0CFB0095B8CD /* CodePush.m in Sources */,
|
|
799
783
|
6463C82F1EBA0CFB0095B8CD /* CodePushConfig.m in Sources */,
|
|
800
|
-
6463C8301EBA0CFB0095B8CD /* CodePushDownloadHandler.m in Sources */,
|
|
801
|
-
6463C8311EBA0CFB0095B8CD /* CodePushErrorUtils.m in Sources */,
|
|
802
784
|
3221E46E2C8ABE1300268379 /* mz_crypt.c in Sources */,
|
|
803
785
|
6463C8321EBA0CFB0095B8CD /* CodePushPackage.m in Sources */,
|
|
804
786
|
6463C8331EBA0CFB0095B8CD /* CodePushTelemetryManager.m in Sources */,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>BinaryPath</key>
|
|
9
|
+
<string>DiffUpdates.framework/DiffUpdates</string>
|
|
10
|
+
<key>LibraryIdentifier</key>
|
|
11
|
+
<string>ios-arm64</string>
|
|
12
|
+
<key>LibraryPath</key>
|
|
13
|
+
<string>DiffUpdates.framework</string>
|
|
14
|
+
<key>SupportedArchitectures</key>
|
|
15
|
+
<array>
|
|
16
|
+
<string>arm64</string>
|
|
17
|
+
</array>
|
|
18
|
+
<key>SupportedPlatform</key>
|
|
19
|
+
<string>ios</string>
|
|
20
|
+
</dict>
|
|
21
|
+
<dict>
|
|
22
|
+
<key>BinaryPath</key>
|
|
23
|
+
<string>DiffUpdates.framework/DiffUpdates</string>
|
|
24
|
+
<key>LibraryIdentifier</key>
|
|
25
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
26
|
+
<key>LibraryPath</key>
|
|
27
|
+
<string>DiffUpdates.framework</string>
|
|
28
|
+
<key>SupportedArchitectures</key>
|
|
29
|
+
<array>
|
|
30
|
+
<string>arm64</string>
|
|
31
|
+
<string>x86_64</string>
|
|
32
|
+
</array>
|
|
33
|
+
<key>SupportedPlatform</key>
|
|
34
|
+
<string>ios</string>
|
|
35
|
+
<key>SupportedPlatformVariant</key>
|
|
36
|
+
<string>simulator</string>
|
|
37
|
+
</dict>
|
|
38
|
+
</array>
|
|
39
|
+
<key>CFBundlePackageType</key>
|
|
40
|
+
<string>XFWK</string>
|
|
41
|
+
<key>XCFrameworkFormatVersion</key>
|
|
42
|
+
<string>1.0</string>
|
|
43
|
+
</dict>
|
|
44
|
+
</plist>
|
|
Binary file
|
package/ios/Frameworks/DiffUpdates.xcframework/ios-arm64/DiffUpdates.framework/Headers/DiffUpdates.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
//! Project version number for DiffUpdates.
|
|
4
|
+
FOUNDATION_EXPORT double DiffUpdatesVersionNumber;
|
|
5
|
+
|
|
6
|
+
//! Project version string for DiffUpdates.
|
|
7
|
+
FOUNDATION_EXPORT const unsigned char DiffUpdatesVersionString[];
|
|
8
|
+
|
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <DiffUpdates/PublicHeader.h>
|
|
10
|
+
|
|
11
|
+
@interface CodePushDownloadHandler : NSObject <NSURLConnectionDelegate>
|
|
12
|
+
|
|
13
|
+
@property (strong) NSOutputStream *outputFileStream;
|
|
14
|
+
@property long long expectedContentLength;
|
|
15
|
+
@property long long receivedContentLength;
|
|
16
|
+
@property dispatch_queue_t operationQueue;
|
|
17
|
+
@property (copy) void (^progressCallback)(long long, long long);
|
|
18
|
+
@property (copy) void (^doneCallback)(BOOL);
|
|
19
|
+
@property (copy) void (^failCallback)(NSError *err);
|
|
20
|
+
@property NSString *downloadUrl;
|
|
21
|
+
|
|
22
|
+
- (id)init:(NSString *)downloadFilePath
|
|
23
|
+
operationQueue:(dispatch_queue_t)operationQueue
|
|
24
|
+
progressCallback:(void (^)(long long, long long))progressCallback
|
|
25
|
+
doneCallback:(void (^)(BOOL))doneCallback
|
|
26
|
+
failCallback:(void (^)(NSError *err))failCallback;
|
|
27
|
+
|
|
28
|
+
- (void)download:(NSString*)url;
|
|
29
|
+
|
|
30
|
+
@end
|
|
31
|
+
|
|
32
|
+
@interface CodePushDiffDownloadHandler : NSObject
|
|
33
|
+
|
|
34
|
+
@property (nonatomic, strong) NSString *finalZipPath;
|
|
35
|
+
@property (nonatomic, strong) dispatch_queue_t operationQueue;
|
|
36
|
+
@property (nonatomic, copy) void (^progressCallback)(long long expected, long long received);
|
|
37
|
+
@property (nonatomic, copy) void (^doneCallback)(BOOL isZip);
|
|
38
|
+
@property (nonatomic, copy) void (^failCallback)(NSError *err);
|
|
39
|
+
|
|
40
|
+
- (instancetype)init:(NSString *)finalZipPath
|
|
41
|
+
operationQueue:(dispatch_queue_t)operationQueue
|
|
42
|
+
progressCallback:(void (^)(long long, long long))progressCallback
|
|
43
|
+
doneCallback:(void (^)(BOOL))doneCallback
|
|
44
|
+
failCallback:(void (^)(NSError *err))failCallback;
|
|
45
|
+
|
|
46
|
+
- (void)downloadWithDiffUrl:(NSString *)diffUrl
|
|
47
|
+
assetsUrl:(NSString * _Nullable)assetsUrl
|
|
48
|
+
assetHash:(NSString * _Nullable)assetHash
|
|
49
|
+
nativeAssetHash:(NSString * _Nullable)nativeAssetHash
|
|
50
|
+
currentPackage:(NSDictionary * _Nullable)currentPackage;
|
|
51
|
+
|
|
52
|
+
@end
|
|
53
|
+
|
|
54
|
+
@interface CodePushErrorUtils : NSObject
|
|
55
|
+
|
|
56
|
+
+ (NSError *)errorWithMessage:(NSString *)errorMessage;
|
|
57
|
+
+ (BOOL)isCodePushError:(NSError *)error;
|
|
58
|
+
|
|
59
|
+
@end
|
|
60
|
+
|
|
61
|
+
void CPLog(NSString *formatString, ...);
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
//! Project version number for DiffUpdates.
|
|
4
|
+
FOUNDATION_EXPORT double DiffUpdatesVersionNumber;
|
|
5
|
+
|
|
6
|
+
//! Project version string for DiffUpdates.
|
|
7
|
+
FOUNDATION_EXPORT const unsigned char DiffUpdatesVersionString[];
|
|
8
|
+
|
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <DiffUpdates/PublicHeader.h>
|
|
10
|
+
|
|
11
|
+
@interface CodePushDownloadHandler : NSObject <NSURLConnectionDelegate>
|
|
12
|
+
|
|
13
|
+
@property (strong) NSOutputStream *outputFileStream;
|
|
14
|
+
@property long long expectedContentLength;
|
|
15
|
+
@property long long receivedContentLength;
|
|
16
|
+
@property dispatch_queue_t operationQueue;
|
|
17
|
+
@property (copy) void (^progressCallback)(long long, long long);
|
|
18
|
+
@property (copy) void (^doneCallback)(BOOL);
|
|
19
|
+
@property (copy) void (^failCallback)(NSError *err);
|
|
20
|
+
@property NSString *downloadUrl;
|
|
21
|
+
|
|
22
|
+
- (id)init:(NSString *)downloadFilePath
|
|
23
|
+
operationQueue:(dispatch_queue_t)operationQueue
|
|
24
|
+
progressCallback:(void (^)(long long, long long))progressCallback
|
|
25
|
+
doneCallback:(void (^)(BOOL))doneCallback
|
|
26
|
+
failCallback:(void (^)(NSError *err))failCallback;
|
|
27
|
+
|
|
28
|
+
- (void)download:(NSString*)url;
|
|
29
|
+
|
|
30
|
+
@end
|
|
31
|
+
|
|
32
|
+
@interface CodePushDiffDownloadHandler : NSObject
|
|
33
|
+
|
|
34
|
+
@property (nonatomic, strong) NSString *finalZipPath;
|
|
35
|
+
@property (nonatomic, strong) dispatch_queue_t operationQueue;
|
|
36
|
+
@property (nonatomic, copy) void (^progressCallback)(long long expected, long long received);
|
|
37
|
+
@property (nonatomic, copy) void (^doneCallback)(BOOL isZip);
|
|
38
|
+
@property (nonatomic, copy) void (^failCallback)(NSError *err);
|
|
39
|
+
|
|
40
|
+
- (instancetype)init:(NSString *)finalZipPath
|
|
41
|
+
operationQueue:(dispatch_queue_t)operationQueue
|
|
42
|
+
progressCallback:(void (^)(long long, long long))progressCallback
|
|
43
|
+
doneCallback:(void (^)(BOOL))doneCallback
|
|
44
|
+
failCallback:(void (^)(NSError *err))failCallback;
|
|
45
|
+
|
|
46
|
+
- (void)downloadWithDiffUrl:(NSString *)diffUrl
|
|
47
|
+
assetsUrl:(NSString * _Nullable)assetsUrl
|
|
48
|
+
assetHash:(NSString * _Nullable)assetHash
|
|
49
|
+
nativeAssetHash:(NSString * _Nullable)nativeAssetHash
|
|
50
|
+
currentPackage:(NSDictionary * _Nullable)currentPackage;
|
|
51
|
+
|
|
52
|
+
@end
|
|
53
|
+
|
|
54
|
+
@interface CodePushErrorUtils : NSObject
|
|
55
|
+
|
|
56
|
+
+ (NSError *)errorWithMessage:(NSString *)errorMessage;
|
|
57
|
+
+ (BOOL)isCodePushError:(NSError *)error;
|
|
58
|
+
|
|
59
|
+
@end
|
|
60
|
+
|
|
61
|
+
void CPLog(NSString *formatString, ...);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|