From 6979e21628c580f21c7e5110e22b1b36221e1a46 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sun, 17 Aug 2025 09:32:02 +0800 Subject: [PATCH] Remove DomainMatcher (#7781) --- v2rayN/ServiceLib/Global.cs | 7 --- v2rayN/ServiceLib/Models/ConfigItems.cs | 1 - v2rayN/ServiceLib/Models/V2rayConfig.cs | 2 - v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 9 --- v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 3 - v2rayN/ServiceLib/Resx/ResUI.hu.resx | 3 - v2rayN/ServiceLib/Resx/ResUI.resx | 3 - v2rayN/ServiceLib/Resx/ResUI.ru.resx | 59 +++++++++---------- v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 3 - v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 3 - .../CoreConfig/CoreConfigV2rayService.cs | 1 - .../ViewModels/RoutingSettingViewModel.cs | 5 -- .../Views/RoutingSettingWindow.axaml | 17 +----- .../Views/RoutingSettingWindow.axaml.cs | 2 - v2rayN/v2rayN/Views/RoutingSettingWindow.xaml | 18 +----- .../v2rayN/Views/RoutingSettingWindow.xaml.cs | 2 - 16 files changed, 31 insertions(+), 107 deletions(-) diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index e3be7004..615c0d38 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -305,13 +305,6 @@ public class Global "" ]; - public static readonly List DomainMatchers = - [ - "linear", - "mph", - "" - ]; - public static readonly List Fingerprints = [ "chrome", diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs index 1c3a57c3..148f2bd7 100644 --- a/v2rayN/ServiceLib/Models/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/ConfigItems.cs @@ -165,7 +165,6 @@ public class RoutingBasicItem { public string DomainStrategy { get; set; } public string DomainStrategy4Singbox { get; set; } - public string DomainMatcher { get; set; } public string RoutingIndexId { get; set; } } diff --git a/v2rayN/ServiceLib/Models/V2rayConfig.cs b/v2rayN/ServiceLib/Models/V2rayConfig.cs index 702bbae1..cff3cf8b 100644 --- a/v2rayN/ServiceLib/Models/V2rayConfig.cs +++ b/v2rayN/ServiceLib/Models/V2rayConfig.cs @@ -233,8 +233,6 @@ public class Routing4Ray { public string domainStrategy { get; set; } - public string? domainMatcher { get; set; } - public List rules { get; set; } public List? balancers { get; set; } diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 2adb4f8d..da0ee773 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -2463,15 +2463,6 @@ namespace ServiceLib.Resx { } } - /// - /// 查找类似 Domain Matcher 的本地化字符串。 - /// - public static string TbdomainMatcher { - get { - return ResourceManager.GetString("TbdomainMatcher", resourceCulture); - } - } - /// /// 查找类似 Domain strategy 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index d35c8d20..6873e1c8 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -825,9 +825,6 @@ تنظیم کردن به عنوان قانون فعال - - تطبیق دامنه - استراتژی دامنه diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 4bc19006..d90ac86c 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -825,9 +825,6 @@ Beállítás aktív szabályként (Enter) - - Tartomány illesztő - Tartomány stratégia diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index 4cf1b91a..2b2e3abd 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -825,9 +825,6 @@ Set as active rule (Enter) - - Domain Matcher - Domain strategy diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index 97c04c81..bb1f6184 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1,17 +1,17 @@ - @@ -825,9 +825,6 @@ Установить как активное правило - - Сопоставитель доменов - Доменная стратегия @@ -1500,4 +1497,4 @@ Эта функция предназначена для продвинутых пользователей и особых случаев. После включения игнорируются базовые настройки ядра, DNS и маршрутизации. Вы должны самостоятельно корректно задать порт системного прокси, учёт трафика и другие связанные параметры — всё настраивается вручную. - + \ 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 a2506ed8..b10ff641 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -825,9 +825,6 @@ 设为活动规则 (Enter) - - 域名匹配算法 - 域名解析策略 diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 3d16e5b5..b3738082 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -825,9 +825,6 @@ 設為活動規則 (Enter) - - 域名匹配演算法 - 域名解析策略 diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs index 62c2e182..96a2556e 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs @@ -523,7 +523,6 @@ public class CoreConfigV2rayService if (v2rayConfig.routing?.rules != null) { v2rayConfig.routing.domainStrategy = _config.RoutingBasicItem.DomainStrategy; - v2rayConfig.routing.domainMatcher = _config.RoutingBasicItem.DomainMatcher.IsNullOrEmpty() ? null : _config.RoutingBasicItem.DomainMatcher; var routing = await ConfigHandler.GetDefaultRouting(_config); if (routing != null) diff --git a/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs index 73b18fb7..e202a094 100644 --- a/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/RoutingSettingViewModel.cs @@ -20,9 +20,6 @@ public class RoutingSettingViewModel : MyReactiveObject [Reactive] public string DomainStrategy { get; set; } - [Reactive] - public string DomainMatcher { get; set; } - [Reactive] public string DomainStrategy4Singbox { get; set; } @@ -75,7 +72,6 @@ public class RoutingSettingViewModel : MyReactiveObject SelectedSource = new(); DomainStrategy = _config.RoutingBasicItem.DomainStrategy; - DomainMatcher = _config.RoutingBasicItem.DomainMatcher; DomainStrategy4Singbox = _config.RoutingBasicItem.DomainStrategy4Singbox; await ConfigHandler.InitBuiltinRouting(_config); @@ -109,7 +105,6 @@ public class RoutingSettingViewModel : MyReactiveObject private async Task SaveRoutingAsync() { _config.RoutingBasicItem.DomainStrategy = DomainStrategy; - _config.RoutingBasicItem.DomainMatcher = DomainMatcher; _config.RoutingBasicItem.DomainStrategy4Singbox = DomainStrategy4Singbox; if (await ConfigHandler.SaveConfig(_config) == 0) diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml index fba1863d..710980c4 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml @@ -50,7 +50,7 @@ Margin="{StaticResource Margin4}" ColumnDefinitions="Auto,Auto" DockPanel.Dock="Top" - RowDefinitions="Auto,Auto,Auto"> + RowDefinitions="Auto,Auto"> - - - @@ -94,7 +81,7 @@ ViewModel = new RoutingSettingViewModel(UpdateViewHandler); cmbdomainStrategy.ItemsSource = Global.DomainStrategies; - cmbdomainMatcher.ItemsSource = Global.DomainMatchers; cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Singbox; this.WhenActivated(disposables => @@ -36,7 +35,6 @@ public partial class RoutingSettingWindow : WindowBase this.Bind(ViewModel, vm => vm.SelectedSource, v => v.lstRoutings.SelectedItem).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DomainStrategy, v => v.cmbdomainStrategy.SelectedValue).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.DomainMatcher, v => v.cmbdomainMatcher.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DomainStrategy4Singbox, v => v.cmbdomainStrategy4Singbox.SelectedValue).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RoutingAdvancedAddCmd, v => v.menuRoutingAdvancedAdd).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml index 463a69d4..36b42409 100644 --- a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml @@ -78,7 +78,6 @@ - @@ -109,21 +108,6 @@ Grid.Column="0" Margin="{StaticResource Margin4}" VerticalAlignment="Center" - Style="{StaticResource ToolbarTextBlock}" - Text="{x:Static resx:ResUI.TbdomainMatcher}" /> - - - @@ -132,7 +116,7 @@ @@ -31,7 +30,6 @@ public partial class RoutingSettingWindow this.Bind(ViewModel, vm => vm.SelectedSource, v => v.lstRoutings.SelectedItem).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DomainStrategy, v => v.cmbdomainStrategy.Text).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.DomainMatcher, v => v.cmbdomainMatcher.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DomainStrategy4Singbox, v => v.cmbdomainStrategy4Singbox.Text).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RoutingAdvancedAddCmd, v => v.menuRoutingAdvancedAdd).DisposeWith(disposables);