fix: 修复 Shadowsocks URI 解析

This commit is contained in:
xream 2025-02-12 19:21:24 +08:00
parent 71fc9affbf
commit 5e2a87e250
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.16.38", "version": "2.16.39",
"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

@ -152,6 +152,7 @@ function URI_SS() {
query = parsed[2]; query = parsed[2];
} }
content = Base64.decode(content); content = Base64.decode(content);
if (query) { if (query) {
if (/(&|\?)v2ray-plugin=/.test(query)) { if (/(&|\?)v2ray-plugin=/.test(query)) {
const parsed = query.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/); const parsed = query.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/);
@ -165,8 +166,8 @@ function URI_SS() {
} }
content = `${content}${query}`; content = `${content}${query}`;
} }
userInfoStr = content.split('@')[0]; userInfoStr = content.match(/(^.*)@/)?.[1];
serverAndPortArray = content.match(/@([^/]*)(\/|$)/); serverAndPortArray = content.match(/@([^/@]*)(\/|$)/);
} else if (content.includes('?')) { } else if (content.includes('?')) {
const parsed = content.match(/(\?.*)$/); const parsed = content.match(/(\?.*)$/);
query = parsed[1]; query = parsed[1];