fix: 修复 SS URI 解析

This commit is contained in:
xream 2024-12-08 11:24:46 +08:00
parent 4713b63083
commit d015c7867e
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 4 additions and 3 deletions

View File

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

@ -46,7 +46,9 @@ function URI_SS() {
content = content.split('#')[0]; // strip proxy name content = content.split('#')[0]; // strip proxy name
// handle IPV4 and IPV6 // handle IPV4 and IPV6
let serverAndPortArray = content.match(/@([^/]*)(\/|$)/); let serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
let userInfoStr = Base64.decode(content.split('@')[0]); let userInfoStr = Base64.decode(
decodeURIComponent(content.split('@')[0]),
);
let query = ''; let query = '';
if (!serverAndPortArray) { if (!serverAndPortArray) {
if (content.includes('?')) { if (content.includes('?')) {
@ -77,7 +79,6 @@ function URI_SS() {
proxy.port = `${serverAndPort.substring(portIdx + 1)}`.match( proxy.port = `${serverAndPort.substring(portIdx + 1)}`.match(
/\d+/, /\d+/,
)?.[0]; )?.[0];
const userInfo = userInfoStr.match(/(^.*?):(.*$)/); const userInfo = userInfoStr.match(/(^.*?):(.*$)/);
proxy.cipher = userInfo[1]; proxy.cipher = userInfo[1];
proxy.password = userInfo[2]; proxy.password = userInfo[2];