@revopush/react-native-code-push 0.0.1
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/.azurepipelines/build-rn-code-push-1es.yml +104 -0
- package/.azurepipelines/test-rn-code-push.yml +94 -0
- package/.config/CredScanSuppressions.json +14 -0
- package/.node-version +1 -0
- package/AlertAdapter.js +24 -0
- package/CONTRIBUTING.md +134 -0
- package/CodePush.js +671 -0
- package/CodePush.podspec +28 -0
- package/LICENSE.md +13 -0
- package/README.md +413 -0
- package/SECURITY.md +41 -0
- package/android/app/build.gradle +48 -0
- package/android/app/proguard-rules.pro +25 -0
- package/android/app/src/main/AndroidManifest.xml +5 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +444 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +35 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +102 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +16 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +7 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +848 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +175 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +383 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +15 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +275 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +238 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +30 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +5 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +203 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactHostHolder.java +11 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +17 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/SettingsManager.java +173 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +72 -0
- package/android/build.gradle +24 -0
- package/android/codepush.gradle +162 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +20 -0
- package/android/gradlew +164 -0
- package/android/gradlew.bat +90 -0
- package/android/settings.gradle +1 -0
- package/docs/api-android.md +52 -0
- package/docs/api-ios.md +31 -0
- package/docs/api-js.md +592 -0
- package/docs/multi-deployment-testing-android.md +55 -0
- package/docs/multi-deployment-testing-ios.md +59 -0
- package/docs/setup-android.md +92 -0
- package/docs/setup-ios.md +137 -0
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +34 -0
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +252 -0
- package/ios/CodePush/Base64/README.md +47 -0
- package/ios/CodePush/CodePush.h +235 -0
- package/ios/CodePush/CodePush.m +1122 -0
- package/ios/CodePush/CodePushConfig.m +116 -0
- package/ios/CodePush/CodePushDownloadHandler.m +130 -0
- package/ios/CodePush/CodePushErrorUtils.m +20 -0
- package/ios/CodePush/CodePushPackage.m +602 -0
- package/ios/CodePush/CodePushTelemetryManager.m +175 -0
- package/ios/CodePush/CodePushUpdateUtils.m +376 -0
- package/ios/CodePush/CodePushUtils.m +9 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +69 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +16 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +51 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +15 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +55 -0
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +24 -0
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +41 -0
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +28 -0
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +205 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +103 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +322 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +37 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +145 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +35 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +551 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +23 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +43 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +230 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +31 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +113 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +38 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +500 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +18 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +214 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +23 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +29 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +19 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +68 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +18 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +72 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +67 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +111 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +119 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +307 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +94 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +619 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +164 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +514 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +24 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +11 -0
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +52 -0
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +5 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +28 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +70 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +22 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +34 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +73 -0
- package/ios/CodePush/JWT/LICENSE +19 -0
- package/ios/CodePush/JWT/README.md +489 -0
- package/ios/CodePush/RCTConvert+CodePushInstallMode.m +20 -0
- package/ios/CodePush/RCTConvert+CodePushUpdateState.m +20 -0
- package/ios/CodePush/SSZipArchive/Info.plist +26 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -0
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +178 -0
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +1496 -0
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
- package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +1052 -0
- package/ios/CodePush.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/CodePush.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/PrivacyInfo.xcprivacy +31 -0
- package/logging.js +6 -0
- package/package-mixins.js +68 -0
- package/package.json +82 -0
- package/react-native.config.js +11 -0
- package/request-fetch-adapter.js +52 -0
- package/scripts/generateBundledResourcesHash.js +125 -0
- package/scripts/getFilesInFolder.js +19 -0
- package/scripts/postlink/android/postlink.js +87 -0
- package/scripts/postlink/ios/postlink.js +116 -0
- package/scripts/postlink/run.js +11 -0
- package/scripts/postunlink/android/postunlink.js +74 -0
- package/scripts/postunlink/ios/postunlink.js +87 -0
- package/scripts/postunlink/run.js +11 -0
- package/scripts/recordFilesBeforeBundleCommand.js +41 -0
- package/scripts/tools/linkToolsAndroid.js +57 -0
- package/scripts/tools/linkToolsIos.js +130 -0
- package/tsconfig.json +17 -0
- package/tslint.json +32 -0
- package/typings/react-native-code-push.d.ts +455 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[](https://github.com/ekscrypto/Base64)
|
|
2
|
+
|
|
3
|
+
Base64 Additions for Objective-C on Mac OS X and iOS
|
|
4
|
+
=======
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Usage
|
|
8
|
+
----
|
|
9
|
+
Open the Xcode project file, and drag MF_Base64Additions.m/.h into your project.
|
|
10
|
+
|
|
11
|
+
In files where you want to use Base64 encoding/decoding, simply include the header file and use one of the provided NSData or NSString additions.
|
|
12
|
+
|
|
13
|
+
Example use:
|
|
14
|
+
#import "MF_Base64Additions.h"
|
|
15
|
+
|
|
16
|
+
NSString *helloWorld = @"Hello World";
|
|
17
|
+
NSString *helloInBase64 = [helloWorld base64String];
|
|
18
|
+
NSString *helloDecoded = [NSString stringFromBase64String:helloInBase64];
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Performance
|
|
24
|
+
----
|
|
25
|
+
* Encoding: Approximately 4 to 5 times faster than using the equivalent SecTransform.
|
|
26
|
+
* Encoding: 30% faster than https://github.com/l4u/NSData-Base64
|
|
27
|
+
* Decoding: 5% faster than using the equivalent SecTransform.
|
|
28
|
+
* Decoding: 5% faster than https://github.com/l4u/NSData-Base64
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Requirements
|
|
33
|
+
-----
|
|
34
|
+
* Compile with Automatic Reference Counting
|
|
35
|
+
* Compatible with Mac OSX 10.6+ and iOS 4.0+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
Implementation
|
|
40
|
+
----
|
|
41
|
+
* Implemented as per RFC 4648, see http://www.ietf.org/rfc/rfc4648.txt for more details.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
Licensing
|
|
46
|
+
----
|
|
47
|
+
* Public Domain
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
#if __has_include(<React/RCTEventEmitter.h>)
|
|
2
|
+
#import <React/RCTEventEmitter.h>
|
|
3
|
+
#elif __has_include("RCTEventEmitter.h")
|
|
4
|
+
#import "RCTEventEmitter.h"
|
|
5
|
+
#else
|
|
6
|
+
#import "React/RCTEventEmitter.h" // Required when used as a Pod in a Swift project
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
@interface CodePush : RCTEventEmitter
|
|
12
|
+
|
|
13
|
+
+ (NSURL *)binaryBundleURL;
|
|
14
|
+
/*
|
|
15
|
+
* This method is used to retrieve the URL for the most recent
|
|
16
|
+
* version of the JavaScript bundle. This could be either the
|
|
17
|
+
* bundle that was packaged with the app binary, or the bundle
|
|
18
|
+
* that was downloaded as part of a CodePush update. The value returned
|
|
19
|
+
* should be used to "bootstrap" the React Native bridge.
|
|
20
|
+
*
|
|
21
|
+
* This method assumes that your JS bundle is named "main.jsbundle"
|
|
22
|
+
* and therefore, if it isn't, you should use either the bundleURLForResource:
|
|
23
|
+
* or bundleURLForResource:withExtension: methods to override that behavior.
|
|
24
|
+
*/
|
|
25
|
+
+ (NSURL *)bundleURL;
|
|
26
|
+
|
|
27
|
+
+ (NSURL *)bundleURLForResource:(NSString *)resourceName;
|
|
28
|
+
|
|
29
|
+
+ (NSURL *)bundleURLForResource:(NSString *)resourceName
|
|
30
|
+
withExtension:(NSString *)resourceExtension;
|
|
31
|
+
|
|
32
|
+
+ (NSURL *)bundleURLForResource:(NSString *)resourceName
|
|
33
|
+
withExtension:(NSString *)resourceExtension
|
|
34
|
+
subdirectory:(NSString *)resourceSubdirectory;
|
|
35
|
+
|
|
36
|
+
+ (NSURL *)bundleURLForResource:(NSString *)resourceName
|
|
37
|
+
withExtension:(NSString *)resourceExtension
|
|
38
|
+
subdirectory:(NSString *)resourceSubdirectory
|
|
39
|
+
bundle:(NSBundle *)resourceBundle;
|
|
40
|
+
|
|
41
|
+
+ (NSString *)getApplicationSupportDirectory;
|
|
42
|
+
|
|
43
|
+
+ (NSString *)bundleAssetsPath;
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* This method allows the version of the app's binary interface
|
|
47
|
+
* to be specified, which would otherwise default to the
|
|
48
|
+
* binary version of the app.
|
|
49
|
+
*/
|
|
50
|
+
+ (void)overrideAppVersion:(NSString *)appVersion;
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* This method allows dynamically setting the app's
|
|
54
|
+
* deployment key, in addition to setting it via
|
|
55
|
+
* the Info.plist file's CodePushDeploymentKey setting.
|
|
56
|
+
*/
|
|
57
|
+
+ (void)setDeploymentKey:(NSString *)deploymentKey;
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
* This method checks to see whether a specific package hash
|
|
61
|
+
* has previously failed installation.
|
|
62
|
+
*/
|
|
63
|
+
+ (BOOL)isFailedHash:(NSString*)packageHash;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* This method is used to get information about the latest rollback.
|
|
68
|
+
* This information will be used to decide whether the application
|
|
69
|
+
* should ignore the update or not.
|
|
70
|
+
*/
|
|
71
|
+
+ (NSDictionary*)getRollbackInfo;
|
|
72
|
+
/*
|
|
73
|
+
* This method is used to save information about the latest rollback.
|
|
74
|
+
* This information will be used to decide whether the application
|
|
75
|
+
* should ignore the update or not.
|
|
76
|
+
*/
|
|
77
|
+
+ (void)setLatestRollbackInfo:(NSString*)packageHash;
|
|
78
|
+
/*
|
|
79
|
+
* This method is used to get the count of rollback for the package
|
|
80
|
+
* using the latest rollback information.
|
|
81
|
+
*/
|
|
82
|
+
+ (int)getRollbackCountForPackage:(NSString*) packageHash fromLatestRollbackInfo:(NSMutableDictionary*) latestRollbackInfo;
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* This method checks to see whether a specific package hash
|
|
86
|
+
* represents a downloaded and installed update, that hasn't
|
|
87
|
+
* been applied yet via an app restart.
|
|
88
|
+
*/
|
|
89
|
+
+ (BOOL)isPendingUpdate:(NSString*)packageHash;
|
|
90
|
+
|
|
91
|
+
// The below methods are only used during tests.
|
|
92
|
+
+ (BOOL)isUsingTestConfiguration;
|
|
93
|
+
+ (void)setUsingTestConfiguration:(BOOL)shouldUseTestConfiguration;
|
|
94
|
+
+ (void)clearUpdates;
|
|
95
|
+
|
|
96
|
+
@end
|
|
97
|
+
|
|
98
|
+
@interface CodePushConfig : NSObject
|
|
99
|
+
|
|
100
|
+
@property (copy) NSString *appVersion;
|
|
101
|
+
@property (readonly) NSString *buildVersion;
|
|
102
|
+
@property (readonly) NSDictionary *configuration;
|
|
103
|
+
@property (copy) NSString *deploymentKey;
|
|
104
|
+
@property (copy) NSString *serverURL;
|
|
105
|
+
@property (copy) NSString *publicKey;
|
|
106
|
+
|
|
107
|
+
+ (instancetype)current;
|
|
108
|
+
|
|
109
|
+
@end
|
|
110
|
+
|
|
111
|
+
@interface CodePushDownloadHandler : NSObject <NSURLConnectionDelegate>
|
|
112
|
+
|
|
113
|
+
@property (strong) NSOutputStream *outputFileStream;
|
|
114
|
+
@property long long expectedContentLength;
|
|
115
|
+
@property long long receivedContentLength;
|
|
116
|
+
@property dispatch_queue_t operationQueue;
|
|
117
|
+
@property (copy) void (^progressCallback)(long long, long long);
|
|
118
|
+
@property (copy) void (^doneCallback)(BOOL);
|
|
119
|
+
@property (copy) void (^failCallback)(NSError *err);
|
|
120
|
+
@property NSString *downloadUrl;
|
|
121
|
+
|
|
122
|
+
- (id)init:(NSString *)downloadFilePath
|
|
123
|
+
operationQueue:(dispatch_queue_t)operationQueue
|
|
124
|
+
progressCallback:(void (^)(long long, long long))progressCallback
|
|
125
|
+
doneCallback:(void (^)(BOOL))doneCallback
|
|
126
|
+
failCallback:(void (^)(NSError *err))failCallback;
|
|
127
|
+
|
|
128
|
+
- (void)download:(NSString*)url;
|
|
129
|
+
|
|
130
|
+
@end
|
|
131
|
+
|
|
132
|
+
@interface CodePushErrorUtils : NSObject
|
|
133
|
+
|
|
134
|
+
+ (NSError *)errorWithMessage:(NSString *)errorMessage;
|
|
135
|
+
+ (BOOL)isCodePushError:(NSError *)error;
|
|
136
|
+
|
|
137
|
+
@end
|
|
138
|
+
|
|
139
|
+
@interface CodePushPackage : NSObject
|
|
140
|
+
|
|
141
|
+
+ (void)downloadPackage:(NSDictionary *)updatePackage
|
|
142
|
+
expectedBundleFileName:(NSString *)expectedBundleFileName
|
|
143
|
+
publicKey:(NSString *)publicKey
|
|
144
|
+
operationQueue:(dispatch_queue_t)operationQueue
|
|
145
|
+
progressCallback:(void (^)(long long, long long))progressCallback
|
|
146
|
+
doneCallback:(void (^)())doneCallback
|
|
147
|
+
failCallback:(void (^)(NSError *err))failCallback;
|
|
148
|
+
|
|
149
|
+
+ (NSDictionary *)getCurrentPackage:(NSError **)error;
|
|
150
|
+
+ (NSDictionary *)getPreviousPackage:(NSError **)error;
|
|
151
|
+
+ (NSString *)getCurrentPackageFolderPath:(NSError **)error;
|
|
152
|
+
+ (NSString *)getCurrentPackageBundlePath:(NSError **)error;
|
|
153
|
+
+ (NSString *)getCurrentPackageHash:(NSError **)error;
|
|
154
|
+
|
|
155
|
+
+ (NSDictionary *)getPackage:(NSString *)packageHash
|
|
156
|
+
error:(NSError **)error;
|
|
157
|
+
|
|
158
|
+
+ (NSString *)getPackageFolderPath:(NSString *)packageHash;
|
|
159
|
+
|
|
160
|
+
+ (BOOL)installPackage:(NSDictionary *)updatePackage
|
|
161
|
+
removePendingUpdate:(BOOL)removePendingUpdate
|
|
162
|
+
error:(NSError **)error;
|
|
163
|
+
|
|
164
|
+
+ (void)rollbackPackage;
|
|
165
|
+
|
|
166
|
+
// The below methods are only used during tests.
|
|
167
|
+
+ (void)clearUpdates;
|
|
168
|
+
+ (void)downloadAndReplaceCurrentBundle:(NSString *)remoteBundleUrl;
|
|
169
|
+
|
|
170
|
+
@end
|
|
171
|
+
|
|
172
|
+
@interface CodePushTelemetryManager : NSObject
|
|
173
|
+
|
|
174
|
+
+ (NSDictionary *)getBinaryUpdateReport:(NSString *)appVersion;
|
|
175
|
+
+ (NSDictionary *)getRetryStatusReport;
|
|
176
|
+
+ (NSDictionary *)getRollbackReport:(NSDictionary *)lastFailedPackage;
|
|
177
|
+
+ (NSDictionary *)getUpdateReport:(NSDictionary *)currentPackage;
|
|
178
|
+
+ (void)recordStatusReported:(NSDictionary *)statusReport;
|
|
179
|
+
+ (void)saveStatusReportForRetry:(NSDictionary *)statusReport;
|
|
180
|
+
|
|
181
|
+
@end
|
|
182
|
+
|
|
183
|
+
@interface CodePushUpdateUtils : NSObject
|
|
184
|
+
|
|
185
|
+
+ (BOOL)copyEntriesInFolder:(NSString *)sourceFolder
|
|
186
|
+
destFolder:(NSString *)destFolder
|
|
187
|
+
error:(NSError **)error;
|
|
188
|
+
|
|
189
|
+
+ (NSString *)findMainBundleInFolder:(NSString *)folderPath
|
|
190
|
+
expectedFileName:(NSString *)expectedFileName
|
|
191
|
+
error:(NSError **)error;
|
|
192
|
+
|
|
193
|
+
+ (NSString *)assetsFolderName;
|
|
194
|
+
+ (NSString *)getHashForBinaryContents:(NSURL *)binaryBundleUrl
|
|
195
|
+
error:(NSError **)error;
|
|
196
|
+
|
|
197
|
+
+ (NSString *)manifestFolderPrefix;
|
|
198
|
+
+ (NSString *)modifiedDateStringOfFileAtURL:(NSURL *)fileURL;
|
|
199
|
+
|
|
200
|
+
+ (BOOL)isHashIgnoredFor:(NSString *) relativePath;
|
|
201
|
+
|
|
202
|
+
+ (BOOL)verifyFolderHash:(NSString *)finalUpdateFolder
|
|
203
|
+
expectedHash:(NSString *)expectedHash
|
|
204
|
+
error:(NSError **)error;
|
|
205
|
+
|
|
206
|
+
// remove BEGIN / END tags and line breaks from public key string
|
|
207
|
+
+ (NSString *)getKeyValueFromPublicKeyString:(NSString *)publicKeyString;
|
|
208
|
+
|
|
209
|
+
+ (NSString *)getSignatureFilePath:(NSString *)updateFolderPath;
|
|
210
|
+
|
|
211
|
+
+ (NSDictionary *) verifyAndDecodeJWT:(NSString *) jwt
|
|
212
|
+
withPublicKey:(NSString *)publicKey
|
|
213
|
+
error:(NSError **)error;
|
|
214
|
+
|
|
215
|
+
+ (BOOL)verifyUpdateSignatureFor:(NSString *)updateFolderPath
|
|
216
|
+
expectedHash:(NSString *)newUpdateHash
|
|
217
|
+
withPublicKey:(NSString *)publicKeyString
|
|
218
|
+
error:(NSError **)error;
|
|
219
|
+
|
|
220
|
+
@end
|
|
221
|
+
|
|
222
|
+
void CPLog(NSString *formatString, ...);
|
|
223
|
+
|
|
224
|
+
typedef NS_ENUM(NSInteger, CodePushInstallMode) {
|
|
225
|
+
CodePushInstallModeImmediate,
|
|
226
|
+
CodePushInstallModeOnNextRestart,
|
|
227
|
+
CodePushInstallModeOnNextResume,
|
|
228
|
+
CodePushInstallModeOnNextSuspend
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
typedef NS_ENUM(NSInteger, CodePushUpdateState) {
|
|
232
|
+
CodePushUpdateStateRunning,
|
|
233
|
+
CodePushUpdateStatePending,
|
|
234
|
+
CodePushUpdateStateLatest
|
|
235
|
+
};
|