diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml index e96682bd..a9a4753e 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -3,6 +3,18 @@ description: 在提出问题前请先自行排除服务器端问题和升级到 title: "[Bug]: " labels: ["bug"] body: + - type: markdown + attributes: + value: | + ### 报告 Bug 前请务必确认以下事项: + > ** ** + > **✓ 已自行排除服务器端问题。** + > **✓ 已升级到最新客户端版本。** + > **✓ 已通过搜索确认没有人提出过相同问题。** + > **✓ 已确认自己的电脑系统环境是受支持的。** + + --- + - type: input id: "os-version" attributes: @@ -10,6 +22,7 @@ body: description: "操作系统和版本" validations: required: true + - type: input id: "expectation" attributes: @@ -17,6 +30,7 @@ body: description: "描述你认为应该发生什么" validations: required: true + - type: textarea id: "describe-the-bug" attributes: @@ -24,22 +38,34 @@ body: description: "描述实际发生了什么" validations: required: true + - type: textarea id: "reproduction-method" attributes: label: "复现方法" description: "在BUG出现前执行了哪些操作" - placeholder: 标序号 + placeholder: "标序号" validations: required: true + - type: textarea - id: "log" + id: "gui-log" attributes: - label: "日志信息" + label: "软件日志" description: "位置在软件当前目录下的guiLogs" - placeholder: 在日志开始和结束位置粘贴冒号后的内容:``` + placeholder: "在日志开始和结束位置粘贴冒号后的内容到这:" validations: required: true + + - type: textarea + id: "core-log" + attributes: + label: "内核日志" + description: "位置在软件主界面的信息框内" + placeholder: "在信息框内鼠标右键复制全部信息粘贴在这:" + validations: + required: true + - type: textarea id: "more" attributes: @@ -47,6 +73,7 @@ body: description: "可选" validations: required: false + - type: checkboxes id: "latest-version" attributes: @@ -55,6 +82,7 @@ body: options: - label: 是 required: true + - type: checkboxes id: "issues" attributes: @@ -63,3 +91,12 @@ body: options: - label: 是 required: true + + - type: checkboxes + id: "system-version" + attributes: + label: "我确认系统版本是受支持的" + description: "否则请切换后尝试" + options: + - label: 是 + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..8dc9c926 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,9 @@ +blank_issues_enabled: false + +contact_links: + - name: Discussions / 讨论区 + url: https://github.com/2dust/v2rayN/discussions + about: 使用问题或需要帮助请前往 Discussions。 + - name: Wiki / 使用说明 + url: https://github.com/2dust/v2rayN/wiki + about: 查看常见问题和使用文档。 diff --git a/v2rayN/Directory.Build.props b/v2rayN/Directory.Build.props index 23fa904f..bea02572 100644 --- a/v2rayN/Directory.Build.props +++ b/v2rayN/Directory.Build.props @@ -1,7 +1,7 @@ - 7.15.4 + 7.15.6 diff --git a/v2rayN/Directory.Packages.props b/v2rayN/Directory.Packages.props index a3dde2c1..a339af4c 100644 --- a/v2rayN/Directory.Packages.props +++ b/v2rayN/Directory.Packages.props @@ -6,13 +6,13 @@ - - - - + + + + - + diff --git a/v2rayN/ServiceLib/Base/MyReactiveObject.cs b/v2rayN/ServiceLib/Base/MyReactiveObject.cs index 0172faad..50563151 100644 --- a/v2rayN/ServiceLib/Base/MyReactiveObject.cs +++ b/v2rayN/ServiceLib/Base/MyReactiveObject.cs @@ -1,5 +1,3 @@ -using ReactiveUI; - namespace ServiceLib.Base; public class MyReactiveObject : ReactiveObject diff --git a/v2rayN/ServiceLib/Common/EmbedUtils.cs b/v2rayN/ServiceLib/Common/EmbedUtils.cs index b647d154..d3b323f7 100644 --- a/v2rayN/ServiceLib/Common/EmbedUtils.cs +++ b/v2rayN/ServiceLib/Common/EmbedUtils.cs @@ -1,6 +1,3 @@ -using System.Collections.Concurrent; -using System.Reflection; - namespace ServiceLib.Common; public static class EmbedUtils diff --git a/v2rayN/ServiceLib/Common/FileManager.cs b/v2rayN/ServiceLib/Common/FileManager.cs index 6d4d28ca..44a9fe82 100644 --- a/v2rayN/ServiceLib/Common/FileManager.cs +++ b/v2rayN/ServiceLib/Common/FileManager.cs @@ -1,6 +1,5 @@ using System.Formats.Tar; using System.IO.Compression; -using System.Text; namespace ServiceLib.Common; diff --git a/v2rayN/ServiceLib/Common/JsonUtils.cs b/v2rayN/ServiceLib/Common/JsonUtils.cs index 4fbaa0e1..b5bcc7fe 100644 --- a/v2rayN/ServiceLib/Common/JsonUtils.cs +++ b/v2rayN/ServiceLib/Common/JsonUtils.cs @@ -1,8 +1,3 @@ -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Text.Json.Nodes; -using System.Text.Json.Serialization; - namespace ServiceLib.Common; public class JsonUtils diff --git a/v2rayN/ServiceLib/Common/ProcUtils.cs b/v2rayN/ServiceLib/Common/ProcUtils.cs index 2819f2fb..ce487c7a 100644 --- a/v2rayN/ServiceLib/Common/ProcUtils.cs +++ b/v2rayN/ServiceLib/Common/ProcUtils.cs @@ -1,5 +1,3 @@ -using System.Diagnostics; - namespace ServiceLib.Common; public static class ProcUtils diff --git a/v2rayN/ServiceLib/Common/Utils.cs b/v2rayN/ServiceLib/Common/Utils.cs index 85182a60..5ca96a88 100644 --- a/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayN/ServiceLib/Common/Utils.cs @@ -1,13 +1,5 @@ using System.Collections.Specialized; -using System.Diagnostics; -using System.Net; -using System.Net.NetworkInformation; -using System.Net.Sockets; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security.Cryptography; using System.Security.Principal; -using System.Text; using CliWrap; using CliWrap.Buffered; @@ -363,6 +355,110 @@ public class Utils return userHostsMap; } + /// + /// Parse a possibly non-standard URL into scheme, domain, port, and path. + /// If parsing fails, the entire input is returned as domain, and others are empty or zero. + /// + /// Input URL or string + /// (domain, scheme, port, path) + public static (string domain, string scheme, int port, string path) ParseUrl(string url) + { + if (string.IsNullOrWhiteSpace(url)) + { + return ("", "", 0, ""); + } + + // 1. First, try to parse using the standard Uri class. + if (Uri.TryCreate(url, UriKind.Absolute, out var uri) && !string.IsNullOrEmpty(uri.Host)) + { + var scheme = uri.Scheme; + var domain = uri.Host; + var port = uri.IsDefaultPort ? 0 : uri.Port; + var path = uri.PathAndQuery; + return (domain, scheme, port, path); + } + + // 2. Try to handle more general cases with a regular expression, including non-standard schemes. + // This regex captures the scheme (optional), authority (host+port), and path (optional). + var match = Regex.Match(url, @"^(?:([a-zA-Z][a-zA-Z0-9+.-]*):/{2,})?([^/?#]+)([^?#]*)?.*$"); + + if (match.Success) + { + var scheme = match.Groups[1].Value; + var authority = match.Groups[2].Value; + var path = match.Groups[3].Value; + + // Remove userinfo from the authority part. + var atIndex = authority.LastIndexOf('@'); + if (atIndex > 0) + { + authority = authority.Substring(atIndex + 1); + } + + var (domain, port) = ParseAuthority(authority); + + // If the parsed domain is empty, it means the authority part is malformed, so trigger the fallback. + if (!string.IsNullOrEmpty(domain)) + { + return (domain, scheme, port, path); + } + } + + // 3. If all of the above fails, execute the final fallback strategy. + return (url, "", 0, ""); + } + + /// + /// Helper function to parse domain and port from the authority part, with correct handling for IPv6. + /// + private static (string domain, int port) ParseAuthority(string authority) + { + if (string.IsNullOrEmpty(authority)) + { + return ("", 0); + } + + var port = 0; + var domain = authority; + + // Handle IPv6 addresses, e.g., "[2001:db8::1]:443" + if (authority.StartsWith("[") && authority.Contains("]")) + { + int closingBracketIndex = authority.LastIndexOf(']'); + if (closingBracketIndex < authority.Length - 1 && authority[closingBracketIndex + 1] == ':') + { + // Port exists + var portStr = authority.Substring(closingBracketIndex + 2); + if (int.TryParse(portStr, out var portNum)) + { + port = portNum; + } + domain = authority.Substring(0, closingBracketIndex + 1); + } + else + { + // No port + domain = authority; + } + } + else // Handle IPv4 or domain names + { + var lastColonIndex = authority.LastIndexOf(':'); + // Ensure there are digits after the colon and that this colon is not part of an IPv6 address. + if (lastColonIndex > 0 && lastColonIndex < authority.Length - 1 && authority.Substring(lastColonIndex + 1).All(char.IsDigit)) + { + var portStr = authority.Substring(lastColonIndex + 1); + if (int.TryParse(portStr, out var portNum)) + { + port = portNum; + domain = authority.Substring(0, lastColonIndex); + } + } + } + + return (domain, port); + } + #endregion 转换函数 #region 数据检查 diff --git a/v2rayN/ServiceLib/Common/WindowsUtils.cs b/v2rayN/ServiceLib/Common/WindowsUtils.cs index 6c6f7be1..2215a3e3 100644 --- a/v2rayN/ServiceLib/Common/WindowsUtils.cs +++ b/v2rayN/ServiceLib/Common/WindowsUtils.cs @@ -1,5 +1,3 @@ -using System.Security.Cryptography; -using System.Text; using Microsoft.Win32; namespace ServiceLib.Common; diff --git a/v2rayN/ServiceLib/Enums/ESpeedActionType.cs b/v2rayN/ServiceLib/Enums/ESpeedActionType.cs index 0478bcc0..a03aa9df 100644 --- a/v2rayN/ServiceLib/Enums/ESpeedActionType.cs +++ b/v2rayN/ServiceLib/Enums/ESpeedActionType.cs @@ -5,5 +5,6 @@ public enum ESpeedActionType Tcping, Realping, Speedtest, - Mixedtest + Mixedtest, + FastRealping } diff --git a/v2rayN/ServiceLib/Events/AppEvents.cs b/v2rayN/ServiceLib/Events/AppEvents.cs index 45de4de1..5824bfc0 100644 --- a/v2rayN/ServiceLib/Events/AppEvents.cs +++ b/v2rayN/ServiceLib/Events/AppEvents.cs @@ -1,5 +1,3 @@ -using System.Reactive; - namespace ServiceLib.Events; public static class AppEvents diff --git a/v2rayN/ServiceLib/Events/EventChannel.cs b/v2rayN/ServiceLib/Events/EventChannel.cs index c3c58f3e..4ca040c6 100644 --- a/v2rayN/ServiceLib/Events/EventChannel.cs +++ b/v2rayN/ServiceLib/Events/EventChannel.cs @@ -1,5 +1,3 @@ -using System.Reactive; -using System.Reactive.Linq; using System.Reactive.Subjects; namespace ServiceLib.Events; diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index 6e3c541c..2327de48 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -316,7 +316,7 @@ public class Global ]; public static readonly HashSet SingboxOnlyConfigType = SingboxSupportConfigType.Except(XraySupportConfigType).ToHashSet(); - + public static readonly List DomainStrategies = [ AsIs, diff --git a/v2rayN/ServiceLib/GlobalUsings.cs b/v2rayN/ServiceLib/GlobalUsings.cs index a952f4a8..d38ccc06 100644 --- a/v2rayN/ServiceLib/GlobalUsings.cs +++ b/v2rayN/ServiceLib/GlobalUsings.cs @@ -1,14 +1,36 @@ +global using System.Collections.Concurrent; +global using System.Diagnostics; +global using System.Net; +global using System.Net.NetworkInformation; +global using System.Net.Sockets; +global using System.Reactive; +global using System.Reactive.Disposables; +global using System.Reactive.Linq; +global using System.Reflection; +global using System.Runtime.InteropServices; +global using System.Security.Cryptography; +global using System.Text; +global using System.Text.Encodings.Web; +global using System.Text.Json; +global using System.Text.Json.Nodes; +global using System.Text.Json.Serialization; +global using System.Text.RegularExpressions; +global using DynamicData; +global using DynamicData.Binding; +global using ReactiveUI; +global using ReactiveUI.Fody.Helpers; global using ServiceLib.Base; global using ServiceLib.Common; global using ServiceLib.Enums; global using ServiceLib.Events; global using ServiceLib.Handler; +global using ServiceLib.Handler.Fmt; +global using ServiceLib.Handler.SysProxy; global using ServiceLib.Helper; global using ServiceLib.Manager; -global using ServiceLib.Handler.Fmt; -global using ServiceLib.Services; -global using ServiceLib.Services.Statistics; -global using ServiceLib.Services.CoreConfig; global using ServiceLib.Models; global using ServiceLib.Resx; -global using ServiceLib.Handler.SysProxy; +global using ServiceLib.Services; +global using ServiceLib.Services.CoreConfig; +global using ServiceLib.Services.Statistics; +global using SQLite; diff --git a/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs b/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs index 015271d9..82e94517 100644 --- a/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs +++ b/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs @@ -1,5 +1,4 @@ using System.Security.Principal; -using System.Text.RegularExpressions; namespace ServiceLib.Handler; diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index c3dc716b..8b5acff2 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1,5 +1,4 @@ using System.Data; -using System.Text.RegularExpressions; namespace ServiceLib.Handler; @@ -113,10 +112,8 @@ public static class ConfigHandler config.ConstItem ??= new ConstItem(); config.SimpleDNSItem ??= InitBuiltinSimpleDNS(); - if (config.SimpleDNSItem.GlobalFakeIp is null) - { - config.SimpleDNSItem.GlobalFakeIp = true; - } + config.SimpleDNSItem.GlobalFakeIp ??= true; + config.SimpleDNSItem.BootstrapDNS ??= Global.DomainPureIPDNSAddress.FirstOrDefault(); config.SpeedTestItem ??= new(); if (config.SpeedTestItem.SpeedTestTimeout < 10) @@ -1224,6 +1221,7 @@ public static class ConfigHandler CoreType = coreType, ConfigType = EConfigType.PolicyGroup, Remarks = remark, + IsSub = false }; if (!subId.IsNullOrEmpty()) { @@ -1484,7 +1482,7 @@ public static class ConfigHandler if (profileItem is null) { profileItem = Hysteria2Fmt.ResolveFull2(strData, subRemarks); - } + } if (profileItem is null || profileItem.Address.IsNullOrEmpty()) { return -1; @@ -2274,6 +2272,7 @@ public static class ConfigHandler BlockBindingQuery = true, DirectDNS = Global.DomainDirectDNSAddress.FirstOrDefault(), RemoteDNS = Global.DomainRemoteDNSAddress.FirstOrDefault(), + BootstrapDNS = Global.DomainPureIPDNSAddress.FirstOrDefault(), }; } diff --git a/v2rayN/ServiceLib/Handler/ConnectionHandler.cs b/v2rayN/ServiceLib/Handler/ConnectionHandler.cs index 38f3ae51..ae3268ea 100644 --- a/v2rayN/ServiceLib/Handler/ConnectionHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConnectionHandler.cs @@ -1,5 +1,3 @@ -using System.Net; - namespace ServiceLib.Handler; public static class ConnectionHandler diff --git a/v2rayN/ServiceLib/Handler/Fmt/ShadowsocksFmt.cs b/v2rayN/ServiceLib/Handler/Fmt/ShadowsocksFmt.cs index 2ec9769f..adaeb954 100644 --- a/v2rayN/ServiceLib/Handler/Fmt/ShadowsocksFmt.cs +++ b/v2rayN/ServiceLib/Handler/Fmt/ShadowsocksFmt.cs @@ -1,5 +1,3 @@ -using System.Text.RegularExpressions; - namespace ServiceLib.Handler.Fmt; public class ShadowsocksFmt : BaseFmt diff --git a/v2rayN/ServiceLib/Handler/SysProxy/ProxySettingWindows.cs b/v2rayN/ServiceLib/Handler/SysProxy/ProxySettingWindows.cs index 44b7e046..8dc2f335 100644 --- a/v2rayN/ServiceLib/Handler/SysProxy/ProxySettingWindows.cs +++ b/v2rayN/ServiceLib/Handler/SysProxy/ProxySettingWindows.cs @@ -1,4 +1,3 @@ -using System.Runtime.InteropServices; using static ServiceLib.Handler.SysProxy.ProxySettingWindows.InternetConnectionOption; namespace ServiceLib.Handler.SysProxy; diff --git a/v2rayN/ServiceLib/Helper/DownloaderHelper.cs b/v2rayN/ServiceLib/Helper/DownloaderHelper.cs index 3764499c..000685a0 100644 --- a/v2rayN/ServiceLib/Helper/DownloaderHelper.cs +++ b/v2rayN/ServiceLib/Helper/DownloaderHelper.cs @@ -1,4 +1,3 @@ -using System.Net; using Downloader; namespace ServiceLib.Helper; diff --git a/v2rayN/ServiceLib/Helper/HttpClientHelper.cs b/v2rayN/ServiceLib/Helper/HttpClientHelper.cs index a559800f..cd971a89 100644 --- a/v2rayN/ServiceLib/Helper/HttpClientHelper.cs +++ b/v2rayN/ServiceLib/Helper/HttpClientHelper.cs @@ -1,8 +1,5 @@ -using System.Diagnostics; -using System.Net; using System.Net.Http.Headers; using System.Net.Mime; -using System.Text; namespace ServiceLib.Helper; diff --git a/v2rayN/ServiceLib/Helper/SqliteHelper.cs b/v2rayN/ServiceLib/Helper/SqliteHelper.cs index 959d5ff6..83c9bf90 100644 --- a/v2rayN/ServiceLib/Helper/SqliteHelper.cs +++ b/v2rayN/ServiceLib/Helper/SqliteHelper.cs @@ -1,5 +1,4 @@ using System.Collections; -using SQLite; namespace ServiceLib.Helper; diff --git a/v2rayN/ServiceLib/Manager/CoreAdminManager.cs b/v2rayN/ServiceLib/Manager/CoreAdminManager.cs index 4143e78a..0d52f1c7 100644 --- a/v2rayN/ServiceLib/Manager/CoreAdminManager.cs +++ b/v2rayN/ServiceLib/Manager/CoreAdminManager.cs @@ -1,4 +1,3 @@ -using System.Text; using CliWrap; using CliWrap.Buffered; diff --git a/v2rayN/ServiceLib/Manager/PacManager.cs b/v2rayN/ServiceLib/Manager/PacManager.cs index 10bedc29..cba89830 100644 --- a/v2rayN/ServiceLib/Manager/PacManager.cs +++ b/v2rayN/ServiceLib/Manager/PacManager.cs @@ -1,6 +1,3 @@ -using System.Net.Sockets; -using System.Text; - namespace ServiceLib.Manager; public class PacManager diff --git a/v2rayN/ServiceLib/Manager/ProfileExManager.cs b/v2rayN/ServiceLib/Manager/ProfileExManager.cs index 0a3b7399..739bd550 100644 --- a/v2rayN/ServiceLib/Manager/ProfileExManager.cs +++ b/v2rayN/ServiceLib/Manager/ProfileExManager.cs @@ -1,5 +1,3 @@ -using System.Collections.Concurrent; - //using System.Reactive.Linq; namespace ServiceLib.Manager; diff --git a/v2rayN/ServiceLib/Manager/ProfileGroupItemManager.cs b/v2rayN/ServiceLib/Manager/ProfileGroupItemManager.cs index 72c55870..bf52dcb2 100644 --- a/v2rayN/ServiceLib/Manager/ProfileGroupItemManager.cs +++ b/v2rayN/ServiceLib/Manager/ProfileGroupItemManager.cs @@ -1,5 +1,3 @@ -using System.Collections.Concurrent; - namespace ServiceLib.Manager; public class ProfileGroupItemManager diff --git a/v2rayN/ServiceLib/Manager/TaskManager.cs b/v2rayN/ServiceLib/Manager/TaskManager.cs index dfbd242d..40da7ac7 100644 --- a/v2rayN/ServiceLib/Manager/TaskManager.cs +++ b/v2rayN/ServiceLib/Manager/TaskManager.cs @@ -26,15 +26,29 @@ public class TaskManager await Task.Delay(1000 * 60); //Execute once 1 minute - await UpdateTaskRunSubscription(); + try + { + await UpdateTaskRunSubscription(); + } + catch (Exception ex) + { + Logging.SaveLog("ScheduledTasks - UpdateTaskRunSubscription", ex); + } //Execute once 20 minute if (numOfExecuted % 20 == 0) { //Logging.SaveLog("Execute save config"); - await ConfigHandler.SaveConfig(_config); - await ProfileExManager.Instance.SaveTo(); + try + { + await ConfigHandler.SaveConfig(_config); + await ProfileExManager.Instance.SaveTo(); + } + catch (Exception ex) + { + Logging.SaveLog("ScheduledTasks - SaveConfig", ex); + } } //Execute once 1 hour @@ -46,8 +60,14 @@ public class TaskManager FileManager.DeleteExpiredFiles(Utils.GetLogPath(), DateTime.Now.AddMonths(-1)); FileManager.DeleteExpiredFiles(Utils.GetTempPath(), DateTime.Now.AddMonths(-1)); - //Check once 1 hour - await UpdateTaskRunGeo(numOfExecuted / 60); + try + { + await UpdateTaskRunGeo(numOfExecuted / 60); + } + catch (Exception ex) + { + Logging.SaveLog("ScheduledTasks - UpdateTaskRunGeo", ex); + } } numOfExecuted++; diff --git a/v2rayN/ServiceLib/Manager/WebDavManager.cs b/v2rayN/ServiceLib/Manager/WebDavManager.cs index 3f5c9ea3..83ae24ce 100644 --- a/v2rayN/ServiceLib/Manager/WebDavManager.cs +++ b/v2rayN/ServiceLib/Manager/WebDavManager.cs @@ -1,4 +1,3 @@ -using System.Net; using WebDav; namespace ServiceLib.Manager; diff --git a/v2rayN/ServiceLib/Models/CheckUpdateModel.cs b/v2rayN/ServiceLib/Models/CheckUpdateModel.cs index f06eedc9..2707cc6e 100644 --- a/v2rayN/ServiceLib/Models/CheckUpdateModel.cs +++ b/v2rayN/ServiceLib/Models/CheckUpdateModel.cs @@ -1,6 +1,3 @@ -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.Models; public class CheckUpdateModel : ReactiveObject diff --git a/v2rayN/ServiceLib/Models/ClashProxyModel.cs b/v2rayN/ServiceLib/Models/ClashProxyModel.cs index 014b0f12..10d68e14 100644 --- a/v2rayN/ServiceLib/Models/ClashProxyModel.cs +++ b/v2rayN/ServiceLib/Models/ClashProxyModel.cs @@ -1,6 +1,3 @@ -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs index 3a7a7b97..531a99f4 100644 --- a/v2rayN/ServiceLib/Models/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/ConfigItems.cs @@ -71,7 +71,6 @@ public class GUIItem public bool DisplayRealTimeSpeed { get; set; } public bool KeepOlderDedupl { get; set; } public int AutoUpdateInterval { get; set; } - public bool EnableSecurityProtocolTls13 { get; set; } public int TrayMenuServersLimit { get; set; } = 20; public bool EnableHWA { get; set; } = false; public bool EnableLog { get; set; } = true; @@ -264,6 +263,7 @@ public class SimpleDNSItem public bool? BlockBindingQuery { get; set; } public string? DirectDNS { get; set; } public string? RemoteDNS { get; set; } + public string? BootstrapDNS { get; set; } public string? RayStrategy4Freedom { get; set; } public string? SingboxStrategy4Direct { get; set; } public string? SingboxStrategy4Proxy { get; set; } diff --git a/v2rayN/ServiceLib/Models/DNSItem.cs b/v2rayN/ServiceLib/Models/DNSItem.cs index 9474d906..2dea42d0 100644 --- a/v2rayN/ServiceLib/Models/DNSItem.cs +++ b/v2rayN/ServiceLib/Models/DNSItem.cs @@ -1,5 +1,3 @@ -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/FullConfigTemplateItem.cs b/v2rayN/ServiceLib/Models/FullConfigTemplateItem.cs index f3881325..b3e3b14e 100644 --- a/v2rayN/ServiceLib/Models/FullConfigTemplateItem.cs +++ b/v2rayN/ServiceLib/Models/FullConfigTemplateItem.cs @@ -1,5 +1,3 @@ -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/GitHubRelease.cs b/v2rayN/ServiceLib/Models/GitHubRelease.cs index 9875c0a0..f6549467 100644 --- a/v2rayN/ServiceLib/Models/GitHubRelease.cs +++ b/v2rayN/ServiceLib/Models/GitHubRelease.cs @@ -1,5 +1,3 @@ -using System.Text.Json.Serialization; - namespace ServiceLib.Models; public class GitHubReleaseAsset diff --git a/v2rayN/ServiceLib/Models/ProfileExItem.cs b/v2rayN/ServiceLib/Models/ProfileExItem.cs index 49a85749..33b20c57 100644 --- a/v2rayN/ServiceLib/Models/ProfileExItem.cs +++ b/v2rayN/ServiceLib/Models/ProfileExItem.cs @@ -1,5 +1,3 @@ -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/ProfileGroupItem.cs b/v2rayN/ServiceLib/Models/ProfileGroupItem.cs index 1030d6de..c6131275 100644 --- a/v2rayN/ServiceLib/Models/ProfileGroupItem.cs +++ b/v2rayN/ServiceLib/Models/ProfileGroupItem.cs @@ -1,5 +1,3 @@ -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/ProfileItem.cs b/v2rayN/ServiceLib/Models/ProfileItem.cs index 55f658e9..729fa7b2 100644 --- a/v2rayN/ServiceLib/Models/ProfileItem.cs +++ b/v2rayN/ServiceLib/Models/ProfileItem.cs @@ -1,6 +1,3 @@ -using ReactiveUI; -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/ProfileItemModel.cs b/v2rayN/ServiceLib/Models/ProfileItemModel.cs index 40ba3f1d..b4d72119 100644 --- a/v2rayN/ServiceLib/Models/ProfileItemModel.cs +++ b/v2rayN/ServiceLib/Models/ProfileItemModel.cs @@ -1,5 +1,3 @@ -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/RoutingItem.cs b/v2rayN/ServiceLib/Models/RoutingItem.cs index 78d93445..ddd27a9b 100644 --- a/v2rayN/ServiceLib/Models/RoutingItem.cs +++ b/v2rayN/ServiceLib/Models/RoutingItem.cs @@ -1,5 +1,3 @@ -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/ServerStatItem.cs b/v2rayN/ServiceLib/Models/ServerStatItem.cs index b5008465..05cd1ee6 100644 --- a/v2rayN/ServiceLib/Models/ServerStatItem.cs +++ b/v2rayN/ServiceLib/Models/ServerStatItem.cs @@ -1,5 +1,3 @@ -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/SingboxConfig.cs b/v2rayN/ServiceLib/Models/SingboxConfig.cs index 8263924a..9474631b 100644 --- a/v2rayN/ServiceLib/Models/SingboxConfig.cs +++ b/v2rayN/ServiceLib/Models/SingboxConfig.cs @@ -1,5 +1,3 @@ -using System.Text.Json.Serialization; - namespace ServiceLib.Models; public class SingboxConfig diff --git a/v2rayN/ServiceLib/Models/SubItem.cs b/v2rayN/ServiceLib/Models/SubItem.cs index cc1fb518..612ec15b 100644 --- a/v2rayN/ServiceLib/Models/SubItem.cs +++ b/v2rayN/ServiceLib/Models/SubItem.cs @@ -1,5 +1,3 @@ -using SQLite; - namespace ServiceLib.Models; [Serializable] diff --git a/v2rayN/ServiceLib/Models/V2rayConfig.cs b/v2rayN/ServiceLib/Models/V2rayConfig.cs index cff3cf8b..22dcf9f4 100644 --- a/v2rayN/ServiceLib/Models/V2rayConfig.cs +++ b/v2rayN/ServiceLib/Models/V2rayConfig.cs @@ -1,5 +1,3 @@ -using System.Text.Json.Serialization; - namespace ServiceLib.Models; public class V2rayConfig @@ -217,6 +215,7 @@ public class Dns4Ray public class DnsServer4Ray { public string? address { get; set; } + public int? port { get; set; } public List? domains { get; set; } public bool? skipFallback { get; set; } public List? expectedIPs { get; set; } diff --git a/v2rayN/ServiceLib/Models/VmessQRCode.cs b/v2rayN/ServiceLib/Models/VmessQRCode.cs index c51d9986..a555aae0 100644 --- a/v2rayN/ServiceLib/Models/VmessQRCode.cs +++ b/v2rayN/ServiceLib/Models/VmessQRCode.cs @@ -1,5 +1,3 @@ -using System.Text.Json.Serialization; - namespace ServiceLib.Models; /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index eb7dd406..90b25530 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -19,7 +19,7 @@ namespace ServiceLib.Resx { // 类通过类似于 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 ResUI { @@ -1023,6 +1023,15 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Test real delay 的本地化字符串。 + /// + public static string menuFastRealPing { + get { + return ResourceManager.GetString("menuFastRealPing", resourceCulture); + } + } + /// /// 查找类似 Full Config Template Setting 的本地化字符串。 /// @@ -2517,6 +2526,24 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Bootstrap DNS 的本地化字符串。 + /// + public static string TbBootstrapDNS { + get { + return ResourceManager.GetString("TbBootstrapDNS", resourceCulture); + } + } + + /// + /// 查找类似 Resolve DNS server domains, requires IP 的本地化字符串。 + /// + public static string TbBootstrapDNSTips { + get { + return ResourceManager.GetString("TbBootstrapDNSTips", resourceCulture); + } + } + /// /// 查找类似 Browse 的本地化字符串。 /// @@ -3966,15 +3993,6 @@ namespace ServiceLib.Resx { } } - /// - /// 查找类似 Enable Security Protocol TLS v1.3 (subscription/update) 的本地化字符串。 - /// - public static string TbSettingsTLS13 { - get { - return ResourceManager.GetString("TbSettingsTLS13", resourceCulture); - } - } - /// /// 查找类似 Tray right-click menu Configurations display limit 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 9a864836..08d4d111 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -747,9 +747,6 @@ تنظیمات پراکسی سیستم - - فعال کردن پروتکل امنیتی TLS نسخه 1.3 (اشتراک/به‌روزرسانی) - محدودیت نمایش سرورهای منوی سینی کلیک راست @@ -1593,4 +1590,13 @@ You can set separate rules for Routing and DNS, or select "ALL" to apply to both + + Bootstrap DNS + + + Resolve DNS server domains, requires IP + + + Test real delay + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 0e920aa8..abb43c0a 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -747,9 +747,6 @@ Rendszerproxy beállítások - - Biztonsági protokoll TLS v1.3 engedélyezése (előfizetés/frissítés) - Tálca jobb egérgombos menü konfigurációk megjelenítési limitje @@ -1593,4 +1590,13 @@ Rule Type + + Bootstrap DNS + + + Resolve DNS server domains, requires IP + + + Test real delay + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index 9fd73a15..9a1639ce 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -747,9 +747,6 @@ System proxy settings - - Enable Security Protocol TLS v1.3 (subscription/update) - Tray right-click menu Configurations display limit @@ -1593,4 +1590,13 @@ Rule Type + + Bootstrap DNS + + + Resolve DNS server domains, requires IP + + + Test real delay + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index 197afb51..67067b9a 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -747,9 +747,6 @@ Настройки системного прокси - - Включить протокол безопасности TLS v1.3 (обновление подписки) - Лимит серверов в меню трея @@ -1593,4 +1590,13 @@ Rule Type + + Bootstrap DNS + + + Resolve DNS server domains, requires IP + + + Test real delay + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index f1f49548..095d8594 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -121,7 +121,7 @@ 导出分享链接至剪贴板成功 - 请先检查配置文件设置 + 请先检查设置 配置格式不正确 @@ -133,7 +133,7 @@ 下载开始... - 转换配置文件失败 + 转换配置失败 生成默认配置文件失败 @@ -142,10 +142,10 @@ 获取默认配置失败 - 导入自定义配置文件失败 + 导入自定义配置失败 - 读取配置文件失败 + 读取配置失败 请填写正确格式的端口 @@ -265,13 +265,13 @@ 请选择协议 - 请先选择配置文件 + 请先选择配置 - 配置文件去重完成。原数量: {0},现数量: {1}。 + 配置去重完成。原数量: {0},现数量: {1}。 - 是否确定移除配置文件? + 是否确定移除? 客户端配置文件保存在:{0} @@ -283,10 +283,10 @@ 配置成功。 {0} - 成功导入自定义配置文件 + 成功导入自定义配置 - 成功从剪贴板导入 {0} 个配置文件 + 成功从剪贴板导入 {0} 个配置 扫描导入分享链接成功 @@ -385,7 +385,7 @@ 所有 - 请浏览导入配置文件配置 + 请浏览导入配置 测试中... @@ -397,7 +397,7 @@ 本地 - 配置文件过滤器,按回车执行 + 过滤器,按回车执行 检查更新 @@ -478,55 +478,55 @@ 扫描屏幕上的二维码 (Ctrl+S) - 克隆所选配置文件 + 克隆所选 - 移除重复的配置文件 + 移除重复 - 移除所选配置文件 (多选) (Delete) + 移除所选 (多选) (Delete) - 设为活动配置文件 (Enter) + 设为活动 (Enter) 清除所有服务统计数据 - 测试配置文件真连接延迟 (多选) (Ctrl+R) + 测试真连接延迟 (多选) (Ctrl+R) 按测试结果排序 - 测试配置文件速度 (多选) (Ctrl+T) + 测试速度 (多选) (Ctrl+T) - 测试配置文件延迟 Tcping (多选) (Ctrl+O) + 测试延迟 Tcping (多选) (Ctrl+O) - 导出所选配置文件完整配置 + 导出所选完整配置 导出分享链接至剪贴板 (多选) (Ctrl+C) - 添加自定义配置文件 + 添加自定义配置 - 添加 [Shadowsocks] 配置文件 + 添加 [Shadowsocks] - 添加 [SOCKS] 配置文件 + 添加 [SOCKS] - 添加 [Trojan] 配置文件 + 添加 [Trojan] - 添加 [VLESS] 配置文件 + 添加 [VLESS] - 添加 [VMess] 配置文件 + 添加 [VMess] 全选 (Ctrl+A) @@ -691,7 +691,7 @@ Outbound Freedom domainStrategy - 自动调整配置文件列宽在更新订阅后 + 自动调整配置列宽在更新订阅后 检查 Pre-Release 更新 (请谨慎启用) @@ -700,7 +700,7 @@ 例外 - 例外:对于下列字符开头的地址,不使用代理配置文件。使用分号 (;) 分隔。 + 例外:对于下列字符开头的地址,不使用代理配置。使用分号 (;) 分隔。 显示实时速度 (需重启) @@ -747,11 +747,8 @@ 系统代理设置 - - 启用安全协议 TLS v1.3 (订阅/检查更新) - - 托盘右键菜单配置文件展示数量限制 + 托盘右键菜单配置展示数量限制 开启 UDP @@ -784,7 +781,7 @@ Pac 模式 - 分享配置文件 (Ctrl+F) + 分享 (Ctrl+F) 路由 @@ -916,7 +913,7 @@ 移至订阅分组 - 启用配置文件拖放排序 (需重启) + 启用配置拖放排序 (需重启) 自动刷新 @@ -925,10 +922,10 @@ 跳过测试 - 编辑配置文件 (Ctrl+D) + 编辑 (Ctrl+D) - 主界面双击设为活动配置文件 + 主界面双击设为活动 测试完成 @@ -1033,7 +1030,7 @@ Domain - 添加 [Hysteria2] 配置文件 + 添加 [Hysteria2] Hysteria 最大带宽 (Up/Dw) @@ -1042,19 +1039,19 @@ 使用系统 hosts - 添加 [TUIC] 配置文件 + 添加 [TUIC] 拥塞控制算法 - 前置代理配置文件别名 + 前置代理配置别名 - 落地代理配置文件別名 + 落地代理配置別名 - 请确保配置文件别名存在并唯一 + 请确保配置别名存在并唯一 自动路由 @@ -1075,7 +1072,7 @@ 启用 IPv6 - 添加 [WireGuard] 配置文件 + 添加 [WireGuard] PrivateKey @@ -1108,7 +1105,7 @@ *grpc Authority - 添加 [HTTP] 配置文件 + 添加 [HTTP] 和分组前置代理冲突 @@ -1198,13 +1195,13 @@ 延迟测试 - 当前部分节点延迟测试 + 当前部分延迟测试 刷新 - 设为活动节点 (Enter) + 设为活动 (Enter) Outbound 默认解析策略 @@ -1222,7 +1219,7 @@ 导出分享链接至剪贴板 (多选) Base64 编码 - 导出所选配置文件完整配置至剪贴板 + 导出所选完整配置至剪贴板 显示或隐藏主界面 @@ -1339,7 +1336,7 @@ 多线程测试时的并发数量 - 例外:对于下列地址不使用代理配置文件。使用逗号 (,) 分隔。 + 例外:对于下列地址不使用代理配置。使用逗号 (,) 分隔。 流量探测类型 @@ -1375,31 +1372,31 @@ 会覆盖端口,多组时用逗号 (,) 隔开 - 多配置文件生成策略组 + 多选生成策略组 - 多配置文件随机 Xray + 多选随机 Xray - 多配置文件负载均衡 Xray + 多选负载均衡 Xray - 多配置文件最低延迟 Xray + 多选最低延迟 Xray - 多配置文件最稳定 Xray + 多选最稳定 Xray - 多配置文件最低延迟 sing-box + 多选最低延迟 sing-box - 导出配置文件 + 导出 当前连接信息测试地址 - 可以填写配置文件别名,请确保存在并唯一 + 可以填写配置别名,请确保存在并唯一 密码错误,请重试。 @@ -1408,7 +1405,7 @@ Mldsa65Verify - 添加 [Anytls] 配置文件 + 添加 [Anytls] 远程 DNS @@ -1495,13 +1492,13 @@ 开始解析和处理订阅内容 - 选择配置文件 + 选择配置 默认全局生效,内置 FakeIP 过滤,仅在 sing-box 中生效 - 请至少添加一个配置文件 + 请至少添加一个配置 策略组 @@ -1525,28 +1522,28 @@ 策略组类型 - 添加策略组配置文件 + 添加策略组 - 添加链式代理配置文件 + 添加链式代理 - 添加子配置文件 + 添加子项 - 删除子配置文件 + 删除子项 - 服务器列表 + 子项列表 故障转移 - 多配置文件故障转移 sing-box + 多选故障转移 sing-box - 多配置文件故障转移 Xray + 多选故障转移 Xray 核心 '{0}' 不支持网络类型 '{1}'。 @@ -1567,10 +1564,10 @@ 策略组: - 节点别名 '{0}' 不存在。 + 别名 '{0}' 不存在。 - 组“{0}”为空。请至少添加一个节点。 + 组“{0}”为空。请至少添加一个配置。 {0}属性无效,请检查 @@ -1590,4 +1587,13 @@ 可对 Routing 和 DNS 单独设定规则,ALL 则都生效 + + Bootstrap DNS + + + 解析 DNS 服务器域名,需指定为 IP + + + 一键测试真连接延迟 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 2ab8dfbf..d03b0d20 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -121,7 +121,7 @@ 匯出分享連結至剪貼簿成功 - 請先檢查設定檔設定 + 請先檢查設定 設定格式不正確 @@ -133,7 +133,7 @@ 下載開始... - 轉換設定檔失敗 + 轉換設定失敗 生成預設設定檔失敗 @@ -142,10 +142,10 @@ 獲取預設設定失敗 - 匯入自訂設定設定檔失敗 + 匯入自訂設定失敗 - 讀取設定檔失敗 + 讀取設定失敗 請填寫正確格式的埠 @@ -265,13 +265,13 @@ 請選擇協定 - 請先選擇設定檔 + 請先選擇設定 - 設定檔去重完成。原數量: {0},現數量: {1}。 + 去重完成。原數量: {0},現數量: {1}。 - 是否確定移除設定檔? + 是否確定移除? 用戶端設定檔儲存在:{0} @@ -283,10 +283,10 @@ 設定成功。{0} - 成功匯入自訂設定設定檔 + 成功匯入自訂節點 - 成功從剪貼簿匯入 {0} 個設定檔 + 成功從剪貼簿匯入 {0} 個節點 掃描匯入分享連結成功 @@ -385,7 +385,7 @@ 所有 - 請瀏覽匯入設定檔設定 + 請瀏覽匯入設定 測試中... @@ -397,7 +397,7 @@ 本機 - 設定檔過濾,按 Enter 執行 + 過濾器,按 Enter 執行 檢查更新 @@ -478,55 +478,55 @@ 掃描螢幕上的二維碼 (Ctrl+S) - 複製所選設定檔 + 複製所選 - 移除重複的設定檔 + 移除重複 - 移除所選設定檔 (多選) (Delete) + 移除所選 (多選) (Delete) - 設為活動設定檔 (Enter) + 設為活動 (Enter) 清除所有服務統計資料 - 測試設定檔真連線延遲 (多選) (Ctrl+R) + 測試真連線延遲 (多選) (Ctrl+R) 按測試結果排序 - 測試設定檔速度 (多選) (Ctrl+T) + 測試速度 (多選) (Ctrl+T) - 測試設定檔延遲 Tcping (多選) (Ctrl+O) + 測試延遲 Tcping (多選) (Ctrl+O) - 匯出所選設定檔完整設定 + 匯出所選完整設定 匯出分享連結至剪貼簿 (多選) (Ctrl+C) - 新增自訂設定設定檔 + 新增自訂節點 - 新增 [Shadowsocks] 設定檔 + 新增 [Shadowsocks] 節點 - 新增 [SOCKS] 設定檔 + 新增 [SOCKS] 節點 - 新增 [Trojan] 設定檔 + 新增 [Trojan] 節點 - 新增 [VLESS] 設定檔 + 新增 [VLESS] 節點 - 新增 [VMess] 設定檔 + 新增 [VMess] 節點 全選 (Ctrl+A) @@ -676,7 +676,7 @@ Core: 基礎設定 - V2ray Custom DNS + v2ray 自訂 DNS Core: KCP 設定 @@ -691,7 +691,7 @@ Outbound Freedom domainStrategy - 在更新訂閱後自動調整設定檔列寬 + 在更新訂閱後自動調整列寬 檢查 Pre-Release 更新 (請謹慎啟用) @@ -700,7 +700,7 @@ 例外 - 例外:對於下列字元開頭的位址,不使用代理設定檔。使用分號 (;) 分隔。 + 例外:對於下列字元開頭的位址,不使用代理。使用分號 (;) 分隔。 顯示即時速度(需重啟) @@ -747,11 +747,8 @@ 系統代理設定 - - 啟用安全協定 TLS v1.3 (訂閱/檢查更新) - - 工具列右鍵選單設定檔展示數量限制 + 工具列右鍵選單設定展示數量限制 開啟 UDP @@ -784,7 +781,7 @@ PAC 模式 - 分享設定檔 (Ctrl+F) + 分享 (Ctrl+F) 路由 @@ -886,7 +883,7 @@ 請勿將代理伺服器用於本機(Intranet)位址 - 一鍵多執行緒測試延遲和速度 (Ctrl+E) + 一鍵延遲與速度測試 (Ctrl+E) 延遲 (ms) @@ -916,7 +913,7 @@ 移至訂閱分組 - 啟動設定檔拖放排序 (需重啟) + 啟用拖放排序 (需重啟) 自動重新整理 @@ -925,10 +922,10 @@ 跳過測試 - 編輯設定檔 (Ctrl+D) + 編輯 (Ctrl+D) - 主介面輕按兩下設為活動設定檔 + 主介面輕按兩下設為活動 測試完成 @@ -946,7 +943,7 @@ 目前字型 (需重啟) - 複製字型 TTF/TTC 檔案到目錄 guiFonts,重啟設定 + 複製字型 TTF/TTC 檔案到目錄 guiFonts,重新啟動後生效 Pac 連接埠 = +3;Xray API 連接埠 = +4;mihomo API 連接埠 = +5; @@ -1006,10 +1003,10 @@ 不需要轉換時請留空 - DNS 設定 + DNS設定 - sing-box Custom DNS + sing-box 自訂 DNS 請填寫 DNS JSON 結構,點擊查看檔案 @@ -1033,7 +1030,7 @@ Domain - 添加 [Hysteria2] 設定檔 + 新增 [Hysteria2] 節點 Hysteria 最大頻寬 (Up/Dw) @@ -1042,19 +1039,19 @@ 使用系統 hosts - 新增 [TUIC] 設定檔 + 新增 [TUIC] 節點 擁塞控制算法 - 前置代理設定檔別名 + 前置代理節點別名 - 落地代理設定檔別名 + 落地代理節點別名 - 請確保設定檔別名存在並且唯一 + 請確保節點別名存在並且唯一 自動路由 @@ -1075,7 +1072,7 @@ 啟用 IPv6 - 添加 [WireGuard] 設定檔 + 新增 [WireGuard] 節點 PrivateKey @@ -1108,7 +1105,7 @@ *grpc Authority - 新增 [HTTP] 設定檔 + 新增 [HTTP] 節點 和分組前置代理衝突 @@ -1222,13 +1219,13 @@ 匯出分享連結至剪貼簿 (多選) Base64 編碼 - 匯出所選設定檔完整設定至剪貼簿 + 匯出所選完整設定至剪貼簿 顯示或隱藏主介面 - 自訂設定的 Socks 連接埠 + 自訂 Socks 連接埠 備份和還原 @@ -1312,7 +1309,7 @@ 請不要使用不安全的 HTTP 協定訂閱位址 - 安裝字體到系統中,選擇或填入字體名稱,重新啟動設定 + 安裝字體到系統中,選擇或填入字體名稱,重新啟動後生效 是否確定退出? @@ -1339,7 +1336,7 @@ 多執行緒測試時的並發數量 - 例外:對於下列位址不使用代理設定檔,使用逗號 (,) 分隔。 + 例外:對於下列位址不使用代理,使用逗號 (,) 分隔。 流量探測類型 @@ -1375,31 +1372,31 @@ 會覆蓋埠,多組時用逗號 (,) 隔開 - Generate Policy Group from Multiple Profiles + 多選生成策略組 - 多設定檔隨機 Xray + 多選隨機 Xray - 多設定檔負載平衡 Xray + 多選負載平衡 Xray - 多設定檔最低延遲 Xray + 多選最低延遲 Xray - 多設定檔最穩定 Xray + 多選最穩定 Xray - 多設定檔最低延遲 sing-box + 多選最低延遲 sing-box - 匯出設定檔 + 匯出 目前連接資訊測試地址 - 可以填寫設定檔別名,請確保存在並唯一 + 可以填寫節點別名,請確保存在並唯一 密碼錯誤,請重試。 @@ -1408,186 +1405,195 @@ Mldsa65Verify - 新增 [Anytls] 設定檔 + 新增 [Anytls] 節點 - Remote DNS + 遠程 DNS - Domestic DNS + 直連 DNS - Via proxy — please ensure remote availability + 通过代理,请确保远程可用 - xray Freedom Resolution Strategy + xray freedom 解析策略 - sing-box Direct Resolution Strategy + sing-box 直連解析策略 - sing-box Remote Resolution Strategy + sing-box 遠程解析策略 - Add Common DNS Hosts + 新增常用 DNS Hosts FakeIP - Block SVCB and HTTPS Queries + 阻止 SVCB 和 HTTPS 查詢 - DNS Hosts: ("domain1 ip1 ip2" per line) + DNS Hosts:(“網域名稱1 ip1 ip2” 一行一個) - Basic DNS Settings + DNS 基礎設定 - Advanced DNS Settings + DNS 進階設定 - Validate Regional Domain IPs + 校驗相應地區域名 IP - When configured, validates IPs returned for regional domains (e.g., geosite:cn), returning only expected IPs + 配置後,會對相應地區域名(如 geosite:cn)的返回 IP 進行校驗,僅返回期望 IP - Enable Custom DNS + 啟用自訂 DNS - Custom DNS Enabled, This Page's Settings Invalid + 自訂 DNS 已啟用,此頁面配置將無效 - Block ECH and HTTP/3 availability checks when enabled + 開啟後將阻止 ECH 和 HTTP/3 可用性查詢 - Please fill in the correct config template + 請填寫正確的配置範本 - Full Config Template Setting + 完整配置範本設定 - Enable Full Config Template + 啟用完整配置範本 - v2ray Full Config Template + v2ray 完整配置範本 - Add Outbound Config Only, routing.balancers and routing.rules.outboundTag, Click to view the document + 僅添加出站配置,routing.balancers 和 routing.rules.outboundTag,點擊查看文檔 - Do Not Add Non-Proxy Protocol Outbound + 不添加非代理協定出站 - Set Upstream Proxy Tag + 設定上游代理 tag - sing-box Full Config Template + sing-box 完整配置範本 - Add Outbound and Endpoint Config Only, Click to view the document + 僅添加出站和端點配置,點擊查看文檔 - This feature is intended for advanced users and those with special requirements. Once enabled, it will ignore the Core's basic settings, DNS settings, and routing settings. You must ensure that the system proxy port, traffic statistics, and other related configurations are set correctly — everything will be configured by you. + 此功能供高級用戶和有特殊需求的用戶使用。 啟用此功能後,將忽略 Core 的基礎設定,DNS 設定 ,路由設定。你需要保證系統代理的埠和流量統計等功能的配置正確,一切都由你來設定。 開始解析和處理訂閱內容 - Select Profile + 選擇節點 - Applies globally by default, with built-in FakeIP filtering (sing-box only). + 默認全域生效,內置 FakeIP 過濾,僅在 sing-box 中生效 - Please Add At Least One Configuration + 請至少添加一個節點 - Policy Group + 策略組 - Proxy Chain + 鏈式代理 - Lowest Latency + 最低延遲 - Random + 隨機 - Round Robin + 負載均衡 - Most Stable + 最穩定 - Policy Group Type + 策略組類型 - Add Policy Group Configuration + 添加策略組 - Add Proxy Chain Configuration + 添加鏈式代理 - Add Child Configuration + 添加子項 - Remove Child Configuration + 刪除子項 - Server List + 子項清單 - Fallback + 容錯移轉 - Multi-Configuration Fallback by sing-box + 多選容錯移轉 sing-box - Multi-Configuration Fallback by Xray + 多選容錯移轉 Xray - Core '{0}' does not support network type '{1}'. + 核心 '{0}' 不支援網路類型 '{1}'. - Core '{0}' does not support protocol '{1}' when using transport '{2}'. + 核心 '{0}' 在使用傳輸方式 '{2}' 時不支援協定 '{1}'. - Core '{0}' does not support protocol '{1}'. + 核心 '{0}' 不支援協定 '{1}'. - Proxy chained: + 代理鏈: - Routing rule outbound: + 路由規則出站: - Policy group: + 策略組: - Node alias '{0}' does not exist. + 別名 '{0}' 不存在。 - Group '{0}' is empty. Please add at least one node. + 組“{0}”為空.請至少添加一個配置。 - The {0} property is invalid, please check. + {0}屬性無效,請檢查 {0} 分組不能引用自身或循環引用 - Not support protocol '{0}'. + 不支援協定 '{0}'. - 如果系統沒有托盤功能,請不要開啟 + 如果系統沒有託盤功能,請不要開啟 - 规则类型 + 規則類型 - 可对 Routing 和 DNS 单独设定规则,ALL 则都生效 + 可對 Routing 和 DNS 單獨設定規則,ALL 則都生效 + + + Bootstrap DNS + + + 解析 DNS 伺服器網域名稱,需指定為 IP + + + 一鍵測試真連線延遲 \ No newline at end of file diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/CoreConfigSingboxService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/CoreConfigSingboxService.cs index 191c7efa..71f25acd 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/CoreConfigSingboxService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/CoreConfigSingboxService.cs @@ -1,7 +1,3 @@ -using System.Net; -using System.Net.NetworkInformation; -using ServiceLib.Common; - namespace ServiceLib.Services.CoreConfig; public partial class CoreConfigSingboxService(Config config) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxConfigTemplateService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxConfigTemplateService.cs index c6bec22b..6fe9b35a 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxConfigTemplateService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxConfigTemplateService.cs @@ -1,5 +1,3 @@ -using System.Text.Json.Nodes; - namespace ServiceLib.Services.CoreConfig; public partial class CoreConfigSingboxService diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxDnsService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxDnsService.cs index b1698ab4..c5ba5b0c 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxDnsService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxDnsService.cs @@ -138,12 +138,7 @@ public partial class CoreConfigSingboxService private async Task GenDnsDomains(SingboxConfig singboxConfig, SimpleDNSItem? simpleDNSItem) { - var finalDnsAddress = "local"; - if (_config.TunModeItem.EnableTun) - { - finalDnsAddress = "dhcp://auto"; - } - var finalDns = ParseDnsAddress(finalDnsAddress); + var finalDns = ParseDnsAddress(simpleDNSItem.BootstrapDNS); finalDns.tag = Global.SingboxLocalDNSTag; singboxConfig.dns ??= new Dns4Sbox(); singboxConfig.dns.servers ??= new List(); @@ -459,79 +454,41 @@ public partial class CoreConfigSingboxService return server; } - if (addressFirst.StartsWith("dhcp://", StringComparison.OrdinalIgnoreCase)) + var (domain, scheme, port, path) = Utils.ParseUrl(addressFirst); + + if (scheme.Equals("dhcp", StringComparison.OrdinalIgnoreCase)) { - var interface_name = addressFirst.Substring(7); server.type = "dhcp"; - server.Interface = interface_name == "auto" ? null : interface_name; + if ((!domain.IsNullOrEmpty()) && domain != "auto") + { + server.server = domain; + } return server; } - if (!addressFirst.Contains("://")) + if (scheme.IsNullOrEmpty()) { // udp dns server.type = "udp"; - server.server = addressFirst; - return server; } - - try + else { - var protocolEndIndex = addressFirst.IndexOf("://", StringComparison.Ordinal); - server.type = addressFirst.Substring(0, protocolEndIndex).ToLower(); + // server.type = scheme.ToLower(); - var uri = new Uri(addressFirst); - server.server = uri.Host; - - if (!uri.IsDefaultPort) - { - server.server_port = uri.Port; - } - - if ((server.type == "https" || server.type == "h3") && !string.IsNullOrEmpty(uri.AbsolutePath) && uri.AbsolutePath != "/") - { - server.path = uri.AbsolutePath; - } + // remove "+local" suffix + // TODO: "+local" suffix decide server.detour = "direct" ? + server.type = scheme.Replace("+local", "", StringComparison.OrdinalIgnoreCase).ToLower(); } - catch (UriFormatException) + + server.server = domain; + if (port != 0) { - var protocolEndIndex = addressFirst.IndexOf("://", StringComparison.Ordinal); - if (protocolEndIndex > 0) - { - server.type = addressFirst.Substring(0, protocolEndIndex).ToLower(); - var remaining = addressFirst.Substring(protocolEndIndex + 3); - - var portIndex = remaining.IndexOf(':'); - var pathIndex = remaining.IndexOf('/'); - - if (portIndex > 0) - { - server.server = remaining.Substring(0, portIndex); - var portPart = pathIndex > portIndex - ? remaining.Substring(portIndex + 1, pathIndex - portIndex - 1) - : remaining.Substring(portIndex + 1); - - if (int.TryParse(portPart, out var parsedPort)) - { - server.server_port = parsedPort; - } - } - else if (pathIndex > 0) - { - server.server = remaining.Substring(0, pathIndex); - } - else - { - server.server = remaining; - } - - if (pathIndex > 0 && (server.type == "https" || server.type == "h3")) - { - server.path = remaining.Substring(pathIndex); - } - } + server.server_port = port; + } + if ((server.type == "https" || server.type == "h3") && !string.IsNullOrEmpty(path) && path != "/") + { + server.path = path; } - return server; } } diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs index 097df4c3..84111652 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs @@ -294,7 +294,7 @@ public partial class CoreConfigSingboxService var tls = new Tls4Sbox() { enabled = true, - record_fragment = _config.CoreBasicItem.EnableFragment, + record_fragment = _config.CoreBasicItem.EnableFragment ? true : null, server_name = server_name, insecure = Utils.ToBool(node.AllowInsecure.IsNullOrEmpty() ? _config.CoreBasicItem.DefAllowInsecure.ToString().ToLower() : node.AllowInsecure), alpn = node.GetAlpn(), diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/CoreConfigV2rayService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/CoreConfigV2rayService.cs index 8c31ddae..f7fb384a 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/CoreConfigV2rayService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/CoreConfigV2rayService.cs @@ -1,6 +1,3 @@ -using System.Net; -using System.Net.NetworkInformation; - namespace ServiceLib.Services.CoreConfig; public partial class CoreConfigV2rayService(Config config) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs index 459e77de..986e1966 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayConfigTemplateService.cs @@ -1,5 +1,3 @@ -using System.Text.Json.Nodes; - namespace ServiceLib.Services.CoreConfig; public partial class CoreConfigV2rayService @@ -88,8 +86,8 @@ public partial class CoreConfigV2rayService } } - // Handle outbounds - append instead of override - var customOutboundsNode = fullConfigTemplateNode["outbounds"] is JsonArray outbounds ? outbounds : new JsonArray(); + var customOutboundsNode = new JsonArray(); + foreach (var outbound in v2rayConfig.outbounds) { if (outbound.protocol.ToLower() is "blackhole" or "dns" or "freedom") @@ -99,14 +97,30 @@ public partial class CoreConfigV2rayService continue; } } - else if ((outbound.streamSettings?.sockopt?.dialerProxy.IsNullOrEmpty() == true) && (!fullConfigTemplate.ProxyDetour.IsNullOrEmpty()) && !(Utils.IsPrivateNetwork(outbound.settings?.servers?.FirstOrDefault()?.address ?? string.Empty) || Utils.IsPrivateNetwork(outbound.settings?.vnext?.FirstOrDefault()?.address ?? string.Empty))) + else if ((!fullConfigTemplate.ProxyDetour.IsNullOrEmpty()) + && ((outbound.streamSettings?.sockopt?.dialerProxy.IsNullOrEmpty() ?? true) == true)) { - outbound.streamSettings ??= new StreamSettings4Ray(); - outbound.streamSettings.sockopt ??= new Sockopt4Ray(); - outbound.streamSettings.sockopt.dialerProxy = fullConfigTemplate.ProxyDetour; + var outboundAddress = outbound.settings?.servers?.FirstOrDefault()?.address + ?? outbound.settings?.vnext?.FirstOrDefault()?.address + ?? string.Empty; + if (!Utils.IsPrivateNetwork(outboundAddress)) + { + outbound.streamSettings ??= new StreamSettings4Ray(); + outbound.streamSettings.sockopt ??= new Sockopt4Ray(); + outbound.streamSettings.sockopt.dialerProxy = fullConfigTemplate.ProxyDetour; + } } customOutboundsNode.Add(JsonUtils.DeepCopy(outbound)); } + + if (fullConfigTemplateNode["outbounds"] is JsonArray templateOutbounds) + { + foreach (var outbound in templateOutbounds) + { + customOutboundsNode.Add(outbound?.DeepClone()); + } + } + fullConfigTemplateNode["outbounds"] = customOutboundsNode; return await Task.FromResult(JsonUtils.Serialize(fullConfigTemplateNode)); diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs index 99cda5b7..7170c5f0 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayDnsService.cs @@ -1,7 +1,3 @@ -using System.Text.Json; -using System.Text.Json.Nodes; -using System.Text.Json.Serialization; - namespace ServiceLib.Services.CoreConfig; public partial class CoreConfigV2rayService @@ -83,9 +79,23 @@ public partial class CoreConfigV2rayService static object CreateDnsServer(string dnsAddress, List domains, List? expectedIPs = null) { + var (domain, scheme, port, path) = Utils.ParseUrl(dnsAddress); + var domainFinal = dnsAddress; + int? portFinal = null; + if (scheme.IsNullOrEmpty() || scheme.StartsWith("udp", StringComparison.OrdinalIgnoreCase)) + { + domainFinal = domain; + portFinal = port > 0 ? port : null; + } + else if (scheme.StartsWith("tcp", StringComparison.OrdinalIgnoreCase)) + { + domainFinal = scheme + "://" + domain; + portFinal = port > 0 ? port : null; + } var dnsServer = new DnsServer4Ray { - address = dnsAddress, + address = domainFinal, + port = portFinal, skipFallback = true, domains = domains.Count > 0 ? domains : null, expectedIPs = expectedIPs?.Count > 0 ? expectedIPs : null @@ -107,6 +117,35 @@ public partial class CoreConfigV2rayService var expectedIPs = new List(); var regionNames = new HashSet(); + var bootstrapDNSAddress = ParseDnsAddresses(simpleDNSItem?.BootstrapDNS, Global.DomainPureIPDNSAddress.FirstOrDefault()); + var dnsServerDomains = new List(); + + foreach (var dns in directDNSAddress) + { + var (domain, _, _, _) = Utils.ParseUrl(dns); + if (domain == "localhost") + { + continue; + } + if (Utils.IsDomain(domain)) + { + dnsServerDomains.Add($"full:{domain}"); + } + } + foreach (var dns in remoteDNSAddress) + { + var (domain, _, _, _) = Utils.ParseUrl(dns); + if (domain == "localhost") + { + continue; + } + if (Utils.IsDomain(domain)) + { + dnsServerDomains.Add($"full:{domain}"); + } + } + dnsServerDomains = dnsServerDomains.Distinct().ToList(); + if (!string.IsNullOrEmpty(simpleDNSItem?.DirectExpectedIPs)) { expectedIPs = simpleDNSItem.DirectExpectedIPs @@ -221,6 +260,10 @@ public partial class CoreConfigV2rayService AddDnsServers(remoteDNSAddress, proxyGeositeList); AddDnsServers(directDNSAddress, directGeositeList); AddDnsServers(directDNSAddress, expectedDomainList, expectedIPs); + if (dnsServerDomains.Count > 0) + { + AddDnsServers(bootstrapDNSAddress, dnsServerDomains); + } var useDirectDns = rules?.LastOrDefault() is { } lastRule && lastRule.OutboundTag == Global.DirectTag diff --git a/v2rayN/ServiceLib/Services/DownloadService.cs b/v2rayN/ServiceLib/Services/DownloadService.cs index 99170646..d4122964 100644 --- a/v2rayN/ServiceLib/Services/DownloadService.cs +++ b/v2rayN/ServiceLib/Services/DownloadService.cs @@ -1,6 +1,4 @@ -using System.Net; using System.Net.Http.Headers; -using System.Net.Sockets; namespace ServiceLib.Services; @@ -19,8 +17,6 @@ public class DownloadService { try { - SetSecurityProtocol(AppManager.Instance.Config.GuiItem.EnableSecurityProtocolTls13); - var progress = new Progress(); progress.ProgressChanged += (sender, value) => updateFunc?.Invoke(false, $"{value}"); @@ -44,7 +40,6 @@ public class DownloadService { try { - SetSecurityProtocol(AppManager.Instance.Config.GuiItem.EnableSecurityProtocolTls13); UpdateCompleted?.Invoke(this, new RetResult(false, $"{ResUI.Downloading} {url}")); var progress = new Progress(); @@ -71,7 +66,6 @@ public class DownloadService public async Task UrlRedirectAsync(string url, bool blProxy) { - SetSecurityProtocol(AppManager.Instance.Config.GuiItem.EnableSecurityProtocolTls13); var webRequestHandler = new SocketsHttpHandler { AllowAutoRedirect = false, @@ -141,7 +135,6 @@ public class DownloadService { try { - SetSecurityProtocol(AppManager.Instance.Config.GuiItem.EnableSecurityProtocolTls13); var webProxy = await GetWebProxy(blProxy); var client = new HttpClient(new SocketsHttpHandler() { @@ -186,8 +179,6 @@ public class DownloadService { try { - SetSecurityProtocol(AppManager.Instance.Config.GuiItem.EnableSecurityProtocolTls13); - var webProxy = await GetWebProxy(blProxy); if (userAgent.IsNullOrEmpty()) @@ -238,17 +229,4 @@ public class DownloadService return false; } } - - private static void SetSecurityProtocol(bool enableSecurityProtocolTls13) - { - if (enableSecurityProtocolTls13) - { - ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13; - } - else - { - ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; - } - ServicePointManager.DefaultConnectionLimit = 256; - } } diff --git a/v2rayN/ServiceLib/Services/ProcessService.cs b/v2rayN/ServiceLib/Services/ProcessService.cs index 06e27d52..0f7161e3 100644 --- a/v2rayN/ServiceLib/Services/ProcessService.cs +++ b/v2rayN/ServiceLib/Services/ProcessService.cs @@ -1,6 +1,3 @@ -using System.Diagnostics; -using System.Text; - namespace ServiceLib.Services; public class ProcessService : IDisposable diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index b2cd6a2b..bb4e9386 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -1,8 +1,3 @@ -using System.Collections.Concurrent; -using System.Diagnostics; -using System.Net; -using System.Net.Sockets; - namespace ServiceLib.Services; public class SpeedtestService(Config config, Func updateFunc) diff --git a/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs b/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs index d3de6a18..2b0f53f1 100644 --- a/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs +++ b/v2rayN/ServiceLib/Services/Statistics/StatisticsSingboxService.cs @@ -1,5 +1,4 @@ using System.Net.WebSockets; -using System.Text; namespace ServiceLib.Services.Statistics; diff --git a/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayN/ServiceLib/Services/UpdateService.cs index 429c0a62..16a69464 100644 --- a/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayN/ServiceLib/Services/UpdateService.cs @@ -1,6 +1,3 @@ -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; - namespace ServiceLib.Services; public class UpdateService diff --git a/v2rayN/ServiceLib/ViewModels/AddGroupServerViewModel.cs b/v2rayN/ServiceLib/ViewModels/AddGroupServerViewModel.cs index 130f447d..b5bfe80d 100644 --- a/v2rayN/ServiceLib/ViewModels/AddGroupServerViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/AddGroupServerViewModel.cs @@ -1,8 +1,3 @@ -using System.Reactive; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class AddGroupServerViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs b/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs index a94ecf74..cbc97642 100644 --- a/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs @@ -1,7 +1,3 @@ -using System.Reactive; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class AddServer2ViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs b/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs index cd2399bc..addd5bcc 100644 --- a/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs @@ -1,7 +1,3 @@ -using System.Reactive; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class AddServerViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs b/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs index 5a96a04d..c0eae75f 100644 --- a/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/BackupAndRestoreViewModel.cs @@ -1,7 +1,3 @@ -using System.Reactive; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class BackupAndRestoreViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs index 4c072712..5267979b 100644 --- a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs @@ -1,11 +1,3 @@ -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.InteropServices; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class CheckUpdateViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/ClashConnectionsViewModel.cs b/v2rayN/ServiceLib/ViewModels/ClashConnectionsViewModel.cs index d45b8e7d..dbcc9a79 100644 --- a/v2rayN/ServiceLib/ViewModels/ClashConnectionsViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ClashConnectionsViewModel.cs @@ -1,11 +1,3 @@ -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class ClashConnectionsViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs index bf999d12..eb67a9d4 100644 --- a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs @@ -1,11 +1,4 @@ -using System.Reactive; using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; using static ServiceLib.Models.ClashProviders; using static ServiceLib.Models.ClashProxies; diff --git a/v2rayN/ServiceLib/ViewModels/DNSSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/DNSSettingViewModel.cs index da21ab35..d53b960d 100644 --- a/v2rayN/ServiceLib/ViewModels/DNSSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/DNSSettingViewModel.cs @@ -1,8 +1,3 @@ -using System.Reactive; -using System.Reactive.Linq; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class DNSSettingViewModel : MyReactiveObject @@ -13,6 +8,7 @@ public class DNSSettingViewModel : MyReactiveObject [Reactive] public bool? BlockBindingQuery { get; set; } [Reactive] public string? DirectDNS { get; set; } [Reactive] public string? RemoteDNS { get; set; } + [Reactive] public string? BootstrapDNS { get; set; } [Reactive] public string? RayStrategy4Freedom { get; set; } [Reactive] public string? SingboxStrategy4Direct { get; set; } [Reactive] public string? SingboxStrategy4Proxy { get; set; } @@ -73,6 +69,7 @@ public class DNSSettingViewModel : MyReactiveObject BlockBindingQuery = item.BlockBindingQuery; DirectDNS = item.DirectDNS; RemoteDNS = item.RemoteDNS; + BootstrapDNS = item.BootstrapDNS; RayStrategy4Freedom = item.RayStrategy4Freedom; SingboxStrategy4Direct = item.SingboxStrategy4Direct; SingboxStrategy4Proxy = item.SingboxStrategy4Proxy; @@ -102,6 +99,7 @@ public class DNSSettingViewModel : MyReactiveObject _config.SimpleDNSItem.BlockBindingQuery = BlockBindingQuery; _config.SimpleDNSItem.DirectDNS = DirectDNS; _config.SimpleDNSItem.RemoteDNS = RemoteDNS; + _config.SimpleDNSItem.BootstrapDNS = BootstrapDNS; _config.SimpleDNSItem.RayStrategy4Freedom = RayStrategy4Freedom; _config.SimpleDNSItem.SingboxStrategy4Direct = SingboxStrategy4Direct; _config.SimpleDNSItem.SingboxStrategy4Proxy = SingboxStrategy4Proxy; diff --git a/v2rayN/ServiceLib/ViewModels/FullConfigTemplateViewModel.cs b/v2rayN/ServiceLib/ViewModels/FullConfigTemplateViewModel.cs index 3619ddef..a3907fc5 100644 --- a/v2rayN/ServiceLib/ViewModels/FullConfigTemplateViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/FullConfigTemplateViewModel.cs @@ -1,7 +1,3 @@ -using System.Reactive; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class FullConfigTemplateViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/GlobalHotkeySettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/GlobalHotkeySettingViewModel.cs index 0acb8726..581007f1 100644 --- a/v2rayN/ServiceLib/ViewModels/GlobalHotkeySettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/GlobalHotkeySettingViewModel.cs @@ -1,6 +1,3 @@ -using System.Reactive; -using ReactiveUI; - namespace ServiceLib.ViewModels; public class GlobalHotkeySettingViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 2ad35e32..0b721184 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -1,8 +1,4 @@ -using System.Reactive; using System.Reactive.Concurrency; -using System.Reactive.Linq; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; namespace ServiceLib.ViewModels; diff --git a/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs b/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs index e9d89b94..08a77d33 100644 --- a/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MsgViewModel.cs @@ -1,10 +1,3 @@ -using System.Collections.Concurrent; -using System.Reactive.Linq; -using System.Text; -using System.Text.RegularExpressions; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class MsgViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index 7f446cf2..8bf21763 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -1,7 +1,3 @@ -using System.Reactive; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class OptionSettingViewModel : MyReactiveObject @@ -52,7 +48,6 @@ public class OptionSettingViewModel : MyReactiveObject [Reactive] public bool DisplayRealTimeSpeed { get; set; } [Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; } [Reactive] public bool EnableUpdateSubOnlyRemarksExist { get; set; } - [Reactive] public bool EnableSecurityProtocolTls13 { get; set; } [Reactive] public bool AutoHideStartup { get; set; } [Reactive] public bool Hide2TrayWhenClose { get; set; } [Reactive] public bool EnableDragDropSort { get; set; } @@ -170,7 +165,6 @@ public class OptionSettingViewModel : MyReactiveObject KeepOlderDedupl = _config.GuiItem.KeepOlderDedupl; EnableAutoAdjustMainLvColWidth = _config.UiItem.EnableAutoAdjustMainLvColWidth; EnableUpdateSubOnlyRemarksExist = _config.UiItem.EnableUpdateSubOnlyRemarksExist; - EnableSecurityProtocolTls13 = _config.GuiItem.EnableSecurityProtocolTls13; AutoHideStartup = _config.UiItem.AutoHideStartup; Hide2TrayWhenClose = _config.UiItem.Hide2TrayWhenClose; EnableDragDropSort = _config.UiItem.EnableDragDropSort; @@ -330,7 +324,6 @@ public class OptionSettingViewModel : MyReactiveObject _config.GuiItem.KeepOlderDedupl = KeepOlderDedupl; _config.UiItem.EnableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth; _config.UiItem.EnableUpdateSubOnlyRemarksExist = EnableUpdateSubOnlyRemarksExist; - _config.GuiItem.EnableSecurityProtocolTls13 = EnableSecurityProtocolTls13; _config.UiItem.AutoHideStartup = AutoHideStartup; _config.UiItem.Hide2TrayWhenClose = Hide2TrayWhenClose; _config.GuiItem.AutoUpdateInterval = AutoUpdateInterval; diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs index 8742755e..7301882c 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs @@ -1,9 +1,3 @@ -using System.Reactive.Linq; -using DynamicData; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class ProfilesSelectViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index bf9c4dbf..1780e513 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -1,12 +1,3 @@ -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Text; -using DynamicData; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class ProfilesViewModel : MyReactiveObject @@ -75,6 +66,7 @@ public class ProfilesViewModel : MyReactiveObject public ReactiveCommand SpeedServerCmd { get; } public ReactiveCommand SortServerResultCmd { get; } public ReactiveCommand RemoveInvalidServerResultCmd { get; } + public ReactiveCommand FastRealPingCmd { get; } //servers export public ReactiveCommand Export2ClientConfigCmd { get; } @@ -188,6 +180,10 @@ public class ProfilesViewModel : MyReactiveObject }, canEditRemove); //servers ping + FastRealPingCmd = ReactiveCommand.CreateFromTask(async () => + { + await ServerSpeedtest(ESpeedActionType.FastRealping); + }); MixedTestServerCmd = ReactiveCommand.CreateFromTask(async () => { await ServerSpeedtest(ESpeedActionType.Mixedtest); @@ -738,6 +734,12 @@ public class ProfilesViewModel : MyReactiveObject { SelectedProfiles = ProfileItems; } + else if (actionType == ESpeedActionType.FastRealping) + { + SelectedProfiles = ProfileItems; + actionType = ESpeedActionType.Realping; + } + var lstSelected = await GetProfileItems(false); if (lstSelected == null) { diff --git a/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs b/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs index 36b1babf..e984ab64 100644 --- a/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/RoutingRuleDetailsViewModel.cs @@ -1,7 +1,3 @@ -using System.Reactive; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class RoutingRuleDetailsViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/RoutingRuleSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/RoutingRuleSettingViewModel.cs index 979d3dc4..445e61bc 100644 --- a/v2rayN/ServiceLib/ViewModels/RoutingRuleSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/RoutingRuleSettingViewModel.cs @@ -1,10 +1,3 @@ -using System.Reactive; -using System.Text.Json; -using System.Text.Json.Serialization; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class RoutingRuleSettingViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs index 5237a8d2..8f62f2d0 100644 --- a/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs @@ -1,8 +1,3 @@ -using System.Reactive; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class RoutingSettingViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index 9742cfe6..707722ad 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -1,11 +1,3 @@ -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Text; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class StatusBarViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/SubEditViewModel.cs b/v2rayN/ServiceLib/ViewModels/SubEditViewModel.cs index bfbfbbe7..344f4ac8 100644 --- a/v2rayN/ServiceLib/ViewModels/SubEditViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/SubEditViewModel.cs @@ -1,7 +1,3 @@ -using System.Reactive; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class SubEditViewModel : MyReactiveObject diff --git a/v2rayN/ServiceLib/ViewModels/SubSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/SubSettingViewModel.cs index 88f33619..ce0f6fa7 100644 --- a/v2rayN/ServiceLib/ViewModels/SubSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/SubSettingViewModel.cs @@ -1,9 +1,3 @@ -using System.Reactive; -using DynamicData; -using DynamicData.Binding; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; - namespace ServiceLib.ViewModels; public class SubSettingViewModel : MyReactiveObject diff --git a/v2rayN/v2rayN.Desktop/App.axaml b/v2rayN/v2rayN.Desktop/App.axaml index 37c54471..21204f60 100644 --- a/v2rayN/v2rayN.Desktop/App.axaml +++ b/v2rayN/v2rayN.Desktop/App.axaml @@ -8,14 +8,7 @@ xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib" Name="v2rayN" x:DataType="vms:StatusBarViewModel" - RequestedThemeVariant="Default"> - - - - - - - + RequestedThemeVariant="Default"> @@ -23,6 +16,13 @@ + + + + + + + diff --git a/v2rayN/v2rayN.Desktop/App.axaml.cs b/v2rayN/v2rayN.Desktop/App.axaml.cs index 9f4d605f..5da86c6e 100644 --- a/v2rayN/v2rayN.Desktop/App.axaml.cs +++ b/v2rayN/v2rayN.Desktop/App.axaml.cs @@ -1,6 +1,3 @@ -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; using v2rayN.Desktop.Views; namespace v2rayN.Desktop; diff --git a/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml b/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml index 6a2cfacd..eccdeb91 100644 --- a/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml +++ b/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml @@ -13,6 +13,7 @@ + + + diff --git a/v2rayN/v2rayN.Desktop/Base/WindowBase.cs b/v2rayN/v2rayN.Desktop/Base/WindowBase.cs index 10105d2e..63b00036 100644 --- a/v2rayN/v2rayN.Desktop/Base/WindowBase.cs +++ b/v2rayN/v2rayN.Desktop/Base/WindowBase.cs @@ -1,7 +1,3 @@ -using Avalonia; -using Avalonia.Interactivity; -using Avalonia.ReactiveUI; - namespace v2rayN.Desktop.Base; public class WindowBase : ReactiveWindow where TViewModel : class diff --git a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs index 3c5169cc..c0702938 100644 --- a/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs +++ b/v2rayN/v2rayN.Desktop/Common/AppBuilderExtension.cs @@ -1,6 +1,3 @@ -using Avalonia; -using Avalonia.Media; - namespace v2rayN.Desktop.Common; public static class AppBuilderExtension diff --git a/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs b/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs index f7f03ab3..1ef294f6 100644 --- a/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs +++ b/v2rayN/v2rayN.Desktop/Common/AvaUtils.cs @@ -1,9 +1,4 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Input; using Avalonia.Input.Platform; -using Avalonia.Media.Imaging; -using Avalonia.Platform; namespace v2rayN.Desktop.Common; diff --git a/v2rayN/v2rayN.Desktop/Common/TextEditorKeywordHighlighter.cs b/v2rayN/v2rayN.Desktop/Common/TextEditorKeywordHighlighter.cs index af1de3d0..f5e4dc6a 100644 --- a/v2rayN/v2rayN.Desktop/Common/TextEditorKeywordHighlighter.cs +++ b/v2rayN/v2rayN.Desktop/Common/TextEditorKeywordHighlighter.cs @@ -1,4 +1,3 @@ -using Avalonia.Media; using AvaloniaEdit; using AvaloniaEdit.Document; using AvaloniaEdit.Rendering; diff --git a/v2rayN/v2rayN.Desktop/Common/UI.cs b/v2rayN/v2rayN.Desktop/Common/UI.cs index e9ddc36f..c17d8947 100644 --- a/v2rayN/v2rayN.Desktop/Common/UI.cs +++ b/v2rayN/v2rayN.Desktop/Common/UI.cs @@ -1,7 +1,5 @@ -using Avalonia.Controls; using Avalonia.Platform.Storage; using MsBox.Avalonia; -using MsBox.Avalonia.Enums; namespace v2rayN.Desktop.Common; diff --git a/v2rayN/v2rayN.Desktop/Converters/DelayColorConverter.cs b/v2rayN/v2rayN.Desktop/Converters/DelayColorConverter.cs index 05364578..82cd0cf1 100644 --- a/v2rayN/v2rayN.Desktop/Converters/DelayColorConverter.cs +++ b/v2rayN/v2rayN.Desktop/Converters/DelayColorConverter.cs @@ -1,6 +1,4 @@ -using System.Globalization; using Avalonia.Data.Converters; -using Avalonia.Media; namespace v2rayN.Desktop.Converters; diff --git a/v2rayN/v2rayN.Desktop/GlobalUsings.cs b/v2rayN/v2rayN.Desktop/GlobalUsings.cs index aede90cc..c9a2bc45 100644 --- a/v2rayN/v2rayN.Desktop/GlobalUsings.cs +++ b/v2rayN/v2rayN.Desktop/GlobalUsings.cs @@ -1,3 +1,29 @@ +global using System; +global using System.Collections.Generic; +global using System.Globalization; +global using System.IO; +global using System.Linq; +global using System.Reactive.Disposables; +global using System.Reactive.Linq; +global using System.Text; +global using System.Threading; +global using System.Threading.Tasks; +global using Avalonia; +global using Avalonia.Controls; +global using Avalonia.Controls.ApplicationLifetimes; +global using Avalonia.Input; +global using Avalonia.Interactivity; +global using Avalonia.Markup.Xaml; +global using Avalonia.Media; +global using Avalonia.Media.Imaging; +global using Avalonia.Platform; +global using Avalonia.ReactiveUI; +global using Avalonia.Styling; +global using Avalonia.Threading; +global using ReactiveUI; +global using ReactiveUI.Fody.Helpers; +global using DynamicData; +global using MsBox.Avalonia.Enums; global using ServiceLib; global using ServiceLib.Base; global using ServiceLib.Common; diff --git a/v2rayN/v2rayN.Desktop/Manager/HotkeyManager.cs b/v2rayN/v2rayN.Desktop/Manager/HotkeyManager.cs index 5ce6ff60..f803c538 100644 --- a/v2rayN/v2rayN.Desktop/Manager/HotkeyManager.cs +++ b/v2rayN/v2rayN.Desktop/Manager/HotkeyManager.cs @@ -1,6 +1,3 @@ -using System.Reactive.Linq; -using Avalonia.Input; -using Avalonia.ReactiveUI; using Avalonia.Win32.Input; using GlobalHotKeys; @@ -11,7 +8,7 @@ public sealed class HotkeyManager private static readonly Lazy _instance = new(() => new()); public static HotkeyManager Instance = _instance.Value; private readonly Dictionary _hotkeyTriggerDic = new(); - private HotKeyManager? _hotKeyManager; + private GlobalHotKeys.HotKeyManager? _hotKeyManager; private Config? _config; diff --git a/v2rayN/v2rayN.Desktop/Program.cs b/v2rayN/v2rayN.Desktop/Program.cs index 4b534324..1a0ce38e 100644 --- a/v2rayN/v2rayN.Desktop/Program.cs +++ b/v2rayN/v2rayN.Desktop/Program.cs @@ -1,5 +1,3 @@ -using Avalonia; -using Avalonia.ReactiveUI; using v2rayN.Desktop.Common; namespace v2rayN.Desktop; diff --git a/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs b/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs index ae12fa07..2bfa5eaf 100644 --- a/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs +++ b/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs @@ -1,13 +1,6 @@ -using System.Reactive.Linq; -using Avalonia; -using Avalonia.Controls; using Avalonia.Controls.Notifications; using Avalonia.Controls.Primitives; -using Avalonia.Media; -using Avalonia.Styling; using AvaloniaEdit; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; using Semi.Avalonia; namespace v2rayN.Desktop.ViewModels; diff --git a/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs index 2acaee55..0430a57c 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs @@ -1,9 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Controls; -using Avalonia.Input; -using Avalonia.Interactivity; -using DynamicData; -using ReactiveUI; using v2rayN.Desktop.Base; namespace v2rayN.Desktop.Views; diff --git a/v2rayN/v2rayN.Desktop/Views/AddServer2Window.axaml.cs b/v2rayN/v2rayN.Desktop/Views/AddServer2Window.axaml.cs index 4d378bf9..2e6731b7 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddServer2Window.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/AddServer2Window.axaml.cs @@ -1,6 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Interactivity; -using ReactiveUI; using v2rayN.Desktop.Base; using v2rayN.Desktop.Common; diff --git a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml index 7aa6a0be..7e3dda10 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml @@ -607,12 +607,14 @@ diff --git a/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs index 76a0fd1d..1c39df72 100644 --- a/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs @@ -1,9 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Controls; -using Avalonia.Interactivity; -using Avalonia.ReactiveUI; -using ReactiveUI; - namespace v2rayN.Desktop.Views; public partial class ClashConnectionsView : ReactiveUserControl diff --git a/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml b/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml index 974d5192..a4ef8315 100644 --- a/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml +++ b/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml @@ -50,27 +50,21 @@ diff --git a/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml.cs index c8e7aeba..9a86846b 100644 --- a/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml.cs @@ -1,9 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Input; -using Avalonia.ReactiveUI; -using DynamicData; -using ReactiveUI; - namespace v2rayN.Desktop.Views; public partial class ClashProxiesView : ReactiveUserControl diff --git a/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml index d15929eb..e5a785b7 100644 --- a/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml @@ -83,58 +83,79 @@ VerticalAlignment="Center" Text="{x:Static resx:ResUI.TbRemoteDNSTips}" TextWrapping="Wrap" /> - + + + + + diff --git a/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml.cs index 2a472e30..a37f2c14 100644 --- a/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml.cs @@ -1,8 +1,3 @@ -using System.Reactive.Disposables; -using System.Reactive.Linq; -using Avalonia.Controls; -using Avalonia.Interactivity; -using ReactiveUI; using v2rayN.Desktop.Base; namespace v2rayN.Desktop.Views; @@ -25,6 +20,7 @@ public partial class DNSSettingWindow : WindowBase cmbSBRemoteDNSStrategy.ItemsSource = Global.SingboxDomainStrategy4Out; cmbDirectDNS.ItemsSource = Global.DomainDirectDNSAddress; cmbRemoteDNS.ItemsSource = Global.DomainRemoteDNSAddress; + cmbBootstrapDNS.ItemsSource = Global.DomainPureIPDNSAddress; cmbDirectExpectedIPs.ItemsSource = Global.ExpectedIPs; cmbdomainStrategy4FreedomCompatible.ItemsSource = Global.DomainStrategy4Freedoms; @@ -40,6 +36,7 @@ public partial class DNSSettingWindow : WindowBase this.Bind(ViewModel, vm => vm.BlockBindingQuery, v => v.togBlockBindingQuery.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DirectDNS, v => v.cmbDirectDNS.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.RemoteDNS, v => v.cmbRemoteDNS.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.BootstrapDNS, v => v.cmbBootstrapDNS.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.RayStrategy4Freedom, v => v.cmbRayFreedomDNSStrategy.SelectedItem).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SingboxStrategy4Direct, v => v.cmbSBDirectDNSStrategy.SelectedItem).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SingboxStrategy4Proxy, v => v.cmbSBRemoteDNSStrategy.SelectedItem).DisposeWith(disposables); diff --git a/v2rayN/v2rayN.Desktop/Views/FullConfigTemplateWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/FullConfigTemplateWindow.axaml.cs index 97bc4afb..1a8d5061 100644 --- a/v2rayN/v2rayN.Desktop/Views/FullConfigTemplateWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/FullConfigTemplateWindow.axaml.cs @@ -1,6 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Interactivity; -using ReactiveUI; using v2rayN.Desktop.Base; namespace v2rayN.Desktop.Views; diff --git a/v2rayN/v2rayN.Desktop/Views/GlobalHotkeySettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/GlobalHotkeySettingWindow.axaml.cs index 18ee0f1b..9b332695 100644 --- a/v2rayN/v2rayN.Desktop/Views/GlobalHotkeySettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/GlobalHotkeySettingWindow.axaml.cs @@ -1,9 +1,3 @@ -using System.Reactive.Disposables; -using System.Text; -using Avalonia.Controls; -using Avalonia.Input; -using Avalonia.Interactivity; -using ReactiveUI; using v2rayN.Desktop.Base; using v2rayN.Desktop.Manager; diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml index b66a98a4..e02d0ba5 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml @@ -25,7 +25,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -90,39 +90,15 @@ - - - - - - - + - - - - - - - + - - - - - - - + - - - - - - - + diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 0fa30a52..c3bba363 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -1,15 +1,5 @@ -using System.Reactive.Disposables; -using System.Reactive.Linq; -using Avalonia; -using Avalonia.Controls; -using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.Notifications; -using Avalonia.Input; -using Avalonia.Interactivity; -using Avalonia.Threading; using DialogHostAvalonia; -using MsBox.Avalonia.Enums; -using ReactiveUI; using v2rayN.Desktop.Base; using v2rayN.Desktop.Common; using v2rayN.Desktop.Manager; diff --git a/v2rayN/v2rayN.Desktop/Views/MsgView.axaml b/v2rayN/v2rayN.Desktop/Views/MsgView.axaml index 2f7ad807..8c2cc90c 100644 --- a/v2rayN/v2rayN.Desktop/Views/MsgView.axaml +++ b/v2rayN/v2rayN.Desktop/Views/MsgView.axaml @@ -25,28 +25,22 @@ - - - this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableUpdateSubOnlyRemarksExist, v => v.togEnableUpdateSubOnlyRemarksExist.IsChecked).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.EnableSecurityProtocolTls13, v => v.togEnableSecurityProtocolTls13.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.Hide2TrayWhenClose, v => v.togHide2TrayWhenClose.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables); diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml index eda3b105..c89a7f71 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml @@ -51,12 +51,11 @@ diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs index ac562758..b71b61b0 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs @@ -1,10 +1,4 @@ -using System.Reactive.Disposables; -using Avalonia; -using Avalonia.Controls; -using Avalonia.Input; -using Avalonia.Interactivity; using Avalonia.VisualTree; -using ReactiveUI; using v2rayN.Desktop.Base; namespace v2rayN.Desktop.Views; diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml index 89bcbb28..14a2d174 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml @@ -32,39 +32,20 @@ - - @@ -74,6 +55,27 @@ Margin="{StaticResource MarginLr4}" VerticalContentAlignment="Center" Watermark="{x:Static resx:ResUI.MsgServerTitle}" /> + + + + + - + + - - - - - - - - - - - - @@ -140,6 +131,7 @@ + @@ -147,6 +139,16 @@ + + + + + + + + + + diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs index c6c16c86..754f6aa6 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs @@ -1,13 +1,4 @@ -using System.Reactive.Disposables; -using System.Reactive.Linq; -using Avalonia.Controls; -using Avalonia.Input; -using Avalonia.Interactivity; -using Avalonia.ReactiveUI; -using Avalonia.Threading; using DialogHostAvalonia; -using MsBox.Avalonia.Enums; -using ReactiveUI; using v2rayN.Desktop.Common; namespace v2rayN.Desktop.Views; @@ -89,6 +80,7 @@ public partial class ProfilesView : ReactiveUserControl this.BindCommand(ViewModel, vm => vm.SpeedServerCmd, v => v.menuSpeedServer).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SortServerResultCmd, v => v.menuSortServerResult).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RemoveInvalidServerResultCmd, v => v.menuRemoveInvalidServerResult).DisposeWith(disposables); + this.BindCommand(ViewModel, vm => vm.FastRealPingCmd, v => v.btnFastRealPing).DisposeWith(disposables); //servers export this.BindCommand(ViewModel, vm => vm.Export2ClientConfigCmd, v => v.menuExport2ClientConfig).DisposeWith(disposables); diff --git a/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs index 05d2dd83..3f1e7149 100644 --- a/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs @@ -1,7 +1,3 @@ -using Avalonia.Controls; -using Avalonia.Media.Imaging; -using Avalonia.Threading; - namespace v2rayN.Desktop.Views; public partial class QrcodeView : UserControl diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs index eb947b11..6c3f663d 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs @@ -1,7 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Controls; -using Avalonia.Interactivity; -using ReactiveUI; using v2rayN.Desktop.Base; namespace v2rayN.Desktop.Views; diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs index 78ec8833..80a13d5a 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs @@ -1,9 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Controls; -using Avalonia.Input; -using Avalonia.Interactivity; -using MsBox.Avalonia.Enums; -using ReactiveUI; using v2rayN.Desktop.Base; using v2rayN.Desktop.Common; diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs index 50a79d18..582bdeee 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml.cs @@ -1,9 +1,3 @@ -using System.Reactive.Disposables; -using Avalonia.Controls; -using Avalonia.Input; -using Avalonia.Interactivity; -using MsBox.Avalonia.Enums; -using ReactiveUI; using v2rayN.Desktop.Base; using v2rayN.Desktop.Common; diff --git a/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs index f59eccb1..e5ab59c9 100644 --- a/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs @@ -1,11 +1,4 @@ -using System.Reactive.Disposables; -using Avalonia; -using Avalonia.Controls; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.ReactiveUI; -using Avalonia.Threading; using DialogHostAvalonia; -using ReactiveUI; using v2rayN.Desktop.Common; namespace v2rayN.Desktop.Views; diff --git a/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml b/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml index 211cff40..79216921 100644 --- a/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml @@ -72,13 +72,15 @@ - + + + + + + Header="{x:Static resx:ResUI.menuCopyServer}" /> - - - - - - - - - - - - + + + + + + + + + + + diff --git a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs index fc8d027f..79d4cdb9 100644 --- a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs +++ b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs @@ -1,13 +1,7 @@ -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; -using System.Windows.Input; using System.Windows.Media; -using System.Windows.Threading; using MaterialDesignThemes.Wpf; -using ReactiveUI; using v2rayN.Base; using Point = System.Windows.Point; @@ -83,6 +77,7 @@ public partial class ProfilesView this.BindCommand(ViewModel, vm => vm.SpeedServerCmd, v => v.menuSpeedServer).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SortServerResultCmd, v => v.menuSortServerResult).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RemoveInvalidServerResultCmd, v => v.menuRemoveInvalidServerResult).DisposeWith(disposables); + this.BindCommand(ViewModel, vm => vm.FastRealPingCmd, v => v.btnFastRealPing).DisposeWith(disposables); //servers export this.BindCommand(ViewModel, vm => vm.Export2ClientConfigCmd, v => v.menuExport2ClientConfig).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs index 220f58b2..0586067a 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs @@ -1,7 +1,3 @@ -using System.Reactive.Disposables; -using System.Windows; -using ReactiveUI; - namespace v2rayN.Views; public partial class RoutingRuleDetailsWindow diff --git a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs index d69146d9..153aaedc 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs @@ -1,8 +1,3 @@ -using System.Reactive.Disposables; -using System.Windows; -using System.Windows.Input; -using ReactiveUI; - namespace v2rayN.Views; public partial class RoutingRuleSettingWindow diff --git a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs index e597715b..565897b0 100644 --- a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs @@ -1,8 +1,3 @@ -using System.Reactive.Disposables; -using System.Windows; -using System.Windows.Input; -using ReactiveUI; - namespace v2rayN.Views; public partial class RoutingSettingWindow diff --git a/v2rayN/v2rayN/Views/StatusBarView.xaml.cs b/v2rayN/v2rayN/Views/StatusBarView.xaml.cs index 1d80a694..906308ab 100644 --- a/v2rayN/v2rayN/Views/StatusBarView.xaml.cs +++ b/v2rayN/v2rayN/Views/StatusBarView.xaml.cs @@ -1,8 +1,3 @@ -using System.Reactive.Disposables; -using System.Windows; -using System.Windows.Input; -using System.Windows.Threading; -using ReactiveUI; using v2rayN.Manager; namespace v2rayN.Views; diff --git a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs index 8bd7d6c5..488420fa 100644 --- a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs @@ -1,7 +1,3 @@ -using System.Reactive.Disposables; -using System.Windows; -using ReactiveUI; - namespace v2rayN.Views; public partial class SubEditWindow diff --git a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs index 9e8d0c76..f44739d3 100644 --- a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs @@ -1,9 +1,4 @@ -using System.ComponentModel; -using System.Reactive.Disposables; -using System.Windows; -using System.Windows.Input; using MaterialDesignThemes.Wpf; -using ReactiveUI; namespace v2rayN.Views; diff --git a/v2rayN/v2rayN/Views/ThemeSettingView.xaml.cs b/v2rayN/v2rayN/Views/ThemeSettingView.xaml.cs index 93d634de..0aacbdbb 100644 --- a/v2rayN/v2rayN/Views/ThemeSettingView.xaml.cs +++ b/v2rayN/v2rayN/Views/ThemeSettingView.xaml.cs @@ -1,5 +1,3 @@ -using System.Reactive.Disposables; -using ReactiveUI; using v2rayN.ViewModels; namespace v2rayN.Views;