@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
@@ -0,0 +1,37 @@
1
+ ## Miniz
2
+
3
+ Miniz is a lossless, high performance data compression library in a single source file that implements the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format specification standards. It supports the most commonly used functions exported by the zlib library, but is a completely independent implementation so zlib's licensing requirements do not apply. Miniz also contains simple to use functions for writing .PNG format image files and reading/writing/appending .ZIP format archives. Miniz's compression speed has been tuned to be comparable to zlib's, and it also has a specialized real-time compressor function designed to compare well against fastlz/minilzo.
4
+
5
+ ## Usage
6
+
7
+ Please use the files from the [releases page](https://github.com/richgel999/miniz/releases) in your projects. Do not use the git checkout directly! The different source and header files are [amalgamated](https://www.sqlite.org/amalgamation.html) into one `miniz.c`/`miniz.h` pair in a build step (`amalgamate.sh`). Include `miniz.c` and `miniz.h` in your project to use Miniz.
8
+
9
+ ## Features
10
+
11
+ * MIT licensed
12
+ * A portable, single source and header file library written in plain C. Tested with GCC, clang and Visual Studio.
13
+ * Easily tuned and trimmed down by defines
14
+ * A drop-in replacement for zlib's most used API's (tested in several open source projects that use zlib, such as libpng and libzip).
15
+ * Fills a single threaded performance vs. compression ratio gap between several popular real-time compressors and zlib. For example, at level 1, miniz.c compresses around 5-9% better than minilzo, but is approx. 35% slower. At levels 2-9, miniz.c is designed to compare favorably against zlib's ratio and speed. See the miniz performance comparison page for example timings.
16
+ * Not a block based compressor: miniz.c fully supports stream based processing using a coroutine-style implementation. The zlib-style API functions can be called a single byte at a time if that's all you've got.
17
+ * Easy to use. The low-level compressor (tdefl) and decompressor (tinfl) have simple state structs which can be saved/restored as needed with simple memcpy's. The low-level codec API's don't use the heap in any way.
18
+ * Entire inflater (including optional zlib header parsing and Adler-32 checking) is implemented in a single function as a coroutine, which is separately available in a small (~550 line) source file: miniz_tinfl.c
19
+ * A fairly complete (but totally optional) set of .ZIP archive manipulation and extraction API's. The archive functionality is intended to solve common problems encountered in embedded, mobile, or game development situations. (The archive API's are purposely just powerful enough to write an entire archiver given a bit of additional higher-level logic.)
20
+
21
+ ## Known Problems
22
+
23
+ * No support for encrypted archives. Not sure how useful this stuff is in practice.
24
+ * Minimal documentation. The assumption is that the user is already familiar with the basic zlib API. I need to write an API wiki - for now I've tried to place key comments before each enum/API, and I've included 6 examples that demonstrate how to use the module's major features.
25
+
26
+ ## Special Thanks
27
+
28
+ Thanks to Alex Evans for the PNG writer function. Also, thanks to Paul Holden and Thorsten Scheuermann for feedback and testing, Matt Pritchard for all his encouragement, and Sean Barrett's various public domain libraries for inspiration (and encouraging me to write miniz.c in C, which was much more enjoyable and less painful than I thought it would be considering I've been programming in C++ for so long).
29
+
30
+ Thanks to Bruce Dawson for reporting a problem with the level_and_flags archive API parameter (which is fixed in v1.12) and general feedback, and Janez Zemva for indirectly encouraging me into writing more examples.
31
+
32
+ ## Patents
33
+
34
+ I was recently asked if miniz avoids patent issues. miniz purposely uses the same core algorithms as the ones used by zlib. The compressor uses vanilla hash chaining as described [here](http://www.gzip.org/zlib/rfc-deflate.html#algorithm). Also see the [gzip FAQ](http://www.gzip.org/#faq11). In my opinion, if miniz falls prey to a patent attack then zlib/gzip are likely to be at serious risk too.
35
+
36
+
37
+ [![Build Status](https://travis-ci.org/uroni/miniz.svg?branch=master)](https://travis-ci.org/uroni/miniz)
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <packages>
3
+ <package id="Microsoft.Windows.CppWinRT" version="2.0.200615.7" targetFramework="native" />
4
+ </packages>
@@ -0,0 +1 @@
1
+ #include "pch.h"
@@ -0,0 +1,4 @@
1
+ #pragma once
2
+ #include <unknwn.h>
3
+ #include <winrt/Windows.Foundation.h>
4
+ #include <winrt/Windows.Foundation.Collections.h>
@@ -102,7 +102,7 @@
102
102
  </ItemGroup>
103
103
  <ItemGroup>
104
104
  <PackageReference Include="Newtonsoft.Json">
105
- <Version>10.0.3</Version>
105
+ <Version>13.0.1</Version>
106
106
  </PackageReference>
107
107
  <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
108
108
  <Version>6.0.6</Version>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <packages>
3
- <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
3
+ <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
4
4
  <package id="PCLStorage" version="1.0.2" targetFramework="net46" />
5
5
  </packages>
@@ -0,0 +1,105 @@
1
+ using System;
2
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
3
+ using CodePush.Net46.Adapters.Storage;
4
+ using System.Threading.Tasks;
5
+
6
+ namespace CodePush.Net46.Test
7
+ {
8
+ [TestClass]
9
+ public class ApplicationDataContainerTest
10
+ {
11
+ readonly static string key1 = "key1";
12
+ readonly static string key2 = "key2";
13
+ readonly static string key3 = "key3";
14
+
15
+ readonly static string val1 = "string data1";
16
+ readonly static string val2 = "string data2";
17
+ readonly static string val3 = "string data1";
18
+
19
+ [TestMethod]
20
+ public void TestInMemmorySet()
21
+ {
22
+ var settings = new ApplicationDataContainer();
23
+
24
+ settings.Values[key1] = val1;
25
+ settings.Values[key2] = val2;
26
+ settings.Values[key3] = val3;
27
+
28
+ Assert.AreEqual(settings.Values[key1], val1);
29
+ Assert.AreEqual(settings.Values[key2], val2);
30
+ Assert.AreEqual(settings.Values[key3], val3);
31
+
32
+ settings.DeleteAsync().Wait();
33
+ }
34
+
35
+ [TestMethod]
36
+ public void TestInMemmoryReset()
37
+ {
38
+ var settings = new ApplicationDataContainer();
39
+
40
+ settings.Values[key1] = val1;
41
+ settings.Values[key1] = val2;
42
+ settings.Values[key1] = val3;
43
+
44
+ Assert.AreEqual(settings.Values[key1], val3);
45
+
46
+ settings.DeleteAsync().Wait();
47
+ }
48
+
49
+ [TestMethod]
50
+ public void TestInMemmoryRemove()
51
+ {
52
+ var settings = new ApplicationDataContainer();
53
+
54
+ settings.Values[key1] = val1;
55
+ settings.Values[key2] = val2;
56
+ settings.Values[key3] = val3;
57
+
58
+ settings.Values.Remove(key2);
59
+
60
+ Assert.AreEqual(settings.Values[key1], val1);
61
+ Assert.IsNull(settings.Values[key2]);
62
+ Assert.AreEqual(settings.Values[key3], val3);
63
+
64
+ settings.DeleteAsync().Wait();
65
+ }
66
+
67
+ [TestMethod]
68
+ public void TestPersistentSet()
69
+ {
70
+ var settings = new ApplicationDataContainer();
71
+
72
+ settings.Values[key1] = val1;
73
+ settings.Values[key2] = val2;
74
+ settings.Values[key3] = val3;
75
+
76
+ settings = new ApplicationDataContainer();
77
+
78
+ Assert.AreEqual(settings.Values[key1], val1);
79
+ Assert.AreEqual(settings.Values[key2], val2);
80
+ Assert.AreEqual(settings.Values[key3], val3);
81
+
82
+ settings.DeleteAsync().Wait();
83
+ }
84
+
85
+ [TestMethod]
86
+ public void TestPersistentRemove()
87
+ {
88
+ var settings = new ApplicationDataContainer();
89
+
90
+ settings.Values[key1] = val1;
91
+ settings.Values[key2] = val2;
92
+ settings.Values[key3] = val3;
93
+
94
+ settings.Values.Remove(key2);
95
+
96
+ settings = new ApplicationDataContainer();
97
+
98
+ Assert.AreEqual(settings.Values[key1], val1);
99
+ Assert.IsNull(settings.Values[key2]);
100
+ Assert.AreEqual(settings.Values[key3], val3);
101
+
102
+ settings.DeleteAsync().Wait();
103
+ }
104
+ }
105
+ }
@@ -0,0 +1,137 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <PropertyGroup>
4
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6
+ <ProjectGuid>{BBB48F0B-AF6F-4A14-AFA4-306D3FB0B7CF}</ProjectGuid>
7
+ <OutputType>Library</OutputType>
8
+ <AppDesignerFolder>Properties</AppDesignerFolder>
9
+ <RootNamespace>CodePush.Net46.Test</RootNamespace>
10
+ <AssemblyName>CodePush.Net46.Test</AssemblyName>
11
+ <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
12
+ <FileAlignment>512</FileAlignment>
13
+ <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
15
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
16
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
17
+ <IsCodedUITest>False</IsCodedUITest>
18
+ <TestProjectType>UnitTest</TestProjectType>
19
+ </PropertyGroup>
20
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21
+ <DebugSymbols>true</DebugSymbols>
22
+ <DebugType>full</DebugType>
23
+ <Optimize>false</Optimize>
24
+ <OutputPath>bin\Debug\</OutputPath>
25
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
26
+ <ErrorReport>prompt</ErrorReport>
27
+ <WarningLevel>4</WarningLevel>
28
+ </PropertyGroup>
29
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30
+ <DebugType>pdbonly</DebugType>
31
+ <Optimize>true</Optimize>
32
+ <OutputPath>bin\Release\</OutputPath>
33
+ <DefineConstants>TRACE</DefineConstants>
34
+ <ErrorReport>prompt</ErrorReport>
35
+ <WarningLevel>4</WarningLevel>
36
+ </PropertyGroup>
37
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
38
+ <DebugSymbols>true</DebugSymbols>
39
+ <OutputPath>bin\x64\Debug\</OutputPath>
40
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
41
+ <DebugType>full</DebugType>
42
+ <PlatformTarget>x64</PlatformTarget>
43
+ <ErrorReport>prompt</ErrorReport>
44
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
45
+ </PropertyGroup>
46
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
47
+ <OutputPath>bin\x64\Release\</OutputPath>
48
+ <DefineConstants>TRACE</DefineConstants>
49
+ <Optimize>true</Optimize>
50
+ <DebugType>pdbonly</DebugType>
51
+ <PlatformTarget>x64</PlatformTarget>
52
+ <ErrorReport>prompt</ErrorReport>
53
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
54
+ </PropertyGroup>
55
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
56
+ <DebugSymbols>true</DebugSymbols>
57
+ <OutputPath>bin\x86\Debug\</OutputPath>
58
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
59
+ <DebugType>full</DebugType>
60
+ <PlatformTarget>x86</PlatformTarget>
61
+ <ErrorReport>prompt</ErrorReport>
62
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
63
+ </PropertyGroup>
64
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
65
+ <OutputPath>bin\x86\Release\</OutputPath>
66
+ <DefineConstants>TRACE</DefineConstants>
67
+ <Optimize>true</Optimize>
68
+ <DebugType>pdbonly</DebugType>
69
+ <PlatformTarget>x86</PlatformTarget>
70
+ <ErrorReport>prompt</ErrorReport>
71
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
72
+ </PropertyGroup>
73
+ <ItemGroup>
74
+ <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
75
+ <SpecificVersion>False</SpecificVersion>
76
+ <HintPath>..\..\Examples\CodePushDemoApp\windows\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
77
+ <Private>True</Private>
78
+ </Reference>
79
+ <Reference Include="System" />
80
+ </ItemGroup>
81
+ <Choose>
82
+ <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
83
+ <ItemGroup>
84
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
85
+ </ItemGroup>
86
+ </When>
87
+ <Otherwise>
88
+ <ItemGroup>
89
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
90
+ <Private>False</Private>
91
+ </Reference>
92
+ </ItemGroup>
93
+ </Otherwise>
94
+ </Choose>
95
+ <ItemGroup>
96
+ <Compile Include="ApplicationDataContainerTest.cs" />
97
+ <Compile Include="Properties\AssemblyInfo.cs" />
98
+ <Compile Include="TelemetryManagerTest.cs" />
99
+ </ItemGroup>
100
+ <ItemGroup>
101
+ <ProjectReference Include="..\CodePush.Net46\CodePush.Net46.csproj">
102
+ <Project>{4dfe3f9f-5e15-4f17-8fd4-33ff0519348e}</Project>
103
+ <Name>CodePush.Net46</Name>
104
+ </ProjectReference>
105
+ </ItemGroup>
106
+ <ItemGroup>
107
+ <None Include="app.config" />
108
+ <None Include="packages.config" />
109
+ </ItemGroup>
110
+ <Choose>
111
+ <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
112
+ <ItemGroup>
113
+ <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
114
+ <Private>False</Private>
115
+ </Reference>
116
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
117
+ <Private>False</Private>
118
+ </Reference>
119
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
120
+ <Private>False</Private>
121
+ </Reference>
122
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
123
+ <Private>False</Private>
124
+ </Reference>
125
+ </ItemGroup>
126
+ </When>
127
+ </Choose>
128
+ <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
129
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
130
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
131
+ Other similar extension points exist, see Microsoft.Common.targets.
132
+ <Target Name="BeforeBuild">
133
+ </Target>
134
+ <Target Name="AfterBuild">
135
+ </Target>
136
+ -->
137
+ </Project>
@@ -0,0 +1,36 @@
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.Net46.Test")]
9
+ [assembly: AssemblyDescription("")]
10
+ [assembly: AssemblyConfiguration("")]
11
+ [assembly: AssemblyCompany("")]
12
+ [assembly: AssemblyProduct("CodePush.Net46.Test")]
13
+ [assembly: AssemblyCopyright("Copyright © 2017")]
14
+ [assembly: AssemblyTrademark("")]
15
+ [assembly: AssemblyCulture("")]
16
+
17
+ // Setting ComVisible to false makes the types in this assembly not visible
18
+ // to COM components. If you need to access a type in this assembly from
19
+ // COM, set the ComVisible attribute to true on that type.
20
+ [assembly: ComVisible(false)]
21
+
22
+ // The following GUID is for the ID of the typelib if this project is exposed to COM
23
+ [assembly: Guid("bbb48f0b-af6f-4a14-afa4-306d3fb0b7cf")]
24
+
25
+ // Version information for an assembly consists of the following four values:
26
+ //
27
+ // Major Version
28
+ // Minor Version
29
+ // Build Number
30
+ // Revision
31
+ //
32
+ // You can specify all the values or you can default the Build and Revision Numbers
33
+ // by using the '*' as shown below:
34
+ // [assembly: AssemblyVersion("1.0.*")]
35
+ [assembly: AssemblyVersion("1.0.0.0")]
36
+ [assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,117 @@
1
+ using CodePush.ReactNative;
2
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
3
+ using Newtonsoft.Json;
4
+ using Newtonsoft.Json.Linq;
5
+
6
+ namespace CodePush.Net46.Test
7
+ {
8
+ /// <summary>
9
+ /// Some tests for telemetry manager
10
+ /// As implementation of TelemetryManager was ported from android version, we do not test logic here.
11
+ /// Here are tests for some tricky parts of implementation, or check some data transformation that
12
+ /// has no full equvalent in C#
13
+ /// </summary>
14
+ [TestClass]
15
+ public class TelemetryManagerTest
16
+ {
17
+ #region Constants from TelemetryManager
18
+ //private static readonly string APP_VERSION_KEY = "appVersion";
19
+ private static readonly string DEPLOYMENT_FAILED_STATUS = "DeploymentFailed";
20
+ private static readonly string DEPLOYMENT_KEY_KEY = "deploymentKey";
21
+ private static readonly string DEPLOYMENT_SUCCEEDED_STATUS = "DeploymentSucceeded";
22
+ private static readonly string LABEL_KEY = "label";
23
+ private static readonly string LAST_DEPLOYMENT_REPORT_KEY = "CODE_PUSH_LAST_DEPLOYMENT_REPORT";
24
+ //private static readonly string PACKAGE_KEY = "package";
25
+ //private static readonly string PREVIOUS_DEPLOYMENT_KEY_KEY = "previousDeploymentKey";
26
+ //private static readonly string PREVIOUS_LABEL_OR_APP_VERSION_KEY = "previousLabelOrAppVersion";
27
+ private static readonly string RETRY_DEPLOYMENT_REPORT_KEY = "CODE_PUSH_RETRY_DEPLOYMENT_REPORT";
28
+ private static readonly string STATUS_KEY = "status";
29
+ #endregion
30
+
31
+ [TestMethod]
32
+ public void TestGetUpdateReportNoPreviousUpdate()
33
+ {
34
+ var input = new JObject();
35
+ input.Add(DEPLOYMENT_KEY_KEY, "depKeyParam");
36
+ input.Add(LABEL_KEY, "labelParam");
37
+
38
+ var output = TelemetryManager.GetUpdateReport(input);
39
+ Assert.IsNotNull(output);
40
+ Assert.IsTrue(output.ToString(Formatting.None).Contains("\"status\":\"DeploymentSucceeded\""));
41
+ }
42
+
43
+ [TestMethod]
44
+ public void TestGetUpdateReportWithPreviousUpdate()
45
+ {
46
+ SettingsManager.SetString(LAST_DEPLOYMENT_REPORT_KEY, "prevKey:prevLabel");
47
+ var input = new JObject();
48
+ input.Add(DEPLOYMENT_KEY_KEY, "depKeyParam");
49
+ input.Add(LABEL_KEY, "labelParam");
50
+
51
+ var output = TelemetryManager.GetUpdateReport(input);
52
+ Assert.IsNotNull(output);
53
+ Assert.IsTrue(output.ToString(Formatting.None).Contains("\"status\":\"DeploymentSucceeded\""));
54
+ Assert.IsTrue(output.ToString(Formatting.None).Contains("\"previousDeploymentKey\":\"prevKey\",\"previousLabelOrAppVersion\":\"prevLabel\""));
55
+
56
+ //Clean Up
57
+ SettingsManager.RemoveString(LAST_DEPLOYMENT_REPORT_KEY);
58
+ }
59
+
60
+ [TestMethod]
61
+ public void TestGetUpdateReportNegative()
62
+ {
63
+ var inputNoLabel = new JObject();
64
+ inputNoLabel.Add(DEPLOYMENT_KEY_KEY, "depKeyParam");
65
+ Assert.IsNull(TelemetryManager.GetUpdateReport(inputNoLabel));
66
+
67
+ var inputNoKey = new JObject();
68
+ inputNoKey.Add(LABEL_KEY, "labelParam");
69
+ Assert.IsNull(TelemetryManager.GetUpdateReport(inputNoKey));
70
+ }
71
+
72
+ [TestMethod]
73
+ public void TestRecordStatusReportWithRollback()
74
+ {
75
+ var report = new JObject();
76
+ report.Add(STATUS_KEY, DEPLOYMENT_FAILED_STATUS);
77
+
78
+ TelemetryManager.RecordStatusReported(report);
79
+ Assert.IsTrue(true);
80
+ }
81
+
82
+ [TestMethod]
83
+ public void TestRecordStatusReportWithoutRollback()
84
+ {
85
+ var reportSuccess = new JObject();
86
+ reportSuccess.Add(STATUS_KEY, DEPLOYMENT_SUCCEEDED_STATUS);
87
+ TelemetryManager.RecordStatusReported(reportSuccess);
88
+
89
+ var reportNoStatus = new JObject();
90
+ TelemetryManager.RecordStatusReported(reportNoStatus);
91
+
92
+ Assert.IsTrue(true);
93
+ }
94
+
95
+ [TestMethod]
96
+ public void TestStatusReportForRetrySerialization()
97
+ {
98
+ SettingsManager.RemoveString(RETRY_DEPLOYMENT_REPORT_KEY);
99
+ var original = new JObject();
100
+ original.Add("keyString", "stringValue");
101
+ original.Add("keyInt", 42);
102
+ original.Add("keyBool", true);
103
+
104
+ TelemetryManager.SaveStatusReportForRetry(original);
105
+
106
+ var stringified = SettingsManager.GetString(RETRY_DEPLOYMENT_REPORT_KEY);
107
+ SettingsManager.RemoveString(RETRY_DEPLOYMENT_REPORT_KEY);
108
+
109
+ Assert.IsNotNull(stringified);
110
+ var result = JObject.Parse(stringified);
111
+
112
+ Assert.IsTrue((bool)result.GetValue("keyBool"));
113
+ Assert.AreEqual(42, (int)result.GetValue("keyInt"));
114
+ Assert.AreEqual("stringValue", (string)result.GetValue("keyString"));
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <configuration>
3
+ <runtime>
4
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5
+ <dependentAssembly>
6
+ <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
7
+ <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
8
+ </dependentAssembly>
9
+ </assemblyBinding>
10
+ </runtime>
11
+ </configuration>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <packages>
3
+ <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net46" />
4
+ </packages>