diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua index 7718e3edd..7cb119bb9 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua @@ -18,7 +18,7 @@ local function _n(name) end local ss_method_list = { - "aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "xchacha20-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" + "aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" } local security_list = { "none", "auto", "aes-128-gcm", "chacha20-poly1305", "zero" } diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index d26ac1b12..bd8ff36c4 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -246,7 +246,9 @@ function gen_outbound(flag, node, tag, proxy_table) { address = node.address, port = tonumber(node.port), - method = node.method or nil, + method = (node.method == "chacha20-ietf-poly1305" and "chacha20-poly1305") or + (node.method == "xchacha20-ietf-poly1305" and "xchacha20-poly1305") or + (node.method ~= "" and node.method) or nil, ivCheck = (node.protocol == "shadowsocks") and node.iv_check == "1" or nil, uot = (node.protocol == "shadowsocks") and node.uot == "1" or nil, password = node.password or "", diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm b/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm index 250836ca8..5177cf8f7 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm @@ -766,17 +766,19 @@ local hysteria2_type = uci:get(appname, "@global_subscribe[0]", "hysteria2_type" dom_prefix = "xray_" opt.set('type', "Xray"); opt.set(dom_prefix + 'protocol', "shadowsocks"); - method = method.toLowerCase() === "chacha20-ietf-poly1305" ? "chacha20-poly1305" : method; } else { if (["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"].includes(method)) { dom_prefix = "ssrust_" opt.set('type', "SS-Rust"); - method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method; } else { dom_prefix = "ss_" opt.set('type', "SS"); } } + if (ss_type !== "xray") { + method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method; + method = method.toLowerCase() === "xchacha20-poly1305" ? "xchacha20-ietf-poly1305" : method; + } opt.set(dom_prefix + 'address', server); opt.set(dom_prefix + 'port', port); opt.set(dom_prefix + 'password', password || ""); @@ -903,6 +905,10 @@ local hysteria2_type = uci:get(appname, "@global_subscribe[0]", "hysteria2_type" dom_prefix = "ss_" opt.set('type', "SS"); } + if (ss_type !== "xray") { + method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method; + method = method.toLowerCase() === "xchacha20-poly1305" ? "xchacha20-ietf-poly1305" : method; + } var sstr = b64decsafe(url0); var team = sstr.split('@'); var part1 = team[0].split(':'); diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index 305887710..a0232d607 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -639,12 +639,9 @@ local function processData(szType, content, add_mode, add_from) result.protocol = 'shadowsocks' end - if result.type == "SS-Rust" and method:lower() == "chacha20-poly1305" then - result.method = "chacha20-ietf-poly1305" - end - - if result.type == "Xray" and method:lower() == "chacha20-ietf-poly1305" then - result.method = "chacha20-poly1305" + if result.type ~= "Xray" then + result.method = (method:lower() == "chacha20-poly1305" and "chacha20-ietf-poly1305") or + (method:lower() == "xchacha20-poly1305" and "xchacha20-ietf-poly1305") or method end if result.plugin then