diff --git a/v2rayN/ServiceLib/Enums/ECoreType.cs b/v2rayN/ServiceLib/Enums/ECoreType.cs index de29b55c..cd93e7b9 100644 --- a/v2rayN/ServiceLib/Enums/ECoreType.cs +++ b/v2rayN/ServiceLib/Enums/ECoreType.cs @@ -5,9 +5,7 @@ v2fly = 1, Xray = 2, v2fly_v5 = 4, - mihomo = 13, - hysteria = 21, naiveproxy = 22, tuic = 23, diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index c0518b42..1dbff452 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -182,8 +182,7 @@ public static readonly List Flows = new() { "", "xtls-rprx-vision", "xtls-rprx-vision-udp443" }; public static readonly List Networks = new() { "tcp", "kcp", "ws", "httpupgrade", "xhttp", "h2", "quic", "grpc" }; public static readonly List KcpHeaderTypes = new() { "srtp", "utp", "wechat-video", "dtls", "wireguard" }; - public static readonly List CoreTypes = new() { "v2fly", "Xray", "sing_box" }; - public static readonly List CoreTypes4VLESS = new() { "Xray", "sing_box" }; + public static readonly List CoreTypes = new() { "Xray", "sing_box" }; public static readonly List DomainStrategies = new() { "AsIs", "IPIfNonMatch", "IPOnDemand" }; public static readonly List DomainStrategies4Singbox = new() { "ipv4_only", "ipv6_only", "prefer_ipv4", "prefer_ipv6", "" }; public static readonly List DomainMatchers = new() { "linear", "mph", "" }; diff --git a/v2rayN/ServiceLib/Handler/AppHandler.cs b/v2rayN/ServiceLib/Handler/AppHandler.cs index 447c31f9..ddc72d06 100644 --- a/v2rayN/ServiceLib/Handler/AppHandler.cs +++ b/v2rayN/ServiceLib/Handler/AppHandler.cs @@ -264,16 +264,8 @@ return (ECoreType)profileItem.CoreType; } - if (_config.CoreTypeItem == null) - { - return ECoreType.Xray; - } - var item = _config.CoreTypeItem.FirstOrDefault(it => it.ConfigType == eConfigType); - if (item == null) - { - return ECoreType.Xray; - } - return item.CoreType; + var item = _config.CoreTypeItem?.FirstOrDefault(it => it.ConfigType == eConfigType); + return item?.CoreType ?? ECoreType.Xray; } #endregion Core Type diff --git a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs index e9f00be9..008d6e6b 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs @@ -26,20 +26,10 @@ namespace v2rayN.Desktop.Views ViewModel = new AddServerViewModel(profileItem, UpdateViewHandler); - if (profileItem.ConfigType == EConfigType.VLESS) + Global.CoreTypes.ForEach(it => { - Global.CoreTypes4VLESS.ForEach(it => - { - cmbCoreType.Items.Add(it); - }); - } - else - { - Global.CoreTypes.ForEach(it => - { - cmbCoreType.Items.Add(it); - }); - } + cmbCoreType.Items.Add(it); + }); cmbCoreType.Items.Add(string.Empty); cmbStreamSecurity.Items.Add(string.Empty); diff --git a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs index 80b26896..11c68424 100644 --- a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs @@ -20,20 +20,10 @@ namespace v2rayN.Views ViewModel = new AddServerViewModel(profileItem, UpdateViewHandler); - if (profileItem.ConfigType == EConfigType.VLESS) + Global.CoreTypes.ForEach(it => { - Global.CoreTypes4VLESS.ForEach(it => - { - cmbCoreType.Items.Add(it); - }); - } - else - { - Global.CoreTypes.ForEach(it => - { - cmbCoreType.Items.Add(it); - }); - } + cmbCoreType.Items.Add(it); + }); cmbCoreType.Items.Add(string.Empty); cmbStreamSecurity.Items.Add(string.Empty);