Skip to content

Commit

Permalink
bug fix for test shadowsocks
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jan 23, 2024
1 parent ff91a5d commit d7c1516
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion v2rayN/v2rayN/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ internal class Global
public static readonly List<string> SsSecuritys = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
public static readonly List<string> SsSecuritysInSagerNet = new() { "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() { "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> SsSecuritysInSingbox = new() { "aes-256-gcm", "aes-192-gcm", "aes-128-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "none", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "rc4-md5", "chacha20-ietf", "xchacha20" };
public static readonly List<string> Flows = new() { "", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
public static readonly List<string> Networks = new() { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
public static readonly List<string> KcpHeaderTypes = new() { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
Expand All @@ -172,7 +173,7 @@ internal class Global
public static readonly List<string> AllowInsecures = new() { "true", "false", "" };
public static readonly List<string> DomainStrategy4Freedoms = new() { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
public static readonly List<string> Languages = new() { "zh-Hans", "zh-Hant", "en", "fa-Ir", "ru" };
public static readonly List<string> Alpns = new() { "h3", "h2", "http/1.1", "h3,h2,http/1.1", "h3,h2", "h2,http/1.1", "" };
public static readonly List<string> Alpns = new() { "h3", "h2", "http/1.1", "h3,h2,http/1.1", "h3,h2", "h2,http/1.1", "" };
public static readonly List<string> LogLevels = new() { "debug", "info", "warning", "error", "none" };
public static readonly List<string> InboundTags = new() { "socks", "http", "socks2", "http2" };
public static readonly List<string> RuleProtocols = new() { "http", "tls", "bittorrent" };
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Handler/CoreConfigSingbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ public int GenerateClientSpeedtestConfig(List<ServerTestItem> selecteds, out Sin
continue;
}
if (item.configType == EConfigType.Shadowsocks
&& !Global.SsSecuritysInXray.Contains(item.security))
&& !Global.SsSecuritysInSingbox.Contains(item.security))
{
continue;
}
Expand Down
17 changes: 10 additions & 7 deletions v2rayN/v2rayN/Handler/LazyConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,18 @@ public DNSItem GetDNSItem(ECoreType eCoreType)

public List<string> GetShadowsocksSecuritys(ProfileItem profileItem)
{
if (GetCoreType(profileItem, EConfigType.Shadowsocks) == ECoreType.v2fly)
var coreType = GetCoreType(profileItem, EConfigType.Shadowsocks);
switch (coreType)
{
return Global.SsSecuritys;
}
if (GetCoreType(profileItem, EConfigType.Shadowsocks) == ECoreType.Xray)
{
return Global.SsSecuritysInXray;
}
case ECoreType.v2fly:
return Global.SsSecuritys;

case ECoreType.Xray:
return Global.SsSecuritysInXray;

case ECoreType.sing_box:
return Global.SsSecuritysInSingbox;
}
return Global.SsSecuritysInSagerNet;
}

Expand Down

0 comments on commit d7c1516

Please sign in to comment.