mirror of
https://github.com/2dust/v2rayN.git
synced 2025-09-18 07:53:04 +00:00
parent
ec627bdb82
commit
cb182125f6
1 changed files with 15 additions and 9 deletions
|
@ -72,11 +72,6 @@ public partial class CoreConfigSingboxService
|
||||||
}
|
}
|
||||||
|
|
||||||
var hostsDomains = new List<string>();
|
var hostsDomains = new List<string>();
|
||||||
var systemHostsMap = Utils.GetSystemHosts();
|
|
||||||
foreach (var kvp in systemHostsMap)
|
|
||||||
{
|
|
||||||
hostsDomains.Add(kvp.Key);
|
|
||||||
}
|
|
||||||
var dnsItem = await AppManager.Instance.GetDNSItem(ECoreType.sing_box);
|
var dnsItem = await AppManager.Instance.GetDNSItem(ECoreType.sing_box);
|
||||||
if (dnsItem == null || dnsItem.Enabled == false)
|
if (dnsItem == null || dnsItem.Enabled == false)
|
||||||
{
|
{
|
||||||
|
@ -89,12 +84,23 @@ public partial class CoreConfigSingboxService
|
||||||
hostsDomains.Add(kvp.Key);
|
hostsDomains.Add(kvp.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (simpleDNSItem.UseSystemHosts == true)
|
||||||
|
{
|
||||||
|
var systemHostsMap = Utils.GetSystemHosts();
|
||||||
|
foreach (var kvp in systemHostsMap)
|
||||||
|
{
|
||||||
|
hostsDomains.Add(kvp.Key);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
singboxConfig.route.rules.Add(new()
|
if (hostsDomains.Count > 0)
|
||||||
{
|
{
|
||||||
action = "resolve",
|
singboxConfig.route.rules.Add(new()
|
||||||
domain = hostsDomains,
|
{
|
||||||
});
|
action = "resolve",
|
||||||
|
domain = hostsDomains,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
singboxConfig.route.rules.Add(new()
|
singboxConfig.route.rules.Add(new()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue