From 7a750a127ebcf39da5a7b37ff92f65b512881153 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:53:33 +0800 Subject: [PATCH] Rename ActionPrecheckService --- .../ActionPrecheckManager.cs} | 14 ++++++-------- v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 2 +- v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.hu.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.ru.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 2 +- v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs | 4 ++-- 9 files changed, 15 insertions(+), 17 deletions(-) rename v2rayN/ServiceLib/{Services/ActionPrecheckService.cs => Manager/ActionPrecheckManager.cs} (95%) diff --git a/v2rayN/ServiceLib/Services/ActionPrecheckService.cs b/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs similarity index 95% rename from v2rayN/ServiceLib/Services/ActionPrecheckService.cs rename to v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs index d5380c69..69c0b915 100644 --- a/v2rayN/ServiceLib/Services/ActionPrecheckService.cs +++ b/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs @@ -1,14 +1,12 @@ -using DynamicData; - -namespace ServiceLib.Services; +namespace ServiceLib.Manager; /// /// Centralized pre-checks before sensitive actions (set active profile, generate config, etc.). /// -public class ActionPrecheckService(Config config) +public class ActionPrecheckManager(Config config) { - private static readonly Lazy _instance = new(() => new ActionPrecheckService(AppManager.Instance.Config)); - public static ActionPrecheckService Instance => _instance.Value; + private static readonly Lazy _instance = new(() => new ActionPrecheckManager(AppManager.Instance.Config)); + public static ActionPrecheckManager Instance => _instance.Value; private readonly Config _config = config; @@ -88,7 +86,7 @@ public class ActionPrecheckService(Config config) break; case EConfigType.VLESS: - if (item.Id.IsNullOrEmpty() || (!Utils.IsGuidByParse(item.Id) && item.Id.Length > 30)) + if (item.Id.IsNullOrEmpty() || !Utils.IsGuidByParse(item.Id) && item.Id.Length > 30) errors.Add(string.Format(ResUI.InvalidProperty, "Id")); if (!Global.Flows.Contains(item.Flow)) errors.Add(string.Format(ResUI.InvalidProperty, "Flow")); @@ -102,7 +100,7 @@ public class ActionPrecheckService(Config config) break; } - if ((item.ConfigType is EConfigType.VLESS or EConfigType.Trojan) + if (item.ConfigType is EConfigType.VLESS or EConfigType.Trojan && item.StreamSecurity == Global.StreamSecurityReality && item.PublicKey.IsNullOrEmpty()) { diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 25fb9b85..6b4257a1 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -304,7 +304,7 @@ namespace ServiceLib.Resx { } /// - /// 查找类似 The group "{0}" cannot reference itself. 的本地化字符串。 + /// 查找类似 {0} Group cannot reference itself or have a circular reference 的本地化字符串。 /// public static string GroupSelfReference { get { diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 449cb297..ae08f28d 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1588,7 +1588,7 @@ The {0} property is invalid, please check. - The group "{0}" cannot reference itself. + {0} Group cannot reference itself or have a circular reference Not support protocol '{0}'. diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 9b7ca556..00fbced7 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1588,7 +1588,7 @@ The {0} property is invalid, please check. - The group "{0}" cannot reference itself. + {0} Group cannot reference itself or have a circular reference Not support protocol '{0}'. diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index d6688de8..5b08c334 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1588,7 +1588,7 @@ The {0} property is invalid, please check. - The group "{0}" cannot reference itself. + {0} Group cannot reference itself or have a circular reference Not support protocol '{0}'. diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index 5cf44f3a..e82d874f 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1588,7 +1588,7 @@ The {0} property is invalid, please check. - The group "{0}" cannot reference itself. + {0} Group cannot reference itself or have a circular reference Not support protocol '{0}'. diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index dd5b8bda..404354ef 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1585,7 +1585,7 @@ {0}属性无效,请检查 - {0} 分组不能引用自身 + {0} 分组不能引用自身或循环引用 不支持协议 '{0}'。 diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 1510ff67..f3fd34c5 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1585,7 +1585,7 @@ The {0} property is invalid, please check. - The group "{0}" cannot reference itself. + {0} 分組不能引用自身或循環引用 Not support protocol '{0}'. diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 546171b2..289dc36e 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -605,7 +605,7 @@ public class ProfilesViewModel : MyReactiveObject return; } - var msgs = await ActionPrecheckService.Instance.CheckBeforeSetActive(indexId); + var msgs = await ActionPrecheckManager.Instance.CheckBeforeSetActive(indexId); foreach (var msg in msgs) { NoticeManager.Instance.SendMessage(msg); @@ -779,7 +779,7 @@ public class ProfilesViewModel : MyReactiveObject return; } - var msgs = await ActionPrecheckService.Instance.CheckBeforeGenerateConfig(item); + var msgs = await ActionPrecheckManager.Instance.CheckBeforeGenerateConfig(item); foreach (var msg in msgs) { NoticeManager.Instance.SendMessage(msg);