fix: 修复 SurgeMac ShadowsocksR obfs-param

This commit is contained in:
xream 2024-08-28 14:50:25 +08:00
parent 153802c7c4
commit 9abeb4ce7b
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
3 changed files with 9 additions and 6 deletions

View File

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

View File

@ -158,7 +158,7 @@ function URI_SSR() {
for (const item of line) {
let [key, val] = item.split('=');
val = val.trim();
if (val.length > 0) {
if (val.length > 0 && val !== '(null)') {
other_params[key] = val;
}
}

View File

@ -1,6 +1,6 @@
import { Result } from './utils';
import { Result, isPresent } from './utils';
import Surge_Producer from './surge';
import { isIPv4, isIPv6, isPresent } from '@/utils';
import { isIPv4, isIPv6 } from '@/utils';
import $ from '@/core/app';
const targetPlatform = 'SurgeMac';
@ -84,6 +84,7 @@ function shadowsocksr(proxy) {
for (const [key, value] of Object.entries({
cipher: '-m',
obfs: '-o',
'obfs-param': '-g',
password: '-k',
port: '-p',
protocol: '-O',
@ -92,8 +93,10 @@ function shadowsocksr(proxy) {
'local-port': '-l',
'local-address': '-b',
})) {
external_proxy.args.push(value);
external_proxy.args.push(external_proxy[key]);
if (external_proxy[key] != null) {
external_proxy.args.push(value);
external_proxy.args.push(external_proxy[key]);
}
}
return external(external_proxy);