@appzung/react-native-code-push 6.4.2 → 7.1.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 (75) hide show
  1. package/CodePush.js +6 -7
  2. package/CodePush.podspec +1 -1
  3. package/README.md +5 -4
  4. package/SECURITY.md +41 -0
  5. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +10 -0
  6. package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +8 -9
  7. package/android/codepush.gradle +11 -8
  8. package/docs/setup-windows.md +36 -3
  9. package/ios/CodePush/CodePushUpdateUtils.m +1 -1
  10. package/ios/CodePush.xcodeproj/project.pbxproj +2 -2
  11. package/package.json +11 -11
  12. package/windows/CodePush/CodePush.def +3 -0
  13. package/windows/CodePush/CodePush.vcxproj +199 -0
  14. package/windows/CodePush/CodePush.vcxproj.filters +91 -0
  15. package/windows/CodePush/CodePushConfig.cpp +104 -0
  16. package/windows/CodePush/CodePushConfig.h +66 -0
  17. package/windows/CodePush/CodePushConfig.idl +12 -0
  18. package/windows/CodePush/CodePushDownloadHandler.cpp +73 -0
  19. package/windows/CodePush/CodePushDownloadHandler.h +32 -0
  20. package/windows/CodePush/CodePushNativeModule.cpp +934 -0
  21. package/windows/CodePush/CodePushNativeModule.h +247 -0
  22. package/windows/CodePush/CodePushPackage.cpp +456 -0
  23. package/windows/CodePush/CodePushPackage.h +49 -0
  24. package/windows/CodePush/CodePushTelemetryManager.cpp +213 -0
  25. package/windows/CodePush/CodePushTelemetryManager.h +29 -0
  26. package/windows/CodePush/CodePushUpdateUtils.cpp +86 -0
  27. package/windows/CodePush/CodePushUpdateUtils.h +38 -0
  28. package/windows/CodePush/CodePushUtils.cpp +29 -0
  29. package/windows/CodePush/CodePushUtils.h +18 -0
  30. package/windows/CodePush/FileUtils.cpp +131 -0
  31. package/windows/CodePush/FileUtils.h +28 -0
  32. package/windows/CodePush/PropertySheet.props +16 -0
  33. package/windows/CodePush/ReactPackageProvider.cpp +15 -0
  34. package/windows/CodePush/ReactPackageProvider.h +22 -0
  35. package/windows/CodePush/ReactPackageProvider.idl +9 -0
  36. package/windows/CodePush/miniz/LICENSE +22 -0
  37. package/windows/CodePush/miniz/miniz.c +7657 -0
  38. package/windows/CodePush/miniz/miniz.h +1338 -0
  39. package/windows/CodePush/miniz/readme.md +37 -0
  40. package/windows/CodePush/packages.config +4 -0
  41. package/windows/CodePush/pch.cpp +1 -0
  42. package/windows/CodePush/pch.h +4 -0
  43. package/{windows → windows-legacy}/CodePush/CodePush.csproj +1 -1
  44. package/{windows → windows-legacy}/CodePush.Net46/packages.config +1 -1
  45. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +105 -0
  46. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +137 -0
  47. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +36 -0
  48. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +117 -0
  49. package/windows-legacy/CodePush.Net46.Test/app.config +11 -0
  50. package/windows-legacy/CodePush.Net46.Test/packages.config +4 -0
  51. /package/{windows → windows-legacy}/CodePush/CodePushUtils.cs +0 -0
  52. /package/{windows → windows-legacy}/CodePush/FileUtils.cs +0 -0
  53. /package/{windows → windows-legacy}/CodePush/Properties/AssemblyInfo.cs +0 -0
  54. /package/{windows → windows-legacy}/CodePush/Properties/CodePush.rd.xml +0 -0
  55. /package/{windows → windows-legacy}/CodePush/UpdateManager.cs +0 -0
  56. /package/{windows → windows-legacy}/CodePush/UpdateUtils.cs +0 -0
  57. /package/{windows → windows-legacy}/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -0
  58. /package/{windows → windows-legacy}/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -0
  59. /package/{windows → windows-legacy}/CodePush.Net46/CodePush.Net46.csproj +0 -0
  60. /package/{windows → windows-legacy}/CodePush.Net46/CodePushUtils.cs +0 -0
  61. /package/{windows → windows-legacy}/CodePush.Net46/FileUtils.cs +0 -0
  62. /package/{windows → windows-legacy}/CodePush.Net46/Properties/AssemblyInfo.cs +0 -0
  63. /package/{windows → windows-legacy}/CodePush.Net46/UpdateManager.cs +0 -0
  64. /package/{windows → windows-legacy}/CodePush.Net46/UpdateUtils.cs +0 -0
  65. /package/{windows → windows-legacy}/CodePush.Shared/CodePush.Shared.projitems +0 -0
  66. /package/{windows → windows-legacy}/CodePush.Shared/CodePush.Shared.shproj +0 -0
  67. /package/{windows → windows-legacy}/CodePush.Shared/CodePushConstants.cs +0 -0
  68. /package/{windows → windows-legacy}/CodePush.Shared/CodePushNativeModule.cs +0 -0
  69. /package/{windows → windows-legacy}/CodePush.Shared/CodePushReactPackage.cs +0 -0
  70. /package/{windows → windows-legacy}/CodePush.Shared/CodePushUtils.cs +0 -0
  71. /package/{windows → windows-legacy}/CodePush.Shared/InstallMode.cs +0 -0
  72. /package/{windows → windows-legacy}/CodePush.Shared/MinimumBackgroundListener.cs +0 -0
  73. /package/{windows → windows-legacy}/CodePush.Shared/SettingsManager.cs +0 -0
  74. /package/{windows → windows-legacy}/CodePush.Shared/TelemetryManager.cs +0 -0
  75. /package/{windows → windows-legacy}/CodePush.Shared/UpdateState.cs +0 -0
package/CodePush.js CHANGED
@@ -180,7 +180,7 @@ async function notifyApplicationReadyInternal() {
180
180
  return statusReport;
181
181
  }
182
182
 
183
- async function tryReportStatus(statusReport, resumeListener) {
183
+ async function tryReportStatus(statusReport, retryOnAppResume) {
184
184
  const config = await getConfiguration();
185
185
  const previousLabelOrAppVersion = statusReport.previousLabelOrAppVersion;
186
186
  const previousDeploymentKey = statusReport.previousDeploymentKey || config.deploymentKey;
@@ -209,22 +209,21 @@ async function tryReportStatus(statusReport, resumeListener) {
209
209
  }
210
210
 
211
211
  NativeCodePush.recordStatusReported(statusReport);
212
- resumeListener && AppState.removeEventListener("change", resumeListener);
212
+ retryOnAppResume && retryOnAppResume.remove();
213
213
  } catch (e) {
214
214
  log(`Report status failed: ${JSON.stringify(statusReport)}`);
215
215
  NativeCodePush.saveStatusReportForRetry(statusReport);
216
216
  // Try again when the app resumes
217
- if (!resumeListener) {
218
- resumeListener = async (newState) => {
217
+ if (!retryOnAppResume) {
218
+ const resumeListener = AppState.addEventListener("change", async (newState) => {
219
219
  if (newState !== "active") return;
220
220
  const refreshedStatusReport = await NativeCodePush.getNewStatusReport();
221
221
  if (refreshedStatusReport) {
222
222
  tryReportStatus(refreshedStatusReport, resumeListener);
223
223
  } else {
224
- AppState.removeEventListener("change", resumeListener);
224
+ resumeListener && resumeListener.remove();
225
225
  }
226
- };
227
- AppState.addEventListener("change", resumeListener);
226
+ });
228
227
  }
229
228
  }
230
229
  }
package/CodePush.podspec CHANGED
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.homepage = package['homepage']
12
12
  s.source = { :git => 'https://github.com/appzung/react-native-code-push.git', :tag => "v#{s.version}"}
13
- s.ios.deployment_target = '7.0'
13
+ s.ios.deployment_target = '9.0'
14
14
  s.tvos.deployment_target = '9.0'
15
15
  s.preserve_paths = '*.js'
16
16
  s.library = 'z'
package/README.md CHANGED
@@ -39,7 +39,7 @@ This plugin provides client-side integration for the [CodePush service](https://
39
39
 
40
40
  ## How does it work?
41
41
 
42
- A React Native app is composed of JavaScript files and any accompanying [images](https://facebook.github.io/react-native/docs/images.html#content), which are bundled together by the [packager](https://github.com/facebook/react-native/tree/master/packager) and distributed as part of a platform-specific binary (i.e. an `.ipa` or `.apk` file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to.
42
+ A React Native app is composed of JavaScript files and any accompanying [images](https://reactnative.dev/docs/image), which are bundled together by the [metro bundler](https://github.com/facebook/metro) and distributed as part of a platform-specific binary (i.e. an `.ipa` or `.apk` file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to.
43
43
 
44
44
  The CodePush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the CodePush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win!
45
45
 
@@ -74,7 +74,8 @@ We try our best to maintain backwards compatibility of our plugin with previous
74
74
  | v0.56-v0.58 | v5.4+ *(RN upgraded versions for Android tools)* |
75
75
  | v0.59 | v5.6+ *(RN refactored js bundle loader code)* |
76
76
  | v0.60-v0.61 | v6.0+ *(RN migrated to Autolinking)* |
77
- | v0.62-v0.63 | v6.2+ *(RN removed LiveReload)* |
77
+ | v0.62-v0.64 | v6.2+ *(RN removed LiveReload)* |
78
+ | v0.65-v0.69 | v7.2+ *(RN updated iPhone-target-version)* |
78
79
 
79
80
  *NOTE: `react-native-code-push` versions lower than **[v5.7.0](https://github.com/microsoft/react-native-code-push/releases/tag/v5.7.0)** will stop working in the near future. You can find more information in our [documentation](https://github.com/microsoft/code-push/blob/master/migration-notice.md).*
80
81
 
@@ -250,7 +251,7 @@ Android Google Play and iOS App Store have corresponding guidelines that have ru
250
251
 
251
252
  #### Google play
252
253
 
253
- Third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) topic describe that updating source code by any method other than Google Play's update mechanism is restricted. But this restriction is not apply to updating javascript bundles.
254
+ Third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) topic describe that updating source code by any method other than Google Play's update mechanism is restricted. But this restriction does not apply to updating javascript bundles.
254
255
  > This restriction does not apply to code that runs in a virtual machine and has limited access to Android APIs (such as JavaScript in a webview or browser).
255
256
 
256
257
  That fully allow CodePush as it updates just JS bundles and can't update native code part.
@@ -426,7 +427,7 @@ Now you'll be able to see CodePush logs in either debug or release mode, on both
426
427
 
427
428
  ### Continuous Integration / Delivery
428
429
 
429
- In addition to being able to use the CodePush CLI to "manually" release updates, we believe that it's important to create a repeatable and sustainable solution for contiously delivering updates to your app. That way, it's simple enough for you and/or your team to create and maintain the rhythm of performing agile deployments. In order to assist with seting up a CodePush-based CD pipeline, refer to the following integrations with various CI servers:
430
+ In addition to being able to use the CodePush CLI to "manually" release updates, we believe that it's important to create a repeatable and sustainable solution for contiously delivering updates to your app. That way, it's simple enough for you and/or your team to create and maintain the rhythm of performing agile deployments. In order to assist with setting up a CodePush-based CD pipeline, refer to the following integrations with various CI servers:
430
431
 
431
432
  * [Visual Studio Team Services](https://marketplace.visualstudio.com/items?itemName=ms-vsclient.code-push) - *NOTE: VSTS also has extensions for publishing to [HockeyApp](https://marketplace.visualstudio.com/items?itemName=ms.hockeyapp) and the [Google Play](https://github.com/microsoft/google-play-vsts-extension) store, so it provides a pretty great mobile CD solution in general.*
432
433
  * [Travis CI](https://github.com/mondora/code-push-travis-cli)
package/SECURITY.md ADDED
@@ -0,0 +1,41 @@
1
+ <!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
2
+
3
+ ## Security
4
+
5
+ Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6
+
7
+ If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8
+
9
+ ## Reporting Security Issues
10
+
11
+ **Please do not report security vulnerabilities through public GitHub issues.**
12
+
13
+ Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14
+
15
+ If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16
+
17
+ You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18
+
19
+ Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
+
21
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
+ * Full paths of source file(s) related to the manifestation of the issue
23
+ * The location of the affected source code (tag/branch/commit or direct URL)
24
+ * Any special configuration required to reproduce the issue
25
+ * Step-by-step instructions to reproduce the issue
26
+ * Proof-of-concept or exploit code (if possible)
27
+ * Impact of the issue, including how an attacker might exploit the issue
28
+
29
+ This information will help us triage your report more quickly.
30
+
31
+ If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32
+
33
+ ## Preferred Languages
34
+
35
+ We prefer all communications to be in English.
36
+
37
+ ## Policy
38
+
39
+ Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40
+
41
+ <!-- END MICROSOFT SECURITY.MD BLOCK -->
@@ -693,4 +693,14 @@ public class CodePushNativeModule extends ReactContextBaseJavaModule {
693
693
  CodePushUtils.log("Clearing updates.");
694
694
  mCodePush.clearUpdates();
695
695
  }
696
+
697
+ @ReactMethod
698
+ public void addListener(String eventName) {
699
+ // Set up any upstream listeners or background tasks as necessary
700
+ }
701
+
702
+ @ReactMethod
703
+ public void removeListeners(Integer count) {
704
+ // Remove upstream listeners, stop unnecessary background tasks
705
+ }
696
706
  }
@@ -123,14 +123,13 @@ public class FileUtils {
123
123
  }
124
124
  }
125
125
 
126
- private static String validateFileName(String fileName, String targetDirectory) throws IOException {
127
- File file = new File(fileName);
128
- String canonicalPath = file.getCanonicalPath();
126
+ private static String validateFileName(String fileName, File destinationFolder) throws IOException {
127
+ String destinationFolderCanonicalPath = destinationFolder.getCanonicalPath() + File.separator;
129
128
 
130
- File targetFile = new File(targetDirectory);
131
- String targetCanonicalPath = targetFile.getCanonicalPath();
129
+ File file = new File(destinationFolderCanonicalPath, fileName);
130
+ String canonicalPath = file.getCanonicalPath();
132
131
 
133
- if (!canonicalPath.startsWith(targetCanonicalPath)) {
132
+ if (!canonicalPath.startsWith(destinationFolderCanonicalPath)) {
134
133
  throw new IllegalStateException("File is outside extraction target directory.");
135
134
  }
136
135
 
@@ -151,13 +150,13 @@ public class FileUtils {
151
150
  if (destinationFolder.exists()) {
152
151
  deleteFileOrFolderSilently(destinationFolder);
153
152
  }
154
-
153
+
155
154
  destinationFolder.mkdirs();
156
155
 
157
156
  byte[] buffer = new byte[WRITE_BUFFER_SIZE];
158
157
  while ((entry = zipStream.getNextEntry()) != null) {
159
- String fileName = validateFileName(entry.getName(), ".");
160
- File file = new File(destinationFolder, fileName);
158
+ String fileName = validateFileName(entry.getName(), destinationFolder);
159
+ File file = new File(fileName);
161
160
  if (entry.isDirectory()) {
162
161
  file.mkdirs();
163
162
  } else {
@@ -17,13 +17,13 @@ void runBefore(String dependentTaskName, Task task) {
17
17
  }
18
18
  }
19
19
 
20
- gradle.projectsEvaluated {
21
- android.buildTypes.each {
22
- // to prevent incorrect long value restoration from strings.xml we need to wrap it with double quotes
23
- // https://github.com/microsoft/cordova-plugin-code-push/issues/264
24
- it.resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
25
- }
26
-
20
+ android.buildTypes.each { buildType ->
21
+ // to prevent incorrect long value restoration from strings.xml we need to wrap it with double quotes
22
+ // https://github.com/microsoft/cordova-plugin-code-push/issues/264
23
+ buildType.resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
24
+ }
25
+
26
+ gradle.projectsEvaluated {
27
27
  android.applicationVariants.all { variant ->
28
28
  def nodeModulesPath;
29
29
  if (config.root) {
@@ -62,7 +62,10 @@ gradle.projectsEvaluated {
62
62
  enabled config."bundleIn${targetName}" ||
63
63
  config."bundleIn${variant.buildType.name.capitalize()}" ?:
64
64
  targetName.toLowerCase().contains("release")
65
- }
65
+ }
66
+
67
+ runBefore("merge${targetName}Resources", generateBundledResourcesHash)
68
+ runBefore("merge${targetName}Assets", generateBundledResourcesHash)
66
69
  } else {
67
70
  def jsBundleDirConfigName = "jsBundleDir${targetName}"
68
71
  jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?:
@@ -2,9 +2,42 @@
2
2
 
3
3
  Once you've acquired the CodePush plugin, you need to integrate it into the Visual Studio project of your React Native app and configure it correctly. To do this, take the following steps:
4
4
 
5
- ### Plugin Installation (Windows)
5
+ ### Plugin Installation and Configuration for React Native Windows 0.63.6 version and above
6
6
 
7
- 1. Open the Visual Studio solution located at `windows\<AppName>\<AppName>.sln` within your app
7
+ #### Plugin Installation (Windows-npx)
8
+
9
+ Once the plugin has been downloaded, run `npx react-native autolink-windows` in your application's root directory to automatically add the CodePush c++ project to your application's windows solution file.
10
+
11
+ #### Plugin Configuration (Windows)
12
+
13
+ 1. Replace the following files located at `windows/<app name>` with those in the CodePushDemoAppCpp example app in this repo found at `Examples/CodePushDemoAppCpp/windows/CodePushDemoAppCpp`:
14
+ 1. app.h
15
+ 2. app.cpp
16
+ 3. app.xaml
17
+
18
+ 2. In the above files, replace any occurance of `CodePushDemoAppCpp` with the name of your application
19
+
20
+ 3. Enter your application's app version and deployment key to the `configMap` object at the top of your app's `OnLaunched` method in `App.cpp`:
21
+
22
+ ```c++
23
+ ...
24
+ void App::OnLaunched(activation::LaunchActivatedEventArgs const& e)
25
+ {
26
+ winrt::Microsoft::CodePush::ReactNative::CodePushConfig::SetHost(Host());
27
+ auto configMap{ winrt::single_threaded_map<hstring, hstring>() };
28
+ configMap.Insert(L"appVersion", L"1.0.0");
29
+ configMap.Insert(L"deploymentKey", L"<app deployment key>");
30
+ winrt::Microsoft::CodePush::ReactNative::CodePushConfig::Init(configMap);
31
+ ...
32
+ }
33
+ ...
34
+ ```
35
+
36
+ ### Plugin Installation and Configuration for React Native Windows lower than 0.60
37
+
38
+ #### Plugin Installation (Windows)
39
+
40
+ 1. Open the Visual Studio solution located at `windows-legacy\<AppName>\<AppName>.sln` within your app
8
41
 
9
42
  2. Right-click the solution node in the `Solution Explorer` window and select the `Add -> Existing Project...` menu item
10
43
 
@@ -20,7 +53,7 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Visu
20
53
 
21
54
  ![Add Reference Dialog](https://cloud.githubusercontent.com/assets/116461/14467147/cb805b6e-008e-11e6-964f-f856c59b65af.PNG)
22
55
 
23
- ### Plugin Configuration (Windows)
56
+ #### Plugin Configuration (Windows)
24
57
 
25
58
  After installing the plugin, you need to configure your app to consult CodePush for the location of your JS bundle, since it will "take control" of managing the current and all future versions. To do this, update the `MainReactNativeHost.cs` file to use CodePush via the following changes:
26
59
 
@@ -93,7 +93,7 @@ NSString * const IgnoreCodePushMetadata = @".codepushrelease";
93
93
  // The JSON serialization turns path separators into "\/", e.g. "CodePush\/assets\/image.png"
94
94
  manifestString = [manifestString stringByReplacingOccurrencesOfString:@"\\/"
95
95
  withString:@"/"];
96
- return [self computeHashForData:[NSData dataWithBytes:manifestString.UTF8String length:manifestString.length]];
96
+ return [self computeHashForData:[NSData dataWithBytes:manifestString.UTF8String length:[manifestString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]]];
97
97
  }
98
98
 
99
99
  + (NSString *)computeHashForData:(NSData *)inputData
@@ -771,7 +771,7 @@
771
771
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
772
772
  GCC_WARN_UNUSED_FUNCTION = YES;
773
773
  GCC_WARN_UNUSED_VARIABLE = YES;
774
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
774
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
775
775
  MTL_ENABLE_DEBUG_INFO = YES;
776
776
  ONLY_ACTIVE_ARCH = YES;
777
777
  SDKROOT = iphoneos;
@@ -817,7 +817,7 @@
817
817
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
818
818
  GCC_WARN_UNUSED_FUNCTION = YES;
819
819
  GCC_WARN_UNUSED_VARIABLE = YES;
820
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
820
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
821
821
  MTL_ENABLE_DEBUG_INFO = NO;
822
822
  SDKROOT = iphoneos;
823
823
  USER_HEADER_SEARCH_PATHS = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appzung/react-native-code-push",
3
- "version": "6.4.2",
3
+ "version": "7.1.1",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "main": "CodePush.js",
6
6
  "typings": "typings/react-native-code-push.d.ts",
@@ -25,33 +25,33 @@
25
25
  "tslint": "tslint -c tslint.json test/**/*.ts"
26
26
  },
27
27
  "dependencies": {
28
- "code-push": "^4.0.2",
29
- "glob": "^7.1.6",
28
+ "code-push": "^4.1.0",
29
+ "glob": "^7.1.7",
30
30
  "hoist-non-react-statics": "^3.3.2",
31
- "inquirer": "^7.3.3",
32
- "plist": "3.0.1",
33
- "semver": "^7.3.2",
31
+ "inquirer": "^8.1.5",
32
+ "plist": "^3.0.4",
33
+ "semver": "^7.3.5",
34
34
  "xcode": "3.0.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/assert": "^1.5.2",
38
38
  "@types/mkdirp": "^1.0.1",
39
- "@types/mocha": "^8.0.3",
39
+ "@types/mocha": "^9.0.0",
40
40
  "@types/node": "^14.0.27",
41
41
  "@types/q": "^1.5.4",
42
42
  "archiver": "latest",
43
43
  "body-parser": "latest",
44
44
  "code-push-plugin-testing-framework": "file:./code-push-plugin-testing-framework",
45
- "del": "latest",
45
+ "del": "v6.0.0",
46
46
  "express": "latest",
47
47
  "mkdirp": "latest",
48
- "mocha": "^8.1.3",
48
+ "mocha": "^9.2.0",
49
49
  "q": "^1.5.1",
50
50
  "run-sequence": "latest",
51
- "shx": "^0.3.2",
51
+ "shx": "^0.3.4",
52
52
  "slash": "^3.0.0",
53
53
  "tslint": "^6.1.3",
54
- "typescript": "^4.0.3"
54
+ "typescript": "^4.4.3"
55
55
  },
56
56
  "rnpm": {
57
57
  "android": {
@@ -0,0 +1,3 @@
1
+ EXPORTS
2
+ DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
3
+ DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
@@ -0,0 +1,199 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props')" />
4
+ <PropertyGroup Label="Globals">
5
+ <CppWinRTOptimized>true</CppWinRTOptimized>
6
+ <CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
7
+ <CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
8
+ <MinimalCoreWin>true</MinimalCoreWin>
9
+ <ProjectGuid>{a6b6216e-fa3f-45e2-9c8e-40023cce9132}</ProjectGuid>
10
+ <ProjectName>CodePush</ProjectName>
11
+ <RootNamespace>Microsoft.CodePush.ReactNative</RootNamespace>
12
+ <DefaultLanguage>en-US</DefaultLanguage>
13
+ <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
14
+ <AppContainerApplication>true</AppContainerApplication>
15
+ <ApplicationType>Windows Store</ApplicationType>
16
+ <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
17
+ <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
18
+ <WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
19
+ </PropertyGroup>
20
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21
+ <PropertyGroup Label="ReactNativeWindowsProps">
22
+ <ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
23
+ </PropertyGroup>
24
+ <ItemGroup Label="ProjectConfigurations">
25
+ <ProjectConfiguration Include="Debug|ARM">
26
+ <Configuration>Debug</Configuration>
27
+ <Platform>ARM</Platform>
28
+ </ProjectConfiguration>
29
+ <ProjectConfiguration Include="Debug|ARM64">
30
+ <Configuration>Debug</Configuration>
31
+ <Platform>ARM64</Platform>
32
+ </ProjectConfiguration>
33
+ <ProjectConfiguration Include="Debug|Win32">
34
+ <Configuration>Debug</Configuration>
35
+ <Platform>Win32</Platform>
36
+ </ProjectConfiguration>
37
+ <ProjectConfiguration Include="Debug|x64">
38
+ <Configuration>Debug</Configuration>
39
+ <Platform>x64</Platform>
40
+ </ProjectConfiguration>
41
+ <ProjectConfiguration Include="Release|ARM">
42
+ <Configuration>Release</Configuration>
43
+ <Platform>ARM</Platform>
44
+ </ProjectConfiguration>
45
+ <ProjectConfiguration Include="Release|ARM64">
46
+ <Configuration>Release</Configuration>
47
+ <Platform>ARM64</Platform>
48
+ </ProjectConfiguration>
49
+ <ProjectConfiguration Include="Release|Win32">
50
+ <Configuration>Release</Configuration>
51
+ <Platform>Win32</Platform>
52
+ </ProjectConfiguration>
53
+ <ProjectConfiguration Include="Release|x64">
54
+ <Configuration>Release</Configuration>
55
+ <Platform>x64</Platform>
56
+ </ProjectConfiguration>
57
+ </ItemGroup>
58
+ <PropertyGroup Label="Configuration">
59
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
60
+ <PlatformToolset>v140</PlatformToolset>
61
+ <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
62
+ <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
63
+ <CharacterSet>Unicode</CharacterSet>
64
+ <GenerateManifest>false</GenerateManifest>
65
+ </PropertyGroup>
66
+ <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
67
+ <UseDebugLibraries>true</UseDebugLibraries>
68
+ <LinkIncremental>true</LinkIncremental>
69
+ </PropertyGroup>
70
+ <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
71
+ <UseDebugLibraries>false</UseDebugLibraries>
72
+ <WholeProgramOptimization>true</WholeProgramOptimization>
73
+ <LinkIncremental>false</LinkIncremental>
74
+ </PropertyGroup>
75
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
76
+ <ImportGroup Label="ExtensionSettings">
77
+ </ImportGroup>
78
+ <ImportGroup Label="Shared">
79
+ </ImportGroup>
80
+ <ImportGroup Label="PropertySheets">
81
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
82
+ </ImportGroup>
83
+ <ImportGroup Label="PropertySheets">
84
+ <Import Project="PropertySheet.props" />
85
+ </ImportGroup>
86
+ <ImportGroup Label="ReactNativeWindowsPropertySheets">
87
+ <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" />
88
+ </ImportGroup>
89
+ <PropertyGroup Label="UserMacros" />
90
+ <PropertyGroup />
91
+ <ItemDefinitionGroup>
92
+ <ClCompile>
93
+ <PrecompiledHeader>Use</PrecompiledHeader>
94
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
95
+ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
96
+ <WarningLevel>Level4</WarningLevel>
97
+ <AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
98
+ <!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
99
+ <AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
100
+ <DisableSpecificWarnings>
101
+ </DisableSpecificWarnings>
102
+ <PreprocessorDefinitions>_WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
103
+ <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
104
+ </ClCompile>
105
+ <Link>
106
+ <SubSystem>Console</SubSystem>
107
+ <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
108
+ <ModuleDefinitionFile>CodePush.def</ModuleDefinitionFile>
109
+ </Link>
110
+ </ItemDefinitionGroup>
111
+ <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
112
+ <ClCompile>
113
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
114
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
115
+ </ClCompile>
116
+ </ItemDefinitionGroup>
117
+ <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
118
+ <ClCompile>
119
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120
+ </ClCompile>
121
+ <Link>
122
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
123
+ <OptimizeReferences>true</OptimizeReferences>
124
+ </Link>
125
+ </ItemDefinitionGroup>
126
+ <ItemGroup>
127
+ <ClInclude Include="CodePushConfig.h" />
128
+ <ClInclude Include="CodePushDownloadHandler.h" />
129
+ <ClInclude Include="CodePushNativeModule.h" />
130
+ <ClInclude Include="CodePushPackage.h" />
131
+ <ClInclude Include="CodePushTelemetryManager.h" />
132
+ <ClInclude Include="CodePushUpdateUtils.h" />
133
+ <ClInclude Include="CodePushUtils.h" />
134
+ <ClInclude Include="FileUtils.h" />
135
+ <ClInclude Include="miniz\miniz.h" />
136
+ <ClInclude Include="pch.h" />
137
+ <ClInclude Include="ReactPackageProvider.h">
138
+ <DependentUpon>ReactPackageProvider.idl</DependentUpon>
139
+ </ClInclude>
140
+ </ItemGroup>
141
+ <ItemGroup>
142
+ <ClCompile Include="CodePushConfig.cpp" />
143
+ <ClCompile Include="CodePushDownloadHandler.cpp" />
144
+ <ClCompile Include="CodePushNativeModule.cpp" />
145
+ <ClCompile Include="CodePushPackage.cpp" />
146
+ <ClCompile Include="CodePushTelemetryManager.cpp" />
147
+ <ClCompile Include="CodePushUpdateUtils.cpp" />
148
+ <ClCompile Include="CodePushUtils.cpp" />
149
+ <ClCompile Include="FileUtils.cpp" />
150
+ <ClCompile Include="miniz\miniz.c">
151
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
152
+ </ClCompile>
153
+ <ClCompile Include="pch.cpp">
154
+ <PrecompiledHeader>Create</PrecompiledHeader>
155
+ </ClCompile>
156
+ <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
157
+ <ClCompile Include="ReactPackageProvider.cpp">
158
+ <DependentUpon>ReactPackageProvider.idl</DependentUpon>
159
+ </ClCompile>
160
+ </ItemGroup>
161
+ <ItemGroup>
162
+ <Midl Include="CodePushConfig.idl" />
163
+ <Midl Include="ReactPackageProvider.idl" />
164
+ </ItemGroup>
165
+ <ItemGroup>
166
+ <None Include="CodePush.def" />
167
+ </ItemGroup>
168
+ <ItemGroup>
169
+ <None Include="packages.config" />
170
+ <None Include="PropertySheet.props" />
171
+ </ItemGroup>
172
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
173
+ <ImportGroup Label="ReactNativeWindowsTargets">
174
+ <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" />
175
+ </ImportGroup>
176
+ <Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
177
+ <PropertyGroup>
178
+ <ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
179
+ </PropertyGroup>
180
+ <Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props'))" />
181
+ <Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets'))" />
182
+ </Target>
183
+ <ImportGroup Label="ExtensionTargets">
184
+ <Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets')" />
185
+ </ImportGroup>
186
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
187
+ <PropertyGroup>
188
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
189
+ </PropertyGroup>
190
+ <Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props'))" />
191
+ <Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets'))" />
192
+ </Target>
193
+ <ItemGroup>
194
+ <ProjectReference Update="$(ReactNativeWindowsDir)\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj">
195
+ <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
196
+ <LinkLibraryDependencies>true</LinkLibraryDependencies>
197
+ </ProjectReference>
198
+ </ItemGroup>
199
+ </Project>