mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 15:29:01 +08:00
feat: Added support for SS URI in other formats
This commit is contained in:
parent
d229047744
commit
5cb226da62
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.7",
|
"version": "2.14.8",
|
||||||
"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": {
|
||||||
|
@ -23,12 +23,19 @@ 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
|
||||||
const serverAndPort = content.match(/@([^/]*)(\/|$)/)[1];
|
let serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
|
||||||
|
let userInfoStr = Base64.decode(content.split('@')[0]);
|
||||||
|
if (!serverAndPortArray) {
|
||||||
|
content = Base64.decode(content);
|
||||||
|
userInfoStr = content.split('@')[0];
|
||||||
|
serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
|
||||||
|
}
|
||||||
|
const serverAndPort = serverAndPortArray[1];
|
||||||
const portIdx = serverAndPort.lastIndexOf(':');
|
const portIdx = serverAndPort.lastIndexOf(':');
|
||||||
proxy.server = serverAndPort.substring(0, portIdx);
|
proxy.server = serverAndPort.substring(0, portIdx);
|
||||||
proxy.port = serverAndPort.substring(portIdx + 1);
|
proxy.port = serverAndPort.substring(portIdx + 1);
|
||||||
|
|
||||||
const userInfo = Base64.decode(content.split('@')[0]).split(':');
|
const userInfo = userInfoStr.split(':');
|
||||||
proxy.cipher = userInfo[0];
|
proxy.cipher = userInfo[0];
|
||||||
proxy.password = userInfo[1];
|
proxy.password = userInfo[1];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user