mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4f646af0c | ||
|
|
532be2ff8c |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.19.54",
|
"version": "2.19.56",
|
||||||
"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": {
|
||||||
|
|||||||
@@ -44,11 +44,9 @@ export default function Stash_Producer() {
|
|||||||
'2022-blake3-aes-256-gcm',
|
'2022-blake3-aes-256-gcm',
|
||||||
].includes(proxy.cipher)) ||
|
].includes(proxy.cipher)) ||
|
||||||
(proxy.type === 'snell' && String(proxy.version) === '4') ||
|
(proxy.type === 'snell' && String(proxy.version) === '4') ||
|
||||||
(opts['include-unsupported-proxy']
|
(proxy.type === 'vless' &&
|
||||||
? proxy.type === 'vless' &&
|
proxy['reality-opts'] &&
|
||||||
proxy['reality-opts'] &&
|
!['xtls-rprx-vision'].includes(proxy.flow))
|
||||||
!['xtls-rprx-vision'].includes(proxy.flow)
|
|
||||||
: proxy.type === 'vless' && proxy['reality-opts'])
|
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
} else if (proxy['underlying-proxy'] || proxy['dialer-proxy']) {
|
} else if (proxy['underlying-proxy'] || proxy['dialer-proxy']) {
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ async function getFile(req, res) {
|
|||||||
proxy,
|
proxy,
|
||||||
noCache,
|
noCache,
|
||||||
produceType,
|
produceType,
|
||||||
|
all: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -184,9 +185,15 @@ async function getFile(req, res) {
|
|||||||
)}`,
|
)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
res.set('Content-Type', 'text/plain; charset=utf-8').send(
|
res.set('Content-Type', 'text/plain; charset=utf-8');
|
||||||
output ?? '',
|
if (output?.$options?._res?.headers) {
|
||||||
);
|
Object.entries(output.$options._res.headers).forEach(
|
||||||
|
([key, value]) => {
|
||||||
|
res.set(key, value);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
res.send(output?.$content ?? '');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
$.notify(
|
$.notify(
|
||||||
`🌍 Sub-Store 下载文件失败`,
|
`🌍 Sub-Store 下载文件失败`,
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ async function produceArtifact({
|
|||||||
$options,
|
$options,
|
||||||
proxy,
|
proxy,
|
||||||
noCache,
|
noCache,
|
||||||
|
all,
|
||||||
}) {
|
}) {
|
||||||
platform = platform || 'JSON';
|
platform = platform || 'JSON';
|
||||||
|
|
||||||
@@ -595,7 +596,7 @@ async function produceArtifact({
|
|||||||
)
|
)
|
||||||
: { $content: filesContent, $files: files, $options };
|
: { $content: filesContent, $files: files, $options };
|
||||||
|
|
||||||
return processed?.$content ?? '';
|
return (all ? processed : processed?.$content) ?? '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,41 +61,41 @@ export function getPlatformFromHeaders(headers) {
|
|||||||
return getPlatformFromUserAgent({ ua, UA, accept });
|
return getPlatformFromUserAgent({ ua, UA, accept });
|
||||||
}
|
}
|
||||||
export function shouldIncludeUnsupportedProxy(platform, ua) {
|
export function shouldIncludeUnsupportedProxy(platform, ua) {
|
||||||
try {
|
// try {
|
||||||
const target = getPlatformFromUserAgent({
|
// const target = getPlatformFromUserAgent({
|
||||||
UA: ua,
|
// UA: ua,
|
||||||
ua: ua.toLowerCase(),
|
// ua: ua.toLowerCase(),
|
||||||
});
|
// });
|
||||||
if (!['Stash', 'Egern', 'Loon'].includes(target)) {
|
// if (!['Stash', 'Egern', 'Loon'].includes(target)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
const coerceVersion = coerce(ua);
|
// const coerceVersion = coerce(ua);
|
||||||
$.log(JSON.stringify(coerceVersion, null, 2));
|
// $.log(JSON.stringify(coerceVersion, null, 2));
|
||||||
const { version } = coerceVersion;
|
// const { version } = coerceVersion;
|
||||||
if (
|
// if (
|
||||||
platform === 'Stash' &&
|
// platform === 'Stash' &&
|
||||||
target === 'Stash' &&
|
// target === 'Stash' &&
|
||||||
gte(version, '3.1.0')
|
// gte(version, '3.1.0')
|
||||||
) {
|
// ) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
if (
|
// if (
|
||||||
platform === 'Egern' &&
|
// platform === 'Egern' &&
|
||||||
target === 'Egern' &&
|
// target === 'Egern' &&
|
||||||
gte(version, '1.29.0')
|
// gte(version, '1.29.0')
|
||||||
) {
|
// ) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
// Loon 的 UA 不规范, version 取出来是 build
|
// // Loon 的 UA 不规范, version 取出来是 build
|
||||||
if (
|
// if (
|
||||||
platform === 'Loon' &&
|
// platform === 'Loon' &&
|
||||||
target === 'Loon' &&
|
// target === 'Loon' &&
|
||||||
gte(version, '842.0.0')
|
// gte(version, '842.0.0')
|
||||||
) {
|
// ) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
$.error(`获取版本号失败: ${e}`);
|
// $.error(`获取版本号失败: ${e}`);
|
||||||
}
|
// }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,15 @@ function operator(proxies = [], targetPlatform, context) {
|
|||||||
// }
|
// }
|
||||||
// console.log($options)
|
// console.log($options)
|
||||||
|
|
||||||
|
// 若设置 $options._res.headers
|
||||||
|
// 则会在输出文件时设置响应头, 例如:
|
||||||
|
|
||||||
|
// $options._res = {
|
||||||
|
// headers: {
|
||||||
|
// 'X-Custom': '1'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// targetPlatform 为输出的目标平台
|
// targetPlatform 为输出的目标平台
|
||||||
|
|
||||||
// lodash
|
// lodash
|
||||||
|
|||||||
Reference in New Issue
Block a user