fix: 过滤 Stash/Clash Shadowsocks cipher

This commit is contained in:
xream 2023-12-13 20:11:36 +08:00
parent ce6cd794c8
commit c287dcad3b
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
3 changed files with 37 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.14.127", "version": "2.14.128",
"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

@ -7,6 +7,7 @@ export default function Clash_Producer() {
// https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/docs/config.yaml#L532 // https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/docs/config.yaml#L532
// github.com/Dreamacro/clash/pull/2891/files // github.com/Dreamacro/clash/pull/2891/files
// filter unsupported proxies // filter unsupported proxies
// https://clash.wiki/configuration/outbound.html#shadowsocks
proxies = proxies.filter((proxy) => { proxies = proxies.filter((proxy) => {
if ( if (
![ ![
@ -20,6 +21,23 @@ export default function Clash_Producer() {
'trojan', 'trojan',
'wireguard', 'wireguard',
].includes(proxy.type) || ].includes(proxy.type) ||
(proxy.type === 'ss' &&
![
'aes-128-gcm',
'aes-192-gcm',
'aes-256-gcm',
'aes-128-cfb',
'aes-192-cfb',
'aes-256-cfb',
'aes-128-ctr',
'aes-192-ctr',
'aes-256-ctr',
'rc4-md5',
'chacha20-ietf',
'xchacha20',
'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.type === 'vless' &&
(typeof proxy.flow !== 'undefined' || (typeof proxy.flow !== 'undefined' ||

View File

@ -3,6 +3,7 @@ import { isPresent } from '@/core/proxy-utils/producers/utils';
export default function Stash_Producer() { export default function Stash_Producer() {
const type = 'ALL'; const type = 'ALL';
const produce = (proxies) => { const produce = (proxies) => {
// https://stash.wiki/proxy-protocols/proxy-types#shadowsocks
return ( return (
'proxies:\n' + 'proxies:\n' +
proxies proxies
@ -22,6 +23,23 @@ export default function Stash_Producer() {
'hysteria', 'hysteria',
'hysteria2', 'hysteria2',
].includes(proxy.type) || ].includes(proxy.type) ||
(proxy.type === 'ss' &&
![
'aes-128-gcm',
'aes-192-gcm',
'aes-256-gcm',
'aes-128-cfb',
'aes-192-cfb',
'aes-256-cfb',
'aes-128-ctr',
'aes-192-ctr',
'aes-256-ctr',
'rc4-md5',
'chacha20-ietf',
'xchacha20',
'chacha20-ietf-poly1305',
'xchacha20-ietf-poly1305',
].includes(proxy.cipher)) ||
(proxy.type === 'snell' && (proxy.type === 'snell' &&
String(proxy.version) === '4') || String(proxy.version) === '4') ||
(proxy.type === 'vless' && proxy['reality-opts']) (proxy.type === 'vless' && proxy['reality-opts'])