Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Delubear committed Mar 7, 2023
2 parents a46b93b + b36c140 commit 9556356
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x
dotnet-version: 7.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand All @@ -38,7 +38,7 @@ jobs:
#artifact:
# An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs)
#artifacts: './GlucoseTray/bin/Release/net5.0-windows/win-x64/publish/'
artifacts: './GlucoseTray/bin/Release/net6.0-windows/win-x64/publish/GlucoseTray.exe'
artifacts: './GlucoseTray/bin/Release/net7.0-windows/win-x64/publish/GlucoseTray.exe'
# The content type of the artifact. Defaults to raw
#artifactContentType: # optional, default is
# An optional body for the release.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x
dotnet-version: 7.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
29 changes: 11 additions & 18 deletions GlucoseTray/GlucoseTray.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<RootNamespace>GlucoseTray</RootNamespace>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRun>false</PublishReadyToRun> <!-- Turn on again once fixed: https://github.com/dotnet/wpf/issues/7282 -->
<PublishSingleFile Condition="'$(Configuration)' == 'Release'">true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ApplicationIcon />
Expand All @@ -26,22 +26,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="6.0.1" />
<PackageReference Include="TaskScheduler" Version="2.9.3" />
<PackageReference Include="System.Text.Json" Version="7.0.1" />
<PackageReference Include="TaskScheduler" Version="2.10.1" />
</ItemGroup>

<ItemGroup>
<TrimmerRootAssembly Include="System.Runtime" />
<TrimmerRootAssembly Include="System.Diagnostics.Debug" />
<TrimmerRootAssembly Include="System.Runtime.Extensions" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion GlucoseTray/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ private static bool LoadApplicationSettings()
return true;
}

private static void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) => MessageBox.Show(JsonSerializer.Serialize(e), "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
private static void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) => MessageBox.Show(e?.Exception?.Message + " --- " + e?.Exception?.InnerException?.Message, "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>bin\Release\net6.0-windows\win-x64\publish\</PublishDir>
<Platform>AnyCPU</Platform>
<TargetFramework>net7.0-windows</TargetFramework>
<PublishDir>bin\Release\net7.0-windows\win-x64\publish\</PublishDir>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun> <!-- Turn on again once fixed: https://github.com/dotnet/wpf/issues/7282 -->
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions GlucoseTray/Services/StringEncryptionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static string EncryptString(string plainText, string passPhrase)
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);
var password = new PasswordDeriveBytes(passPhrase, null);
byte[] keyBytes = password.GetBytes(keysize / 8);
var symmetricKey = Aes.Create("AesManaged");
var symmetricKey = Aes.Create();
symmetricKey.Mode = CipherMode.CBC;
ICryptoTransform encryptor = symmetricKey.CreateEncryptor(keyBytes, initVectorBytes);
var memoryStream = new MemoryStream();
Expand All @@ -42,7 +42,7 @@ public static string DecryptString(string cipherText, string passPhrase)
byte[] cipherTextBytes = Convert.FromBase64String(cipherText);
var password = new PasswordDeriveBytes(passPhrase, null);
byte[] keyBytes = password.GetBytes(keysize / 8);
var symmetricKey = Aes.Create("AesManaged");
var symmetricKey = Aes.Create();
symmetricKey.Mode = CipherMode.CBC;
ICryptoTransform decryptor = symmetricKey.CreateDecryptor(keyBytes, initVectorBytes);
var memoryStream = new MemoryStream(cipherTextBytes);
Expand All @@ -57,7 +57,7 @@ public static string DecryptString(string cipherText, string passPhrase)
byte[] tempBytes = new byte[cipherTextBytes.Length];
do
{
int bytesRead = cryptoStream.Read(tempBytes, 0, tempBytes.Length);
int bytesRead = cryptoStream.Read(tempBytes, 0, tempBytes.Length);
if (bytesRead == 0)
break;

Expand Down
2 changes: 1 addition & 1 deletion GlucoseTray/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"appsettings": {
"Version": "13.5.0",
"Version": "14.1.0",
"Url": "https://github.com/Delubear/GlucoseTray"
}
}

0 comments on commit 9556356

Please sign in to comment.