Compare commits

...

1 commit

Author SHA1 Message Date
DHR60
db6b021d82 Fixes sing-box system hosts and ui 2025-08-10 23:19:25 +08:00
10 changed files with 65 additions and 38 deletions

View file

@ -2310,6 +2310,15 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 Prevent domain-based routing rules from failing 的本地化字符串。
/// </summary>
public static string TbBlockSVCBHTTPSQueriesTips {
get {
return ResourceManager.GetString("TbBlockSVCBHTTPSQueriesTips", resourceCulture);
}
}
/// <summary>
/// 查找类似 Browse 的本地化字符串。
/// </summary>
@ -2688,15 +2697,6 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 Prevent DNS Leaks 的本地化字符串。
/// </summary>
public static string TbPreventDNSLeaks {
get {
return ResourceManager.GetString("TbPreventDNSLeaks", resourceCulture);
}
}
/// <summary>
/// 查找类似 Private Key 的本地化字符串。
/// </summary>

View file

@ -1443,9 +1443,6 @@
<data name="TbBlockSVCBHTTPSQueries" xml:space="preserve">
<value>Block SVCB and HTTPS Queries</value>
</data>
<data name="TbPreventDNSLeaks" xml:space="preserve">
<value>Prevent DNS Leaks</value>
</data>
<data name="TbDNSHostsConfig" xml:space="preserve">
<value>DNS Hosts: ("domain1 ip1 ip2" per line)</value>
</data>
@ -1470,4 +1467,7 @@
<data name="TbCustomDNSEnabledPageInvalid" xml:space="preserve">
<value>Custom DNS Enabled, This Page's Settings Invalid</value>
</data>
<data name="TbBlockSVCBHTTPSQueriesTips" xml:space="preserve">
<value>Prevent domain-based routing rules from failing</value>
</data>
</root>

View file

@ -1443,9 +1443,6 @@
<data name="TbBlockSVCBHTTPSQueries" xml:space="preserve">
<value>Block SVCB and HTTPS Queries</value>
</data>
<data name="TbPreventDNSLeaks" xml:space="preserve">
<value>Prevent DNS Leaks</value>
</data>
<data name="TbDNSHostsConfig" xml:space="preserve">
<value>DNS Hosts: ("domain1 ip1 ip2" per line)</value>
</data>
@ -1470,4 +1467,7 @@
<data name="TbCustomDNSEnabledPageInvalid" xml:space="preserve">
<value>Custom DNS Enabled, This Page's Settings Invalid</value>
</data>
<data name="TbBlockSVCBHTTPSQueriesTips" xml:space="preserve">
<value>Prevent domain-based routing rules from failing</value>
</data>
</root>

View file

@ -1443,9 +1443,6 @@
<data name="TbBlockSVCBHTTPSQueries" xml:space="preserve">
<value>Block SVCB and HTTPS Queries</value>
</data>
<data name="TbPreventDNSLeaks" xml:space="preserve">
<value>Prevent DNS Leaks</value>
</data>
<data name="TbDNSHostsConfig" xml:space="preserve">
<value>DNS Hosts: ("domain1 ip1 ip2" per line)</value>
</data>
@ -1470,4 +1467,7 @@
<data name="TbCustomDNSEnabledPageInvalid" xml:space="preserve">
<value>Custom DNS Enabled, This Page's Settings Invalid</value>
</data>
<data name="TbBlockSVCBHTTPSQueriesTips" xml:space="preserve">
<value>Prevent domain-based routing rules from failing</value>
</data>
</root>

View file

@ -1443,9 +1443,6 @@
<data name="TbBlockSVCBHTTPSQueries" xml:space="preserve">
<value>Block SVCB and HTTPS Queries</value>
</data>
<data name="TbPreventDNSLeaks" xml:space="preserve">
<value>Prevent DNS Leaks</value>
</data>
<data name="TbDNSHostsConfig" xml:space="preserve">
<value>DNS Hosts: ("domain1 ip1 ip2" per line)</value>
</data>
@ -1470,4 +1467,7 @@
<data name="TbCustomDNSEnabledPageInvalid" xml:space="preserve">
<value>Custom DNS Enabled, This Page's Settings Invalid</value>
</data>
<data name="TbBlockSVCBHTTPSQueriesTips" xml:space="preserve">
<value>Prevent domain-based routing rules from failing</value>
</data>
</root>

View file

@ -1440,9 +1440,6 @@
<data name="TbBlockSVCBHTTPSQueries" xml:space="preserve">
<value>阻止 SVCB 和 HTTPS 查询</value>
</data>
<data name="TbPreventDNSLeaks" xml:space="preserve">
<value>避免 DNS 泄漏</value>
</data>
<data name="TbDNSHostsConfig" xml:space="preserve">
<value>DNS Hosts“域名1 ip1 ip2” 一行一个)</value>
</data>
@ -1467,4 +1464,7 @@
<data name="TbCustomDNSEnabledPageInvalid" xml:space="preserve">
<value>自定义 DNS 已启用,此页面配置将无效</value>
</data>
<data name="TbBlockSVCBHTTPSQueriesTips" xml:space="preserve">
<value>避免域名分流规则失效</value>
</data>
</root>

View file

@ -1440,9 +1440,6 @@
<data name="TbBlockSVCBHTTPSQueries" xml:space="preserve">
<value>Block SVCB and HTTPS Queries</value>
</data>
<data name="TbPreventDNSLeaks" xml:space="preserve">
<value>Prevent DNS Leaks</value>
</data>
<data name="TbDNSHostsConfig" xml:space="preserve">
<value>DNS Hosts: ("domain1 ip1 ip2" per line)</value>
</data>
@ -1467,4 +1464,7 @@
<data name="TbCustomDNSEnabledPageInvalid" xml:space="preserve">
<value>Custom DNS Enabled, This Page's Settings Invalid</value>
</data>
<data name="TbBlockSVCBHTTPSQueriesTips" xml:space="preserve">
<value>Prevent domain-based routing rules from failing</value>
</data>
</root>

View file

@ -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<string> { host.Value };
}
}
}
foreach (var host in hostsDns.predefined)
{
if (finalDns.server == host.Key)

View file

@ -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" />
<TextBlock
Grid.Row="4"
@ -117,7 +118,8 @@
Grid.Column="2"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TbSBFallbackDNSResolve}" />
Text="{x:Static resx:ResUI.TbSBFallbackDNSResolve}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="5"
@ -178,7 +180,8 @@
Grid.Column="2"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TbSBDoHOverride}" />
Text="{x:Static resx:ResUI.TbSBDoHOverride}"
TextWrapping="Wrap" />
</Grid>
</ScrollViewer>
</TabItem>
@ -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" />
<TextBlock
Grid.Row="3"
@ -247,7 +251,8 @@
Grid.Column="2"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TbPreventDNSLeaks}" />
Text="{x:Static resx:ResUI.TbBlockSVCBHTTPSQueriesTips}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="4"
@ -267,7 +272,8 @@
Grid.Column="2"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TbValidateDirectExpectedIPsDesc}" />
Text="{x:Static resx:ResUI.TbValidateDirectExpectedIPsDesc}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="5"

View file

@ -124,7 +124,8 @@
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSBOutboundDomainResolve}" />
Text="{x:Static resx:ResUI.TbSBOutboundDomainResolve}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="4"
@ -147,7 +148,8 @@
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSBFallbackDNSResolve}" />
Text="{x:Static resx:ResUI.TbSBFallbackDNSResolve}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="5"
@ -281,7 +283,8 @@
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbApplyProxyDomainsOnly}" />
Text="{x:Static resx:ResUI.TbApplyProxyDomainsOnly}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="3"
@ -302,7 +305,8 @@
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPreventDNSLeaks}" />
Text="{x:Static resx:ResUI.TbBlockSVCBHTTPSQueriesTips}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="4"
@ -325,7 +329,8 @@
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbValidateDirectExpectedIPsDesc}" />
Text="{x:Static resx:ResUI.TbValidateDirectExpectedIPsDesc}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="5"