From 5bef02bd6df09f0946162afaf9e8722abf4d6627 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 7 Dec 2025 15:32:03 +0800 Subject: [PATCH] Code clean --- v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs | 2 ++ .../Services/CoreConfig/Singbox/SingboxOutboundService.cs | 2 +- v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs | 8 +------- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs b/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs index 7b665816..fd3436db 100644 --- a/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs +++ b/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs @@ -12,8 +12,10 @@ public class ActionPrecheckManager(Config config) // sing-box supported transports for different protocol types private static readonly HashSet SingboxUnsupportedTransports = [nameof(ETransport.kcp), nameof(ETransport.xhttp)]; + private static readonly HashSet SingboxTransportSupportedProtocols = [EConfigType.VMess, EConfigType.VLESS, EConfigType.Trojan, EConfigType.Shadowsocks]; + private static readonly HashSet SingboxShadowsocksAllowedTransports = [nameof(ETransport.tcp), nameof(ETransport.ws), nameof(ETransport.quic)]; diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs index b04c6e9f..f18f833c 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs @@ -365,7 +365,7 @@ public partial class CoreConfigSingboxService case nameof(ETransport.ws): transport.type = nameof(ETransport.ws); var wsPath = node.Path; - + // Parse eh and ed parameters from path using regex if (!wsPath.IsNullOrEmpty()) { diff --git a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs index 5a3fca95..4266b91f 100644 --- a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs +++ b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Avalonia; -using Avalonia.Media; - namespace v2rayN.Desktop.Common; public static class AppBuilderExtension @@ -11,7 +5,7 @@ public static class AppBuilderExtension public static AppBuilder WithFontByDefault(this AppBuilder appBuilder) { var fallbacks = new List(); - + var notoSansSc = new FontFamily(Path.Combine(Global.AvaAssets, "Fonts#Noto Sans SC")); fallbacks.Add(new FontFallback { FontFamily = notoSansSc });