Skip to content

Commit

Permalink
Update .NET 6 RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Sep 15, 2021
1 parent 4b5021b commit 8fe5063
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100-preview.7.21379.14
dotnet-version: 6.0.100-rc.1.21458.32

# - name: Install macOS SDK(macOS)
# if: matrix.os == 'macOS-latest'
Expand Down
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageVersion Include="NUnit" Version="3.13.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="5.0.0" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="6.0.0-rc.1.21451.13" />
<PackageVersion Include="nunit.xamarin" Version="3.6.1" />
<PackageVersion Include="PCLStorage" Version="1.0.2" />
<PackageVersion Include="Xamarin.Forms" Version="5.0.0.2083" />
Expand All @@ -55,7 +55,7 @@
<PackageVersion Include="StatefulModel.Standard" Version="0.1.0" />
<PackageVersion Include="Titanium.Web.Proxy" Version="3.1.1397" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
<PackageVersion Include="System.Drawing.Common" Version="5.0.2" />
<PackageVersion Include="System.Drawing.Common" Version="6.0.0-rc.1.21451.13" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
<PackageVersion Include="Avalonia" Version="0.10.7" />
<PackageVersion Include="Avalonia.Desktop" Version="0.10.7" />
Expand Down Expand Up @@ -84,9 +84,9 @@
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
<PackageVersion Include="System.Runtime.WindowsRuntime" Version="4.7.0" />
<PackageVersion Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.7.0" />
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageVersion Include="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5" />
<PackageVersion Include="SQLitePCLRaw.bundle_green" Version="2.0.4" />
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0" />
<PackageVersion Include="System.Security.Principal.Windows" Version="6.0.0-preview.5.21301.5" />
<PackageVersion Include="BrotliSharpLib" Version="0.3.3" />
<PackageVersion Include="System.Buffers" Version="4.5.1" />
<PackageVersion Include="System.Memory" Version="4.5.4" />
Expand Down
6 changes: 4 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ English | [简体中文](./README.md)
OS | Version | Architectures | Lifecycle
--------------------------------------|-------------------------|-----------------|----------
[Windows Client][Windows-client] | 7 SP1(**\***), 8.1 | x64 | [Windows][Windows-lifecycle]
[Windows 10 Client][Windows-client] | Version 1607+ | x64 | [Windows][Windows-lifecycle]
[Windows 10 Client][Windows-client] | Version 1607+(**\***) | x64 | [Windows][Windows-lifecycle]
[Windows Server][Windows-Server] | 2012+ | x64 | [Windows Server][Windows-Server-lifecycle]

**\*** Windows 7 SP1 is supported with KB3063858 [64 bit](https://www.microsoft.com/download/details.aspx?id=47442) installed.
**\*** Windows 7 SP1 is supported with KB3063858 [64 bit](https://www.microsoft.com/download/details.aspx?id=47442) installed.
**\*** Microsoft Store/Desktop Bridge Version 1809+

[Windows-client]: https://www.microsoft.com/windows/
[Windows-lifecycle]: https://support.microsoft.com/help/13853/windows-lifecycle-fact-sheet
Expand Down Expand Up @@ -139,6 +140,7 @@ OS | Version | Architectures |
- Windows Server 2008 R2 SP1
- Only version 1.x is available, 2.x is not supported at first, and it is recommended to upgrade to a higher version
- Windows Server / Linux version without desktop GUI
- Xbox or Windows Mobile / Phone

## 🌏 Roadmap
Read what we [milestones](https://github.com/SteamTools-Team/SteamTools/milestones), and feel free to ask questions.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@
OS | Version | Architectures | Lifecycle
--------------------------------------|-------------------------|-----------------|----------
[Windows Client][Windows-client] | 7 SP1(**\***), 8.1 | x64 | [Windows][Windows-lifecycle]
[Windows 10 Client][Windows-client] | Version 1607+ | x64 | [Windows][Windows-lifecycle]
[Windows 10 Client][Windows-client] | Version 1607+(**\***) | x64 | [Windows][Windows-lifecycle]
[Windows Server][Windows-Server] | 2012+ | x64 | [Windows Server][Windows-Server-lifecycle]

**\*** Windows 7 SP1 is supported with KB3063858 [64 位](https://www.microsoft.com/zh-cn/download/details.aspx?id=47442) installed.
**\*** Windows 7 SP1 is supported with KB3063858 [64 位](https://www.microsoft.com/zh-cn/download/details.aspx?id=47442) installed.
**\*** Microsoft Store/Desktop Bridge Version 1809+

[Windows-client]: https://www.microsoft.com/windows/
[Windows-lifecycle]: https://support.microsoft.com/help/13853/windows-lifecycle-fact-sheet
Expand Down Expand Up @@ -148,6 +149,7 @@ OS | Version | Architectures |
- Windows Server 2008 R2 SP1
- 仅可使用 1.X 版本,2.X 开始不受支持,建议升级到更高版本
- 无桌面 GUI 的 Windows Server / Linux 版本
- Xbox or Windows Mobile / Phone

## 🌏 路线图
查看这个 [milestones](https://github.com/SteamTools-Team/SteamTools/milestones) 来了解我们下一步的开发计划,并随时提出问题。
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "3.0.23"
"MSBuild.Sdk.Extras": "3.0.38"
},
"sdk": {
"version": "6.0.100-preview.7.21379.14"
"version": "6.0.100-rc.1.21458.32"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Application.Services;
using System.Runtime.Versioning;
using System.Linq;
using Windows.ApplicationModel;
using System.Application.Services;
using Windows.ApplicationModel.Activation;
using System.Diagnostics;
using System.Application.UI;

// ReSharper disable once CheckNamespace
namespace System.Application
Expand Down
7 changes: 4 additions & 3 deletions src/ST.Client.Desktop.Avalonia.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
using System.Linq;
using System.Runtime.Versioning;

#if WINDOWS_DESKTOP_BRIDGE
[assembly: SupportedOSPlatform("Windows10.0.17763.0")]
#endif

namespace System.Application.UI
{
static partial class Program
Expand All @@ -14,9 +18,6 @@ static partial class Program
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
#if WINDOWS_DESKTOP_BRIDGE
[SupportedOSPlatform("Windows10.0.17763.0")]
#endif
static int Main(string[] args)
{
#if WINDOWS_DESKTOP_BRIDGE
Expand Down
3 changes: 3 additions & 0 deletions src/ST.Client.Desktop.Linux/Properties/AssemblyInfo.OS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.Versioning;

[assembly: SupportedOSPlatform("Linux")]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Application.UI.ViewModels;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
Expand Down Expand Up @@ -181,18 +182,23 @@ public void UnelevatedProcessStart(string cmdArgs)
throw new PlatformNotSupportedException();
}

public bool SetAsSystemProxy(bool state, string? ip, int? port)
public bool SetAsSystemProxy(bool state, IPAddress? ip, int port)
{
var shellContent = new StringBuilder();
if (state)
{
var hasIpAndProt = ip != null && port >= 0;
shellContent.AppendLine($"gsettings set org.gnome.system.proxy mode 'manual'");
shellContent.AppendLine($"gsettings set org.gnome.system.proxy.http host '{ip}'");
shellContent.AppendLine($"gsettings set org.gnome.system.proxy.http port {port}");
shellContent.AppendLine($" gsettings set org.gnome.system.proxy.https host '{ip}'");
shellContent.AppendLine($"gsettings set org.gnome.system.proxy.https port {port}");
if (hasIpAndProt)
{
shellContent.AppendLine($"gsettings set org.gnome.system.proxy.http host '{ip}'");
shellContent.AppendLine($"gsettings set org.gnome.system.proxy.http port {port}");
shellContent.AppendLine($"gsettings set org.gnome.system.proxy.https host '{ip}'");
shellContent.AppendLine($"gsettings set org.gnome.system.proxy.https port {port}");
}
}
else {
else
{
shellContent.AppendLine($"gsettings set org.gnome.system.proxy mode 'none'");
}
((IPlatformService)this).AdminShell(shellContent.ToString(), false);
Expand Down
3 changes: 3 additions & 0 deletions src/ST.Client.Desktop.Mac/Properties/AssemblyInfo.OS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.Versioning;

[assembly: SupportedOSPlatform("macOS")]
2 changes: 1 addition & 1 deletion src/ST.Client.Desktop.Mac/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static IServiceCollection AddDesktopPlatformService(this IServiceCollecti
services.AddSingleton<IPlatformService>(s => s.GetRequiredService<MacDesktopPlatformServiceImpl>());
services.AddSingleton<IDesktopPlatformService>(s => s.GetRequiredService<MacDesktopPlatformServiceImpl>());
services.AddSingleton<IEmailPlatformService>(s => s.GetRequiredService<MacDesktopPlatformServiceImpl>());
services.AddSingleton<ISystemJumpListService, SystemJumpListServiceImpl>();
//services.AddSingleton<ISystemJumpListService, SystemJumpListServiceImpl>();
if (hasNotifyIcon) services.AddNotifyIcon();
}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@

using System.Application.Models;
using System.Diagnostics;
using System.Runtime.Versioning;
using System.Text;
//namespace System.Application.Services.Implementation
//{
// internal sealed class SystemJumpListServiceImpl : ISystemJumpListService
// {
// public void InitJumpList()
// {
// }

namespace System.Application.Services.Implementation
{
internal sealed class SystemJumpListServiceImpl : ISystemJumpListService
{
public void InitJumpList()
{
}

public void AddJumpTask(string title, string applicationPath, string iconResourcePath, string arguments = "", string description = "", string customCategory = "")
{

}
}
}
// public void AddJumpTask(string title, string applicationPath, string iconResourcePath, string arguments = "", string description = "", string customCategory = "")
// {
// }
// }
//}
3 changes: 3 additions & 0 deletions src/ST.Client.Desktop.Windows/Properties/AssemblyInfo.OS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.Versioning;

[assembly: SupportedOSPlatform("Windows")]
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
extern alias JumpLists;
using JumpLists::System.Windows.Shell;
using System.Runtime.Versioning;
using JumpList = System.Application.UI.JumpLists;

namespace System.Application.Services.Implementation
{
[SupportedOSPlatform("Windows")]
internal sealed class SystemJumpListServiceImpl : ISystemJumpListService
{
public void InitJumpList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.IO;
using System.Linq;
using System.Management;
using System.Net;
using System.Runtime.Versioning;
using System.Security.Principal;
using Windows.ApplicationModel;
Expand Down Expand Up @@ -297,14 +298,15 @@ public bool SetAsSystemProxy()
return true;
}

const string ProxyOverride= "\"ProxyOverride\"=\"localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*\"";
const string ProxyOverride = "\"ProxyOverride\"=\"localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*\"";

public bool SetAsSystemProxy(bool state, string? ip=null, int? port=null)
public bool SetAsSystemProxy(bool state, IPAddress? ip, int port)
{
if (DesktopBridge.IsRunningAsUwp)
{
var proxyEnable = $"\"ProxyEnable\"=dword:{(state ? "00000001" : "00000000")}";
var proxyServer= port.HasValue?$"\"proxyServer\"=\"{ip}:{port}\"":"";
var hasIpAndProt = ip != null && port >= 0;
var proxyServer = hasIpAndProt ? $"\"proxyServer\"=\"{ip}:{port}\"" : "";
var reg = $"Windows Registry Editor Version 5.00{Environment.NewLine}[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings]{Environment.NewLine}{proxyEnable}{Environment.NewLine}{(state ? $"{ProxyOverride}{Environment.NewLine}" : "")}{proxyServer}";
var path = Path.Combine(IOPath.CacheDirectory, "switchproxy.reg");
File.WriteAllText(path, reg, Text.Encoding.UTF8);
Expand Down
6 changes: 5 additions & 1 deletion src/ST.Client/Services/IPlatformService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Net;
using System.Text;
using System.Threading.Tasks;

Expand Down Expand Up @@ -28,6 +29,9 @@ public interface IPlatformService
/// <summary>
/// 设置启用或关闭系统代理
/// </summary>
bool SetAsSystemProxy(bool state,string? ip=null,int? port=null);
bool SetAsSystemProxy(bool state, IPAddress? ip = null, int port = -1)
{
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ public bool StartProxy()
}
else
{
if (!IPlatformService.Instance.SetAsSystemProxy(true, explicitProxyEndPoint.IpAddress.ToString(), explicitProxyEndPoint.Port))
if (!IPlatformService.Instance.SetAsSystemProxy(true, explicitProxyEndPoint.IpAddress, explicitProxyEndPoint.Port))
{
Log.Error("Proxy", "系统代理开启失败");
return false;
Expand Down

0 comments on commit 8fe5063

Please sign in to comment.