mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-16 02:37:19 +08:00
feat: 输出时校验 Surge, Surfboard, Loon, QX Shadowsocks cipher
This commit is contained in:
parent
1a18e65e47
commit
2e99f28aa5
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.199",
|
"version": "2.14.200",
|
||||||
"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": {
|
||||||
|
@ -32,6 +32,32 @@ export default function Loon_Producer() {
|
|||||||
|
|
||||||
function shadowsocks(proxy) {
|
function shadowsocks(proxy) {
|
||||||
const result = new Result(proxy);
|
const result = new Result(proxy);
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'rc4',
|
||||||
|
'rc4-md5',
|
||||||
|
'aes-128-cfb',
|
||||||
|
'aes-192-cfb',
|
||||||
|
'aes-256-cfb',
|
||||||
|
'aes-128-ctr',
|
||||||
|
'aes-192-ctr',
|
||||||
|
'aes-256-ctr',
|
||||||
|
'bf-cfb',
|
||||||
|
'camellia-128-cfb',
|
||||||
|
'camellia-192-cfb',
|
||||||
|
'camellia-256-cfb',
|
||||||
|
'salsa20',
|
||||||
|
'chacha20',
|
||||||
|
'chacha20-ietf',
|
||||||
|
'aes-128-gcm',
|
||||||
|
'aes-192-gcm',
|
||||||
|
'aes-256-gcm',
|
||||||
|
'chacha20-ietf-poly1305',
|
||||||
|
'xchacha20-ietf-poly1305',
|
||||||
|
].includes(proxy.cipher)
|
||||||
|
) {
|
||||||
|
throw new Error(`cipher ${proxy.cipher} is not supported`);
|
||||||
|
}
|
||||||
result.append(
|
result.append(
|
||||||
`${proxy.name}=shadowsocks,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`,
|
`${proxy.name}=shadowsocks,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`,
|
||||||
);
|
);
|
||||||
|
@ -37,7 +37,36 @@ function shadowsocks(proxy) {
|
|||||||
const result = new Result(proxy);
|
const result = new Result(proxy);
|
||||||
const append = result.append.bind(result);
|
const append = result.append.bind(result);
|
||||||
const appendIfPresent = result.appendIfPresent.bind(result);
|
const appendIfPresent = result.appendIfPresent.bind(result);
|
||||||
|
if (!proxy.cipher) {
|
||||||
|
proxy.cipher = 'none';
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'none',
|
||||||
|
'rc4-md5',
|
||||||
|
'rc4-md5-6',
|
||||||
|
'aes-128-cfb',
|
||||||
|
'aes-192-cfb',
|
||||||
|
'aes-256-cfb',
|
||||||
|
'aes-128-ctr',
|
||||||
|
'aes-192-ctr',
|
||||||
|
'aes-256-ctr',
|
||||||
|
'bf-cfb',
|
||||||
|
'cast5-cfb',
|
||||||
|
'des-cfb',
|
||||||
|
'rc2-cfb',
|
||||||
|
'salsa20',
|
||||||
|
'chacha20',
|
||||||
|
'chacha20-ietf',
|
||||||
|
'aes-128-gcm',
|
||||||
|
'aes-192-gcm',
|
||||||
|
'aes-256-gcm',
|
||||||
|
'chacha20-ietf-poly1305',
|
||||||
|
'xchacha20-ietf-poly1305',
|
||||||
|
].includes(proxy.cipher)
|
||||||
|
) {
|
||||||
|
throw new Error(`cipher ${proxy.cipher} is not supported`);
|
||||||
|
}
|
||||||
append(`shadowsocks=${proxy.server}:${proxy.port}`);
|
append(`shadowsocks=${proxy.server}:${proxy.port}`);
|
||||||
append(`,method=${proxy.cipher}`);
|
append(`,method=${proxy.cipher}`);
|
||||||
append(`,password=${proxy.password}`);
|
append(`,password=${proxy.password}`);
|
||||||
|
@ -31,6 +31,32 @@ export default function Surfboard_Producer() {
|
|||||||
function shadowsocks(proxy) {
|
function shadowsocks(proxy) {
|
||||||
const result = new Result(proxy);
|
const result = new Result(proxy);
|
||||||
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'aes-128-gcm',
|
||||||
|
'aes-192-gcm',
|
||||||
|
'aes-256-gcm',
|
||||||
|
'chacha20-ietf-poly1305',
|
||||||
|
'xchacha20-ietf-poly1305',
|
||||||
|
'rc4',
|
||||||
|
'rc4-md5',
|
||||||
|
'aes-128-cfb',
|
||||||
|
'aes-192-cfb',
|
||||||
|
'aes-256-cfb',
|
||||||
|
'aes-128-ctr',
|
||||||
|
'aes-192-ctr',
|
||||||
|
'aes-256-ctr',
|
||||||
|
'bf-cfb',
|
||||||
|
'camellia-128-cfb',
|
||||||
|
'camellia-192-cfb',
|
||||||
|
'camellia-256-cfb',
|
||||||
|
'salsa20',
|
||||||
|
'chacha20',
|
||||||
|
'chacha20-ietf',
|
||||||
|
].includes(proxy.cipher)
|
||||||
|
) {
|
||||||
|
throw new Error(`cipher ${proxy.cipher} is not supported`);
|
||||||
|
}
|
||||||
result.append(`,encrypt-method=${proxy.cipher}`);
|
result.append(`,encrypt-method=${proxy.cipher}`);
|
||||||
result.appendIfPresent(`,password=${proxy.password}`, 'password');
|
result.appendIfPresent(`,password=${proxy.password}`, 'password');
|
||||||
|
|
||||||
|
@ -44,6 +44,41 @@ export default function Surge_Producer() {
|
|||||||
function shadowsocks(proxy) {
|
function shadowsocks(proxy) {
|
||||||
const result = new Result(proxy);
|
const result = new Result(proxy);
|
||||||
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
|
||||||
|
if (!proxy.cipher) {
|
||||||
|
proxy.cipher = 'none';
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'aes-128-gcm',
|
||||||
|
'aes-192-gcm',
|
||||||
|
'aes-256-gcm',
|
||||||
|
'chacha20-ietf-poly1305',
|
||||||
|
'xchacha20-ietf-poly1305',
|
||||||
|
'rc4',
|
||||||
|
'rc4-md5',
|
||||||
|
'aes-128-cfb',
|
||||||
|
'aes-192-cfb',
|
||||||
|
'aes-256-cfb',
|
||||||
|
'aes-128-ctr',
|
||||||
|
'aes-192-ctr',
|
||||||
|
'aes-256-ctr',
|
||||||
|
'bf-cfb',
|
||||||
|
'camellia-128-cfb',
|
||||||
|
'camellia-192-cfb',
|
||||||
|
'camellia-256-cfb',
|
||||||
|
'cast5-cfb',
|
||||||
|
'des-cfb',
|
||||||
|
'idea-cfb',
|
||||||
|
'rc2-cfb',
|
||||||
|
'seed-cfb',
|
||||||
|
'salsa20',
|
||||||
|
'chacha20',
|
||||||
|
'chacha20-ietf',
|
||||||
|
'none',
|
||||||
|
].includes(proxy.cipher)
|
||||||
|
) {
|
||||||
|
throw new Error(`cipher ${proxy.cipher} is not supported`);
|
||||||
|
}
|
||||||
result.append(`,encrypt-method=${proxy.cipher}`);
|
result.append(`,encrypt-method=${proxy.cipher}`);
|
||||||
result.appendIfPresent(`,password=${proxy.password}`, 'password');
|
result.appendIfPresent(`,password=${proxy.password}`, 'password');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user