mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-13 18:46:01 +08:00
feat: Added dedicated Stash producer
This commit is contained in:
parent
bea2c64e40
commit
d602dbeb7c
6
backend/dist/sub-store-parser.loon.min.js
vendored
6
backend/dist/sub-store-parser.loon.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.0.9",
|
"version": "2.0.10",
|
||||||
"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": {
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
export default function Clash_Producer() {
|
export default function Clash_Producer() {
|
||||||
const type = 'ALL';
|
const type = 'ALL';
|
||||||
const produce = (proxies) => {
|
const produce = (proxies) => {
|
||||||
|
proxies.filter((proxy) => {
|
||||||
|
if (proxy.type === 'vless') return false;
|
||||||
|
return true;
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
'proxies:\n' +
|
'proxies:\n' +
|
||||||
proxies
|
proxies
|
||||||
.map((proxy) => {
|
.map((proxy) => {
|
||||||
delete proxy.supported;
|
delete proxy['tls-fingerprint'];
|
||||||
|
delete proxy['vmess-aead'];
|
||||||
return ' - ' + JSON.stringify(proxy) + '\n';
|
return ' - ' + JSON.stringify(proxy) + '\n';
|
||||||
})
|
})
|
||||||
.join('')
|
.join('')
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Surge_Producer from './surge';
|
import Surge_Producer from './surge';
|
||||||
import Clash_Producer from './clash';
|
import Clash_Producer from './clash';
|
||||||
|
import Stash_Producer from './stash';
|
||||||
import Loon_Producer from './loon';
|
import Loon_Producer from './loon';
|
||||||
import URI_Producer from './uri';
|
import URI_Producer from './uri';
|
||||||
import QX_Producer from './qx';
|
import QX_Producer from './qx';
|
||||||
@ -17,4 +18,5 @@ export default {
|
|||||||
Clash: Clash_Producer(),
|
Clash: Clash_Producer(),
|
||||||
URI: URI_Producer(),
|
URI: URI_Producer(),
|
||||||
JSON: JSON_Producer(),
|
JSON: JSON_Producer(),
|
||||||
|
Stash: Stash_Producer(),
|
||||||
};
|
};
|
||||||
|
16
backend/src/core/proxy-utils/producers/stash.js
Normal file
16
backend/src/core/proxy-utils/producers/stash.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
export default function Stash_Producer() {
|
||||||
|
const type = 'ALL';
|
||||||
|
const produce = (proxies) => {
|
||||||
|
return (
|
||||||
|
'proxies:\n' +
|
||||||
|
proxies
|
||||||
|
.map((proxy) => {
|
||||||
|
delete proxy['tls-fingerprint'];
|
||||||
|
delete proxy['vmess-aead'];
|
||||||
|
return ' - ' + JSON.stringify(proxy) + '\n';
|
||||||
|
})
|
||||||
|
.join('')
|
||||||
|
);
|
||||||
|
};
|
||||||
|
return { type, produce };
|
||||||
|
}
|
@ -204,11 +204,10 @@ export function getPlatformFromHeaders(headers) {
|
|||||||
return 'Surge';
|
return 'Surge';
|
||||||
} else if (UA.indexOf('Decar') !== -1 || UA.indexOf('Loon') !== -1) {
|
} else if (UA.indexOf('Decar') !== -1 || UA.indexOf('Loon') !== -1) {
|
||||||
return 'Loon';
|
return 'Loon';
|
||||||
} else if (
|
} else if (UA.indexOf('Shadowrocket') !== -1) {
|
||||||
UA.indexOf('Stash') !== -1 ||
|
|
||||||
UA.indexOf('Shadowrocket') !== -1
|
|
||||||
) {
|
|
||||||
return 'Clash';
|
return 'Clash';
|
||||||
|
} else if (UA.indexOf('Stash') !== -1) {
|
||||||
|
return 'Stash';
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
7
backend/src/vendor/open-api.js
vendored
7
backend/src/vendor/open-api.js
vendored
@ -2,7 +2,10 @@
|
|||||||
const isQX = typeof $task !== 'undefined';
|
const isQX = typeof $task !== 'undefined';
|
||||||
const isLoon = typeof $loon !== 'undefined';
|
const isLoon = typeof $loon !== 'undefined';
|
||||||
const isSurge = typeof $httpClient !== 'undefined' && !isLoon;
|
const isSurge = typeof $httpClient !== 'undefined' && !isLoon;
|
||||||
const isNode = eval(`typeof process !== "undefined"`);
|
const isNode = eval(`typeof process !== "undefined"`); // eval is needed in order to avoid browserify processing
|
||||||
|
const isStash =
|
||||||
|
'undefined' !== typeof $environment && $environment['stash-version'];
|
||||||
|
const isShadowRocket = 'undefined' !== typeof $rocket;
|
||||||
|
|
||||||
export class OpenAPI {
|
export class OpenAPI {
|
||||||
constructor(name = 'untitled', debug = false) {
|
constructor(name = 'untitled', debug = false) {
|
||||||
@ -218,7 +221,7 @@ export class OpenAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ENV() {
|
export function ENV() {
|
||||||
return { isQX, isLoon, isSurge, isNode };
|
return { isQX, isLoon, isSurge, isNode, isStash, isShadowRocket };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HTTP(defaultOptions = { baseURL: '' }) {
|
export function HTTP(defaultOptions = { baseURL: '' }) {
|
||||||
|
6
backend/sub-store.min.js
vendored
6
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user