mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-27 02:34:41 +00:00
Compare commits
1 commit
a145b546e0
...
330044e5df
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
330044e5df |
4 changed files with 15 additions and 34 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>7.14.10</Version>
|
<Version>7.14.9</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
|
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.6" />
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.5" />
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="11.3.6" />
|
<PackageVersion Include="Avalonia.Desktop" Version="11.3.5" />
|
||||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.6" />
|
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.5" />
|
||||||
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.3.6" />
|
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.3.5" />
|
||||||
<PackageVersion Include="CliWrap" Version="3.9.0" />
|
<PackageVersion Include="CliWrap" Version="3.9.0" />
|
||||||
<PackageVersion Include="Downloader" Version="4.0.3" />
|
<PackageVersion Include="Downloader" Version="4.0.3" />
|
||||||
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.0" />
|
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.0" />
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,11 @@ 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)
|
||||||
{
|
{
|
||||||
|
|
@ -84,23 +89,12 @@ 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (hostsDomains.Count > 0)
|
singboxConfig.route.rules.Add(new()
|
||||||
{
|
{
|
||||||
singboxConfig.route.rules.Add(new()
|
action = "resolve",
|
||||||
{
|
domain = hostsDomains,
|
||||||
action = "resolve",
|
});
|
||||||
domain = hostsDomains,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
singboxConfig.route.rules.Add(new()
|
singboxConfig.route.rules.Add(new()
|
||||||
{
|
{
|
||||||
|
|
@ -374,13 +368,6 @@ public partial class CoreConfigSingboxService
|
||||||
return Global.ProxyTag;
|
return Global.ProxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tag = Global.ProxyTag + node.IndexId.ToString();
|
|
||||||
if (singboxConfig.outbounds.Any(o => o.tag == tag)
|
|
||||||
|| (singboxConfig.endpoints != null && singboxConfig.endpoints.Any(e => e.tag == tag)))
|
|
||||||
{
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
var server = await GenServer(node);
|
var server = await GenServer(node);
|
||||||
if (server is null)
|
if (server is null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -131,16 +131,10 @@ public partial class CoreConfigV2rayService
|
||||||
return Global.ProxyTag;
|
return Global.ProxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tag = Global.ProxyTag + node.IndexId.ToString();
|
|
||||||
if (v2rayConfig.outbounds.Any(p => p.tag == tag))
|
|
||||||
{
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
var txtOutbound = EmbedUtils.GetEmbedText(Global.V2raySampleOutbound);
|
var txtOutbound = EmbedUtils.GetEmbedText(Global.V2raySampleOutbound);
|
||||||
var outbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
|
var outbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
|
||||||
await GenOutbound(node, outbound);
|
await GenOutbound(node, outbound);
|
||||||
outbound.tag = tag;
|
outbound.tag = Global.ProxyTag + node.IndexId.ToString();
|
||||||
v2rayConfig.outbounds.Add(outbound);
|
v2rayConfig.outbounds.Add(outbound);
|
||||||
|
|
||||||
return outbound.tag;
|
return outbound.tag;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue