From 9f39a0ddb4177f1a325f605d64e90c2165b0d240 Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Wed, 2 Mar 2022 13:39:09 +0800 Subject: [PATCH] auto aead --- Scripts/resource-parser.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index a050c45..22b8e61 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1,5 +1,5 @@ /** -☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-03-01 20:35⟧ +☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-03-02 13:45⟧ ---------------------------------------------------------- 🛠 发现 𝐁𝐔𝐆 请反馈: @ShawnKOP_bot ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API @@ -15,7 +15,7 @@ ---------------------------------------------------------- 0️⃣ 在 ⟦订阅链接⟧ 后加 "#" 使用, 不同参数用 "&" 连接 ⚠️ ☞ “你的订阅连接”#emoji=1&tfo=1&in=香港+台湾 -❖ 本地资源片段引用, 请将参数如 "#𝗶𝗻=𝘅𝘅𝘅." 填入文件第 ① 行 +❖ 本地资源片段引用, 请将参数如 "#in=𝘅𝘅𝘅&out=yyy" 填入文件第 ① 行 ❖ 🚦 支持中文, "操作" 以下特殊字符时请先替换 🚦 ∎ "+"⇒"%2B", 空格⇒"%20", "@"⇒"%40", "&"⇒"%26", "."⇒"\." @@ -1362,7 +1362,10 @@ function VR2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { var tls13 = PTls13 == 1 ? "tls13=true, " : "" obfs = obfs + cert + tls13 } - node = node + obfs + tag + if (subs.indexOf("alterId=") != -1) { + caead = Number(subs.split("alterId=")[1].split("&")[0]) != 0 ? "aead=false, " : "" + } + node = node + obfs +caead+ tag return node } @@ -1388,10 +1391,11 @@ function V2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { udp = Pudp == 1 ? "udp-relay=false" : "udp-relay=false"; tfo = Ptfo == 1 ? "fast-open=true" : "fast-open=false"; obfs = Pobfs(ss, cert, tls13); + caead = ss.aid && ss.aid != "0" ? "aead=false" : "aead=true"; //aead 选项 if (obfs == "" || obfs == undefined) { - nss.push(ip, mtd, pwd, tfo, udp, tag) + nss.push(ip, mtd, pwd, tfo, udp, caead, tag) } else if(obfs != "NOT-SUPPORTTED"){ - nss.push(ip, mtd, pwd, obfs, tfo, udp, tag); + nss.push(ip, mtd, pwd, obfs, tfo, udp, caead, tag); } QX = nss.join(", "); }