@srcpush/react-native-code-push 1.0.3-develop.2 → 1.0.3-develop.4

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 (66) hide show
  1. package/CONTRIBUTING.md +20 -9
  2. package/package.json +1 -1
  3. package/windows/CodePush/CodePush.def +0 -3
  4. package/windows/CodePush/CodePush.vcxproj +0 -198
  5. package/windows/CodePush/CodePush.vcxproj.filters +0 -91
  6. package/windows/CodePush/CodePushConfig.cpp +0 -104
  7. package/windows/CodePush/CodePushConfig.h +0 -66
  8. package/windows/CodePush/CodePushConfig.idl +0 -12
  9. package/windows/CodePush/CodePushDownloadHandler.cpp +0 -73
  10. package/windows/CodePush/CodePushDownloadHandler.h +0 -32
  11. package/windows/CodePush/CodePushNativeModule.cpp +0 -937
  12. package/windows/CodePush/CodePushNativeModule.h +0 -247
  13. package/windows/CodePush/CodePushPackage.cpp +0 -456
  14. package/windows/CodePush/CodePushPackage.h +0 -49
  15. package/windows/CodePush/CodePushTelemetryManager.cpp +0 -213
  16. package/windows/CodePush/CodePushTelemetryManager.h +0 -29
  17. package/windows/CodePush/CodePushUpdateUtils.cpp +0 -86
  18. package/windows/CodePush/CodePushUpdateUtils.h +0 -38
  19. package/windows/CodePush/CodePushUtils.cpp +0 -29
  20. package/windows/CodePush/CodePushUtils.h +0 -18
  21. package/windows/CodePush/FileUtils.cpp +0 -131
  22. package/windows/CodePush/FileUtils.h +0 -28
  23. package/windows/CodePush/PropertySheet.props +0 -16
  24. package/windows/CodePush/ReactPackageProvider.cpp +0 -15
  25. package/windows/CodePush/ReactPackageProvider.h +0 -22
  26. package/windows/CodePush/ReactPackageProvider.idl +0 -9
  27. package/windows/CodePush/miniz/LICENSE +0 -22
  28. package/windows/CodePush/miniz/miniz.c +0 -7657
  29. package/windows/CodePush/miniz/miniz.h +0 -1338
  30. package/windows/CodePush/miniz/readme.md +0 -37
  31. package/windows/CodePush/packages.config +0 -4
  32. package/windows/CodePush/pch.cpp +0 -1
  33. package/windows/CodePush/pch.h +0 -4
  34. package/windows-legacy/CodePush/CodePush.csproj +0 -128
  35. package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
  36. package/windows-legacy/CodePush/FileUtils.cs +0 -40
  37. package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
  38. package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
  39. package/windows-legacy/CodePush/UpdateManager.cs +0 -305
  40. package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
  41. package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
  42. package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
  43. package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
  44. package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
  45. package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
  46. package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
  47. package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
  48. package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
  49. package/windows-legacy/CodePush.Net46/packages.config +0 -5
  50. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
  51. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
  52. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
  53. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
  54. package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
  55. package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
  56. package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
  57. package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
  58. package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
  59. package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
  60. package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
  61. package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
  62. package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
  63. package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
  64. package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
  65. package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
  66. package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
@@ -1,46 +0,0 @@
1
- using Newtonsoft.Json.Linq;
2
- using System;
3
- using System.IO;
4
- using System.Threading.Tasks;
5
- using Windows.Storage;
6
-
7
- namespace CodePush.ReactNative
8
- {
9
- internal class UpdateUtils
10
- {
11
- internal async static Task CopyNecessaryFilesFromCurrentPackageAsync(StorageFile diffManifestFile, StorageFolder currentPackageFolder, StorageFolder newPackageFolder)
12
- {
13
- await FileUtils.MergeFoldersAsync(currentPackageFolder, newPackageFolder).ConfigureAwait(false);
14
- JObject diffManifest = await CodePushUtils.GetJObjectFromFileAsync(diffManifestFile).ConfigureAwait(false);
15
- var deletedFiles = (JArray)diffManifest["deletedFiles"];
16
- foreach (string fileNameToDelete in deletedFiles)
17
- {
18
- StorageFile fileToDelete = await newPackageFolder.GetFileAsync(fileNameToDelete.Replace("/", "\\")).AsTask().ConfigureAwait(false);
19
- await fileToDelete.DeleteAsync().AsTask().ConfigureAwait(false);
20
- }
21
- }
22
-
23
- internal async static Task<string> FindJSBundleInUpdateContentsAsync(StorageFolder updateFolder, string expectedFileName)
24
- {
25
- foreach (StorageFile file in await updateFolder.GetFilesAsync().AsTask().ConfigureAwait(false))
26
- {
27
- string fileName = file.Name;
28
- if (fileName.Equals(expectedFileName))
29
- {
30
- return fileName;
31
- }
32
- }
33
-
34
- foreach (StorageFolder folder in await updateFolder.GetFoldersAsync().AsTask().ConfigureAwait(false))
35
- {
36
- string mainBundlePathInSubFolder = await FindJSBundleInUpdateContentsAsync(folder, expectedFileName).ConfigureAwait(false);
37
- if (mainBundlePathInSubFolder != null)
38
- {
39
- return Path.Combine(folder.Name, mainBundlePathInSubFolder);
40
- }
41
- }
42
-
43
- return null;
44
- }
45
- }
46
- }
@@ -1,28 +0,0 @@
1
- using System;
2
-
3
- namespace CodePush.Net46.Adapters.Http
4
- {
5
- public enum HttpProgressStage
6
- {
7
- None = 0,
8
- DetectingProxy = 10,
9
- ResolvingName = 20,
10
- ConnectingToServer = 30,
11
- NegotiatingSsl = 40,
12
- SendingHeaders = 50,
13
- SendingContent = 60,
14
- WaitingForResponse = 70,
15
- ReceivingHeaders = 80,
16
- ReceivingContent = 90
17
- }
18
-
19
- public struct HttpProgress
20
- {
21
- public UInt64 BytesReceived;
22
- public UInt64 BytesSent;
23
- public UInt32 Retries;
24
- public HttpProgressStage Stage;
25
- public UInt64? TotalBytesToReceive;
26
- public UInt64? TotalBytesToSend;
27
- }
28
- }
@@ -1,106 +0,0 @@
1
- using CodePush.ReactNative;
2
- using Newtonsoft.Json;
3
- using Newtonsoft.Json.Linq;
4
- using PCLStorage;
5
- using System;
6
- using System.Collections.Generic;
7
- using System.Threading;
8
- using System.Threading.Tasks;
9
-
10
- namespace CodePush.Net46.Adapters.Storage
11
- {
12
- public enum ApplicationDataCreateDisposition
13
- {
14
- Always = 0,
15
- Existing = 1
16
- }
17
-
18
- public class DictionaryWithDefault<TKey, TValue> : Dictionary<TKey, TValue>
19
- {
20
- TValue _default;
21
- public TValue DefaultValue
22
- {
23
- get { return _default; }
24
- set { _default = value; }
25
- }
26
- public DictionaryWithDefault() : base() { }
27
- public DictionaryWithDefault(TValue defaultValue) : base()
28
- {
29
- _default = defaultValue;
30
- }
31
- public new TValue this[TKey key]
32
- {
33
- get
34
- {
35
- TValue t;
36
- return base.TryGetValue(key, out t) ? t : _default;
37
- }
38
- set
39
- {
40
- base[key] = value;
41
- DataChanged(this, null);
42
- }
43
- }
44
-
45
- public new bool Remove(TKey key)
46
- {
47
- var found = base.Remove(key);
48
- if (found)
49
- DataChanged(this, null);
50
-
51
- return found;
52
- }
53
-
54
- public event EventHandler DataChanged;
55
-
56
- }
57
-
58
- // A naive implementation of Windows.Storage.ApplicationDataContainer
59
- public class ApplicationDataContainer
60
- {
61
- public DictionaryWithDefault<string, string> Values;
62
- private readonly SemaphoreSlim mutex = new SemaphoreSlim(1, 1);
63
-
64
- const string STORAGE_NAME = "AppStorage.data";
65
- string storageFileName = null;
66
-
67
- public ApplicationDataContainer(string name = STORAGE_NAME)
68
- {
69
- storageFileName = name;
70
- var storageFile = FileSystem.Current.LocalStorage.CreateFileAsync(storageFileName, CreationCollisionOption.OpenIfExists).Result;
71
- var data = CodePushUtils.GetJObjectFromFileAsync(storageFile).Result;
72
-
73
- if (data != null)
74
- {
75
- Values = data.ToObject<DictionaryWithDefault<string, string>>();
76
- }
77
- else
78
- {
79
- Values = new DictionaryWithDefault<string, string>();
80
- }
81
-
82
- Values.DataChanged += async (s, e) => await SaveAsync();
83
- }
84
-
85
- ~ApplicationDataContainer()
86
- {
87
- mutex.Dispose();
88
- }
89
-
90
- async Task SaveAsync()
91
- {
92
- await mutex.WaitAsync().ConfigureAwait(false);
93
- var jobject = JObject.FromObject(Values);
94
- var storageFile = await FileSystem.Current.LocalStorage.CreateFileAsync(storageFileName, CreationCollisionOption.OpenIfExists).ConfigureAwait(false);
95
- await storageFile.WriteAllTextAsync(JsonConvert.SerializeObject(jobject)).ConfigureAwait(false);
96
- mutex.Release();
97
- }
98
-
99
- public async Task DeleteAsync()
100
- {
101
- Values.Clear();
102
- var storageFile = await FileSystem.Current.LocalStorage.CreateFileAsync(storageFileName, CreationCollisionOption.OpenIfExists).ConfigureAwait(false);
103
- await storageFile.DeleteAsync().ConfigureAwait(false);
104
- }
105
- }
106
- }
@@ -1,103 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
- <PropertyGroup>
5
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
- <ProjectGuid>{4DFE3F9F-5E15-4F17-8FD4-33FF0519348E}</ProjectGuid>
8
- <OutputType>Library</OutputType>
9
- <AppDesignerFolder>Properties</AppDesignerFolder>
10
- <RootNamespace>CodePush.Net46</RootNamespace>
11
- <AssemblyName>CodePush.Net46</AssemblyName>
12
- <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
13
- <FileAlignment>512</FileAlignment>
14
- <TargetFrameworkProfile />
15
- </PropertyGroup>
16
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
17
- <DebugSymbols>true</DebugSymbols>
18
- <OutputPath>bin\x86\Debug\</OutputPath>
19
- <DefineConstants>DEBUG;TRACE</DefineConstants>
20
- <DebugType>full</DebugType>
21
- <PlatformTarget>x86</PlatformTarget>
22
- <ErrorReport>prompt</ErrorReport>
23
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
24
- </PropertyGroup>
25
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
26
- <OutputPath>bin\x86\Release\</OutputPath>
27
- <DefineConstants>TRACE</DefineConstants>
28
- <Optimize>true</Optimize>
29
- <DebugType>pdbonly</DebugType>
30
- <PlatformTarget>x86</PlatformTarget>
31
- <ErrorReport>prompt</ErrorReport>
32
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
33
- </PropertyGroup>
34
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
35
- <DebugSymbols>true</DebugSymbols>
36
- <OutputPath>bin\x64\Debug\</OutputPath>
37
- <DefineConstants>DEBUG;TRACE</DefineConstants>
38
- <DebugType>full</DebugType>
39
- <PlatformTarget>x64</PlatformTarget>
40
- <ErrorReport>prompt</ErrorReport>
41
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
42
- </PropertyGroup>
43
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
44
- <OutputPath>bin\x64\Release\</OutputPath>
45
- <DefineConstants>TRACE</DefineConstants>
46
- <Optimize>true</Optimize>
47
- <DebugType>pdbonly</DebugType>
48
- <PlatformTarget>x64</PlatformTarget>
49
- <ErrorReport>prompt</ErrorReport>
50
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
51
- </PropertyGroup>
52
- <ItemGroup>
53
- <Reference Include="Newtonsoft.Json, Version=13.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
54
- <HintPath>$(SolutionDir)\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
55
- <Private>True</Private>
56
- </Reference>
57
- <Reference Include="PCLStorage, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
58
- <SpecificVersion>False</SpecificVersion>
59
- <HintPath>$(SolutionDir)\packages\PCLStorage.1.0.2\lib\net45\PCLStorage.dll</HintPath>
60
- <Private>True</Private>
61
- </Reference>
62
- <Reference Include="PCLStorage.Abstractions, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
63
- <SpecificVersion>False</SpecificVersion>
64
- <HintPath>$(SolutionDir)\packages\PCLStorage.1.0.2\lib\net45\PCLStorage.Abstractions.dll</HintPath>
65
- <Private>True</Private>
66
- </Reference>
67
- <Reference Include="System" />
68
- <Reference Include="System.Core" />
69
- <Reference Include="System.IO.Compression" />
70
- <Reference Include="System.IO.Compression.FileSystem" />
71
- <Reference Include="System.Management" />
72
- <Reference Include="System.Data.DataSetExtensions" />
73
- <Reference Include="System.Data" />
74
- <Reference Include="System.Net.Http" />
75
- </ItemGroup>
76
- <ItemGroup>
77
- <Compile Include="Adapters\Http\HttpProgress.cs" />
78
- <Compile Include="Adapters\Storage\ApplicationDataContainer.cs" />
79
- <Compile Include="CodePushUtils.cs" />
80
- <Compile Include="FileUtils.cs" />
81
- <Compile Include="Properties\AssemblyInfo.cs" />
82
- <Compile Include="UpdateManager.cs" />
83
- <Compile Include="UpdateUtils.cs" />
84
- </ItemGroup>
85
- <ItemGroup>
86
- <None Include="packages.config" />
87
- </ItemGroup>
88
- <ItemGroup>
89
- <ProjectReference Include="..\..\..\react-native-windows\ReactWindows\ReactNative.Net46\ReactNative.Net46.csproj">
90
- <Project>{22cbff9c-fe36-43e8-a246-266c7635e662}</Project>
91
- <Name>ReactNative.Net46</Name>
92
- </ProjectReference>
93
- </ItemGroup>
94
- <Import Project="..\CodePush.Shared\CodePush.Shared.projitems" Label="Shared" />
95
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
96
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
97
- Other similar extension points exist, see Microsoft.Common.targets.
98
- <Target Name="BeforeBuild">
99
- </Target>
100
- <Target Name="AfterBuild">
101
- </Target>
102
- -->
103
- </Project>
@@ -1,158 +0,0 @@
1
- using Newtonsoft.Json.Linq;
2
- using PCLStorage;
3
- using System;
4
- using System.Diagnostics;
5
- using System.IO;
6
- using System.Management;
7
- using System.Threading.Tasks;
8
-
9
- namespace CodePush.ReactNative
10
- {
11
- internal partial class CodePushUtils
12
- {
13
- class ApplicationInfo
14
- {
15
- public ApplicationInfo()
16
- {
17
- var info = FileVersionInfo.GetVersionInfo(Environment.GetCommandLineArgs()[0]);
18
- Version = $"{info.FileMajorPart}.{info.FileMinorPart}.{info.FileBuildPart}";
19
- CompanyName = string.IsNullOrEmpty(info.CompanyName) ? info.ProductName : info.CompanyName;
20
- ProductName = info.ProductName;
21
- }
22
-
23
- public string Version { private set; get; }
24
- public string CompanyName { private set; get; }
25
- public string ProductName { private set; get; }
26
- }
27
-
28
- static ApplicationInfo applicationInfo = new ApplicationInfo();
29
- static string _bundlePath;
30
-
31
- internal static string GetFileBundlePrefix()
32
- {
33
- // For Windows desktop application the prefix of a bundle is the full path to the folder where
34
- // bundle should be installed.
35
- //
36
- // Desktop application can be installed at any location, the most popular are:
37
- // - User local data folder, in this case the bundle can be stored in the same location and be
38
- // unique for the user.
39
- // - Program Files folder, in this case the application is unique for the system and will be shared
40
- // amoung all users of the system, the bundle should be unique for the system as well.
41
- // Commonly, user has no write access to Program Files folder or at least admin privileges have to been requested.
42
- // In this case the bundle will be stored in ProgramData folder as it is recommended by MS.
43
-
44
- if (!string.IsNullOrEmpty(_bundlePath))
45
- {
46
- return _bundlePath;
47
- }
48
-
49
- _bundlePath = GetAppFolder();
50
-
51
- if (!HasWriteAccessToFolder(_bundlePath))
52
- {
53
- _bundlePath = $"{Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), applicationInfo.CompanyName, applicationInfo.ProductName, applicationInfo.Version)}\\";
54
- }
55
-
56
- return _bundlePath;
57
- }
58
-
59
- internal async static Task<JObject> GetJObjectFromFileAsync(IFile file)
60
- {
61
- string jsonString = await file.ReadAllTextAsync().ConfigureAwait(false);
62
- if (jsonString.Length == 0)
63
- {
64
- return new JObject();
65
- }
66
-
67
- try
68
- {
69
- return JObject.Parse(jsonString);
70
- }
71
- catch (Exception)
72
- {
73
- return null;
74
- }
75
- }
76
-
77
- static string GetDeviceIdImpl()
78
- {
79
- var mbId = GetSerialNumber();
80
- var procId = GetProcId();
81
-
82
- if (string.IsNullOrEmpty(procId))
83
- {
84
- procId = GetMAC();
85
- }
86
-
87
- return procId + '-' + mbId;
88
- }
89
-
90
- static string GetSerialNumber()
91
- {
92
- var mos = new ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard");
93
- var moc = mos.Get();
94
- var mbId = String.Empty;
95
-
96
- foreach (ManagementObject mo in moc)
97
- {
98
- mbId = (string)mo["SerialNumber"];
99
- if (!string.IsNullOrEmpty(mbId))
100
- break;
101
- }
102
-
103
- return mbId;
104
- }
105
-
106
- static string GetProcId()
107
- {
108
- var mos = new ManagementObjectSearcher("Select * From Win32_processor");
109
- var moc = mos.Get();
110
- var procId = string.Empty;
111
-
112
- foreach (ManagementObject mo in moc)
113
- {
114
- procId = (string)mo["ProcessorID"];
115
- if (!string.IsNullOrEmpty(procId))
116
- break;
117
- }
118
- return procId;
119
- }
120
-
121
- static string GetMAC()
122
- {
123
- var mos = new ManagementObjectSearcher("Select * From Win32_NetworkAdapterConfiguration");
124
- var moc = mos.Get();
125
- var mac = string.Empty;
126
-
127
- foreach (ManagementObject mo in moc)
128
- {
129
- try
130
- {
131
- if ((bool)mo["IPEnabled"])
132
- {
133
- mac = (string)mo["MacAddress"];
134
- break;
135
- }
136
- }
137
- catch (Exception)
138
- {
139
- }
140
- }
141
-
142
- return mac;
143
- }
144
-
145
- static bool HasWriteAccessToFolder(string path)
146
- {
147
- try
148
- {
149
- File.Open(Path.Combine(path, ".security-check"), FileMode.OpenOrCreate).Close();
150
- return true;
151
- }
152
- catch
153
- {
154
- return false;
155
- }
156
- }
157
- }
158
- }
@@ -1,55 +0,0 @@
1
- using PCLStorage;
2
- using System;
3
- using System.IO;
4
- using System.Threading.Tasks;
5
-
6
- namespace CodePush.ReactNative
7
- {
8
- internal class FileUtils
9
- {
10
- internal async static Task MergeFoldersAsync(IFolder source, IFolder target)
11
- {
12
- foreach (IFile sourceFile in await source.GetFilesAsync().ConfigureAwait(false))
13
- {
14
- await CopyFileAsync(sourceFile.Path, Path.Combine(target.Path, sourceFile.Name)).ConfigureAwait(false);
15
- }
16
-
17
- foreach (IFolder sourceDirectory in await source.GetFoldersAsync().ConfigureAwait(false))
18
- {
19
- var nextTargetSubDir = await target.CreateFolderAsync(sourceDirectory.Name, CreationCollisionOption.OpenIfExists).ConfigureAwait(false);
20
- await MergeFoldersAsync(sourceDirectory, nextTargetSubDir).ConfigureAwait(false);
21
- }
22
- }
23
-
24
- internal async static Task ClearReactDevBundleCacheAsync()
25
- {
26
-
27
- if (await FileSystem.Current.LocalStorage.CheckExistsAsync(CodePushConstants.ReactDevBundleCacheFileName).ConfigureAwait(false) != ExistenceCheckResult.FileExists)
28
- return;
29
-
30
- var devBundleCacheFile = await FileSystem.Current.LocalStorage.GetFileAsync(CodePushConstants.ReactDevBundleCacheFileName).ConfigureAwait(false);
31
- await devBundleCacheFile.DeleteAsync().ConfigureAwait(false);
32
- }
33
-
34
- internal static Task<long> GetBinaryResourcesModifiedTimeAsync(string fileName)
35
- {
36
- var pathToAssembly = CodePushUtils.GetAppFolder();
37
- var pathToAssemblyResource = Path.Combine(pathToAssembly, CodePushConstants.AssetsBundlePrefix, fileName);
38
- var lastUpdateTime = File.GetCreationTime(pathToAssemblyResource);
39
-
40
- return Task.FromResult(new DateTimeOffset(lastUpdateTime).ToUnixTimeMilliseconds());
41
- }
42
-
43
- internal async static Task CopyFileAsync(string sourcePath, string destinationPath)
44
- {
45
- using (var source = File.Open(sourcePath, FileMode.Open, System.IO.FileAccess.Read))
46
- {
47
- using (var destination = File.Create(destinationPath)) // Replace if exists
48
- {
49
- await source.CopyToAsync(destination);
50
- }
51
- }
52
- }
53
-
54
- }
55
- }
@@ -1,36 +0,0 @@
1
- using System.Reflection;
2
- using System.Runtime.CompilerServices;
3
- using System.Runtime.InteropServices;
4
-
5
- // General Information about an assembly is controlled through the following
6
- // set of attributes. Change these attribute values to modify the information
7
- // associated with an assembly.
8
- [assembly: AssemblyTitle("CodePush.Net46")]
9
- [assembly: AssemblyDescription("")]
10
- [assembly: AssemblyConfiguration("")]
11
- [assembly: AssemblyCompany("")]
12
- [assembly: AssemblyProduct("CodePush.Net46")]
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("4dfe3f9f-5e15-4f17-8fd4-33ff0519348e")]
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")]