diff --git a/v2rayN/v2rayN/Forms/AddServer3Form.cs b/v2rayN/v2rayN/Forms/AddServer3Form.cs index bd076170..e4920b37 100644 --- a/v2rayN/v2rayN/Forms/AddServer3Form.cs +++ b/v2rayN/v2rayN/Forms/AddServer3Form.cs @@ -15,7 +15,7 @@ namespace v2rayN.Forms private void AddServer3Form_Load(object sender, EventArgs e) { - cmbSecurity.Items.AddRange(Global.ssSecuritys.ToArray()); + cmbSecurity.Items.AddRange(config.GetShadowsocksSecuritys().ToArray()); if (EditIndex >= 0) { vmessItem = config.vmess[EditIndex]; diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 879d20ea..979d8b82 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -195,6 +195,7 @@ namespace v2rayN public static readonly List vmessSecuritys = new List { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" }; public static readonly List ssSecuritys = new List { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" }; + public static readonly List ssSecuritysInXray = new List { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain" }; public static readonly List xtlsFlows = new List { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443" }; public static readonly List networks = new List { "tcp", "kcp", "ws", "h2", "quic", "grpc" }; public static readonly List kcpHeaderTypes = new List { "srtp", "utp", "wechat-video", "dtls", "wireguard" }; diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index ea720624..45284b21 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -540,7 +540,7 @@ namespace v2rayN.Handler vmessItem.id = vmessItem.id.TrimEx(); vmessItem.security = vmessItem.security.TrimEx(); - if (!Global.ssSecuritys.Contains(vmessItem.security)) + if (!config.GetShadowsocksSecuritys().Contains(vmessItem.security)) { return -1; } diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 452aed06..7af5ea3f 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -401,7 +401,7 @@ namespace v2rayN.Handler serversItem.address = config.address(); serversItem.port = config.port(); serversItem.password = config.id(); - if (Global.ssSecuritys.Contains(config.security())) + if (config.GetShadowsocksSecuritys().Contains(config.security())) { serversItem.method = config.security(); } diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index 6293fcc7..41e6c0ac 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -404,6 +404,16 @@ namespace v2rayN.Mode } return vmess.FindIndex(it => it.indexId == indexId); } + + public List GetShadowsocksSecuritys() + { + if (coreType == ECoreType.v2fly_core) + { + return Global.ssSecuritys; + } + + return Global.ssSecuritysInXray; + } #endregion