Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade projects to .NET 7.0 #3423

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Restore dependencies
if: matrix.os == 'windows-latest'
run: dotnet restore
Expand Down Expand Up @@ -74,56 +74,56 @@ jobs:
# Upload CLI
- name: Upload CLI artifacts for Linux ARM64
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-cli-${{ github.sha }}-linux-arm64
path: Shadowsocks.CLI/bin/Release/net5.0/linux-arm64/publish/
path: Shadowsocks.CLI/bin/Release/net7.0/linux-arm64/publish/
- name: Upload CLI artifacts for Linux x64
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-cli-${{ github.sha }}-linux-x64
path: Shadowsocks.CLI/bin/Release/net5.0/linux-x64/publish/
path: Shadowsocks.CLI/bin/Release/net7.0/linux-x64/publish/
- name: Upload CLI artifacts for Linux framework-dependent
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-cli-${{ github.sha }}-linux
path: Shadowsocks.CLI/bin/Release/net5.0/publish/
path: Shadowsocks.CLI/bin/Release/net7.0/publish/
- name: Upload CLI artifacts for Windows ARM64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-cli-${{ github.sha }}-windows-arm64
path: Shadowsocks.CLI/bin/Release/net5.0/win-arm64/publish/
path: Shadowsocks.CLI/bin/Release/net7.0/win-arm64/publish/
- name: Upload CLI artifacts for Windows x64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-cli-${{ github.sha }}-windows-x64
path: Shadowsocks.CLI/bin/Release/net5.0/win-x64/publish/
path: Shadowsocks.CLI/bin/Release/net7.0/win-x64/publish/
- name: Upload CLI artifacts for Windows framework-dependent
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-cli-${{ github.sha }}-windows
path: Shadowsocks.CLI/bin/Release/net5.0/publish/
path: Shadowsocks.CLI/bin/Release/net7.0/publish/
# Upload WPF
# - name: Upload WPF artifacts for Windows ARM64
# if: matrix.os == 'windows-latest'
# uses: actions/upload-artifact@v2
# uses: actions/upload-artifact@v3
# with:
# name: shadowsocks-wpf-${{ github.sha }}-windows-arm64
# path: Shadowsocks.WPF/bin/Release/net5.0-windows10.0.19041.0/win-arm64/publish/
# path: Shadowsocks.WPF/bin/Release/net7.0-windows/win-arm64/publish/
- name: Upload WPF artifacts for Windows x64
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-wpf-${{ github.sha }}-windows-x64
path: Shadowsocks.WPF/bin/Release/net5.0-windows10.0.19041.0/win-x64/publish/
path: Shadowsocks.WPF/bin/Release/net7.0-windows/win-x64/publish/
- name: Upload WPF artifacts for Windows framework-dependent
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: shadowsocks-wpf-${{ github.sha }}-windows
path: Shadowsocks.WPF/bin/Release/net5.0-windows10.0.19041.0/publish/
path: Shadowsocks.WPF/bin/Release/net7.0-windows/publish/
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Restore dependencies
if: matrix.os == 'windows-latest'
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion Shadowsocks.CLI/Shadowsocks.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<AssemblyName>sscli</AssemblyName>
<PackageId>Shadowsocks.CLI</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion Shadowsocks.Interop/Shadowsocks.Interop.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Shadowsocks.Net/Crypto/AEAD/AEADCryptoBaseCrypto.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#nullable enable
using CryptoBase;
using CryptoBase.SymmetricCryptos.AEADCryptos;
using CryptoBase.Abstractions.SymmetricCryptos;
using System;
using System.Collections.Generic;
Expand Down
3 changes: 2 additions & 1 deletion Shadowsocks.Net/Crypto/CryptoUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ public static class CryptoUtils
public static byte[] MD5(byte[] b)
{
var hash = new byte[CryptoBase.MD5Length];
MD5Utils.Default(b, hash);
using DefaultMD5Digest md5 = new();
md5.UpdateFinal(b, hash);
return hash;
}
}
Expand Down
4 changes: 3 additions & 1 deletion Shadowsocks.Net/Crypto/Stream/StreamCryptoBaseCrypto.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#nullable enable
using CryptoBase;
using CryptoBase.SymmetricCryptos.StreamCryptos;
using CryptoBase.Abstractions.SymmetricCryptos;
using CryptoBase.Digests.MD5;
using System;
Expand Down Expand Up @@ -27,7 +28,8 @@ protected override void InitCipher(byte[] iv, bool isEncrypt)
var realKey = new byte[MD5Length];
key.CopyTo(temp);
iv.CopyTo(temp.Slice(keyLen));
MD5Utils.Fast440(temp, realKey);
using Fast440MD5Digest md5 = new();
md5.UpdateFinal(temp, realKey);

_crypto = StreamCryptoCreate.Rc4(realKey);
return;
Expand Down
6 changes: 3 additions & 3 deletions Shadowsocks.Net/Shadowsocks.Net.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CryptoBase" Version="1.2.2" />
<PackageReference Include="Splat" Version="11.0.1" />
<PackageReference Include="CryptoBase" Version="1.7.2" />
<PackageReference Include="Splat" Version="14.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Shadowsocks.PAC/Shadowsocks.PAC.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Shadowsocks.Protobuf/Shadowsocks.Protobuf.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.15.8" />
<PackageReference Include="Google.Protobuf" Version="3.23.4" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Shadowsocks.Protocol/Shadowsocks.Protocol.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CryptoBase" Version="1.2.2" />
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.2.0" />
<PackageReference Include="CryptoBase" Version="1.7.2" />
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.2.8" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CryptoBase;
using CryptoBase.SymmetricCryptos.AEADCryptos;

namespace Shadowsocks.Protocol.Shadowsocks.Crypto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CryptoBase;
using CryptoBase.SymmetricCryptos.AEADCryptos;

namespace Shadowsocks.Protocol.Shadowsocks.Crypto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CryptoBase;
using CryptoBase.SymmetricCryptos.AEADCryptos;

namespace Shadowsocks.Protocol.Shadowsocks.Crypto
{
Expand Down
6 changes: 4 additions & 2 deletions Shadowsocks.Protocol/Shadowsocks/Crypto/CryptoUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ public static byte[] SSKDF(string password, int keylen)
{
if (i == 0)
{
MD5Utils.Default(pw, md5Sum);
using DefaultMD5Digest md5 = new();
md5.UpdateFinal(pw, md5Sum);
}
else
{
md5Sum.CopyTo(result);
pw.CopyTo(result.Slice(md5Length));
MD5Utils.Default(result, md5Sum);
using DefaultMD5Digest md5 = new();
md5.UpdateFinal(result, md5Sum);
}

var length = Math.Min(16, keylen - i);
Expand Down
10 changes: 5 additions & 5 deletions Shadowsocks.Tests/Shadowsocks.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>

<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
12 changes: 6 additions & 6 deletions Shadowsocks.WPF.Tests/Shadowsocks.WPF.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>

<IsPackable>false</IsPackable>

<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shadowsocks.WPF\Shadowsocks.WPF.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\publish\</PublishDir>
<PublishDir>bin\Release\net7.0-windows\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions Shadowsocks.WPF/Properties/PublishProfiles/win-arm.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\win-arm\publish\</PublishDir>
<PublishDir>bin\Release\net7.0-windows\win-arm\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<RuntimeIdentifier>win-arm</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions Shadowsocks.WPF/Properties/PublishProfiles/win-x64.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\win-x64\publish\</PublishDir>
<PublishDir>bin\Release\net7.0-windows\win-x64\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions Shadowsocks.WPF/Properties/PublishProfiles/win-x86.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\win-x86\publish\</PublishDir>
<PublishDir>bin\Release\net7.0-windows\win-x86\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
25 changes: 13 additions & 12 deletions Shadowsocks.WPF/Shadowsocks.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationManifest>App.manifest</ApplicationManifest>
<Product>Shadowsocks for Windows WPF GUI</Product>
Expand Down Expand Up @@ -49,18 +49,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MaterialDesignThemes" Version="4.0.0" />
<PackageReference Include="MdXaml" Version="1.10.0" />
<PackageReference Include="OxyPlot.Wpf" Version="2.0.0" />
<PackageReference Include="ReactiveUI.Events.WPF" Version="13.2.18" />
<PackageReference Include="ReactiveUI.Fody" Version="13.2.18" />
<PackageReference Include="ReactiveUI.Validation" Version="2.1.1" />
<PackageReference Include="ReactiveUI.WPF" Version="13.2.18" />
<PackageReference Include="Splat.NLog" Version="11.0.1" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="MdXaml" Version="1.21.0" />
<PackageReference Include="OxyPlot.Wpf" Version="2.1.2" />
<PackageReference Include="ReactiveUI.Events.WPF" Version="15.1.1" />
<PackageReference Include="ReactiveUI.Fody" Version="19.4.1" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
<PackageReference Include="ReactiveUI.WPF" Version="19.4.1" />
<PackageReference Include="Splat.NLog" Version="14.7.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21223.1" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="WPFLocalizeExtension" Version="3.8.0" />
<PackageReference Include="ZXing.Net" Version="0.16.6" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="WPFLocalizeExtension" Version="3.10.0" />
<PackageReference Include="ZXing.Net" Version="0.16.9" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Shadowsocks.WPF/Utils/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using ZXing;
using ZXing.Common;
using ZXing.QrCode;
using ZXing.Windows.Compatibility;

namespace Shadowsocks.WPF.Utils
{
Expand Down
2 changes: 1 addition & 1 deletion Shadowsocks/Shadowsocks.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down