@appzung/react-native-code-push 6.4.2 → 8.3.2

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 (91) 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/CONTRIBUTING.md +3 -3
  5. package/CodePush.js +26 -28
  6. package/CodePush.podspec +1 -1
  7. package/README.md +8 -7
  8. package/SECURITY.md +41 -0
  9. package/android/app/build.gradle +1 -1
  10. package/android/app/src/main/AndroidManifest.xml +1 -5
  11. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +14 -5
  12. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +1 -0
  13. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +19 -1
  14. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +5 -4
  15. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +3 -1
  16. package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +8 -9
  17. package/android/build.gradle +3 -2
  18. package/android/codepush.gradle +79 -30
  19. package/docs/api-js.md +1 -1
  20. package/docs/setup-android.md +27 -3
  21. package/docs/setup-ios.md +1 -1
  22. package/docs/setup-windows.md +59 -3
  23. package/ios/CodePush/CodePushPackage.m +4 -0
  24. package/ios/CodePush/CodePushUpdateUtils.m +1 -1
  25. package/ios/CodePush.xcodeproj/project.pbxproj +2 -2
  26. package/package.json +11 -11
  27. package/typings/react-native-code-push.d.ts +1 -1
  28. package/windows/CodePush/CodePush.def +3 -0
  29. package/windows/CodePush/CodePush.vcxproj +198 -0
  30. package/windows/CodePush/CodePush.vcxproj.filters +91 -0
  31. package/windows/CodePush/CodePushConfig.cpp +104 -0
  32. package/windows/CodePush/CodePushConfig.h +66 -0
  33. package/windows/CodePush/CodePushConfig.idl +12 -0
  34. package/windows/CodePush/CodePushDownloadHandler.cpp +73 -0
  35. package/windows/CodePush/CodePushDownloadHandler.h +32 -0
  36. package/windows/CodePush/CodePushNativeModule.cpp +934 -0
  37. package/windows/CodePush/CodePushNativeModule.h +247 -0
  38. package/windows/CodePush/CodePushPackage.cpp +456 -0
  39. package/windows/CodePush/CodePushPackage.h +49 -0
  40. package/windows/CodePush/CodePushTelemetryManager.cpp +213 -0
  41. package/windows/CodePush/CodePushTelemetryManager.h +29 -0
  42. package/windows/CodePush/CodePushUpdateUtils.cpp +86 -0
  43. package/windows/CodePush/CodePushUpdateUtils.h +38 -0
  44. package/windows/CodePush/CodePushUtils.cpp +29 -0
  45. package/windows/CodePush/CodePushUtils.h +18 -0
  46. package/windows/CodePush/FileUtils.cpp +131 -0
  47. package/windows/CodePush/FileUtils.h +28 -0
  48. package/windows/CodePush/PropertySheet.props +16 -0
  49. package/windows/CodePush/ReactPackageProvider.cpp +15 -0
  50. package/windows/CodePush/ReactPackageProvider.h +22 -0
  51. package/windows/CodePush/ReactPackageProvider.idl +9 -0
  52. package/windows/CodePush/miniz/LICENSE +22 -0
  53. package/windows/CodePush/miniz/miniz.c +7657 -0
  54. package/windows/CodePush/miniz/miniz.h +1338 -0
  55. package/windows/CodePush/miniz/readme.md +37 -0
  56. package/windows/CodePush/packages.config +4 -0
  57. package/windows/CodePush/pch.cpp +1 -0
  58. package/windows/CodePush/pch.h +4 -0
  59. package/{windows → windows-legacy}/CodePush/CodePush.csproj +1 -1
  60. package/{windows → windows-legacy}/CodePush.Net46/CodePush.Net46.csproj +2 -2
  61. package/{windows → windows-legacy}/CodePush.Net46/packages.config +1 -1
  62. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +105 -0
  63. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +137 -0
  64. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +36 -0
  65. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +117 -0
  66. package/windows-legacy/CodePush.Net46.Test/app.config +11 -0
  67. package/windows-legacy/CodePush.Net46.Test/packages.config +4 -0
  68. /package/{windows → windows-legacy}/CodePush/CodePushUtils.cs +0 -0
  69. /package/{windows → windows-legacy}/CodePush/FileUtils.cs +0 -0
  70. /package/{windows → windows-legacy}/CodePush/Properties/AssemblyInfo.cs +0 -0
  71. /package/{windows → windows-legacy}/CodePush/Properties/CodePush.rd.xml +0 -0
  72. /package/{windows → windows-legacy}/CodePush/UpdateManager.cs +0 -0
  73. /package/{windows → windows-legacy}/CodePush/UpdateUtils.cs +0 -0
  74. /package/{windows → windows-legacy}/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -0
  75. /package/{windows → windows-legacy}/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -0
  76. /package/{windows → windows-legacy}/CodePush.Net46/CodePushUtils.cs +0 -0
  77. /package/{windows → windows-legacy}/CodePush.Net46/FileUtils.cs +0 -0
  78. /package/{windows → windows-legacy}/CodePush.Net46/Properties/AssemblyInfo.cs +0 -0
  79. /package/{windows → windows-legacy}/CodePush.Net46/UpdateManager.cs +0 -0
  80. /package/{windows → windows-legacy}/CodePush.Net46/UpdateUtils.cs +0 -0
  81. /package/{windows → windows-legacy}/CodePush.Shared/CodePush.Shared.projitems +0 -0
  82. /package/{windows → windows-legacy}/CodePush.Shared/CodePush.Shared.shproj +0 -0
  83. /package/{windows → windows-legacy}/CodePush.Shared/CodePushConstants.cs +0 -0
  84. /package/{windows → windows-legacy}/CodePush.Shared/CodePushNativeModule.cs +0 -0
  85. /package/{windows → windows-legacy}/CodePush.Shared/CodePushReactPackage.cs +0 -0
  86. /package/{windows → windows-legacy}/CodePush.Shared/CodePushUtils.cs +0 -0
  87. /package/{windows → windows-legacy}/CodePush.Shared/InstallMode.cs +0 -0
  88. /package/{windows → windows-legacy}/CodePush.Shared/MinimumBackgroundListener.cs +0 -0
  89. /package/{windows → windows-legacy}/CodePush.Shared/SettingsManager.cs +0 -0
  90. /package/{windows → windows-legacy}/CodePush.Shared/TelemetryManager.cs +0 -0
  91. /package/{windows → windows-legacy}/CodePush.Shared/UpdateState.cs +0 -0
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup>
4
+ <Filter Include="Resources">
5
+ <UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
6
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7
+ </Filter>
8
+ <Filter Include="CodePush">
9
+ <UniqueIdentifier>{c2eae772-39a8-4b12-aad7-60e9ca2072ef}</UniqueIdentifier>
10
+ </Filter>
11
+ <Filter Include="miniz">
12
+ <UniqueIdentifier>{53513ea0-fe7c-4f69-8d3e-c1a9efbb7333}</UniqueIdentifier>
13
+ </Filter>
14
+ </ItemGroup>
15
+ <ItemGroup>
16
+ <ClCompile Include="pch.cpp" />
17
+ <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
18
+ <ClCompile Include="miniz\miniz.c">
19
+ <Filter>miniz</Filter>
20
+ </ClCompile>
21
+ <ClCompile Include="CodePushConfig.cpp">
22
+ <Filter>CodePush</Filter>
23
+ </ClCompile>
24
+ <ClCompile Include="CodePushDownloadHandler.cpp">
25
+ <Filter>CodePush</Filter>
26
+ </ClCompile>
27
+ <ClCompile Include="CodePushNativeModule.cpp">
28
+ <Filter>CodePush</Filter>
29
+ </ClCompile>
30
+ <ClCompile Include="CodePushPackage.cpp">
31
+ <Filter>CodePush</Filter>
32
+ </ClCompile>
33
+ <ClCompile Include="CodePushTelemetryManager.cpp">
34
+ <Filter>CodePush</Filter>
35
+ </ClCompile>
36
+ <ClCompile Include="CodePushUpdateUtils.cpp">
37
+ <Filter>CodePush</Filter>
38
+ </ClCompile>
39
+ <ClCompile Include="CodePushUtils.cpp">
40
+ <Filter>CodePush</Filter>
41
+ </ClCompile>
42
+ <ClCompile Include="FileUtils.cpp">
43
+ <Filter>CodePush</Filter>
44
+ </ClCompile>
45
+ <ClCompile Include="ReactPackageProvider.cpp" />
46
+ </ItemGroup>
47
+ <ItemGroup>
48
+ <ClInclude Include="pch.h" />
49
+ <ClInclude Include="miniz\miniz.h">
50
+ <Filter>miniz</Filter>
51
+ </ClInclude>
52
+ <ClInclude Include="CodePushConfig.h">
53
+ <Filter>CodePush</Filter>
54
+ </ClInclude>
55
+ <ClInclude Include="CodePushDownloadHandler.h">
56
+ <Filter>CodePush</Filter>
57
+ </ClInclude>
58
+ <ClInclude Include="CodePushNativeModule.h">
59
+ <Filter>CodePush</Filter>
60
+ </ClInclude>
61
+ <ClInclude Include="CodePushPackage.h">
62
+ <Filter>CodePush</Filter>
63
+ </ClInclude>
64
+ <ClInclude Include="CodePushTelemetryManager.h">
65
+ <Filter>CodePush</Filter>
66
+ </ClInclude>
67
+ <ClInclude Include="CodePushUpdateUtils.h">
68
+ <Filter>CodePush</Filter>
69
+ </ClInclude>
70
+ <ClInclude Include="CodePushUtils.h">
71
+ <Filter>CodePush</Filter>
72
+ </ClInclude>
73
+ <ClInclude Include="FileUtils.h">
74
+ <Filter>CodePush</Filter>
75
+ </ClInclude>
76
+ <ClInclude Include="ReactPackageProvider.h" />
77
+ </ItemGroup>
78
+ <ItemGroup>
79
+ <None Include="CodePush.def" />
80
+ <None Include="packages.config" />
81
+ </ItemGroup>
82
+ <ItemGroup>
83
+ <None Include="PropertySheet.props" />
84
+ </ItemGroup>
85
+ <ItemGroup>
86
+ <Midl Include="ReactPackageProvider.idl" />
87
+ <Midl Include="CodePushConfig.idl">
88
+ <Filter>CodePush</Filter>
89
+ </Midl>
90
+ </ItemGroup>
91
+ </Project>
@@ -0,0 +1,104 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "pch.h"
5
+ #include "CodePushConfig.h"
6
+ #include "CodePushConfig.g.cpp"
7
+ #include "CodePushNativeModule.h"
8
+
9
+ #include "winrt/Windows.Foundation.Collections.h"
10
+ #include "winrt/Windows.Storage.h"
11
+
12
+ namespace winrt::Microsoft::CodePush::ReactNative::implementation
13
+ {
14
+ using namespace Windows::Storage;
15
+ using namespace Windows::Data::Json;
16
+ using namespace Windows::Foundation::Collections;
17
+
18
+ CodePushConfig CodePushConfig::s_currentConfig{};
19
+
20
+ /*static*/ CodePushConfig& CodePushConfig::Current() noexcept
21
+ {
22
+ return s_currentConfig;
23
+ }
24
+
25
+ JsonObject CodePushConfig::GetConfiguration()
26
+ {
27
+ JsonObject configObject;
28
+ for (const auto& pair : m_configuration)
29
+ {
30
+ configObject.Insert(pair.Key(), JsonValue::CreateStringValue(pair.Value()));
31
+ }
32
+ return configObject;
33
+ }
34
+
35
+ /*static*/ void CodePushConfig::Init(IMap<hstring, hstring> const& configMap) noexcept
36
+ {
37
+ std::optional<hstring> appVersion;
38
+ std::optional<hstring> buildVersion;
39
+ std::optional<hstring> deploymentKey;
40
+ std::optional<hstring> publicKey;
41
+ std::optional<hstring> serverUrl;
42
+
43
+ if (configMap != nullptr)
44
+ {
45
+ appVersion = configMap.TryLookup(AppVersionConfigKey);
46
+ buildVersion = configMap.TryLookup(BuildVersionConfigKey);
47
+ deploymentKey = configMap.TryLookup(DeploymentKeyConfigKey);
48
+ publicKey = configMap.TryLookup(PublicKeyKey);
49
+ serverUrl = configMap.TryLookup(ServerURLConfigKey);
50
+ }
51
+
52
+ s_currentConfig.m_configuration = winrt::single_threaded_map<hstring, hstring>();
53
+ auto addToConfiguration = [=](std::wstring_view key, std::optional<hstring> optValue) {
54
+ if (optValue.has_value())
55
+ {
56
+ s_currentConfig.m_configuration.Insert(key, optValue.value());
57
+ }
58
+ };
59
+
60
+ auto localSettings{ ::Microsoft::CodePush::ReactNative::CodePushNativeModule::GetLocalSettings() };
61
+ hstring clientUniqueId;
62
+ auto clientUniqueIdData{ localSettings.Values().TryLookup(ClientUniqueIDConfigKey) };
63
+ if (clientUniqueIdData == nullptr)
64
+ {
65
+ auto newGuid{ GuidHelper::CreateNewGuid() };
66
+ clientUniqueId = to_hstring(newGuid);
67
+ localSettings.Values().Insert(ClientUniqueIDConfigKey, box_value(clientUniqueId));
68
+ }
69
+ else
70
+ {
71
+ clientUniqueId = unbox_value<hstring>(clientUniqueIdData);
72
+ }
73
+
74
+ addToConfiguration(AppVersionConfigKey, appVersion);
75
+ addToConfiguration(BuildVersionConfigKey, buildVersion);
76
+ addToConfiguration(DeploymentKeyConfigKey, deploymentKey);
77
+ addToConfiguration(PublicKeyKey, publicKey);
78
+ addToConfiguration(ServerURLConfigKey, serverUrl);
79
+
80
+ s_currentConfig.m_configuration.Insert(ClientUniqueIDConfigKey, clientUniqueId);
81
+
82
+ if (!serverUrl.has_value())
83
+ {
84
+ s_currentConfig.m_configuration.Insert(ServerURLConfigKey, L"https://codepush.appzung.com/");
85
+ }
86
+
87
+ ::Microsoft::CodePush::ReactNative::CodePushNativeModule::LoadBundle();
88
+ }
89
+
90
+ hstring CodePushConfig::QueryConfig(std::wstring_view key)
91
+ {
92
+ auto value{ m_configuration.TryLookup(key) };
93
+ if (value.has_value())
94
+ {
95
+ return value.value();
96
+ }
97
+ return L"";
98
+ }
99
+
100
+ /*static*/ void CodePushConfig::SetHost(Microsoft::ReactNative::ReactNativeHost const& host) noexcept
101
+ {
102
+ ::Microsoft::CodePush::ReactNative::CodePushNativeModule::SetHost(host);
103
+ }
104
+ }
@@ -0,0 +1,66 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #pragma once
5
+ #include "CodePushConfig.g.h"
6
+
7
+ #include "NativeModules.h"
8
+
9
+ #include <string_view>
10
+ #include "winrt/Microsoft.ReactNative.h"
11
+ #include "winrt/Windows.Data.Json.h"
12
+ #include "winrt/Windows.Foundation.Collections.h"
13
+
14
+ namespace winrt::Microsoft::CodePush::ReactNative::implementation
15
+ {
16
+ struct CodePushConfig : CodePushConfigT<CodePushConfig>
17
+ {
18
+ CodePushConfig() = default;
19
+
20
+ static void Init(Windows::Foundation::Collections::IMap<hstring, hstring> const& configMap) noexcept;
21
+ static void SetHost(Microsoft::ReactNative::ReactNativeHost const& host) noexcept;
22
+
23
+ static CodePushConfig& Current() noexcept;
24
+
25
+ hstring GetAppVersion() { return QueryConfig(AppVersionConfigKey); }
26
+ void SetAppVersion(std::wstring_view appVersion) { m_configuration.Insert(AppVersionConfigKey, appVersion); }
27
+
28
+ hstring GetBuildVersion() { return QueryConfig(BuildVersionConfigKey); }
29
+
30
+ Windows::Data::Json::JsonObject GetConfiguration();
31
+
32
+ hstring GetDeploymentKey() { return QueryConfig(DeploymentKeyConfigKey); }
33
+ void SetDeploymentKey(std::wstring_view deploymentKey) { m_configuration.Insert(DeploymentKeyConfigKey, deploymentKey); }
34
+
35
+ hstring GetServerUrl() { return QueryConfig(ServerURLConfigKey); }
36
+ void SetServerUrl(std::wstring_view serverUrl) { m_configuration.Insert(ServerURLConfigKey, serverUrl); }
37
+
38
+ hstring GetPublicKey() { return QueryConfig(PublicKeyKey); }
39
+ void SetPublicKey(std::wstring_view publicKey) { m_configuration.Insert(PublicKeyKey, publicKey); }
40
+
41
+ private:
42
+ static constexpr std::wstring_view AppVersionConfigKey{ L"appVersion" };
43
+ static constexpr std::wstring_view BuildVersionConfigKey{ L"buildVersion" };
44
+ static constexpr std::wstring_view ClientUniqueIDConfigKey{ L"clientUniqueId" };
45
+ static constexpr std::wstring_view DeploymentKeyConfigKey{ L"deploymentKey" };
46
+ static constexpr std::wstring_view ServerURLConfigKey{ L"serverUrl" };
47
+ static constexpr std::wstring_view PublicKeyKey{ L"publicKey" };
48
+
49
+ Windows::Foundation::Collections::IMap<hstring, hstring> m_configuration;
50
+ static CodePushConfig s_currentConfig;
51
+
52
+ hstring QueryConfig(std::wstring_view key);
53
+ };
54
+ }
55
+
56
+ namespace winrt::Microsoft::CodePush::ReactNative::factory_implementation
57
+ {
58
+ struct CodePushConfig : CodePushConfigT<CodePushConfig, implementation::CodePushConfig>
59
+ {
60
+ };
61
+ }
62
+
63
+ namespace Microsoft::CodePush::ReactNative
64
+ {
65
+ using winrt::Microsoft::CodePush::ReactNative::implementation::CodePushConfig;
66
+ }
@@ -0,0 +1,12 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ namespace Microsoft.CodePush.ReactNative
5
+ {
6
+ [webhosthidden]
7
+ [default_interface]
8
+ runtimeclass CodePushConfig {
9
+ static void Init(IMap<String, String> configMap);
10
+ static void SetHost(Microsoft.ReactNative.ReactNativeHost host);
11
+ };
12
+ } // namespace CppModule
@@ -0,0 +1,73 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "pch.h"
5
+
6
+ #include "winrt/Windows.Data.Json.h"
7
+ #include "winrt/Windows.Foundation.h"
8
+ #include "winrt/Windows.Storage.h"
9
+ #include "winrt/Windows.Storage.Streams.h"
10
+ #include "winrt/Windows.Web.Http.h"
11
+ #include "winrt/Windows.Web.Http.Headers.h"
12
+
13
+ #include "CodePushDownloadHandler.h"
14
+
15
+ namespace Microsoft::CodePush::ReactNative
16
+ {
17
+ using namespace winrt;
18
+ using namespace Windows::Data::Json;
19
+ using namespace Windows::Foundation;
20
+ using namespace Windows::Storage;
21
+ using namespace Windows::Storage::Streams;
22
+ using namespace Windows::Web::Http;
23
+
24
+ CodePushDownloadHandler::CodePushDownloadHandler(
25
+ StorageFile downloadFile,
26
+ std::function<void(int64_t, int64_t)> progressCallback) :
27
+ receivedContentLength(0),
28
+ expectedContentLength(0),
29
+ progressCallback(progressCallback),
30
+ downloadFile(downloadFile) {}
31
+
32
+ IAsyncOperation<bool> CodePushDownloadHandler::Download(std::wstring_view url)
33
+ {
34
+ HttpClient client;
35
+
36
+ auto headers{ client.DefaultRequestHeaders() };
37
+ headers.Append(L"Accept-Encoding", L"identity");
38
+
39
+ HttpRequestMessage reqm{ HttpMethod::Get(), Uri(url) };
40
+ auto resm{ co_await client.SendRequestAsync(reqm, HttpCompletionOption::ResponseHeadersRead) };
41
+ expectedContentLength = resm.Content().Headers().ContentLength().GetInt64();
42
+ auto inputStream{ co_await resm.Content().ReadAsInputStreamAsync() };
43
+ auto outputStream{ co_await downloadFile.OpenAsync(FileAccessMode::ReadWrite) };
44
+
45
+ uint8_t header[4] = {};
46
+
47
+ for (;;)
48
+ {
49
+ auto outputBuffer{ co_await inputStream.ReadAsync(Buffer{ BufferSize }, BufferSize, InputStreamOptions::None) };
50
+
51
+ if (outputBuffer.Length() == 0)
52
+ {
53
+ break;
54
+ }
55
+ co_await outputStream.WriteAsync(outputBuffer);
56
+
57
+ if (receivedContentLength < ARRAYSIZE(header))
58
+ {
59
+ for (uint32_t i{ static_cast<uint32_t>(receivedContentLength) }; i < min(ARRAYSIZE(header), outputBuffer.Length()); i++)
60
+ {
61
+ header[i] = outputBuffer.data()[i];
62
+ }
63
+ }
64
+
65
+ receivedContentLength += outputBuffer.Length();
66
+
67
+ progressCallback(/*expectedContentLength*/ expectedContentLength, /*receivedContentLength*/ receivedContentLength);
68
+ }
69
+
70
+ bool isZip{ header[0] == 'P' && header[1] == 'K' && header[2] == 3 && header[3] == 4 };
71
+ co_return isZip;
72
+ }
73
+ }
@@ -0,0 +1,32 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #pragma once
5
+
6
+ #include "winrt/Windows.Storage.h"
7
+ #include "winrt/Windows.Foundation.h"
8
+ #include "winrt/Windows.Data.Json.h"
9
+ #include <string_view>
10
+ #include <functional>
11
+
12
+ namespace Microsoft::CodePush::ReactNative
13
+ {
14
+ struct CodePushDownloadHandler
15
+ {
16
+ winrt::Windows::Storage::StorageFile downloadFile;
17
+ int64_t expectedContentLength;
18
+ int64_t receivedContentLength;
19
+ std::function<void(int64_t, int64_t)> progressCallback;
20
+ std::wstring_view downloadUrl;
21
+
22
+ CodePushDownloadHandler(
23
+ winrt::Windows::Storage::StorageFile downloadFile,
24
+ std::function<void(int64_t, int64_t)> progressCallback);
25
+
26
+ // Returns true if the downloaded file is a zip file
27
+ winrt::Windows::Foundation::IAsyncOperation<bool> Download(std::wstring_view url);
28
+
29
+ private:
30
+ static constexpr uint32_t BufferSize{ 256 * 1024 };
31
+ };
32
+ }