Add SagerNet/v2ray-core support

This commit is contained in:
InterestingDarkness 2022-07-29 20:11:39 +08:00
parent ad8afa0d3d
commit bbd8ef1f26
4 changed files with 21 additions and 1 deletions

View file

@ -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<string> vmessSecuritys = new List<string> { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" };
public static readonly List<string> ssSecuritys = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
public static readonly List<string> ssSecuritysInSagerNet = new List<string> { "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<string> ssSecuritysInXray = new List<string> { "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<string> xtlsFlows = new List<string> { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443" };
public static readonly List<string> networks = new List<string> { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
public static readonly List<string> kcpHeaderTypes = new List<string> { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
public static readonly List<string> coreTypes = new List<string> { "v2fly", "Xray" };
public static readonly List<string> coreTypes = new List<string> { "v2fly", "SagerNet", "Xray" };
public const string GrpcgunMode = "gun";
public const string GrpcmultiMode = "multi";

View file

@ -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<string> { "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,

View file

@ -949,6 +949,7 @@ namespace v2rayN.Handler
switch (coreType)
{
case ECoreType.v2fly:
case ECoreType.SagerNet:
case ECoreType.Xray:
break;
case ECoreType.clash:

View file

@ -5,6 +5,7 @@ namespace v2rayN.Mode
{
v2fly = 1,
Xray = 2,
SagerNet = 3,
clash = 11,
clash_meta = 12,
hysteria = 21,