@turbopush/react-native-code-push 10.2.5 → 10.2.6

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 (85) hide show
  1. package/LICENSE.md +3 -1
  2. package/README.md +118 -39
  3. package/android/app/src/debug/AndroidManifest.xml +9 -0
  4. package/package.json +15 -12
  5. package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
  6. package/.azurepipelines/test-rn-code-push.yml +0 -94
  7. package/.config/CredScanSuppressions.json +0 -14
  8. package/.gitconfig +0 -6
  9. package/CONTRIBUTING.md +0 -134
  10. package/SECURITY.md +0 -41
  11. package/docs/api-android.md +0 -52
  12. package/docs/api-ios.md +0 -31
  13. package/docs/api-js.md +0 -592
  14. package/docs/multi-deployment-testing-android.md +0 -55
  15. package/docs/multi-deployment-testing-ios.md +0 -59
  16. package/docs/setup-android.md +0 -92
  17. package/docs/setup-ios.md +0 -138
  18. package/docs/setup-windows.md +0 -121
  19. package/expo.js +0 -324
  20. package/tsconfig.json +0 -17
  21. package/tslint.json +0 -32
  22. package/windows/CodePush/CodePush.def +0 -3
  23. package/windows/CodePush/CodePush.vcxproj +0 -198
  24. package/windows/CodePush/CodePush.vcxproj.filters +0 -91
  25. package/windows/CodePush/CodePushConfig.cpp +0 -104
  26. package/windows/CodePush/CodePushConfig.h +0 -66
  27. package/windows/CodePush/CodePushConfig.idl +0 -12
  28. package/windows/CodePush/CodePushDownloadHandler.cpp +0 -73
  29. package/windows/CodePush/CodePushDownloadHandler.h +0 -32
  30. package/windows/CodePush/CodePushNativeModule.cpp +0 -934
  31. package/windows/CodePush/CodePushNativeModule.h +0 -247
  32. package/windows/CodePush/CodePushPackage.cpp +0 -456
  33. package/windows/CodePush/CodePushPackage.h +0 -49
  34. package/windows/CodePush/CodePushTelemetryManager.cpp +0 -213
  35. package/windows/CodePush/CodePushTelemetryManager.h +0 -29
  36. package/windows/CodePush/CodePushUpdateUtils.cpp +0 -86
  37. package/windows/CodePush/CodePushUpdateUtils.h +0 -38
  38. package/windows/CodePush/CodePushUtils.cpp +0 -29
  39. package/windows/CodePush/CodePushUtils.h +0 -18
  40. package/windows/CodePush/FileUtils.cpp +0 -131
  41. package/windows/CodePush/FileUtils.h +0 -28
  42. package/windows/CodePush/PropertySheet.props +0 -16
  43. package/windows/CodePush/ReactPackageProvider.cpp +0 -15
  44. package/windows/CodePush/ReactPackageProvider.h +0 -22
  45. package/windows/CodePush/ReactPackageProvider.idl +0 -9
  46. package/windows/CodePush/miniz/LICENSE +0 -22
  47. package/windows/CodePush/miniz/miniz.c +0 -7657
  48. package/windows/CodePush/miniz/miniz.h +0 -1338
  49. package/windows/CodePush/miniz/readme.md +0 -37
  50. package/windows/CodePush/packages.config +0 -4
  51. package/windows/CodePush/pch.cpp +0 -1
  52. package/windows/CodePush/pch.h +0 -4
  53. package/windows-legacy/CodePush/CodePush.csproj +0 -128
  54. package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
  55. package/windows-legacy/CodePush/FileUtils.cs +0 -40
  56. package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
  57. package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
  58. package/windows-legacy/CodePush/UpdateManager.cs +0 -305
  59. package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
  60. package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
  61. package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
  62. package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
  63. package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
  64. package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
  65. package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
  66. package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
  67. package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
  68. package/windows-legacy/CodePush.Net46/packages.config +0 -5
  69. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
  70. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
  71. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
  72. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
  73. package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
  74. package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
  75. package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
  76. package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
  77. package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
  78. package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
  79. package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
  80. package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
  81. package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
  82. package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
  83. package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
  84. package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
  85. package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
@@ -1,250 +0,0 @@
1
- using Newtonsoft.Json;
2
- using Newtonsoft.Json.Linq;
3
- using System;
4
- using System.Runtime.CompilerServices;
5
-
6
- [assembly: InternalsVisibleTo("CodePush.Net46.Test")]
7
-
8
- namespace CodePush.ReactNative
9
- {
10
- /// <summary>
11
- /// Implementation is ported from
12
- /// android\app\src\main\java\com\microsoft\codepush\react\CodePushTelemetry.java
13
- /// I've tried to leave all logic, comments and structure without significant modification.
14
- /// </summary>
15
-
16
- internal class TelemetryManager
17
- {
18
- #region Constants
19
- private static readonly string APP_VERSION_KEY = "appVersion";
20
- private static readonly string DEPLOYMENT_FAILED_STATUS = "DeploymentFailed";
21
- private static readonly string DEPLOYMENT_KEY_KEY = "deploymentKey";
22
- private static readonly string DEPLOYMENT_SUCCEEDED_STATUS = "DeploymentSucceeded";
23
- private static readonly string LABEL_KEY = "label";
24
- private static readonly string LAST_DEPLOYMENT_REPORT_KEY = "CODE_PUSH_LAST_DEPLOYMENT_REPORT";
25
- private static readonly string PACKAGE_KEY = "package";
26
- private static readonly string PREVIOUS_DEPLOYMENT_KEY_KEY = "previousDeploymentKey";
27
- private static readonly string PREVIOUS_LABEL_OR_APP_VERSION_KEY = "previousLabelOrAppVersion";
28
- private static readonly string RETRY_DEPLOYMENT_REPORT_KEY = "CODE_PUSH_RETRY_DEPLOYMENT_REPORT";
29
- private static readonly string STATUS_KEY = "status";
30
- #endregion
31
-
32
- #region Internal methods
33
-
34
- internal static JObject GetBinaryUpdateReport(string appVersion)
35
- {
36
- var previousStatusReportIdentifier = GetPreviousStatusReportIdentifier();
37
-
38
- if (previousStatusReportIdentifier == null)
39
- {
40
- ClearRetryStatusReport();
41
-
42
- var report = new JObject();
43
- report.Add(APP_VERSION_KEY, appVersion);
44
- return report;
45
- }
46
-
47
- if (!previousStatusReportIdentifier.Equals(appVersion))
48
- {
49
- ClearRetryStatusReport();
50
-
51
- var report = new JObject();
52
- report.Add(APP_VERSION_KEY, appVersion);
53
- if (IsStatusReportIdentifierCodePushLabel(previousStatusReportIdentifier))
54
- {
55
- var previousDeploymentKey = GetDeploymentKeyFromStatusReportIdentifier(previousStatusReportIdentifier);
56
- var previousLabel = GetVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier);
57
-
58
- report.Add(PREVIOUS_DEPLOYMENT_KEY_KEY, previousDeploymentKey);
59
- report.Add(PREVIOUS_LABEL_OR_APP_VERSION_KEY, previousLabel);
60
- }
61
- else
62
- {
63
- // Previous status report was with a binary app version.
64
- report.Add(PREVIOUS_LABEL_OR_APP_VERSION_KEY, previousStatusReportIdentifier);
65
- }
66
- return report;
67
- }
68
-
69
- return null;
70
- }
71
-
72
- internal static JObject GetRetryStatusReport()
73
- {
74
- var retryStatusReportString = SettingsManager.GetString(RETRY_DEPLOYMENT_REPORT_KEY);
75
-
76
- if (retryStatusReportString != null)
77
- {
78
- ClearRetryStatusReport();
79
- try
80
- {
81
- var report = JObject.Parse(retryStatusReportString);
82
- return report;
83
- }
84
- catch (Exception)
85
- {
86
- //TODO: should be reported error
87
- }
88
- }
89
-
90
- return null;
91
- }
92
-
93
- internal static JObject GetRollbackReport(JObject lastFailedPackage)
94
- {
95
- var report = new JObject();
96
- report.Add(STATUS_KEY, DEPLOYMENT_FAILED_STATUS);
97
- report.Add(PACKAGE_KEY, lastFailedPackage);
98
-
99
- return report;
100
- }
101
-
102
- internal static JObject GetUpdateReport(JObject currentPackage)
103
- {
104
- var currentPackageIdentifier = GetPackageStatusReportIdentifier(currentPackage);
105
- if (currentPackageIdentifier == null)
106
- {
107
- return null;
108
- }
109
-
110
- var previousStatusReportIdentifier = GetPreviousStatusReportIdentifier();
111
- if (previousStatusReportIdentifier == null)
112
- {
113
- ClearRetryStatusReport();
114
- var report = new JObject();
115
- report.Add(PACKAGE_KEY, currentPackage);
116
- report.Add(STATUS_KEY, DEPLOYMENT_SUCCEEDED_STATUS);
117
- return report;
118
- }
119
-
120
- if (!previousStatusReportIdentifier.Equals(currentPackageIdentifier))
121
- {
122
- ClearRetryStatusReport();
123
- var report = new JObject();
124
- report.Add(PACKAGE_KEY, currentPackage);
125
- report.Add(STATUS_KEY, DEPLOYMENT_SUCCEEDED_STATUS);
126
-
127
- if (IsStatusReportIdentifierCodePushLabel(previousStatusReportIdentifier))
128
- {
129
- var previousDeploymentKey = GetDeploymentKeyFromStatusReportIdentifier(previousStatusReportIdentifier);
130
- var previousLabel = GetVersionLabelFromStatusReportIdentifier(previousStatusReportIdentifier);
131
-
132
- report.Add(PREVIOUS_DEPLOYMENT_KEY_KEY, previousDeploymentKey);
133
- report.Add(PREVIOUS_LABEL_OR_APP_VERSION_KEY, previousLabel);
134
- }
135
- else
136
- {
137
- // Previous status report was with a binary app version.
138
- report.Add(PREVIOUS_LABEL_OR_APP_VERSION_KEY, previousStatusReportIdentifier);
139
- }
140
-
141
- return report;
142
- }
143
-
144
- return null;
145
- }
146
-
147
- internal static void RecordStatusReported(JObject statusReport)
148
- {
149
- // We don't need to record rollback reports, so exit early if that's what was specified.
150
- var status = (string)statusReport.GetValue(STATUS_KEY);
151
- if ((!string.IsNullOrEmpty(status)) && DEPLOYMENT_FAILED_STATUS.Equals(status))
152
- {
153
- return;
154
- }
155
-
156
- var appVersion = (string)statusReport.GetValue(APP_VERSION_KEY);
157
- if (!string.IsNullOrEmpty(appVersion))
158
- {
159
- SaveStatusReportedForIdentifier(appVersion);
160
- }
161
- else
162
- {
163
- var package = (JObject)statusReport.GetValue(PACKAGE_KEY);
164
- if (package == null)
165
- {
166
- return;
167
- }
168
-
169
- var packageIdentifier = GetPackageStatusReportIdentifier(package);
170
- SaveStatusReportedForIdentifier(packageIdentifier);
171
- }
172
- }
173
-
174
- internal static void SaveStatusReportForRetry(JObject statusReport)
175
- {
176
- SettingsManager.SetString(RETRY_DEPLOYMENT_REPORT_KEY, statusReport.ToString(Formatting.None));
177
- }
178
-
179
- #endregion
180
-
181
- #region Private methods
182
- static string GetPackageStatusReportIdentifier(JObject updatePackage)
183
- {
184
- // Because deploymentKeys can be dynamically switched, we use a
185
- // combination of the deploymentKey and label as the packageIdentifier.
186
- try
187
- {
188
- var deploymentKey = (string)updatePackage[DEPLOYMENT_KEY_KEY];
189
- var label = (string)updatePackage[LABEL_KEY];
190
- if (string.IsNullOrEmpty(deploymentKey) || string.IsNullOrEmpty(label))
191
- {
192
- return null;
193
- }
194
-
195
- return $"{deploymentKey}:{label}";
196
- }
197
- catch
198
- {
199
- return null;
200
- }
201
- }
202
-
203
- static string GetPreviousStatusReportIdentifier()
204
- {
205
- return SettingsManager.GetString(LAST_DEPLOYMENT_REPORT_KEY);
206
- }
207
-
208
- static private void ClearRetryStatusReport()
209
- {
210
- SettingsManager.RemoveString(RETRY_DEPLOYMENT_REPORT_KEY);
211
- }
212
-
213
- static bool IsStatusReportIdentifierCodePushLabel(string statusReportIdentifier)
214
- {
215
- return (!string.IsNullOrEmpty(statusReportIdentifier)) && statusReportIdentifier.Contains(":");
216
- }
217
-
218
- static string GetDeploymentKeyFromStatusReportIdentifier(string statusReportIdentifier)
219
- {
220
- string[] parsedIdentifier = statusReportIdentifier.Split(':');
221
- if (parsedIdentifier.Length > 0)
222
- {
223
- return parsedIdentifier[0];
224
- }
225
- else
226
- {
227
- return null;
228
- }
229
- }
230
-
231
- static string GetVersionLabelFromStatusReportIdentifier(string statusReportIdentifier)
232
- {
233
- string[] parsedIdentifier = statusReportIdentifier.Split(':');
234
- if (parsedIdentifier.Length > 1)
235
- {
236
- return parsedIdentifier[1];
237
- }
238
- else
239
- {
240
- return null;
241
- }
242
- }
243
-
244
- static void SaveStatusReportedForIdentifier(string appVersionOrPackageIdentifier)
245
- {
246
- SettingsManager.SetString(LAST_DEPLOYMENT_REPORT_KEY, appVersionOrPackageIdentifier);
247
- }
248
- #endregion
249
- }
250
- }
@@ -1,9 +0,0 @@
1
- namespace CodePush.ReactNative
2
- {
3
- enum UpdateState
4
- {
5
- Running,
6
- Pending,
7
- Latest
8
- }
9
- }