Merge pull request #2510 from InterestingDarkness/master

Add SagerNet/v2ray-core support
pull/2530/head
2dust 2022-07-30 19:17:57 +08:00 committed by GitHub
commit 19e03a1fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 51 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -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);

View File

@ -842,6 +842,9 @@
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>Update v2fly Core</value>
</data>
<data name="tsbCheckUpdateSagerNetCore.Size" type="System.Drawing.Size, System.Drawing">
<value>219, 22</value>
</data>
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
<value>219, 22</value>
</data>
@ -1412,6 +1415,12 @@
<data name="&gt;&gt;tsbCheckUpdateCore.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsbCheckUpdateSagerNetCore.Name" xml:space="preserve">
<value>tsbCheckUpdateSagerNetCore</value>
</data>
<data name="&gt;&gt;tsbCheckUpdateSagerNetCore.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsbCheckUpdateXrayCore.Name" xml:space="preserve">
<value>tsbCheckUpdateXrayCore</value>
</data>
@ -1514,4 +1523,7 @@
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="tsbCheckUpdateSagerNetCore.Text" xml:space="preserve">
<value>Update SagerNet Core</value>
</data>
</root>

View File

@ -570,4 +570,7 @@
<data name="menuSortServerResult.Text" xml:space="preserve">
<value>按测试结果排序 (Ctrl+E)</value>
</data>
<data name="tsbCheckUpdateSagerNetCore.Text" xml:space="preserve">
<value>SagerNet-Core</value>
</data>
</root>

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

@ -392,6 +392,7 @@ namespace v2rayN.Handler
switch (type)
{
case ECoreType.v2fly:
case ECoreType.SagerNet:
case ECoreType.Xray:
{
curVersion = "v" + getCoreVersion(type);

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,