sub-store-convert 2.39.6 → 2.44.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +45 -14
- package/package.json +6 -1
package/index.js
CHANGED
|
@@ -2557,6 +2557,7 @@ var grammars2 = String.raw`
|
|
|
2557
2557
|
function loonClientFingerprint(tlsProfile) {
|
|
2558
2558
|
switch (String(tlsProfile || "").trim()) {
|
|
2559
2559
|
case "chrome":
|
|
2560
|
+
case "chrome147":
|
|
2560
2561
|
return "chrome";
|
|
2561
2562
|
case "ios18":
|
|
2562
2563
|
case "ios26":
|
|
@@ -2756,12 +2757,19 @@ max_stream_count = comma "max-stream-count" equals match:$[0-9]+ { proxy["max-st
|
|
|
2756
2757
|
|
|
2757
2758
|
udp_over_tcp = comma "udp-over-tcp" equals flag:bool { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 2; }
|
|
2758
2759
|
|
|
2760
|
+
server_dns = comma "server-dns" equals value:(
|
|
2761
|
+
'"' match:$[^"]* '"' { return match; }
|
|
2762
|
+
/ $(!(comma [a-zA-Z0-9_-]+ equals) [^"])*
|
|
2763
|
+
) {
|
|
2764
|
+
proxy["server-dns"] = value.split(",").map((item) => item.trim()).filter(Boolean);
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2759
2767
|
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
|
|
2760
2768
|
comma = _ "," _
|
|
2761
2769
|
equals = _ "=" _
|
|
2762
2770
|
_ = [ \r\t]*
|
|
2763
2771
|
bool = b:("true"/"false") { return b === "true" }
|
|
2764
|
-
others = comma [^=,]+ equals [^=,]+
|
|
2772
|
+
others = server_dns / (comma [^=,]+ equals [^=,]+)
|
|
2765
2773
|
`;
|
|
2766
2774
|
var parser2;
|
|
2767
2775
|
function getParser2() {
|
|
@@ -5443,6 +5451,14 @@ function URI_VLESS() {
|
|
|
5443
5451
|
if (params.pqv) {
|
|
5444
5452
|
proxy._pqv = params.pqv;
|
|
5445
5453
|
}
|
|
5454
|
+
if (params.fm) {
|
|
5455
|
+
try {
|
|
5456
|
+
const finalmask = JSON.parse(params.fm);
|
|
5457
|
+
proxy._finalmask = isPlainObject(finalmask) ? finalmask : params.fm;
|
|
5458
|
+
} catch (e) {
|
|
5459
|
+
proxy._finalmask = params.fm;
|
|
5460
|
+
}
|
|
5461
|
+
}
|
|
5446
5462
|
return proxy;
|
|
5447
5463
|
};
|
|
5448
5464
|
return { name, test, parse: parse2 };
|
|
@@ -6079,6 +6095,9 @@ function Loon_WireGuard() {
|
|
|
6079
6095
|
reserved = JSON.parse(reserved);
|
|
6080
6096
|
}
|
|
6081
6097
|
let dns;
|
|
6098
|
+
const serverDns = line.match(
|
|
6099
|
+
/(?:^|,)\s*server-dns\s*=\s*(?:"([^"]*)"|([^"]*?))(?=\s*(?:,\s*[\w-]+\s*=|$))/i
|
|
6100
|
+
);
|
|
6082
6101
|
let dnsv4 = line.match(/(,|^)\s*?dns\s*?=\s*?"?(.+?)"?\s*?(,|$)/i)?.[2];
|
|
6083
6102
|
let dnsv6 = line.match(
|
|
6084
6103
|
/(,|^)\s*?dnsv6\s*?=\s*?"?(.+?)"?\s*?(,|$)/i
|
|
@@ -6122,6 +6141,7 @@ function Loon_WireGuard() {
|
|
|
6122
6141
|
"allowed-ips": allowedIps,
|
|
6123
6142
|
"preshared-key": preSharedKey,
|
|
6124
6143
|
dns,
|
|
6144
|
+
"server-dns": (serverDns?.[1] ?? serverDns?.[2])?.split(",").map((item) => item.trim()).filter(Boolean),
|
|
6125
6145
|
udp: true,
|
|
6126
6146
|
peers: [
|
|
6127
6147
|
{
|
|
@@ -6221,7 +6241,7 @@ function Surge_Trojan() {
|
|
|
6221
6241
|
const parse2 = (line) => getParser().parse(line);
|
|
6222
6242
|
return { name, test, parse: parse2 };
|
|
6223
6243
|
}
|
|
6224
|
-
var LOON_ONLY_OPTIONS = /(^|,)\s*(fast-open|over-tls|tls-name|ip-mode|tls-cert-sha256|tls-pubkey-sha256)\s*=/i;
|
|
6244
|
+
var LOON_ONLY_OPTIONS = /(^|,)\s*(fast-open|over-tls|tls-name|ip-mode|tls-cert-sha256|tls-pubkey-sha256|server-dns)\s*=/i;
|
|
6225
6245
|
function Surge_Http() {
|
|
6226
6246
|
const name = "Surge HTTP Parser";
|
|
6227
6247
|
const test = (line) => {
|
|
@@ -8708,7 +8728,13 @@ function Loon_Producer() {
|
|
|
8708
8728
|
`Platform ${targetPlatform3} does not support proxy type: ${proxy.type}`
|
|
8709
8729
|
);
|
|
8710
8730
|
};
|
|
8711
|
-
return {
|
|
8731
|
+
return {
|
|
8732
|
+
produce: (proxy, type, opts = {}) => {
|
|
8733
|
+
const result = produce2(proxy, type, opts);
|
|
8734
|
+
const serverDns = proxy["server-dns"];
|
|
8735
|
+
return Array.isArray(serverDns) && serverDns.length > 0 ? `${result},server-dns="${serverDns.join(",")}"` : result;
|
|
8736
|
+
}
|
|
8737
|
+
};
|
|
8712
8738
|
}
|
|
8713
8739
|
function appendTlsProfile(result, proxy) {
|
|
8714
8740
|
const tlsProfile = getLoonTlsProfile(proxy);
|
|
@@ -8759,12 +8785,12 @@ function getLoonAlpn(proxy) {
|
|
|
8759
8785
|
}
|
|
8760
8786
|
function getLoonTlsProfile(proxy) {
|
|
8761
8787
|
const tlsProfile = `${proxy._loon_tls_profile || ""}`.trim();
|
|
8762
|
-
if (["default", "chrome", "ios18", "ios26"].includes(tlsProfile)) {
|
|
8788
|
+
if (["default", "chrome", "chrome147", "ios18", "ios26"].includes(tlsProfile)) {
|
|
8763
8789
|
return tlsProfile;
|
|
8764
8790
|
}
|
|
8765
8791
|
switch (`${proxy["client-fingerprint"] || ""}`.trim()) {
|
|
8766
8792
|
case "chrome":
|
|
8767
|
-
return "
|
|
8793
|
+
return "chrome147";
|
|
8768
8794
|
case "ios":
|
|
8769
8795
|
return "ios26";
|
|
8770
8796
|
}
|
|
@@ -9678,17 +9704,17 @@ function mergeUnsupportedXhttpExtraObject(baseObject, unsupportedObject) {
|
|
|
9678
9704
|
}
|
|
9679
9705
|
return mergedExtra;
|
|
9680
9706
|
}
|
|
9681
|
-
function
|
|
9682
|
-
if (typeof
|
|
9683
|
-
return
|
|
9707
|
+
function serializeUriJsonValue(value) {
|
|
9708
|
+
if (typeof value === "string") {
|
|
9709
|
+
return value;
|
|
9684
9710
|
}
|
|
9685
|
-
if (isPlainObject(
|
|
9686
|
-
return JSON.stringify(
|
|
9711
|
+
if (isPlainObject(value)) {
|
|
9712
|
+
return JSON.stringify(value);
|
|
9687
9713
|
}
|
|
9688
9714
|
return void 0;
|
|
9689
9715
|
}
|
|
9690
9716
|
function buildVlessExtra(proxy) {
|
|
9691
|
-
const explicitExtraOverride =
|
|
9717
|
+
const explicitExtraOverride = serializeUriJsonValue(proxy._extra);
|
|
9692
9718
|
if (explicitExtraOverride != null) {
|
|
9693
9719
|
return explicitExtraOverride;
|
|
9694
9720
|
}
|
|
@@ -9785,6 +9811,11 @@ function vless2(proxy) {
|
|
|
9785
9811
|
if (extraPayload) {
|
|
9786
9812
|
extra = `&extra=${encodeURIComponent(extraPayload)}`;
|
|
9787
9813
|
}
|
|
9814
|
+
let fm = "";
|
|
9815
|
+
const finalmaskPayload = serializeUriJsonValue(proxy._finalmask);
|
|
9816
|
+
if (finalmaskPayload) {
|
|
9817
|
+
fm = `&fm=${encodeURIComponent(finalmaskPayload)}`;
|
|
9818
|
+
}
|
|
9788
9819
|
let mode = "";
|
|
9789
9820
|
if (["xhttp"].includes(proxy.network) && proxy[`${proxy.network}-opts`]?.mode) {
|
|
9790
9821
|
mode = `&mode=${encodeURIComponent(
|
|
@@ -9903,7 +9934,7 @@ function vless2(proxy) {
|
|
|
9903
9934
|
}
|
|
9904
9935
|
return `vless://${proxy.uuid}@${proxy.server}:${proxy.port}?security=${encodeURIComponent(
|
|
9905
9936
|
security
|
|
9906
|
-
)}${vlessTransport}${packetEncoding}${alpn}${allowInsecure}${pcs}${vcn}${ech}${h2}${sni}${fp}${flow}${sid}${spx}${pbk}${mode}${extra}${pqv}${encryption}#${encodeURIComponent(
|
|
9937
|
+
)}${vlessTransport}${packetEncoding}${alpn}${allowInsecure}${pcs}${vcn}${ech}${h2}${sni}${fp}${flow}${sid}${spx}${pbk}${mode}${extra}${fm}${pqv}${encryption}#${encodeURIComponent(
|
|
9907
9938
|
proxy.name
|
|
9908
9939
|
)}`;
|
|
9909
9940
|
}
|
|
@@ -10088,10 +10119,10 @@ function URI_Producer() {
|
|
|
10088
10119
|
result = "ssr://" + Base644.encode(result);
|
|
10089
10120
|
break;
|
|
10090
10121
|
case "vmess":
|
|
10091
|
-
if (proxy["reality-opts"]) {
|
|
10122
|
+
if (proxy["reality-opts"] || proxy._finalmask) {
|
|
10092
10123
|
if (proxy.aead === false || proxy.aead !== true && Number(proxy.alterId || 0) !== 0) {
|
|
10093
10124
|
throw new Error(
|
|
10094
|
-
"VMess
|
|
10125
|
+
"VMess query URI format cannot represent non-AEAD authentication (alterId must be 0)"
|
|
10095
10126
|
);
|
|
10096
10127
|
}
|
|
10097
10128
|
result = vless2({
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sub-store-convert",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.16",
|
|
4
4
|
"description": "Advanced Subscription Converter for QX, Loon, Surge, Stash and ShadowRocket.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/tbxark/sub-store-convert.git",
|
|
11
|
+
"directory": "packages/core"
|
|
12
|
+
},
|
|
8
13
|
"files": [
|
|
9
14
|
"index.js"
|
|
10
15
|
],
|