diff --git a/v2rayN/v2rayN/Forms/MainForm.Designer.cs b/v2rayN/v2rayN/Forms/MainForm.Designer.cs
index 6a76630c..f0fe26dc 100644
--- a/v2rayN/v2rayN/Forms/MainForm.Designer.cs
+++ b/v2rayN/v2rayN/Forms/MainForm.Designer.cs
@@ -111,6 +111,7 @@
this.tsbCheckUpdate = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbCheckUpdateN = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem();
+ this.tsbCheckUpdateSagerNetCore = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckUpdateClashCore = new System.Windows.Forms.ToolStripMenuItem();
@@ -718,6 +719,7 @@
this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbCheckUpdateN,
this.tsbCheckUpdateCore,
+ this.tsbCheckUpdateSagerNetCore,
this.tsbCheckUpdateXrayCore,
this.toolStripSeparator16,
this.tsbCheckUpdateClashCore,
@@ -740,6 +742,12 @@
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click);
//
+ // tsbCheckUpdateSagerNetCore
+ //
+ this.tsbCheckUpdateSagerNetCore.Name = "tsbCheckUpdateSagerNetCore";
+ resources.ApplyResources(this.tsbCheckUpdateSagerNetCore, "tsbCheckUpdateSagerNetCore");
+ this.tsbCheckUpdateSagerNetCore.Click += new System.EventHandler(this.tsbCheckUpdateSagerNetCore_Click);
+ //
// tsbCheckUpdateXrayCore
//
this.tsbCheckUpdateXrayCore.Name = "tsbCheckUpdateXrayCore";
@@ -972,6 +980,7 @@
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateClashMetaCore;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator16;
private System.Windows.Forms.ToolStripMenuItem menuSortServerResult;
+ private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateSagerNetCore;
}
}
diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs
index 086c41df..0c490514 100644
--- a/v2rayN/v2rayN/Forms/MainForm.cs
+++ b/v2rayN/v2rayN/Forms/MainForm.cs
@@ -1364,6 +1364,11 @@ namespace v2rayN.Forms
CheckUpdateCore(ECoreType.v2fly);
}
+ private void tsbCheckUpdateSagerNetCore_Click(object sender, EventArgs e)
+ {
+ CheckUpdateCore(ECoreType.SagerNet);
+ }
+
private void tsbCheckUpdateXrayCore_Click(object sender, EventArgs e)
{
CheckUpdateCore(ECoreType.Xray);
diff --git a/v2rayN/v2rayN/Forms/MainForm.resx b/v2rayN/v2rayN/Forms/MainForm.resx
index 5714620a..2d512adb 100644
--- a/v2rayN/v2rayN/Forms/MainForm.resx
+++ b/v2rayN/v2rayN/Forms/MainForm.resx
@@ -842,6 +842,9 @@
Update v2fly Core
+
+ 219, 22
+
219, 22
@@ -1412,6 +1415,12 @@
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ tsbCheckUpdateSagerNetCore
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
tsbCheckUpdateXrayCore
@@ -1514,4 +1523,7 @@
v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+
+ Update SagerNet Core
+
\ No newline at end of file
diff --git a/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx
index 695e1a3d..e1a374e3 100644
--- a/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx
+++ b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx
@@ -570,4 +570,7 @@
按测试结果排序 (Ctrl+E)
+
+ SagerNet-Core
+
\ No newline at end of file
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/UpdateHandle.cs b/v2rayN/v2rayN/Handler/UpdateHandle.cs
index 88ade46d..8a86892e 100644
--- a/v2rayN/v2rayN/Handler/UpdateHandle.cs
+++ b/v2rayN/v2rayN/Handler/UpdateHandle.cs
@@ -392,6 +392,7 @@ namespace v2rayN.Handler
switch (type)
{
case ECoreType.v2fly:
+ case ECoreType.SagerNet:
case ECoreType.Xray:
{
curVersion = "v" + getCoreVersion(type);
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,