feat: 优化日志, Loon 解析器自动读取 build

This commit is contained in:
xream 2025-03-25 23:58:28 +08:00
parent 543641de9d
commit 9568f4d6d9
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.19.7", "version": "2.19.8",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -361,10 +361,12 @@ function vless(proxy, includeUnsupportedProxy) {
['xtls-rprx-vision'].includes(proxy.flow) ['xtls-rprx-vision'].includes(proxy.flow)
) { ) {
isReality = true; isReality = true;
} else if (proxy['reality-opts'] || proxy.flow) { } else if (proxy['reality-opts']) {
throw new Error( throw new Error(
`VLESS XTLS/REALITY with flow(${proxy.flow}) is not supported`, `VLESS REALITY with flow(${proxy.flow}) is not supported`,
); );
} else if (proxy.flow) {
throw new Error(`VLESS XTLS is not supported`);
} }
} }
const result = new Result(proxy); const result = new Result(proxy);
@ -416,6 +418,7 @@ function vless(proxy, includeUnsupportedProxy) {
// sni // sni
if (isReality) { if (isReality) {
result.appendIfPresent(`,flow=${proxy.flow}`, 'flow');
result.appendIfPresent(`,sni=${proxy.sni}`, 'sni'); result.appendIfPresent(`,sni=${proxy.sni}`, 'sni');
result.appendIfPresent( result.appendIfPresent(
`,public-key="${proxy['reality-opts']['public-key']}"`, `,public-key="${proxy['reality-opts']['public-key']}"`,

View File

@ -14,10 +14,12 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : '';
` `
Sub-Store -- v${version} Sub-Store -- v${version}
Loon -- ${$loon}
`, `,
); );
const build = $loon.match(/\((\d+)\)$/)?.[1];
let arg; let arg;
if (typeof $argument != 'undefined') { if (typeof $argument != 'undefined') {
arg = Object.fromEntries( arg = Object.fromEntries(
@ -38,7 +40,8 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : '';
try { try {
let proxies = ProxyUtils.parse(resource); let proxies = ProxyUtils.parse(resource);
result = ProxyUtils.produce(proxies, 'Loon', undefined, { result = ProxyUtils.produce(proxies, 'Loon', undefined, {
'include-unsupported-proxy': arg?.includeUnsupportedProxy, 'include-unsupported-proxy':
arg?.includeUnsupportedProxy || build >= 838,
}); });
} catch (e) { } catch (e) {
console.log('解析器: 使用 resource 出现错误'); console.log('解析器: 使用 resource 出现错误');