@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.
Files changed (174) hide show
  1. package/.azurepipelines/build-rn-code-push-1es.yml +104 -0
  2. package/.azurepipelines/test-rn-code-push.yml +94 -0
  3. package/.config/CredScanSuppressions.json +14 -0
  4. package/.node-version +1 -0
  5. package/AlertAdapter.js +24 -0
  6. package/CONTRIBUTING.md +134 -0
  7. package/CodePush.js +671 -0
  8. package/CodePush.podspec +28 -0
  9. package/LICENSE.md +13 -0
  10. package/README.md +413 -0
  11. package/SECURITY.md +41 -0
  12. package/android/app/build.gradle +48 -0
  13. package/android/app/proguard-rules.pro +25 -0
  14. package/android/app/src/main/AndroidManifest.xml +5 -0
  15. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +444 -0
  16. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +35 -0
  17. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +102 -0
  18. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +16 -0
  19. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +12 -0
  20. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +7 -0
  21. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +12 -0
  22. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +848 -0
  23. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +12 -0
  24. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +175 -0
  25. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +12 -0
  26. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +383 -0
  27. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +15 -0
  28. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +275 -0
  29. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +238 -0
  30. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +30 -0
  31. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +5 -0
  32. package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +203 -0
  33. package/android/app/src/main/java/com/microsoft/codepush/react/ReactHostHolder.java +11 -0
  34. package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +17 -0
  35. package/android/app/src/main/java/com/microsoft/codepush/react/SettingsManager.java +173 -0
  36. package/android/app/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +72 -0
  37. package/android/build.gradle +24 -0
  38. package/android/codepush.gradle +162 -0
  39. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  40. package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  41. package/android/gradle.properties +20 -0
  42. package/android/gradlew +164 -0
  43. package/android/gradlew.bat +90 -0
  44. package/android/settings.gradle +1 -0
  45. package/docs/api-android.md +52 -0
  46. package/docs/api-ios.md +31 -0
  47. package/docs/api-js.md +592 -0
  48. package/docs/multi-deployment-testing-android.md +55 -0
  49. package/docs/multi-deployment-testing-ios.md +59 -0
  50. package/docs/setup-android.md +92 -0
  51. package/docs/setup-ios.md +137 -0
  52. package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +34 -0
  53. package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +252 -0
  54. package/ios/CodePush/Base64/README.md +47 -0
  55. package/ios/CodePush/CodePush.h +235 -0
  56. package/ios/CodePush/CodePush.m +1122 -0
  57. package/ios/CodePush/CodePushConfig.m +116 -0
  58. package/ios/CodePush/CodePushDownloadHandler.m +130 -0
  59. package/ios/CodePush/CodePushErrorUtils.m +20 -0
  60. package/ios/CodePush/CodePushPackage.m +602 -0
  61. package/ios/CodePush/CodePushTelemetryManager.m +175 -0
  62. package/ios/CodePush/CodePushUpdateUtils.m +376 -0
  63. package/ios/CodePush/CodePushUtils.m +9 -0
  64. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +69 -0
  65. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +16 -0
  66. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +51 -0
  67. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +15 -0
  68. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +55 -0
  69. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +24 -0
  70. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +41 -0
  71. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +28 -0
  72. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +205 -0
  73. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +103 -0
  74. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +322 -0
  75. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +37 -0
  76. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +145 -0
  77. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +35 -0
  78. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +551 -0
  79. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +23 -0
  80. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +43 -0
  81. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +230 -0
  82. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +31 -0
  83. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +113 -0
  84. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +38 -0
  85. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +500 -0
  86. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +18 -0
  87. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +214 -0
  88. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +23 -0
  89. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +29 -0
  90. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +19 -0
  91. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +68 -0
  92. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +18 -0
  93. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +72 -0
  94. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +67 -0
  95. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +111 -0
  96. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +119 -0
  97. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +307 -0
  98. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +94 -0
  99. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +619 -0
  100. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +164 -0
  101. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +514 -0
  102. package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +24 -0
  103. package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +11 -0
  104. package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +52 -0
  105. package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +5 -0
  106. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +28 -0
  107. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +70 -0
  108. package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +22 -0
  109. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +34 -0
  110. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +73 -0
  111. package/ios/CodePush/JWT/LICENSE +19 -0
  112. package/ios/CodePush/JWT/README.md +489 -0
  113. package/ios/CodePush/RCTConvert+CodePushInstallMode.m +20 -0
  114. package/ios/CodePush/RCTConvert+CodePushUpdateState.m +20 -0
  115. package/ios/CodePush/SSZipArchive/Info.plist +26 -0
  116. package/ios/CodePush/SSZipArchive/README.md +1 -0
  117. package/ios/CodePush/SSZipArchive/SSZipArchive.h +178 -0
  118. package/ios/CodePush/SSZipArchive/SSZipArchive.m +1496 -0
  119. package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
  120. package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
  121. package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
  122. package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
  123. package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
  124. package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
  125. package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
  126. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
  127. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
  128. package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
  129. package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
  130. package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
  131. package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
  132. package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
  133. package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
  134. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
  135. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
  136. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
  137. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
  138. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
  139. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
  140. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
  141. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
  142. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
  143. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
  144. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
  145. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
  146. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
  147. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
  148. package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
  149. package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
  150. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
  151. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
  152. package/ios/CodePush.xcodeproj/project.pbxproj +1052 -0
  153. package/ios/CodePush.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  154. package/ios/CodePush.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  155. package/ios/PrivacyInfo.xcprivacy +31 -0
  156. package/logging.js +6 -0
  157. package/package-mixins.js +68 -0
  158. package/package.json +82 -0
  159. package/react-native.config.js +11 -0
  160. package/request-fetch-adapter.js +52 -0
  161. package/scripts/generateBundledResourcesHash.js +125 -0
  162. package/scripts/getFilesInFolder.js +19 -0
  163. package/scripts/postlink/android/postlink.js +87 -0
  164. package/scripts/postlink/ios/postlink.js +116 -0
  165. package/scripts/postlink/run.js +11 -0
  166. package/scripts/postunlink/android/postunlink.js +74 -0
  167. package/scripts/postunlink/ios/postunlink.js +87 -0
  168. package/scripts/postunlink/run.js +11 -0
  169. package/scripts/recordFilesBeforeBundleCommand.js +41 -0
  170. package/scripts/tools/linkToolsAndroid.js +57 -0
  171. package/scripts/tools/linkToolsIos.js +130 -0
  172. package/tsconfig.json +17 -0
  173. package/tslint.json +32 -0
  174. package/typings/react-native-code-push.d.ts +455 -0
@@ -0,0 +1,47 @@
1
+ [![CI Status](https://travis-ci.org/ekscrypto/Base64.svg?branch=master)](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
+ };