Compare commits

..
13 Commits
Author SHA1 Message Date
Mossimo d04213147e 🔧 修复离线安装脚本 dotnet_path 参数缺失导致脚本错误 2026-08-31 18:08:47 +08:00
ff m 4310f72872 🌐 本地化代理启动错误提示
将代理启动时的硬编码错误字符串替换为本地化资源:
- ProxyService.Operate 中证书校验失败、端口绑定失败改用多语言资源字符串
- 新增 Error_CheckRootCertificateFailed_、Error_BindPortError_ 及各语言资源翻译
2026-08-23 22:22:01 +08:00
ff m fefaedb54f ✨ 新增 linux-x64 发布配置 2026-08-23 22:01:05 +08:00
LY 9e25ff7460 🔖 TBD v3.1.10001.0 2026-08-22 22:40:10 +08:00
RMBGAME 3e870daeaf 🔧 修复rxapp编译错误 2026-08-22 19:53:54 +08:00
LY 8f16d3aa66 引入源码方式引用 dotnetCampus.Ipc 并增强进程校验
- 用 ProjectReference 替换 NuGet 包方式引用 dotnetCampus.Ipc,并调整解决方案和项目文件
- IPC 服务实现中增加命名管道连接进程校验,确保仅允许自身或特定模块连接
- 新增 TryGetProcessById、CheckBePid、ValidateNamedPipeClientConnection 等方法用于进程和连接安全校验
- 启动流程中增加主进程 PID 合法性校验,失败时返回新错误码 MainProcessIdIncorrect(4043)
- 日志增加调试信息,便于追踪进程校验流程
- WattToolkit.slnx 新增 dotnetCampus.Ipc 项目引用路径
- 更新 dotnetCampus.Ipc 子模块提交引用
2026-08-22 00:53:04 +08:00
LY 9374231e9f 新增子模块 ref/dotnetCampus.Ipc
添加了指向 https://github.com/BeyondDimension/dotnetCampus.Ipc 的子模块,并在 dotnetCampus.Ipc 目录下记录了对应的提交哈希。
2026-08-21 23:36:38 +08:00
LY 2c0bf8b2d6 重构跨平台 Shell 执行接口及实现
统一各平台 Shell 执行方式,将相关方法改为静态调用,简化接口实现。注释并保留过时方法代码,推荐统一入口。完善方法注释,预留扩展点,提升代码一致性和可维护性。
2026-08-21 23:17:57 +08:00
LY 048fb345ed 🛡️ 安全修复 path 特权任意路径文件覆盖 2026-08-21 21:14:04 +08:00
LY 5726f27445 ↑ .NET 11 PRE 7 & Avalonia 11.3.20 2026-08-21 21:02:53 +08:00
LY 2c3aba6709 还原 Ava 11 2026-08-21 18:53:19 +08:00
LY 137ff46ed9 升级目标框架至 .NET 10/11 并同步子模块
本次提交将项目目标框架升级为 net10.0 和 net11.0,更新了多个 Avalonia 相关 csproj 文件的 <TargetFrameworks> 配置。Directory.Build.props 默认 DotNet_Version 升级为 11.0,并为 net11.0 增加 runtime-async=on 特性。各子模块同步更新引用,指向新 commit。
2026-08-21 18:44:49 +08:00
RMBGAME c16ffa08e0 ⬆️ Avalonia 12.1.0 2026-07-17 18:27:31 +08:00
95 changed files with 15632 additions and 15332 deletions
+1
View File
@@ -34,6 +34,7 @@ bld/
# Visual Studio 2015/2017 cache/options directory
.vs/
.vscode/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
+3
View File
@@ -46,3 +46,6 @@
[submodule "ref/Avalonia8"]
path = ref/Avalonia8
url = https://github.com/BeyondDimension/Avalonia8
[submodule "ref/dotnetCampus.Ipc"]
path = ref/dotnetCampus.Ipc
url = https://github.com/BeyondDimension/dotnetCampus.Ipc
+4 -1
View File
@@ -111,8 +111,11 @@
<Project Path="ref/Common/src/BD.Common.Settings/BD.Common.Settings.csproj" />
<Project Path="ref/Common/src/BD.Common/BD.Common.csproj" />
</Folder>
<Folder Name="/2.Reference/Ipc/">
<Project Path="ref/dotnetCampus.Ipc/src/dotnetCampus.Ipc.Analyzers/dotnetCampus.Ipc.Analyzers.csproj" />
<Project Path="ref/dotnetCampus.Ipc/src/dotnetCampus.Ipc/dotnetCampus.Ipc.csproj" />
</Folder>
<Folder Name="/2.Reference/Steam/">
<Project Path="ref/ArchiSteamFarm/ArchiSteamFarm/ArchiSteamFarm.csproj" />
<Project Path="ref/Facepunch.Steamworks/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj" />
<Project Path="ref/Facepunch.Steamworks/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj" />
<Project Path="ref/Gameloop.Vdf/Gameloop.Vdf/Gameloop.Vdf.csproj" />
+1 -1
View File
@@ -163,7 +163,7 @@ Install_zenity
Install_jq
certutil_Init
Kill_Process
dotnet_path="$base_path/dotnet"
dotnet_exec="$dotnet_path/dotnet/dotnet"
if [ -x "$dotnet_exec" ]; then
echo "文件具有执行权限。"
+7
View File
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "11.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
}
+40 -3
View File
@@ -13,19 +13,21 @@ public static partial class AssemblyInfo
/// </summary>
public const string Version = $"{Version2}.{VersionBuild}";
const string VersionBuild = "0";
const string VersionBuild = "1"; // 1~99
const string VersionBuild2 = $"{VersionBuild}0"; // VersionBuild为1位时,补0,两位
/// <summary>
/// 预览版本号,范围 1~9,只增不减
/// </summary>
const string ver_for_preview = "5";
const string ver_for_preview = "1";
/// <summary>
/// RC 版本号,范围 0~9,只增不减
/// </summary>
const string ver_for_rc = "0";
public const string FileVersion = $"{Version2}.2{ver_for_rc}2{ver_for_preview}.0"; // msix 需要保持第四位为0
public const string FileVersion = $"{Version2}.{VersionBuild2}{ver_for_rc}0{ver_for_preview}.0"; // msix 需要保持第四位为0
public const string InformationalVersion = Version;
//public const string InformationalVersion = $"{Version}-preview.{ver_for_preview}";
@@ -65,6 +67,8 @@ public static partial class AssemblyInfo
/// </summary>
public const string Product = Trademark;
public const string Product_APP_REVERSE_PROXY = $"{Product} - Accelerator and script module sub-process";
/// <summary>
/// 与该应用程序关联的公司名称。
/// </summary>
@@ -148,4 +152,37 @@ false
#endif
/// <summary>
/// 验证程序集是否为合法程序集
/// </summary>
/// <param name="assemblyPath"></param>
/// <returns></returns>
public static bool ValidateAssembly(string assemblyPath)
{
var fvi = FileVersionInfo.GetVersionInfo(assemblyPath);
if (fvi.Comments != Description)
{
return false;
}
else if (fvi.CompanyName != Company)
{
return false;
}
else if (fvi.LegalCopyright != Copyright)
{
return false;
}
else if (fvi.LegalTrademarks != Trademark)
{
return false;
}
else if (fvi.ProductName != Product && fvi.ProductName != Product_APP_REVERSE_PROXY)
{
return false;
}
// TODO: Digital signature verification
return true;
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ using AssemblyInfo = BD.WTTS.AssemblyInfo;
[assembly: AssemblyTrademark(AssemblyInfo.Trademark)]
[assembly: AssemblyDescription(AssemblyInfo.Description)]
#if APP_REVERSE_PROXY
[assembly: AssemblyProduct($"{AssemblyInfo.Product} - Accelerator and script module sub-process")]
[assembly: AssemblyProduct(AssemblyInfo.Product_APP_REVERSE_PROXY)]
#else
[assembly: AssemblyProduct(AssemblyInfo.Product)]
#endif
@@ -23,4 +23,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
+4
View File
@@ -18,4 +18,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
@@ -21,4 +21,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
@@ -19,4 +19,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
@@ -23,4 +23,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
@@ -26,4 +26,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
@@ -23,4 +23,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
+4
View File
@@ -23,4 +23,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
+4
View File
@@ -23,4 +23,8 @@
<Import Project="..\TFM_NETX.props" />
<PropertyGroup>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
</PropertyGroup>
</Project>
+1 -1
View File
@@ -9,6 +9,6 @@
<legacyCorruptedStateExceptionsPolicy enabled="true"/>
</runtime>
<appSettings>
<add key="d" value="10.0.3"/>
<add key="d" value="11.0.0-preview.7.26381.103"/>
</appSettings>
</configuration>
+1 -1
View File
@@ -10,6 +10,6 @@
<legacyCorruptedStateExceptionsPolicy enabled="true"/>
</runtime>
<appSettings>
<add key="d" value="10.0.3"/>
<add key="d" value="11.0.0-preview.7.26381.103"/>
</appSettings>
</configuration>
+19 -8
View File
@@ -5,6 +5,7 @@
#if NETFRAMEWORK
using System.Configuration;
using System.Diagnostics;
#endif
using static BD.WTTS.AssemblyInfo;
using static BD.WTTS.Client.Resources.Strings;
@@ -16,14 +17,15 @@ static unsafe partial class Program
{
static Program()
{
dotnet_version_major = "10";
dotnet_version_major = "11";
dotnet_version_minor = "0";
dotnet_version_build = "3";
dotnet_version = $"{dotnet_version_major}.{dotnet_version_minor}.{dotnet_version_build}";
dotnet_version_build = "0";
dotnet_version_preOrRcString = "-preview.7.26381.103"; // -字符开头!
dotnet_version = $"{dotnet_version_major}.{dotnet_version_minor}.{dotnet_version_build}{dotnet_version_preOrRcString}";
}
//#if NETFRAMEWORK
public static string dotnet_version_major, dotnet_version_minor, dotnet_version_build, dotnet_version;
public static string dotnet_version_major, dotnet_version_minor, dotnet_version_build, dotnet_version, dotnet_version_preOrRcString;
//#else
// public const string dotnet_version_major = "7";
// public const string dotnet_version_minor = "0";
@@ -239,7 +241,7 @@ static unsafe partial class Program
#if NETFRAMEWORK
try
{
var dotnet_version_ = ConfigurationManager.AppSettings["d"];
var dotnet_version_ = ConfigurationManager.AppSettings["d"]; // 由 App.config 中的配置键控制加载运行时版本
if (!
#if !NET35
string.
@@ -248,7 +250,7 @@ static unsafe partial class Program
dotnet_version_.Length < sbyte.MaxValue)
{
var dotnet_version__ = dotnet_version_.Split('.');
int major, minor, build;
int major, minor;
switch (dotnet_version__.Length)
{
case 1:
@@ -265,8 +267,17 @@ static unsafe partial class Program
case 3:
dotnet_version_major = (int.TryParse(dotnet_version__[0], out major) ? major : 0).ToString();
dotnet_version_minor = (int.TryParse(dotnet_version__[1], out minor) ? minor : 0).ToString();
dotnet_version_build = (int.TryParse(dotnet_version__[2], out build) ? build : 0).ToString();
dotnet_version = $"{dotnet_version_major}.{dotnet_version_minor}.{dotnet_version_build}";
// 支持 PRE/RC 版本号
string? preOrRcString = null;
var buildString = dotnet_version__[2];
var index = buildString.IndexOf('-');
if (index > 0)
{
preOrRcString = buildString.Substring(index);
buildString = buildString.Substring(0, index);
}
dotnet_version_build = (int.TryParse(buildString, out var build) ? build : 0).ToString();
dotnet_version = $"{dotnet_version_major}.{dotnet_version_minor}.{dotnet_version_build}{preOrRcString}";
break;
}
}
+3 -1
View File
@@ -120,7 +120,9 @@ partial class Program
#endif
.UseSkia()
.LogToTrace()
.UseReactiveUI();
.UseReactiveUI(_ =>
{
});
builder.With(new FontManagerOptions
{
@@ -85,7 +85,7 @@
<PackageReference Include="Avalonia.Controls.ColorPicker" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.Avalonia" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="AvaloniaUI.DiagnosticsSupport" />
<!--ProjectReference Include="..\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj" />
<ProjectReference Include="..\Avalonia.Themes.Fluent\Avalonia.Themes.Fluent.csproj" />-->
<ProjectReference Include="..\Avalonia.Desktop\Avalonia.Desktop.csproj" />
@@ -214,12 +214,12 @@ public sealed class AppSplashScreen : IApplicationSplashScreen
IconKey = "avares://BD.WTTS.Client.Avalonia/UI/Assets/Icons/bug.ico",
},
#endif
new MenuTabItemViewModel("Plugin_Store")
{
PageType = typeof(PluginStorePage),
IsResourceGet = true,
IconKey = "avares://BD.WTTS.Client.Avalonia/UI/Assets/Icons/store.ico",
},
// new MenuTabItemViewModel("Plugin_Store")
// {
// PageType = typeof(PluginStorePage),
// IsResourceGet = true,
// IconKey = "avares://BD.WTTS.Client.Avalonia/UI/Assets/Icons/store.ico",
// },
new MenuTabItemViewModel("Settings")
{
PageType = typeof(SettingsPage),
@@ -49,7 +49,8 @@
<ItemGroup>
<!-- PackageReference -->
<ProjectReference Include="..\..\ref\Common\src\BD.Common\BD.Common.csproj" />
<PackageReference Include="dotnetCampus.Ipc" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
<PackageReference Include="NLog" />
<PackageReference Include="NLog.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
@@ -46,16 +46,113 @@ public sealed class IPCSubProcessServiceImpl : IPCSubProcessService
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool TryGetProcessById(int pid, [NotNullWhen(true)] out Process? process)
{
try
{
process = Process.GetProcessById(pid);
return true;
}
catch
{
// 异常不记录日志
process = null;
return false;
}
}
internal static bool CheckBePid(Process proc)
{
if (proc.Id == Environment.ProcessId)
{
return true;
}
var thisPath = Environment.ProcessPath;
ArgumentException.ThrowIfNullOrWhiteSpace(thisPath);
thisPath = Path.GetFullPath(thisPath);
var procPath = proc.TryGetMainModule()?.FileName;
procPath = procPath == null ? null : Path.GetFullPath(procPath);
if (procPath != null)
{
if (thisPath == procPath)
{
return true;
}
var accProPath = Path.GetFullPath(Path.Combine(thisPath, "..", "modules", "Accelerator",
#if WINDOWS
"Steam++.Accelerator.exe"
#else
"Steam++.Accelerator"
#endif
));
if (procPath == accProPath)
{
return true;
}
if (AssemblyInfo.ValidateAssembly(procPath))
{
return true;
}
}
return false;
}
internal static bool CheckBePid(int pid)
{
if (pid == Environment.ProcessId)
{
return true;
}
if (!TryGetProcessById(pid, out var proc))
{
return false;
}
return CheckBePid(proc);
}
internal static void ValidateNamedPipeClientConnection(object? s, NamedPipeClientConnectingEventArgs e)
{
#if WINDOWS
#if DEBUG
Log.Info(nameof(IPCSubProcessServiceImpl), "服务端正在校验命名管道客户端进程,{ClientProcessId}", e.ClientProcessId);
#endif
try
{
// 验证连接的客户端进程必须是自己的程序
if (!e.ClientProcessId.HasValue ||
!CheckBePid(e.ClientProcessId.Value))
{
e.AllowConnection = false;
return;
}
}
catch (Exception ex)
{
Log.Error(nameof(IPCSubProcessServiceImpl), ex, "IpcConfiguration.NamedPipeClientConnecting fail");
e.AllowConnection = false;
}
#endif
}
public async Task RunAsync(string moduleName, TaskCompletionSource tcs, string pipeName,
Action<IpcProvider>? configureIpcProvider = null)
{
this.tcs = tcs;
ipcProvider = new IpcProvider(
IPCSubProcessModuleService.Constants.GetClientPipeName(moduleName, pipeName),
new IpcConfiguration
{
IpcLoggerProvider = _ => new IpcLogger_(loggerFactory, nameof(IPCSubProcessServiceImpl)),
});
var ipcCfg = new IpcConfiguration
{
IpcLoggerProvider = _ => new IpcLogger_(loggerFactory, nameof(IPCSubProcessServiceImpl)),
};
ipcCfg.NamedPipeClientConnecting += ValidateNamedPipeClientConnection;
ipcProvider = new IpcProvider(IPCSubProcessModuleService.Constants.GetClientPipeName(moduleName, pipeName), ipcCfg);
ipcProvider.CreateIpcJoint<IPCSubProcessModuleService>(new IPCSubProcessModuleServiceImpl(this));
configureIpcProvider?.Invoke(ipcProvider);
ipcProvider.StartServer();
@@ -89,6 +89,14 @@ public interface IPCSubProcessService : IDisposable
if (!TryGetProcessById(pid, out var mainProcess))
return (int)CommandExitCode.NotFoundMainProcessId;
#if DEBUG
Log.Info(nameof(IPCSubProcessServiceImpl), "客户端正在校验服务端进程,{pid}", pid);
#endif
// 验证要连接的服务端进程是否为自己的程序
var ckPid = IPCSubProcessServiceImpl.CheckBePid(mainProcess);
if (!ckPid)
return (int)CommandExitCode.MainProcessIdIncorrect;
#if LIB_CLIENT_IPC
var nativeLibraryPath = Environment.GetEnvironmentVariable(EnvKey_NativeLibraryPath);
if (!string.IsNullOrWhiteSpace(nativeLibraryPath))
@@ -96,6 +96,8 @@
<PackageReference Include="BD.Common.Repositories.SQLitePCL" />-->
<ProjectReference Include="..\..\ref\Common\src\BD.Common.Repositories.SQLitePCL\BD.Common.Repositories.SQLitePCL.csproj" />
<ProjectReference Include="..\..\ref\Common\src\BD.Common\BD.Common.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
<PackageReference Include="NLog" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="Ae.DNS.Client" />
@@ -301,37 +301,37 @@ sealed partial class CertificateManagerImpl : ICertificateManager
ICertificateManager.Constants.TrustRootCertificate(GetCerFilePathGeneratedWhenNoFileExists, platformService, RootCertificate);
}
[Obsolete("use ICertificateManager.Constants.TrustRootCertificate")]
[SupportedOSPlatform("macOS")]
void TrustRootCertificateMacOS()
{
var filePath = GetCerFilePathGeneratedWhenNoFileExists();
if (filePath == null) return;
var state = platformService.TrustRootCertificateAsync(filePath);
//await platformService.RunShellAsync($"security add-trusted-cert -d -r trustRoot -k /Users/{Environment.UserName}/Library/Keychains/login.keychain-db \\\"{filePath}\\\"", true);
if (state.HasValue && !state.Value)
TrustRootCertificateMacOS();
}
//[Obsolete("use ICertificateManager.Constants.TrustRootCertificate")]
//[SupportedOSPlatform("macOS")]
//void TrustRootCertificateMacOS()
//{
// var filePath = GetCerFilePathGeneratedWhenNoFileExists();
// if (filePath == null) return;
// var state = platformService.TrustRootCertificateAsync(filePath);
// //await platformService.RunShellAsync($"security add-trusted-cert -d -r trustRoot -k /Users/{Environment.UserName}/Library/Keychains/login.keychain-db \\\"{filePath}\\\"", true);
// if (state.HasValue && !state.Value)
// TrustRootCertificateMacOS();
//}
[Obsolete("use ICertificateManager.Constants.TrustRootCertificate")]
[SupportedOSPlatform("Linux")]
void TrustRootCertificateLinux()
{
var filePath = GetCerFilePathGeneratedWhenNoFileExists();
if (filePath == null) return;
var state = platformService.TrustRootCertificateAsync(filePath);
//部分系统还是只能手动导入浏览器
Browser2.Open(Constants.Urls.OfficialWebsite_LiunxSetupCer);
if (state.HasValue && !state.Value)
GetCerFilePathGeneratedWhenNoFileExists();
//全部屏蔽 Linux 浏览器全部不信任系统证书 只能手动导入 如需导入请手动操作
//var crtFile = $"{Path.Combine(IOPath.AppDataDirectory, $@"{ICertificateManager.CertificateName}.Certificate.crt")}";
////复制一份Crt导入系统用 ca-certificates 只识别Crt后缀
//platformService.RunShell($"cp -f \"{filePath}\" \"{crtFile}\"", false);
//platformService.RunShell($"cp -f \"{crtFile}\" \"/usr/local/share/ca-certificates\" && sudo update-ca-certificates", true);
//浏览器不信任系统证书列表
//Browser2.Open(Constants.Urls.OfficialWebsite_LiunxSetupCer);
}
//[Obsolete("use ICertificateManager.Constants.TrustRootCertificate")]
//[SupportedOSPlatform("Linux")]
//void TrustRootCertificateLinux()
//{
// var filePath = GetCerFilePathGeneratedWhenNoFileExists();
// if (filePath == null) return;
// var state = platformService.TrustRootCertificateAsync(filePath);
// //部分系统还是只能手动导入浏览器
// Browser2.Open(Constants.Urls.OfficialWebsite_LiunxSetupCer);
// if (state.HasValue && !state.Value)
// GetCerFilePathGeneratedWhenNoFileExists();
// //全部屏蔽 Linux 浏览器全部不信任系统证书 只能手动导入 如需导入请手动操作
// //var crtFile = $"{Path.Combine(IOPath.AppDataDirectory, $@"{ICertificateManager.CertificateName}.Certificate.crt")}";
// ////复制一份Crt导入系统用 ca-certificates 只识别Crt后缀
// //platformService.RunShell($"cp -f \"{filePath}\" \"{crtFile}\"", false);
// //platformService.RunShell($"cp -f \"{crtFile}\" \"/usr/local/share/ca-certificates\" && sudo update-ca-certificates", true);
// //浏览器不信任系统证书列表
// //Browser2.Open(Constants.Urls.OfficialWebsite_LiunxSetupCer);
//}
/// <inheritdoc cref="ICertificateManager.SetupRootCertificate"/>
public bool SetupRootCertificate()
@@ -82,6 +82,8 @@
<ItemGroup>
<ProjectReference Include="..\BD.WTTS.Client\BD.WTTS.Client.csproj" />
<ProjectReference Include="..\BD.WTTS.Client.Avalonia\BD.WTTS.Client.Avalonia.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>
<ItemGroup>
@@ -81,7 +81,7 @@ public sealed partial class GameAcceleratorService
if (XunYouSDK.IsSupported)
{
this.WhenValueChanged(x => x.XYAccelState, false)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Subscribe(x =>
{
if (x == null)
@@ -184,7 +184,7 @@ public sealed partial class GameAcceleratorService
});
UserService.Current.WhenAnyValue(static x => x.User)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Subscribe(async x =>
{
string vipEndTimeString = VipEndTimeStringDef;
@@ -228,7 +228,7 @@ partial class ProxyService
ICertificateManager.Constants.Instance);
if (checkRootCertificateCode != StartProxyResultCode.Ok)
{
return $"CheckRootCertificate, ErrCode: {checkRootCertificateCode}";
return Strings.Error_CheckRootCertificateFailed_;
}
}
@@ -295,14 +295,14 @@ partial class ProxyService
}
//新线程等待 IPC 错误返回后 Kill 自己 Linux 修改权限需要重新启动
reverseProxyService.Exit();
return "StartProxyFail: BindPortError";
return Strings.Error_BindPortError_.Format(proxyPort);
}
else
{
var errorString = startProxyResult.Code switch
{
StartProxyResultCode.Exception => startProxyResult.Exception?.ToString() ?? nameof(StartProxyResultCode.Exception),
_ => $"StartProxyFail, ErrCode: {startProxyResult.Code}"
_ => $"{Strings.Error_BindPortError_.Format(proxyPort)}StaartProxyErrorCode:${startProxyResult.Code}"
};
return errorString;
}
@@ -28,13 +28,13 @@ public sealed partial class ProxyService
ProxyDomains
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<AccelerateProjectGroupDTO>.Ascending(x => x.Order).ThenBy(x => x.Name))
.Bind(out _ProxyDomainsList)
.Subscribe(_ => SelectGroup = ProxyDomains.Items.FirstOrDefault());
//this.WhenValueChanged(x => x.ProxyStatus, false)
// .ObserveOn(RxApp.MainThreadScheduler)
// .ObserveOn(RxSchedulers.MainThreadScheduler)
// .Subscribe(async proxyStatusLeft =>
// {
// bool proxyStatusRight;
@@ -64,7 +64,7 @@ public sealed partial class ProxyService
// });
this.WhenAnyValue(v => v.ProxyDomainsList)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Subscribe(domain => domain?
.ToObservableChangeSet()
.AutoRefresh(x => x.ObservableItems)
@@ -78,7 +78,7 @@ public sealed partial class ProxyService
}));
this.WhenAnyValue(v => v.ProxyScripts)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Subscribe(script => script?
.Connect()
.AutoRefresh(x => x.Disable)
@@ -9,7 +9,7 @@ public sealed partial class GameAcceleratorPageViewModel
GameAcceleratorService.Current.Games
.Connect()
.Sort(new LastAccelerateTimeComparer())
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Bind(out _Games)
.Subscribe();
}
@@ -13,7 +13,7 @@ public sealed partial class GameAcceleratorViewModel
GameAcceleratorService.Current.Games
.Connect()
.Sort(new LastAccelerateTimeComparer())
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Bind(out _Games)
.Subscribe();
@@ -59,7 +59,7 @@ public partial class ScriptPageViewModel : TabItemViewModel
ProxyService.Current.ProxyScripts
.Connect()
//.Filter(scriptFilter)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<ScriptDTO>.Ascending(x => x.Order).ThenBy(x => x.Name))
.Bind(out _ProxyScripts)
.Subscribe(_ => this.RaisePropertyChanged(nameof(IsProxyScriptsEmpty)));
@@ -11,7 +11,7 @@ public partial class ScriptStorePageViewModel : ViewModelBase
_ScriptsSourceList
.Connect()
//.Filter(scriptFilter)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<ScriptDTO>.Ascending(x => x.Order).ThenBy(x => x.Name))
.Bind(out _Scripts)
.Subscribe(_ => this.RaisePropertyChanged(nameof(IsScriptsEmpty)));
@@ -117,6 +117,8 @@
<ItemGroup>
<ProjectReference Include="..\BD.WTTS.Client\BD.WTTS.Client.csproj" />
<ProjectReference Include="..\BD.WTTS.Client.Avalonia\BD.WTTS.Client.Avalonia.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>
<ItemGroup>
@@ -26,7 +26,7 @@ public partial class BotPageViewModel : ViewModelBase
ASFService.Current.SteamBotsSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<BotViewModel>.Descending(x => x.Bot.BotName))
.Bind(out _SteamBots)
.Subscribe();
@@ -70,6 +70,8 @@
<ProjectReference Include="..\..\ref\WinAuth\src\WinAuth\WinAuth.csproj" />
<ProjectReference Include="..\BD.WTTS.Client\BD.WTTS.Client.csproj" />
<ProjectReference Include="..\BD.WTTS.Client.Avalonia\BD.WTTS.Client.Avalonia.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>
<ItemGroup>
@@ -67,7 +67,7 @@ public sealed partial class AuthenticatorHomePageViewModel
this.AuthSource
.Connect()
.Filter(textFilter)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<AuthenticatorItemModel>.Ascending(x => x.AuthData.Index).ThenBy(x => x.AuthName))
.Bind(out _Auths)
.Subscribe();
@@ -81,6 +81,8 @@
<ItemGroup>
<ProjectReference Include="..\BD.WTTS.Client\BD.WTTS.Client.csproj" />
<ProjectReference Include="..\BD.WTTS.Client.Avalonia\BD.WTTS.Client.Avalonia.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>
<ItemGroup>
@@ -134,7 +134,7 @@ public sealed partial class PlatformAccount
var iconSize = GetImgResolutionPower(Math.Min(avatarImgBitmap.Width, avatarImgBitmap.Height), gear);
using var fBitmap = DrawIcon(avatarImgBitmap, SKBitmap.Decode(IApplication.Login_512), iconSize.Max());
SKBitmap[]? bitmaps = new[] { fBitmap }.Concat(iconSize.Where(x => x != iconSize.Max())
.Select(x => fBitmap.Resize(new SKSizeI { Height = x, Width = x }, SKFilterQuality.High)))
.Select(x => fBitmap.Resize(new SKSizeI { Height = x, Width = x }, SKSamplingOptions.Default)))
.ToArray();
try
{
@@ -192,13 +192,13 @@ public sealed partial class PlatformAccount
SKBitmap DrawIcon(SKBitmap originalBitmap, SKBitmap loginIcon, int iconSize)
{
loginIcon = loginIcon.Resize(new SKSizeI(iconSize / 3, iconSize / 3), SKFilterQuality.High);
loginIcon = loginIcon.Resize(new SKSizeI(iconSize / 3, iconSize / 3), SKSamplingOptions.Default);
SKBitmap avatarImgBitmap = new(iconSize, iconSize);
using SKCanvas canvas = new(avatarImgBitmap);
SKPaint paint = new SKPaint();
paint.FilterQuality = SKFilterQuality.High;
canvas.DrawBitmap(originalBitmap.Resize(new SKSizeI(iconSize, iconSize), SKFilterQuality.High),
// paint.FilterQuality = SKSamplingOptions.Default;
canvas.DrawBitmap(originalBitmap.Resize(new SKSizeI(iconSize, iconSize), SKSamplingOptions.Default),
new SKRect(0, 0, iconSize, iconSize), paint);
canvas.DrawBitmap(loginIcon, new SKRect(0, 0, loginIcon.Width, loginIcon.Height));
@@ -16,7 +16,7 @@ public sealed partial class SteamFamilyShareManagePageViewModel : WindowViewMode
//_AuthorizedSourceList = new SourceCache<AuthorizedDevice, long>(t => t.SteamId3_Int);
//_AuthorizedSourceList
// .Connect()
// .ObserveOn(RxApp.MainThreadScheduler)
// .ObserveOn(RxSchedulers.MainThreadScheduler)
// .Sort(SortExpressionComparer<AuthorizedDevice>.Ascending(x => x.Index))
// .Bind(out _AuthorizedList)
// .Subscribe(_ => this.RaisePropertyChanged(nameof(IsAuthorizedListEmpty)));
@@ -80,6 +80,8 @@
<ItemGroup>
<ProjectReference Include="..\BD.WTTS.Client\BD.WTTS.Client.csproj" />
<ProjectReference Include="..\BD.WTTS.Client.Avalonia\BD.WTTS.Client.Avalonia.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>
<ItemGroup>
@@ -17,7 +17,7 @@ public sealed class DownloadPageViewModel : ViewModelBase
.Connect()
.Filter(p => p.IsDownloading)
.Sort(SortExpressionComparer<SteamApp>.Ascending(x => x.AppId).ThenBy(x => x.DisplayName))
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Bind(out _DownloadingApps)
.Subscribe();
@@ -51,7 +51,7 @@ public sealed class EditAppInfoPageViewModel : WindowViewModel
_SteamGridItemSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<SteamGridItem>.Ascending(x => x.Id))
.Bind(out _SteamGridItems)
.Subscribe(_ => this.RaisePropertyChanged(nameof(IsSteamGridEmpty)));
@@ -26,7 +26,7 @@ public sealed class EditAppsPageViewModel : ViewModelBase
SteamConnectService.Current.SteamApps
.Connect()
.Filter(x => x.IsEdited)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<SteamApp>.Ascending(x => x.AppId))
.Bind(out _SteamEditedApps)
.Subscribe(_ => this.RaisePropertyChanged(nameof(IsSteamEditedAppsEmpty)));
@@ -56,7 +56,7 @@ public sealed partial class GameListPageViewModel : TabItemViewModel
.Filter(installFilter)
.Filter(isCloudArchiveFilter)
.Sort(SortExpressionComparer<SteamApp>.Ascending(x => x.DisplayName).ThenByDescending(s => s.SizeOnDisk))
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Bind(out _SteamApps)
.Subscribe(_ =>
{
@@ -92,7 +92,7 @@ public sealed class AchievementAppPageViewModel : WindowViewModel
_AchievementsSourceList
.Connect()
.Filter(nameAchievementsFilter)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<AchievementInfo>.Descending(x => x.IsAchieved).ThenByAscending(x => x.Name))
.Bind(out _Achievements)
.Subscribe();
@@ -100,7 +100,7 @@ public sealed class AchievementAppPageViewModel : WindowViewModel
_StatisticsSourceList
.Connect()
.Filter(nameStatisticsFilter)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<StatInfo>.Descending(x => x.Id!))
.Bind(out _Statistics)
.Subscribe();
@@ -86,7 +86,7 @@ public sealed class CloudArchiveAppPageViewModel : WindowViewModel
_CloudArchivewSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOn(RxSchedulers.MainThreadScheduler)
.Sort(SortExpressionComparer<SteamRemoteFile>.Descending(x => x.Timestamp).ThenByAscending(x => x.Name))
.Bind(out _CloudArchivews)
.Subscribe(_ => this.RaisePropertyChanged(nameof(CloudArchivewCountStr)));
@@ -76,6 +76,8 @@
<ItemGroup>
<ProjectReference Include="..\BD.WTTS.Client\BD.WTTS.Client.csproj" />
<ProjectReference Include="..\BD.WTTS.Client.Avalonia\BD.WTTS.Client.Avalonia.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>
<ItemGroup>
@@ -624,6 +624,27 @@ $"""
/// <param name="architecture"></param>
static void CopyRuntime(string rootPublishDir, Platform platform, bool isCopyRuntime, Architecture architecture)
{
string? preOrRcString = null;
var infoVer = typeof(object).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
if (!string.IsNullOrWhiteSpace(infoVer))
{
var index = infoVer.IndexOf('-');
if (index > 4) // x.y.z-abc
{
var index2 = infoVer.IndexOf('+');
if (index2 > 0)
{
preOrRcString = infoVer.Substring(index + 1, index2 - index - 1);
}
else
{
preOrRcString = infoVer[(index + 1)..];
}
}
}
var specific_version = $"{Environment.Version.Major}.{Environment.Version.Minor}.{Environment.Version.Build}{(preOrRcString == null ? null : $"-{preOrRcString}")}";
switch (platform)
{
case Platform.UWP:
@@ -643,36 +664,36 @@ $"""
Environment.SpecialFolder.ProgramFilesX86 :
Environment.SpecialFolder.ProgramFiles);
static string get_hostfxr_path(string rootPath) => Path.Combine(rootPath,
string get_hostfxr_path(string rootPath) => Path.Combine(rootPath,
"dotnet",
"host",
"fxr",
$"{Environment.Version.Major}.{Environment.Version.Minor}.{Environment.Version.Build}",
specific_version,
"hostfxr.dll");
var hostfxr_path = get_hostfxr_path(programFiles);
static string get_aspnetcore_path(string rootPath) => Path.Combine(rootPath,
string get_aspnetcore_path(string rootPath) => Path.Combine(rootPath,
"dotnet",
"shared",
"Microsoft.AspNetCore.App",
$"{Environment.Version.Major}.{Environment.Version.Minor}.{Environment.Version.Build}");
specific_version);
var aspnetcore_path = get_aspnetcore_path(programFiles);
static string get_win_desktop_path(string rootPath) => Path.Combine(rootPath,
string get_win_desktop_path(string rootPath) => Path.Combine(rootPath,
"dotnet",
"shared",
"Microsoft.WindowsDesktop.App",
$"{Environment.Version.Major}.{Environment.Version.Minor}.{Environment.Version.Build}");
specific_version);
var win_desktop_path = get_win_desktop_path(programFiles);
static string get_netcore_path(string rootPath) => Path.Combine(rootPath,
string get_netcore_path(string rootPath) => Path.Combine(rootPath,
"dotnet",
"shared",
"Microsoft.NETCore.App",
$"{Environment.Version.Major}.{Environment.Version.Minor}.{Environment.Version.Build}");
specific_version);
var netcore_path = get_netcore_path(programFiles);
@@ -6,7 +6,7 @@ interface Constants
{
const string ProjectDir_AvaloniaApp = "BD.WTTS.Client.Avalonia.App";
const string ProjectDir_AppHost = "BD.WTTS.Client.AppHost";
const string windowssdkver = "10.0.19041";
const string windowssdkver = "10.0.19041.0";
static string DebugRuntimeConfigPath => Path.Combine(ProjectUtils.ProjPath, "src", ProjectDir_AvaloniaApp, "bin", "Debug", $"net{Environment.Version.Major}.{Environment.Version.Minor}-windows{windowssdkver}", runtimeconfigjsonfilename);
@@ -21,6 +21,10 @@
"commandName": "Project",
"commandLineArgs": "run --rids osx-arm64"
},
"Publish(linux-x64)": {
"commandName": "Project",
"commandLineArgs": "run --rids linux-x64"
},
"Publish Setup(win-x64 hsm-sign)": {
"commandName": "Project",
"commandLineArgs": "nsis --rids win-x64 --hsm-sign --t latest"
+2 -1
View File
@@ -126,7 +126,6 @@
<PackageReference Include="System.Linq.Async" />
<!--<PackageReference Include="Portable.BouncyCastle" />-->
<PackageReference Include="ReactiveUI.Fody" />
<PackageReference Include="dotnetCampus.Ipc" />
<PackageReference Include="fusillade" />
<PackageReference Include="Splat.Drawing" />
<PackageReference Include="System.Drawing.Common" />
@@ -140,6 +139,8 @@
<PackageReference Include="BD.Any.AppCenter.Analytics" />-->
<ProjectReference Include="..\..\ref\appcenter-sdk-dotnet\SDK\AppCenterAnalytics\BD.AppCenter.Analytics.Any\BD.AppCenter.Analytics.Any.csproj" />
<ProjectReference Include="..\..\ref\appcenter-sdk-dotnet\SDK\AppCenter\BD.AppCenter.Any\BD.AppCenter.Any.csproj" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc.Analyzers\dotnetCampus.Ipc.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\ref\dotnetCampus.Ipc\src\dotnetCampus.Ipc\dotnetCampus.Ipc.csproj" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
@@ -57,5 +57,10 @@ public enum CommandExitCode
/// </summary>
GetSubProcessBootConfigurationFail = 4042,
/// <summary>
/// 主进程 Id 不正确
/// </summary>
MainProcessIdIncorrect = 4043,
#endregion
}
@@ -6,9 +6,8 @@ namespace BD.WTTS;
partial class QRCodeHelper
{
public static (QRCodeCreateResult result, Stream? stream, Exception? exception) Create(byte[] bytes, QrCode.Ecc? level = null)
public static (QRCodeCreateResult result, Stream? stream, Exception? exception) Create(byte[] bytes, QrCode.Ecc level = QrCode.Ecc.Low)
{
level ??= QrCode.Ecc.Low;
try
{
var qrCode = QrCode.EncodeBinary(bytes, level); // Make the QR code symbol
+19 -1
View File
@@ -19,7 +19,7 @@ namespace BD.WTTS.Client.Resources {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Strings {
@@ -2087,6 +2087,15 @@ namespace BD.WTTS.Client.Resources {
}
}
/// <summary>
/// 查找类似 权限不足或端口{0}被占用,请手动授权或更换端口。 的本地化字符串。
/// </summary>
public static string Error_BindPortError_ {
get {
return ResourceManager.GetString("Error_BindPortError_", resourceCulture);
}
}
/// <summary>
/// 查找类似 无法连接到 Google 服务器 的本地化字符串。
/// </summary>
@@ -2114,6 +2123,15 @@ namespace BD.WTTS.Client.Resources {
}
}
/// <summary>
/// 查找类似 证书格式不正确或版本过旧,请在加速设置中删除并重新生成。 的本地化字符串。
/// </summary>
public static string Error_CheckRootCertificateFailed_ {
get {
return ResourceManager.GetString("Error_CheckRootCertificateFailed_", resourceCulture);
}
}
/// <summary>
/// 查找类似 云令牌已达数量上限 {0},云端令牌数量 {0},正在上传数量 {0} 的本地化字符串。
/// </summary>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -241,13 +241,13 @@ public sealed partial class IPCMainProcessServiceImpl : IPCMainProcessService
{
var tickCount64 = Environment.TickCount64;
var pid = Environment.ProcessId;
ipcProvider = new IpcProvider(
$"ipc_{_()}{tickCount64}{pid / 3}{pid % 3}",
new IpcConfiguration
{
AutoReconnectPeers = true, // 允许重连
IpcLoggerProvider = _ => new IpcLogger_(loggerFactory, nameof(IPCMainProcessServiceImpl)),
});
var ipcCfg = new IpcConfiguration
{
AutoReconnectPeers = true, // 允许重连
IpcLoggerProvider = _ => new IpcLogger_(loggerFactory, nameof(IPCMainProcessServiceImpl)),
};
ipcCfg.NamedPipeClientConnecting += IPCSubProcessServiceImpl.ValidateNamedPipeClientConnection;
ipcProvider = new IpcProvider($"ipc_{_()}{tickCount64}{pid / 3}{pid % 3}", ipcCfg);
ConfigureServices();
ipcProvider.StartServer();
ipcProvider.PeerConnected += IpcProvider_PeerConnected;
@@ -11,7 +11,18 @@ partial class LinuxPlatformServiceImpl
return Path.Combine(AppContext.BaseDirectory, AppHost);
}
public ValueTask RunShellAsync(string script, bool requiredAdministrator)
=> UnixHelper.RunShellAsync(script, requiredAdministrator);
/// <summary>
/// 运行 Shell 脚本
/// </summary>
/// <param name="script">要运行的脚本字符串</param>
/// <param name="requiredAdministrator">是否以管理员或 Root 权限运行</param>
public static async void RunShell(string script, bool requiredAdministrator = false)
=> await RunShellAsync(script, requiredAdministrator);
/// <inheritdoc cref="RunShell(string, bool)"/>
public static ValueTask RunShellAsync(string script, bool requiredAdministrator = false)
{
return UnixHelper.RunShellAsync(script, requiredAdministrator);
}
}
#endif
@@ -25,8 +25,7 @@ partial class LinuxPlatformServiceImpl
{
shellContent.AppendLine($"gsettings set org.gnome.system.proxy mode 'none'");
}
IPlatformService @this = this;
@this.RunShell(shellContent.ToString(), false);
RunShell(shellContent.ToString(), false);
return Task.FromResult(true);
}
}
@@ -6,7 +6,7 @@ namespace BD.WTTS.Services.Implementation;
partial class MacCatalystPlatformServiceImpl
{
static async ValueTask RunShellCoreAsync(string script, bool requiredAdministrator)
internal static async ValueTask RunShellCoreAsync(string script, bool requiredAdministrator)
{
var scriptContent = new StringBuilder();
if (requiredAdministrator)
@@ -32,7 +32,18 @@ partial class MacCatalystPlatformServiceImpl
}
}
public ValueTask RunShellAsync(string script, bool requiredAdministrator)
=> RunShellCoreAsync(script, requiredAdministrator);
/// <summary>
/// 运行 Shell 脚本
/// </summary>
/// <param name="script">要运行的脚本字符串</param>
/// <param name="requiredAdministrator">是否以管理员或 Root 权限运行</param>
public static async void RunShell(string script, bool requiredAdministrator = false)
=> await RunShellAsync(script, requiredAdministrator);
/// <inheritdoc cref="RunShell(string, bool)"/>
public static ValueTask RunShellAsync(string script, bool requiredAdministrator = false)
{
return MacCatalystPlatformServiceImpl.RunShellCoreAsync(script, requiredAdministrator);
}
}
#endif
@@ -38,7 +38,7 @@ partial class MacCatalystPlatformServiceImpl
}
}
}
@this.RunShell(shellContent.ToString(), false);
RunShell(shellContent.ToString(), false);
return Task.FromResult(true);
#else
throw new PlatformNotSupportedException();
@@ -111,7 +111,7 @@ partial class WindowsPlatformServiceImpl
/// <param name="fileName"></param>
/// <param name="arguments"></param>
/// <returns></returns>
internal static /*async*/ ValueTask<Process?> StartAsAdministrator(string fileName, string? arguments = null)
internal static /*async*/ ValueTask<Process?> StartAsAdministrator(string fileName, string? arguments = null/*, IReadOnlyDictionary<string, string>? environment = null*/)
{
#if !DEBUG
if (IsPrivilegedProcess)
@@ -133,6 +133,14 @@ partial class WindowsPlatformServiceImpl
UseShellExecute = true,
Verb = "runas",
};
// runas 不起作用
//if (environment != null)
//{
// foreach (var it in environment)
// {
// psi.Environment[it.Key] = it.Value;
// }
//}
var process_runas = Process.Start(psi);
return ValueTask.FromResult(process_runas);
}
@@ -28,7 +28,7 @@ public sealed class AdvertiseService : ReactiveObject
{
//AdvertisementsSource
// .Connect()
// .ObserveOn(RxApp.MainThreadScheduler)
// .ObserveOn(RxSchedulers.MainThreadScheduler)
// .Filter(x => x.Standard == AdvertisementOrientation.Horizontal)
// .Sort(SortExpressionComparer<AdvertisementDTO>.Ascending(x => x.Order))
// .Bind(out _HorizontalBannerAdvertisements)
@@ -36,7 +36,7 @@ public sealed class AdvertiseService : ReactiveObject
//AdvertisementsSource
// .Connect()
// .ObserveOn(RxApp.MainThreadScheduler)
// .ObserveOn(RxSchedulers.MainThreadScheduler)
// .Filter(x => x.Standard == AdvertisementOrientation.Vertical)
// .Sort(SortExpressionComparer<AdvertisementDTO>.Ascending(x => x.Order))
// .Bind(out _VerticalBannerAdvertisements)
@@ -3,16 +3,5 @@ namespace BD.WTTS.Services;
partial interface IPCPlatformService
{
/// <summary>
/// 运行 Shell 脚本
/// </summary>
/// <param name="script">要运行的脚本字符串</param>
/// <param name="requiredAdministrator">是否以管理员或 Root 权限运行</param>
async void RunShell(string script, bool requiredAdministrator = false)
=> await RunShellAsync(script, requiredAdministrator);
/// <inheritdoc cref="RunShell(string, bool)"/>
ValueTask RunShellAsync(string script, bool requiredAdministrator = false) => default;
ValueTask<bool?> RunShellReturnAsync(string script, bool requiredAdministrator = false) => default;
// Safe
}
+12 -52
View File
@@ -413,58 +413,6 @@ partial class Startup // 自定义控制台命令参数
});
rootCommand.Subcommands.Add(proxy);
// -clt ayaneo -path
var ayaneo_path = new Option<string>("-path")
{
Description = "json 生成路径",
};
var ayaneo = new Command("ayaneo", "生成 ayaneo 数据在指定位置")
{
ayaneo_path,
};
ayaneo.SetAction(async parseResult =>
{
var path = parseResult.GetValue(ayaneo_path);
RunUIApplication(AppServicesLevel.Steam);
await WaitConfiguredServices;
var steamService = ISteamService.Instance;
var users = steamService.GetRememberUserList();
var accountRemarks =
Ioc.Get_Nullable<IPartialGameAccountSettings>()?.AccountRemarks;
var sUsers = users.Select(s =>
{
if (accountRemarks?.TryGetValue("Steam-" + s.SteamId64, out var remark) == true &&
!string.IsNullOrEmpty(remark))
s.Remark = remark;
var title = s.SteamNickName ?? s.SteamId64.ToString(CultureInfo.InvariantCulture);
if (!string.IsNullOrEmpty(s.Remark))
title = s.SteamNickName + "(" + s.Remark + ")";
return new
{
Name = title,
Account = s.AccountName,
};
});
var content = new
{
steamppPath = Environment.ProcessPath,
steamUsers = sUsers,
};
if (string.IsNullOrWhiteSpace(path))
{
path = Path.Combine(IOPath.BaseDirectory, "steampp.json");
}
File.WriteAllText(path, Serializable.SJSON(content, writeIndented: true));
});
rootCommand.Subcommands.Add(ayaneo);
// -clt shutdown
var shutdown = new Command(key_shutdown, "安全结束正在运行的程序")
{
@@ -501,6 +449,18 @@ partial class Startup // 自定义控制台命令参数
if (ModuleName != IPlatformService.IPCRoot.moduleName)
return 402;
if (!int.TryParse(p, out var pid) || pid <= 0)
return (int)CommandExitCode.NotFoundMainProcessId;
#if DEBUG
Log.Info(nameof(IPCSubProcessServiceImpl), "客户端正在校验服务端进程,{pid}", pid);
#endif
// 验证要连接的服务端进程是否为自己的程序
var ckPid = IPCSubProcessServiceImpl.CheckBePid(pid);
if (!ckPid)
return (int)CommandExitCode.MainProcessIdIncorrect;
RunUIApplication(AppServicesLevel.IPCRoot | AppServicesLevel.Hosts);
await WaitConfiguredServices;
@@ -61,11 +61,11 @@ partial class Startup // 全局异常处理
Handler(ex, nameof(AppDomain), e.IsTerminating);
}
};
RxApp.DefaultExceptionHandler = Observer.Create<Exception>(ex =>
{
// https://github.com/AvaloniaUI/Avalonia/issues/5290#issuecomment-760751036
Handler(ex, nameof(RxApp));
});
//RxApp.DefaultExceptionHandler = Observer.Create<Exception>(ex =>
//{
// // https://github.com/AvaloniaUI/Avalonia/issues/5290#issuecomment-760751036
// Handler(ex, nameof(RxApp));
//});
}
public static void Handler(Exception ex, string name, bool? isTerminating = null)
+3 -3
View File
@@ -31,7 +31,7 @@ public sealed class IcoTest
using var logo512Bitmap = SKBitmap.Decode(logo512Path);
logoBitmaps = new[] { logo512Bitmap }.Concat(new[] { 256, 128, 96, 64, 48, 32, 24, 16 }
.Select(x => logo512Bitmap.Resize(new SKSizeI { Height = x, Width = x }, SKFilterQuality.High)))
.Select(x => logo512Bitmap.Resize(new SKSizeI { Height = x, Width = x }, SKSamplingOptions.Default)))
.ToArray(); // 根据 512 大小生成所有挡位的位图数组
var savePath = Path.Combine(assemblyDir, "EncodeTest.ico");
@@ -79,7 +79,7 @@ public sealed class IcoTest
var maxSize = allSize.Max();
using var fBitmap = ResizeImage(imgBitmap, gameBitmap, maxSize);
bitmaps = new[] { fBitmap }.Concat(allSize.Where(x => x != maxSize)
.Select(x => fBitmap.Resize(new SKSizeI { Height = x, Width = x }, SKFilterQuality.High)))
.Select(x => fBitmap.Resize(new SKSizeI { Height = x, Width = x }, SKSamplingOptions.Default)))
.ToArray();
var savePath = Path.Combine(saveDirPath, $"{img.Name}.ico");
@@ -106,7 +106,7 @@ public sealed class IcoTest
int watermarkTop = size - icoHeight;
SKBitmap scaledImage = new(size, size);
image.ScalePixels(scaledImage, SKFilterQuality.High);
image.ScalePixels(scaledImage, SKSamplingOptions.Default);
using SKCanvas canvas = new(scaledImage);
canvas.DrawBitmap(icoIcon, new SKRect(watermarkLeft, watermarkTop, watermarkLeft + icoWidth, watermarkTop + icoHeight));
+6 -1
View File
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<DotNet_Version>10.0</DotNet_Version>
<DotNet_Version>11.0</DotNet_Version>
<NoWarn>$(NoWarn);NU1507;1591;SA1612;IL2026;IL2091</NoWarn>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
@@ -26,6 +26,11 @@
<!--<DefineConstants>REMOVE_DNS_INTERCEPT;$(DefineConstants)</DefineConstants>-->
<CETCompat>false</CETCompat>
</PropertyGroup>
<!-- 👇 .NET 11+ 配置 -->
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net11.0'))">
<Features>$(Features);runtime-async=on</Features>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AssemblyInfo.cs">
+2 -2
View File
@@ -1,12 +1,12 @@
<Project>
<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net$(DotNet_Version)-windows10.0.19041</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net$(DotNet_Version)-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">net$(DotNet_Version)-macos</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net$(DotNet_Version)</TargetFrameworks>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
+1 -1
View File
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net$(DotNet_Version)</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net$(DotNet_Version)-windows10.0.19041</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net$(DotNet_Version)-windows10.0.19041.0</TargetFrameworks>
</PropertyGroup>
</Project>
+2 -2
View File
@@ -2,14 +2,14 @@
<PropertyGroup>
<TargetFrameworks>net$(DotNet_Version)</TargetFrameworks>
<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net$(DotNet_Version)-android;net$(DotNet_Version)-ios;net$(DotNet_Version)-macos;net$(DotNet_Version)-maccatalyst;net$(DotNet_Version)-windows10.0.19041</TargetFrameworks>-->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net$(DotNet_Version)-macos;net$(DotNet_Version)-windows10.0.19041</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net$(DotNet_Version)-macos;net$(DotNet_Version)-windows10.0.19041.0</TargetFrameworks>
<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">$(TargetFrameworks);net$(DotNet_Version)-android;net$(DotNet_Version)-ios;net$(DotNet_Version)-macos;net$(DotNet_Version)-maccatalyst</TargetFrameworks>-->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">$(TargetFrameworks);net$(DotNet_Version)-ios;net$(DotNet_Version)-macos;net$(DotNet_Version)-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks)</TargetFrameworks>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
+2 -2
View File
@@ -1,12 +1,12 @@
<Project>
<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net$(DotNet_Version);net$(DotNet_Version)-macos;net$(DotNet_Version)-windows10.0.19041</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net$(DotNet_Version);net$(DotNet_Version)-macos;net$(DotNet_Version)-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">net$(DotNet_Version)-macos</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net$(DotNet_Version)</TargetFrameworks>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
+2 -2
View File
@@ -1,11 +1,11 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net$(DotNet_Version)</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net$(DotNet_Version)-windows10.0.19041</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net$(DotNet_Version)-windows10.0.19041.0</TargetFrameworks>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
+1 -1
View File
@@ -78,7 +78,7 @@ public static partial class ProjectUtils
/// </summary>
public const string tfm_ =
#if WINDOWS
"-windows10.0.19041";
"-windows10.0.19041.0";
#elif LINUX
"";
#elif MACCATALYST