feat: produceArtifact 支持 Stash internal (Fixes #271)

This commit is contained in:
xream 2024-01-17 20:31:43 +08:00
parent 059c4bd148
commit 4966132397
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 225 additions and 223 deletions

View File

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

View File

@ -2,12 +2,11 @@ import { isPresent } from '@/core/proxy-utils/producers/utils';
export default function Stash_Producer() {
const type = 'ALL';
const produce = (proxies) => {
const produce = (proxies, type, opts = {}) => {
// https://stash.wiki/proxy-protocols/proxy-types#shadowsocks
return (
'proxies:\n' +
proxies
const list = proxies
.filter((proxy) => {
if (opts['include-unsupported-proxy']) return true;
if (
![
'ss',
@ -40,8 +39,7 @@ export default function Stash_Producer() {
'chacha20-ietf-poly1305',
'xchacha20-ietf-poly1305',
].includes(proxy.cipher)) ||
(proxy.type === 'snell' &&
String(proxy.version) === '4') ||
(proxy.type === 'snell' && String(proxy.version) === '4') ||
(proxy.type === 'vless' && proxy['reality-opts'])
) {
return false;
@ -233,10 +231,14 @@ export default function Stash_Producer() {
) {
delete proxy[`${proxy.network}-opts`]['_grpc-type'];
}
return ' - ' + JSON.stringify(proxy) + '\n';
})
.join('')
);
return proxy;
});
return type === 'internal'
? list
: 'proxies:\n' +
list
.map((proxy) => ' - ' + JSON.stringify(proxy) + '\n')
.join('');
};
return { type, produce };
}