| 1730 | |
| 1731 | //V2RayN uri转换成 QUANX 格式 |
| 1732 | function V2QX(subs, Pudp, Ptfo, Pcert0, PTls13) { |
| 1733 | //console.log("v2 type",subs) |
| 1734 | var cert = Pcert0 |
| 1735 | var tls13 = PTls13 |
| 1736 | var server = String(Base64.decode(subs.replace("vmess://", "")).trim()).split("\u0000")[0]; |
| 1737 | var nss = []; |
| 1738 | if (server != "") { |
| 1739 | ss = JSON.parse(server); |
| 1740 | if(Pdbg) {$notify("Vmess-URI","",JSON.stringify(ss))} |
| 1741 | ip = "vmess=" + ss.add + ":" + ss.port; |
| 1742 | pwd = "password=" + ss.id; |
| 1743 | mtd = "method=aes-128-gcm" |
| 1744 | try { |
| 1745 | tag = "tag=" + decodeURIComponent(ss.ps); |
| 1746 | } catch (e) { |
| 1747 | tag = "tag=" + ss.ps; |
| 1748 | } |
| 1749 | udp = Pudp == 1 ? "udp-relay=false" : "udp-relay=false"; |
| 1750 | tfo = Ptfo == 1 ? "fast-open=true" : "fast-open=false"; |
| 1751 | obfs = Fobfs(ss, cert, tls13); |
| 1752 | caead = ss.aid && ss.aid != "0" ? "aead=false" : "aead=true"; //aead 选项 |
| 1753 | if (obfs == "" || obfs == undefined) { |
| 1754 | nss.push(ip, mtd, pwd, tfo, udp, caead, tag) |
| 1755 | } else if(obfs != "NOT-SUPPORTTED"){ |
| 1756 | nss.push(ip, mtd, pwd, obfs, tfo, udp, caead, tag); |
| 1757 | } |
| 1758 | QX = nss.join(", "); |
| 1759 | } |
| 1760 | return QX |
| 1761 | } |
| 1762 | |
| 1763 | // Vmess obfs 参数 |
| 1764 | function Fobfs(jsonl, Pcert0, PTls13) { |