mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-28 19:12:51 +00:00
Compare commits
1 commit
5851785156
...
9e985c31cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e985c31cc |
2 changed files with 14 additions and 29 deletions
|
|
@ -338,20 +338,6 @@ public partial class CoreConfigSingboxService
|
||||||
|
|
||||||
var node = await AppManager.Instance.GetProfileItemViaRemarks(outboundTag);
|
var node = await AppManager.Instance.GetProfileItemViaRemarks(outboundTag);
|
||||||
|
|
||||||
if (node == null
|
|
||||||
|| (!Global.SingboxSupportConfigType.Contains(node.ConfigType)
|
|
||||||
&& node.ConfigType is not (EConfigType.PolicyGroup or EConfigType.ProxyChain)))
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.ConfigType is EConfigType.PolicyGroup or EConfigType.ProxyChain)
|
if (node.ConfigType is EConfigType.PolicyGroup or EConfigType.ProxyChain)
|
||||||
{
|
{
|
||||||
ProfileGroupItemManager.Instance.TryGet(node.IndexId, out var profileGroupItem);
|
ProfileGroupItemManager.Instance.TryGet(node.IndexId, out var profileGroupItem);
|
||||||
|
|
@ -384,13 +370,19 @@ public partial class CoreConfigSingboxService
|
||||||
return Global.ProxyTag;
|
return Global.ProxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node == null
|
||||||
|
|| !Global.SingboxSupportConfigType.Contains(node.ConfigType))
|
||||||
|
{
|
||||||
|
return Global.ProxyTag;
|
||||||
|
}
|
||||||
|
|
||||||
var server = await GenServer(node);
|
var server = await GenServer(node);
|
||||||
if (server is null)
|
if (server is null)
|
||||||
{
|
{
|
||||||
return Global.ProxyTag;
|
return Global.ProxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
server.tag = tag;
|
server.tag = Global.ProxyTag + node.IndexId.ToString();
|
||||||
if (server is Endpoints4Sbox endpoint)
|
if (server is Endpoints4Sbox endpoint)
|
||||||
{
|
{
|
||||||
singboxConfig.endpoints ??= new();
|
singboxConfig.endpoints ??= new();
|
||||||
|
|
|
||||||
|
|
@ -126,19 +126,6 @@ public partial class CoreConfigV2rayService
|
||||||
|
|
||||||
var node = await AppManager.Instance.GetProfileItemViaRemarks(outboundTag);
|
var node = await AppManager.Instance.GetProfileItemViaRemarks(outboundTag);
|
||||||
|
|
||||||
if (node == null
|
|
||||||
|| (!Global.XraySupportConfigType.Contains(node.ConfigType)
|
|
||||||
&& node.ConfigType is not (EConfigType.PolicyGroup or EConfigType.ProxyChain)))
|
|
||||||
{
|
|
||||||
return Global.ProxyTag;
|
|
||||||
}
|
|
||||||
|
|
||||||
var tag = Global.ProxyTag + node.IndexId.ToString();
|
|
||||||
if (v2rayConfig.outbounds.Any(p => p.tag == tag))
|
|
||||||
{
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.ConfigType is EConfigType.PolicyGroup or EConfigType.ProxyChain)
|
if (node.ConfigType is EConfigType.PolicyGroup or EConfigType.ProxyChain)
|
||||||
{
|
{
|
||||||
ProfileGroupItemManager.Instance.TryGet(node.IndexId, out var profileGroupItem);
|
ProfileGroupItemManager.Instance.TryGet(node.IndexId, out var profileGroupItem);
|
||||||
|
|
@ -175,10 +162,16 @@ public partial class CoreConfigV2rayService
|
||||||
return Global.ProxyTag;
|
return Global.ProxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node == null
|
||||||
|
|| !Global.XraySupportConfigType.Contains(node.ConfigType))
|
||||||
|
{
|
||||||
|
return Global.ProxyTag;
|
||||||
|
}
|
||||||
|
|
||||||
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