diff --git a/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigSingbox.cs b/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigSingbox.cs index 69836040..b30d41a0 100644 --- a/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigSingbox.cs +++ b/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigSingbox.cs @@ -132,10 +132,10 @@ namespace ServiceLib.Handler.CoreConfig { continue; } + var item = LazyConfig.Instance.GetProfileItem(it.indexId); if (it.configType is EConfigType.VMess or EConfigType.VLESS) { - var item2 = LazyConfig.Instance.GetProfileItem(it.indexId); - if (item2 is null || Utils.IsNullOrEmpty(item2.id) || !Utils.IsGuidByParse(item2.id)) + if (item is null || Utils.IsNullOrEmpty(item.id) || !Utils.IsGuidByParse(item.id)) { continue; } @@ -178,7 +178,6 @@ namespace ServiceLib.Handler.CoreConfig singboxConfig.inbounds.Add(inbound); //outbound - var item = LazyConfig.Instance.GetProfileItem(it.indexId); if (item is null) { continue; @@ -193,6 +192,12 @@ namespace ServiceLib.Handler.CoreConfig { continue; } + if ((it.configType is EConfigType.VLESS or EConfigType.Trojan) + && item.streamSecurity == Global.StreamSecurityReality + && item.publicKey.IsNullOrEmpty()) + { + continue; + } var outbound = JsonUtils.Deserialize(txtOutbound); GenOutbound(item, outbound); diff --git a/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigV2ray.cs b/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigV2ray.cs index 15e5bcc0..72f3f8ff 100644 --- a/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigV2ray.cs +++ b/v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigV2ray.cs @@ -248,10 +248,10 @@ namespace ServiceLib.Handler.CoreConfig { continue; } + var item = LazyConfig.Instance.GetProfileItem(it.indexId); if (it.configType is EConfigType.VMess or EConfigType.VLESS) { - var item2 = LazyConfig.Instance.GetProfileItem(it.indexId); - if (item2 is null || Utils.IsNullOrEmpty(item2.id) || !Utils.IsGuidByParse(item2.id)) + if (item is null || Utils.IsNullOrEmpty(item.id) || !Utils.IsGuidByParse(item.id)) { continue; } @@ -294,7 +294,6 @@ namespace ServiceLib.Handler.CoreConfig v2rayConfig.inbounds.Add(inbound); //outbound - var item = LazyConfig.Instance.GetProfileItem(it.indexId); if (item is null) { continue; @@ -309,6 +308,12 @@ namespace ServiceLib.Handler.CoreConfig { continue; } + if ((it.configType is EConfigType.VLESS or EConfigType.Trojan) + && item.streamSecurity == Global.StreamSecurityReality + && item.publicKey.IsNullOrEmpty()) + { + continue; + } var outbound = JsonUtils.Deserialize(txtOutbound); GenOutbound(item, outbound);