@appzung/react-native-code-push 9.0.2 → 10.0.0-rc1

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 (191) hide show
  1. package/CodePush.js +22 -19
  2. package/LICENSE.md +1 -1
  3. package/README.md +159 -298
  4. package/android/app/.gradle/config.properties +2 -0
  5. package/android/app/build.gradle +1 -1
  6. package/android/app/local.properties +8 -0
  7. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +27 -21
  8. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +5 -5
  9. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +1 -1
  10. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +1 -1
  11. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +2 -2
  12. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +2 -2
  13. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +1 -1
  14. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +2 -2
  15. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +5 -5
  16. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +2 -2
  17. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +14 -14
  18. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +2 -2
  19. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +1 -1
  20. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +2 -2
  21. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +1 -1
  22. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +1 -1
  23. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +1 -1
  24. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +1 -1
  25. package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +1 -1
  26. package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +1 -1
  27. package/android/app/src/main/java/com/microsoft/codepush/react/SettingsManager.java +1 -1
  28. package/android/app/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +1 -1
  29. package/android/build.gradle +1 -1
  30. package/android/codepush.gradle +3 -3
  31. package/docs/advanced-usage.md +56 -0
  32. package/docs/api-android.md +12 -75
  33. package/docs/api-ios.md +5 -17
  34. package/docs/api-js.md +18 -55
  35. package/docs/setup-android.md +15 -397
  36. package/docs/setup-ios.md +24 -198
  37. package/docs/setup-windows.md +7 -74
  38. package/ios/CodePush/CodePush.h +4 -4
  39. package/ios/CodePush/CodePush.m +8 -8
  40. package/ios/CodePush/CodePushConfig.m +14 -11
  41. package/ios/CodePush/CodePushPackage.m +60 -60
  42. package/ios/CodePush/CodePushTelemetryManager.m +13 -13
  43. package/ios/CodePush.xcodeproj/project.pbxproj +1 -562
  44. package/package.json +27 -24
  45. package/react-native.config.js +1 -1
  46. package/scripts/generateBundledResourcesHash.js +1 -1
  47. package/scripts/getFilesInFolder.js +1 -1
  48. package/scripts/recordFilesBeforeBundleCommand.js +1 -1
  49. package/typings/react-native-code-push.d.ts +22 -22
  50. package/windows/CodePush/CodePushConfig.cpp +3 -3
  51. package/windows/CodePush/CodePushConfig.h +3 -3
  52. package/windows/CodePush/CodePushNativeModule.cpp +27 -27
  53. package/windows/CodePush/CodePushNativeModule.h +4 -4
  54. package/windows/CodePush/CodePushTelemetryManager.cpp +12 -12
  55. package/windows/CodePush/CodePushTelemetryManager.h +1 -1
  56. package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
  57. package/.azurepipelines/test-rn-code-push.yml +0 -94
  58. package/.config/CredScanSuppressions.json +0 -14
  59. package/SECURITY.md +0 -41
  60. package/docs/multi-deployment-testing-android.md +0 -148
  61. package/docs/multi-deployment-testing-ios.md +0 -59
  62. package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
  63. package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
  64. package/ios/CodePush/Base64/README.md +0 -47
  65. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
  66. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
  67. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
  68. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
  69. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
  70. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
  71. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
  72. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
  73. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
  74. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
  75. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
  76. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
  77. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
  78. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
  79. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
  80. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
  81. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
  82. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
  83. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
  84. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
  85. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
  86. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
  87. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
  88. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
  89. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
  90. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
  91. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
  92. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
  93. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
  94. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
  95. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
  96. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
  97. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
  98. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
  99. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
  100. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
  101. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
  102. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
  103. package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
  104. package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
  105. package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
  106. package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
  107. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
  108. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
  109. package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
  110. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
  111. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
  112. package/ios/CodePush/JWT/LICENSE +0 -19
  113. package/ios/CodePush/JWT/README.md +0 -489
  114. package/ios/CodePush/SSZipArchive/Info.plist +0 -26
  115. package/ios/CodePush/SSZipArchive/README.md +0 -1
  116. package/ios/CodePush/SSZipArchive/SSZipArchive.h +0 -178
  117. package/ios/CodePush/SSZipArchive/SSZipArchive.m +0 -1496
  118. package/ios/CodePush/SSZipArchive/SSZipCommon.h +0 -71
  119. package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +0 -23
  120. package/ios/CodePush/SSZipArchive/include/ZipArchive.h +0 -25
  121. package/ios/CodePush/SSZipArchive/minizip/LICENSE +0 -17
  122. package/ios/CodePush/SSZipArchive/minizip/mz.h +0 -273
  123. package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +0 -1306
  124. package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +0 -346
  125. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +0 -187
  126. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +0 -65
  127. package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +0 -526
  128. package/ios/CodePush/SSZipArchive/minizip/mz_os.c +0 -348
  129. package/ios/CodePush/SSZipArchive/minizip/mz_os.h +0 -176
  130. package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +0 -350
  131. package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +0 -556
  132. package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +0 -132
  133. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +0 -383
  134. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +0 -42
  135. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +0 -269
  136. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +0 -48
  137. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +0 -40
  138. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +0 -203
  139. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +0 -334
  140. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +0 -46
  141. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +0 -429
  142. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +0 -43
  143. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +0 -360
  144. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +0 -46
  145. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +0 -389
  146. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +0 -43
  147. package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +0 -2782
  148. package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +0 -262
  149. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +0 -1942
  150. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +0 -285
  151. package/scripts/postlink/android/postlink.js +0 -87
  152. package/scripts/postlink/ios/postlink.js +0 -116
  153. package/scripts/postlink/run.js +0 -11
  154. package/scripts/postunlink/android/postunlink.js +0 -74
  155. package/scripts/postunlink/ios/postunlink.js +0 -87
  156. package/scripts/postunlink/run.js +0 -11
  157. package/scripts/tools/linkToolsAndroid.js +0 -57
  158. package/scripts/tools/linkToolsIos.js +0 -130
  159. package/windows-legacy/CodePush/CodePush.csproj +0 -128
  160. package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
  161. package/windows-legacy/CodePush/FileUtils.cs +0 -40
  162. package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
  163. package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
  164. package/windows-legacy/CodePush/UpdateManager.cs +0 -305
  165. package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
  166. package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
  167. package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
  168. package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
  169. package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
  170. package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
  171. package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
  172. package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
  173. package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
  174. package/windows-legacy/CodePush.Net46/packages.config +0 -5
  175. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
  176. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
  177. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
  178. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
  179. package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
  180. package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
  181. package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
  182. package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
  183. package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
  184. package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
  185. package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
  186. package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
  187. package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
  188. package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
  189. package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
  190. package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
  191. package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
@@ -1,57 +0,0 @@
1
- var fs = require("fs");
2
- var glob = require("glob");
3
- var path = require("path");
4
-
5
- var ignoreFolders = { ignore: ["node_modules/**", "**/build/**"] };
6
- var manifestPath = glob.sync("**/AndroidManifest.xml", ignoreFolders)[0];
7
-
8
- exports.getJSBundleFileOverride = `
9
- @Override
10
- protected String getJSBundleFile(){
11
- return CodePush.getJSBundleFile();
12
- }
13
- `;
14
- exports.reactNativeHostInstantiation = "new ReactNativeHost(this) {";
15
- exports.mainActivityClassDeclaration = "public class MainActivity extends ReactActivity {";
16
- exports.codePushGradleLink = `\napply from: "../../node_modules/react-native-code-push/android/codepush.gradle"`;
17
- exports.deploymentKeyName = "CodePushDeploymentKey";
18
-
19
- exports.getMainApplicationLocation = function () {
20
- return findMainApplication() || glob.sync("**/MainApplication.java", ignoreFolders)[0];
21
- }
22
-
23
- exports.getMainActivityPath = function () {
24
- return glob.sync("**/MainActivity.java", ignoreFolders)[0]
25
- }
26
-
27
- exports.getStringsResourcesPath = function () {
28
- return glob.sync("**/strings.xml", ignoreFolders)[0];
29
- }
30
-
31
- exports.getBuildGradlePath = function () {
32
- return path.join("android", "app", "build.gradle");
33
- }
34
-
35
- exports.isJsBundleOverridden = function (codeContents) {
36
- return /@Override\s*\n\s*protected String getJSBundleFile\(\)\s*\{[\s\S]*?\}/.test(codeContents);
37
- }
38
-
39
- function findMainApplication() {
40
- if (!manifestPath) {
41
- return null;
42
- }
43
-
44
- var manifest = fs.readFileSync(manifestPath, "utf8");
45
-
46
- // Android manifest must include single 'application' element
47
- var matchResult = manifest.match(/application\s+android:name\s*=\s*"(.*?)"/);
48
- if (matchResult) {
49
- var appName = matchResult[1];
50
- } else {
51
- return null;
52
- }
53
-
54
- var nameParts = appName.split('.');
55
- var searchPath = glob.sync("**/" + nameParts[nameParts.length - 1] + ".java", ignoreFolders)[0];
56
- return searchPath;
57
- }
@@ -1,130 +0,0 @@
1
- var glob = require("glob");
2
- var path = require("path");
3
- var xcode = require("xcode");
4
- var packageFile = require('../../../../package.json');
5
-
6
- var ignoreNodeModules = { ignore: "node_modules/**" };
7
- var ignoreNodeModulesAndPods = { ignore: ["node_modules/**", "ios/Pods/**"] };
8
- var appDelegatePaths = glob.sync("**/AppDelegate.+(mm|m)", ignoreNodeModules);
9
-
10
- exports.codePushHeaderImportStatement = `#import <CodePush/CodePush.h>`;
11
- exports.codePushHeaderImportStatementFormatted = `\n${this.codePushHeaderImportStatement}`;
12
- exports.codePushBundleUrl = "[CodePush bundleURL]";
13
- exports.oldBundleUrl = "[[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"]";
14
- exports.linkedJsCodeLocationAssignmentStatement = "jsCodeLocation = [CodePush bundleURL];";
15
-
16
- exports.getJsCodeLocationPatch = function(defaultJsCodeLocationAssignmentStatement) {
17
- return `
18
- #ifdef DEBUG
19
- ${defaultJsCodeLocationAssignmentStatement}
20
- #else
21
- ${this.linkedJsCodeLocationAssignmentStatement}
22
- #endif`;
23
- }
24
-
25
- // Fix for https://github.com/microsoft/react-native-code-push/issues/477
26
- // Typical location of AppDelegate.m for newer RN versions: $PROJECT_ROOT/ios/<project_name>/AppDelegate.m
27
- // Let's try to find that path by filtering the whole array for any path containing <project_name>
28
- // If we can't find it there, play dumb and pray it is the first path we find.
29
- exports.getAppDeletePath = function() {
30
- return findFileByAppName(appDelegatePaths, packageFile ? packageFile.name : null) || appDelegatePaths[0];
31
- }
32
-
33
- exports.getPlistPath = function() {
34
- var xcodeProjectPaths = glob.sync(`**/*.xcodeproj/project.pbxproj`, ignoreNodeModulesAndPods);
35
- if (!xcodeProjectPaths){
36
- return getDefaultPlistPath();
37
- }
38
-
39
- if (xcodeProjectPaths.length !== 1) {
40
- console.log('Could not determine correct xcode proj path to retrieve related plist file, there are multiple xcodeproj under the solution.');
41
- return getDefaultPlistPath();
42
- }
43
-
44
- var xcodeProjectPath = xcodeProjectPaths[0];
45
- var parsedXCodeProj;
46
-
47
- try {
48
- var proj = xcode.project(xcodeProjectPath);
49
- //use sync version because there are some problems with async version of xcode lib as of current version
50
- parsedXCodeProj = proj.parseSync();
51
- }
52
- catch(e) {
53
- console.log('Couldn\'t read info.plist path from xcode project - error: ' + e.message);
54
- return getDefaultPlistPath();
55
- }
56
-
57
- var INFO_PLIST_PROJECT_KEY = 'INFOPLIST_FILE';
58
- var RELEASE_BUILD_PROPERTY_NAME = "Release";
59
- var targetProductName = packageFile ? packageFile.name : null;
60
-
61
- //Try to get 'Release' build of ProductName matching the package name first and if it doesn't exist then try to get any other if existing
62
- var plistPathValue = getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY, targetProductName, RELEASE_BUILD_PROPERTY_NAME) ||
63
- getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY, targetProductName) ||
64
- getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY, null, RELEASE_BUILD_PROPERTY_NAME) ||
65
- getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, INFO_PLIST_PROJECT_KEY) ||
66
- parsedXCodeProj.getBuildProperty(INFO_PLIST_PROJECT_KEY, RELEASE_BUILD_PROPERTY_NAME) ||
67
- parsedXCodeProj.getBuildProperty(INFO_PLIST_PROJECT_KEY);
68
-
69
- if (!plistPathValue){
70
- return getDefaultPlistPath();
71
- }
72
-
73
- //also remove surrounding quotes from plistPathValue to get correct path resolved
74
- //(see https://github.com/microsoft/react-native-code-push/issues/534#issuecomment-302069326 for details)
75
- return path.resolve(path.dirname(xcodeProjectPath), '..', plistPathValue.replace(/^"(.*)"$/, '$1'));
76
- }
77
-
78
- // Helper that filters an array with AppDelegate.m paths for a path with the app name inside it
79
- // Should cover nearly all cases
80
- function findFileByAppName(array, appName) {
81
- if (array.length === 0 || !appName) return null;
82
-
83
- for (var i = 0; i < array.length; i++) {
84
- var path = array[i];
85
- if (path && path.indexOf(appName) !== -1) {
86
- return path;
87
- }
88
- }
89
-
90
- return null;
91
- }
92
-
93
- function getDefaultPlistPath() {
94
- //this is old logic in case we are unable to find PLIST from xcode/pbxproj - at least we can fallback to default solution
95
- return glob.sync(`**/${packageFile.name}/*Info.plist`, ignoreNodeModules)[0];
96
- }
97
-
98
- // This is enhanced version of standard implementation of xcode 'getBuildProperty' function
99
- // but allows us to narrow results by PRODUCT_NAME property also.
100
- // So we suppose that proj name should be the same as package name, otherwise fallback to default plist path searching logic
101
- function getBuildSettingsPropertyMatchingTargetProductName(parsedXCodeProj, prop, targetProductName, build) {
102
- var target;
103
- var COMMENT_KEY = /_comment$/;
104
- var PRODUCT_NAME_PROJECT_KEY = 'PRODUCT_NAME';
105
- var TV_OS_DEPLOYMENT_TARGET_PROPERTY_NAME = 'TVOS_DEPLOYMENT_TARGET';
106
- var TEST_HOST_PROPERTY_NAME = 'TEST_HOST';
107
-
108
- var configs = parsedXCodeProj.pbxXCBuildConfigurationSection();
109
- for (var configName in configs) {
110
- if (!COMMENT_KEY.test(configName)) {
111
- var config = configs[configName];
112
- if ( (build && config.name === build) || (build === undefined) ) {
113
- if (targetProductName) {
114
- if (config.buildSettings[prop] !== undefined && config.buildSettings[PRODUCT_NAME_PROJECT_KEY] == targetProductName) {
115
- target = config.buildSettings[prop];
116
- }
117
- } else {
118
- if (config.buildSettings[prop] !== undefined &&
119
- //exclude tvOS projects
120
- config.buildSettings[TV_OS_DEPLOYMENT_TARGET_PROPERTY_NAME] == undefined &&
121
- //exclude test app
122
- config.buildSettings[TEST_HOST_PROPERTY_NAME] == undefined) {
123
- target = config.buildSettings[prop];
124
- }
125
- }
126
- }
127
- }
128
- }
129
- return target;
130
- }
@@ -1,128 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
- <PropertyGroup>
5
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
- <ProjectGuid>{446A85D9-55EB-4C7D-8B9D-448306C833D6}</ProjectGuid>
8
- <OutputType>Library</OutputType>
9
- <AppDesignerFolder>Properties</AppDesignerFolder>
10
- <RootNamespace>CodePush</RootNamespace>
11
- <AssemblyName>CodePush</AssemblyName>
12
- <DefaultLanguage>en-US</DefaultLanguage>
13
- <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
14
- <TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
15
- <TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
16
- <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
17
- <FileAlignment>512</FileAlignment>
18
- <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
19
- </PropertyGroup>
20
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
21
- <PlatformTarget>x86</PlatformTarget>
22
- <DebugSymbols>true</DebugSymbols>
23
- <OutputPath>bin\x86\Debug\</OutputPath>
24
- <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
25
- <NoWarn>;2008</NoWarn>
26
- <DebugType>full</DebugType>
27
- <PlatformTarget>x86</PlatformTarget>
28
- <UseVSHostingProcess>false</UseVSHostingProcess>
29
- <ErrorReport>prompt</ErrorReport>
30
- </PropertyGroup>
31
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
32
- <PlatformTarget>x86</PlatformTarget>
33
- <OutputPath>bin\x86\Release\</OutputPath>
34
- <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
35
- <Optimize>true</Optimize>
36
- <NoWarn>;2008</NoWarn>
37
- <DebugType>pdbonly</DebugType>
38
- <PlatformTarget>x86</PlatformTarget>
39
- <UseVSHostingProcess>false</UseVSHostingProcess>
40
- <ErrorReport>prompt</ErrorReport>
41
- </PropertyGroup>
42
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
43
- <PlatformTarget>ARM</PlatformTarget>
44
- <DebugSymbols>true</DebugSymbols>
45
- <OutputPath>bin\ARM\Debug\</OutputPath>
46
- <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
47
- <NoWarn>;2008</NoWarn>
48
- <DebugType>full</DebugType>
49
- <PlatformTarget>ARM</PlatformTarget>
50
- <UseVSHostingProcess>false</UseVSHostingProcess>
51
- <ErrorReport>prompt</ErrorReport>
52
- </PropertyGroup>
53
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
54
- <PlatformTarget>ARM</PlatformTarget>
55
- <OutputPath>bin\ARM\Release\</OutputPath>
56
- <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
57
- <Optimize>true</Optimize>
58
- <NoWarn>;2008</NoWarn>
59
- <DebugType>pdbonly</DebugType>
60
- <PlatformTarget>ARM</PlatformTarget>
61
- <UseVSHostingProcess>false</UseVSHostingProcess>
62
- <ErrorReport>prompt</ErrorReport>
63
- </PropertyGroup>
64
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
65
- <PlatformTarget>x64</PlatformTarget>
66
- <DebugSymbols>true</DebugSymbols>
67
- <OutputPath>bin\x64\Debug\</OutputPath>
68
- <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
69
- <NoWarn>;2008</NoWarn>
70
- <DebugType>full</DebugType>
71
- <PlatformTarget>x64</PlatformTarget>
72
- <UseVSHostingProcess>false</UseVSHostingProcess>
73
- <ErrorReport>prompt</ErrorReport>
74
- </PropertyGroup>
75
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
76
- <PlatformTarget>x64</PlatformTarget>
77
- <OutputPath>bin\x64\Release\</OutputPath>
78
- <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
79
- <Optimize>true</Optimize>
80
- <NoWarn>;2008</NoWarn>
81
- <DebugType>pdbonly</DebugType>
82
- <PlatformTarget>x64</PlatformTarget>
83
- <UseVSHostingProcess>false</UseVSHostingProcess>
84
- <ErrorReport>prompt</ErrorReport>
85
- </PropertyGroup>
86
- <PropertyGroup>
87
- <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
88
- </PropertyGroup>
89
- <ItemGroup>
90
- <Compile Include="UpdateManager.cs" />
91
- <Compile Include="UpdateUtils.cs" />
92
- <Compile Include="CodePushUtils.cs" />
93
- <Compile Include="FileUtils.cs" />
94
- <Compile Include="Properties\AssemblyInfo.cs" />
95
- <EmbeddedResource Include="Properties\CodePush.rd.xml" />
96
- </ItemGroup>
97
- <ItemGroup>
98
- <ProjectReference Include="..\..\..\react-native-windows\ReactWindows\ReactNative\ReactNative.csproj">
99
- <Project>{c7673ad5-e3aa-468c-a5fd-fa38154e205c}</Project>
100
- <Name>ReactNative</Name>
101
- </ProjectReference>
102
- </ItemGroup>
103
- <ItemGroup>
104
- <PackageReference Include="Newtonsoft.Json">
105
- <Version>13.0.1</Version>
106
- </PackageReference>
107
- <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
108
- <Version>6.0.6</Version>
109
- </PackageReference>
110
- </ItemGroup>
111
- <ItemGroup>
112
- <SDKReference Include="WindowsMobile, Version=10.0.14393.0">
113
- <Name>Windows Mobile Extensions for the UWP</Name>
114
- </SDKReference>
115
- </ItemGroup>
116
- <Import Project="..\CodePush.Shared\CodePush.Shared.projitems" Label="Shared" />
117
- <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
118
- <VisualStudioVersion>14.0</VisualStudioVersion>
119
- </PropertyGroup>
120
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
121
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
122
- Other similar extension points exist, see Microsoft.Common.targets.
123
- <Target Name="BeforeBuild">
124
- </Target>
125
- <Target Name="AfterBuild">
126
- </Target>
127
- -->
128
- </Project>
@@ -1,47 +0,0 @@
1
- using Newtonsoft.Json.Linq;
2
- using System;
3
- using System.Threading.Tasks;
4
- using Windows.Storage;
5
- using Windows.Storage.Streams;
6
- using Windows.System.Profile;
7
-
8
- namespace CodePush.ReactNative
9
- {
10
- internal partial class CodePushUtils
11
- {
12
- internal static string GetFileBundlePrefix()
13
- {
14
- return CodePushConstants.FileBundlePrefix;
15
- }
16
-
17
- internal async static Task<JObject> GetJObjectFromFileAsync(StorageFile file)
18
- {
19
- string jsonString = await FileIO.ReadTextAsync(file).AsTask().ConfigureAwait(false);
20
- if (jsonString.Length == 0)
21
- {
22
- return new JObject();
23
- }
24
-
25
- try
26
- {
27
- return JObject.Parse(jsonString);
28
- }
29
- catch (Exception)
30
- {
31
- return null;
32
- }
33
- }
34
-
35
- static string GetDeviceIdImpl()
36
- {
37
- HardwareToken token = HardwareIdentification.GetPackageSpecificToken(null);
38
- IBuffer hardwareId = token.Id;
39
- var dataReader = DataReader.FromBuffer(hardwareId);
40
-
41
- var bytes = new byte[hardwareId.Length];
42
- dataReader.ReadBytes(bytes);
43
-
44
- return BitConverter.ToString(bytes);
45
- }
46
- }
47
- }
@@ -1,40 +0,0 @@
1
- using System;
2
- using System.Threading.Tasks;
3
- using Windows.Storage;
4
-
5
- namespace CodePush.ReactNative
6
- {
7
- internal class FileUtils
8
- {
9
- internal async static Task MergeFoldersAsync(StorageFolder source, StorageFolder target)
10
- {
11
- foreach (StorageFile sourceFile in await source.GetFilesAsync().AsTask().ConfigureAwait(false))
12
- {
13
- await sourceFile.CopyAndReplaceAsync(await target.CreateFileAsync(sourceFile.Name, CreationCollisionOption.OpenIfExists).AsTask().ConfigureAwait(false)).AsTask().ConfigureAwait(false);
14
- }
15
-
16
- foreach (StorageFolder sourceDirectory in await source.GetFoldersAsync().AsTask().ConfigureAwait(false))
17
- {
18
- StorageFolder nextTargetSubDir = await target.CreateFolderAsync(sourceDirectory.Name, CreationCollisionOption.OpenIfExists).AsTask().ConfigureAwait(false);
19
- await MergeFoldersAsync(sourceDirectory, nextTargetSubDir).ConfigureAwait(false);
20
- }
21
- }
22
-
23
- internal async static Task ClearReactDevBundleCacheAsync()
24
- {
25
- var devBundleCacheFile = (StorageFile)await ApplicationData.Current.LocalFolder.TryGetItemAsync(CodePushConstants.ReactDevBundleCacheFileName).AsTask().ConfigureAwait(false);
26
- if (devBundleCacheFile != null)
27
- {
28
- await devBundleCacheFile.DeleteAsync().AsTask().ConfigureAwait(false);
29
- }
30
- }
31
-
32
- internal async static Task<long> GetBinaryResourcesModifiedTimeAsync(string fileName)
33
- {
34
- var assetJSBundleFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(CodePushConstants.AssetsBundlePrefix + fileName)).AsTask().ConfigureAwait(false);
35
- var fileProperties = await assetJSBundleFile.GetBasicPropertiesAsync().AsTask().ConfigureAwait(false);
36
- return fileProperties.DateModified.ToUnixTimeMilliseconds();
37
- }
38
-
39
- }
40
- }
@@ -1,29 +0,0 @@
1
- using System.Reflection;
2
- using System.Runtime.CompilerServices;
3
- using System.Runtime.InteropServices;
4
-
5
- // General Information about an assembly is controlled through the following
6
- // set of attributes. Change these attribute values to modify the information
7
- // associated with an assembly.
8
- [assembly: AssemblyTitle("CodePush")]
9
- [assembly: AssemblyDescription("")]
10
- [assembly: AssemblyConfiguration("")]
11
- [assembly: AssemblyCompany("")]
12
- [assembly: AssemblyProduct("CodePush")]
13
- [assembly: AssemblyCopyright("Copyright © 2016")]
14
- [assembly: AssemblyTrademark("")]
15
- [assembly: AssemblyCulture("")]
16
-
17
- // Version information for an assembly consists of the following four values:
18
- //
19
- // Major Version
20
- // Minor Version
21
- // Build Number
22
- // Revision
23
- //
24
- // You can specify all the values or you can default the Build and Revision Numbers
25
- // by using the '*' as shown below:
26
- // [assembly: AssemblyVersion("1.0.*")]
27
- [assembly: AssemblyVersion("1.0.0.0")]
28
- [assembly: AssemblyFileVersion("1.0.0.0")]
29
- [assembly: ComVisible(false)]
@@ -1,33 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- This file contains Runtime Directives, specifications about types your application accesses
4
- through reflection and other dynamic code patterns. Runtime Directives are used to control the
5
- .NET Native optimizer and ensure that it does not remove code accessed by your library. If your
6
- library does not do any reflection, then you generally do not need to edit this file. However,
7
- if your library reflects over types, especially types passed to it or derived from its types,
8
- then you should write Runtime Directives.
9
-
10
- The most common use of reflection in libraries is to discover information about types passed
11
- to the library. Runtime Directives have three ways to express requirements on types passed to
12
- your library.
13
-
14
- 1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
15
- Use these directives to reflect over types passed as a parameter.
16
-
17
- 2. SubTypes
18
- Use a SubTypes directive to reflect over types derived from another type.
19
-
20
- 3. AttributeImplies
21
- Use an AttributeImplies directive to indicate that your library needs to reflect over
22
- types or methods decorated with an attribute.
23
-
24
- For more information on writing Runtime Directives for libraries, please visit
25
- http://go.microsoft.com/fwlink/?LinkID=391919
26
- -->
27
- <Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
28
- <Library Name="CodePush">
29
-
30
- <!-- add directives for your library here -->
31
-
32
- </Library>
33
- </Directives>