From db6b021d82a33d9f6000869db86d837c00b7b8f8 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sun, 10 Aug 2025 23:19:06 +0800 Subject: [PATCH] Fixes sing-box system hosts and ui --- v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 18 +++++++++--------- v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 6 +++--- v2rayN/ServiceLib/Resx/ResUI.hu.resx | 6 +++--- v2rayN/ServiceLib/Resx/ResUI.resx | 6 +++--- v2rayN/ServiceLib/Resx/ResUI.ru.resx | 6 +++--- v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 6 +++--- v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 6 +++--- .../CoreConfig/CoreConfigSingboxService.cs | 16 ++++++++++++++++ .../Views/DNSSettingWindow.axaml | 18 ++++++++++++------ v2rayN/v2rayN/Views/DNSSettingWindow.xaml | 15 ++++++++++----- 10 files changed, 65 insertions(+), 38 deletions(-) diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 6a021a2b..e6c1d39e 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -2310,6 +2310,15 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Prevent domain-based routing rules from failing 的本地化字符串。 + /// + public static string TbBlockSVCBHTTPSQueriesTips { + get { + return ResourceManager.GetString("TbBlockSVCBHTTPSQueriesTips", resourceCulture); + } + } + /// /// 查找类似 Browse 的本地化字符串。 /// @@ -2688,15 +2697,6 @@ namespace ServiceLib.Resx { } } - /// - /// 查找类似 Prevent DNS Leaks 的本地化字符串。 - /// - public static string TbPreventDNSLeaks { - get { - return ResourceManager.GetString("TbPreventDNSLeaks", resourceCulture); - } - } - /// /// 查找类似 Private Key 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 25a3c80e..ddab00a5 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1443,9 +1443,6 @@ Block SVCB and HTTPS Queries - - Prevent DNS Leaks - DNS Hosts: ("domain1 ip1 ip2" per line) @@ -1470,4 +1467,7 @@ Custom DNS Enabled, This Page's Settings Invalid + + Prevent domain-based routing rules from failing + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 20d0ab8e..a895cb80 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1443,9 +1443,6 @@ Block SVCB and HTTPS Queries - - Prevent DNS Leaks - DNS Hosts: ("domain1 ip1 ip2" per line) @@ -1470,4 +1467,7 @@ Custom DNS Enabled, This Page's Settings Invalid + + Prevent domain-based routing rules from failing + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index a6009434..60c8f57b 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1443,9 +1443,6 @@ Block SVCB and HTTPS Queries - - Prevent DNS Leaks - DNS Hosts: ("domain1 ip1 ip2" per line) @@ -1470,4 +1467,7 @@ Custom DNS Enabled, This Page's Settings Invalid + + Prevent domain-based routing rules from failing + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index 6207b163..79990f4b 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1443,9 +1443,6 @@ Block SVCB and HTTPS Queries - - Prevent DNS Leaks - DNS Hosts: ("domain1 ip1 ip2" per line) @@ -1470,4 +1467,7 @@ Custom DNS Enabled, This Page's Settings Invalid + + Prevent domain-based routing rules from failing + \ 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 72c42604..b685f058 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1440,9 +1440,6 @@ 阻止 SVCB 和 HTTPS 查询 - - 避免 DNS 泄漏 - DNS Hosts:(“域名1 ip1 ip2” 一行一个) @@ -1467,4 +1464,7 @@ 自定义 DNS 已启用,此页面配置将无效 + + 避免域名分流规则失效 + \ 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 84c8f929..955b0b54 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1440,9 +1440,6 @@ Block SVCB and HTTPS Queries - - Prevent DNS Leaks - DNS Hosts: ("domain1 ip1 ip2" per line) @@ -1467,4 +1464,7 @@ Custom DNS Enabled, This Page's Settings Invalid + + Prevent domain-based routing rules from failing + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs index 6ea20a20..648b0625 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs @@ -1685,6 +1685,22 @@ public class CoreConfigSingboxService } } + if (simpleDNSItem.UseSystemHosts == true) + { + var systemHosts = Utils.GetSystemHosts(); + if (systemHosts.Count > 0) + { + foreach (var host in systemHosts) + { + if (userHostsMap[host.Key] != null) + { + continue; + } + userHostsMap[host.Key] = new List { host.Value }; + } + } + } + foreach (var host in hostsDns.predefined) { if (finalDns.server == host.Key) diff --git a/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml index 9ec377ff..afb3dd97 100644 --- a/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml @@ -97,7 +97,8 @@ Grid.Column="2" Margin="{StaticResource Margin4}" VerticalAlignment="Center" - Text="{x:Static resx:ResUI.TbSBOutboundDomainResolve}" /> + Text="{x:Static resx:ResUI.TbSBOutboundDomainResolve}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbSBFallbackDNSResolve}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbSBDoHOverride}" + TextWrapping="Wrap" /> @@ -228,7 +231,8 @@ Grid.Column="2" Margin="{StaticResource Margin4}" VerticalAlignment="Center" - Text="{x:Static resx:ResUI.TbApplyProxyDomainsOnly}" /> + Text="{x:Static resx:ResUI.TbApplyProxyDomainsOnly}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbBlockSVCBHTTPSQueriesTips}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbValidateDirectExpectedIPsDesc}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbSBOutboundDomainResolve}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbSBFallbackDNSResolve}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbApplyProxyDomainsOnly}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbBlockSVCBHTTPSQueriesTips}" + TextWrapping="Wrap" /> + Text="{x:Static resx:ResUI.TbValidateDirectExpectedIPsDesc}" + TextWrapping="Wrap" />