diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 9b3a1dec..feb36602 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -13,6 +13,7 @@ namespace v2rayN public const string UpdateUrl = AboutUrl + @"/releases"; public const string v2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases"; public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases"; + public const string SagerNetCoreUrl = "https://github.com/SagerNet/v2ray-core/releases"; public const string NUrl = @"https://github.com/2dust/v2rayN/releases"; public const string clashCoreUrl = "https://github.com/Dreamacro/clash/releases"; public const string clashMetaCoreUrl = "https://github.com/MetaCubeX/Clash.Meta/releases"; @@ -207,11 +208,12 @@ 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 ssSecuritysInSagerNet = new List { "none", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "rc4", "rc4-md5", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-cfb8", "aes-192-cfb8", "aes-256-cfb8", "aes-128-ofb", "aes-192-ofb", "aes-256-ofb", "bf-cfb", "cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "camellia-128-cfb8", "camellia-192-cfb8", "camellia-256-cfb8", "salsa20", "chacha20", "chacha20-ietf", "xchacha20" }; 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", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" }; 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" }; - public static readonly List coreTypes = new List { "v2fly", "Xray" }; + public static readonly List coreTypes = new List { "v2fly", "SagerNet", "Xray" }; public const string GrpcgunMode = "gun"; public const string GrpcmultiMode = "multi"; diff --git a/v2rayN/v2rayN/Handler/LazyConfig.cs b/v2rayN/v2rayN/Handler/LazyConfig.cs index 5e18ebc9..d907ec3b 100644 --- a/v2rayN/v2rayN/Handler/LazyConfig.cs +++ b/v2rayN/v2rayN/Handler/LazyConfig.cs @@ -28,6 +28,10 @@ namespace v2rayN.Handler { return Global.ssSecuritys; } + if (GetCoreType(null, EConfigType.Shadowsocks) == ECoreType.SagerNet) + { + return Global.ssSecuritysInSagerNet; + } return Global.ssSecuritysInXray; } @@ -85,6 +89,18 @@ namespace v2rayN.Handler match = "V2Ray" }); + coreInfos.Add(new CoreInfo + { + coreType = ECoreType.SagerNet, + coreExes = new List { "v2ray" }, + arguments = "run", + coreUrl = Global.SagerNetCoreUrl, + coreLatestUrl = Global.SagerNetCoreUrl + "/latest", + coreDownloadUrl32 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip", + coreDownloadUrl64 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip", + match = "V2Ray" + }); + coreInfos.Add(new CoreInfo { coreType = ECoreType.Xray, diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 97f5abf5..8596b9a2 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -949,6 +949,7 @@ namespace v2rayN.Handler switch (coreType) { case ECoreType.v2fly: + case ECoreType.SagerNet: case ECoreType.Xray: break; case ECoreType.clash: diff --git a/v2rayN/v2rayN/Mode/ECoreType.cs b/v2rayN/v2rayN/Mode/ECoreType.cs index 8f754fed..74d72756 100644 --- a/v2rayN/v2rayN/Mode/ECoreType.cs +++ b/v2rayN/v2rayN/Mode/ECoreType.cs @@ -5,6 +5,7 @@ namespace v2rayN.Mode { v2fly = 1, Xray = 2, + SagerNet = 3, clash = 11, clash_meta = 12, hysteria = 21,