mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:53:44 +08:00
Revert "chore: add base64 decode step"
This reverts commit 4727d613c0d9279a6d9a447522cc1f455fc3e1ac.
This commit is contained in:
parent
22f7f059ce
commit
1728442d62
@ -83,7 +83,7 @@ function decodeBase64OrOriginal(str: string): string {
|
|||||||
function URI_SS(line: string): IProxyShadowsocksConfig {
|
function URI_SS(line: string): IProxyShadowsocksConfig {
|
||||||
// parse url
|
// parse url
|
||||||
let content = line.split("ss://")[1];
|
let content = line.split("ss://")[1];
|
||||||
content = decodeBase64OrOriginal(content);
|
|
||||||
const proxy: IProxyShadowsocksConfig = {
|
const proxy: IProxyShadowsocksConfig = {
|
||||||
name: decodeURIComponent(line.split("#")[1]).trim(),
|
name: decodeURIComponent(line.split("#")[1]).trim(),
|
||||||
type: "ss",
|
type: "ss",
|
||||||
@ -172,7 +172,7 @@ function URI_SS(line: string): IProxyShadowsocksConfig {
|
|||||||
|
|
||||||
function URI_SSR(line: string): IProxyshadowsocksRConfig {
|
function URI_SSR(line: string): IProxyshadowsocksRConfig {
|
||||||
line = decodeBase64OrOriginal(line.split("ssr://")[1]);
|
line = decodeBase64OrOriginal(line.split("ssr://")[1]);
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
// handle IPV6 & IPV4 format
|
// handle IPV6 & IPV4 format
|
||||||
let splitIdx = line.indexOf(":origin");
|
let splitIdx = line.indexOf(":origin");
|
||||||
if (splitIdx === -1) {
|
if (splitIdx === -1) {
|
||||||
@ -411,7 +411,6 @@ function URI_VMESS(line: string): IProxyVmessConfig {
|
|||||||
|
|
||||||
function URI_VLESS(line: string): IProxyVlessConfig {
|
function URI_VLESS(line: string): IProxyVlessConfig {
|
||||||
line = line.split("vless://")[1];
|
line = line.split("vless://")[1];
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
let isShadowrocket;
|
let isShadowrocket;
|
||||||
let parsed = /^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
let parsed = /^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||||
if (!parsed) {
|
if (!parsed) {
|
||||||
@ -578,7 +577,6 @@ function URI_Trojan(line: string): IProxyTrojanConfig {
|
|||||||
|
|
||||||
function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
||||||
line = line.split(/(hysteria2|hy2):\/\//)[2];
|
line = line.split(/(hysteria2|hy2):\/\//)[2];
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
let [__, password, server, ___, port, ____, addons = "", name] =
|
let [__, password, server, ___, port, ____, addons = "", name] =
|
||||||
/^(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
/^(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
||||||
@ -627,7 +625,6 @@ function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
|||||||
|
|
||||||
function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
||||||
line = line.split(/(hysteria|hy):\/\//)[2];
|
line = line.split(/(hysteria|hy):\/\//)[2];
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
let [__, server, ___, port, ____, addons = "", name] =
|
let [__, server, ___, port, ____, addons = "", name] =
|
||||||
/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||||
let portNum = parseInt(`${port}`, 10);
|
let portNum = parseInt(`${port}`, 10);
|
||||||
@ -723,7 +720,7 @@ function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
|||||||
|
|
||||||
function URI_TUIC(line: string): IProxyTuicConfig {
|
function URI_TUIC(line: string): IProxyTuicConfig {
|
||||||
line = line.split(/tuic:\/\//)[1];
|
line = line.split(/tuic:\/\//)[1];
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
let [__, uuid, password, server, ___, port, ____, addons = "", name] =
|
let [__, uuid, password, server, ___, port, ____, addons = "", name] =
|
||||||
/^(.*?):(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
/^(.*?):(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
||||||
|
|
||||||
@ -803,7 +800,6 @@ function URI_TUIC(line: string): IProxyTuicConfig {
|
|||||||
|
|
||||||
function URI_Wireguard(line: string): IProxyWireguardConfig {
|
function URI_Wireguard(line: string): IProxyWireguardConfig {
|
||||||
line = line.split(/(wireguard|wg):\/\//)[2];
|
line = line.split(/(wireguard|wg):\/\//)[2];
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
let [__, ___, privateKey, server, ____, port, _____, addons = "", name] =
|
let [__, ___, privateKey, server, ____, port, _____, addons = "", name] =
|
||||||
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||||
|
|
||||||
@ -886,7 +882,6 @@ function URI_Wireguard(line: string): IProxyWireguardConfig {
|
|||||||
|
|
||||||
function URI_HTTP(line: string): IProxyHttpConfig {
|
function URI_HTTP(line: string): IProxyHttpConfig {
|
||||||
line = line.split(/(http|https):\/\//)[2];
|
line = line.split(/(http|https):\/\//)[2];
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
||||||
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||||
|
|
||||||
@ -951,7 +946,6 @@ function URI_HTTP(line: string): IProxyHttpConfig {
|
|||||||
|
|
||||||
function URI_SOCKS(line: string): IProxySocks5Config {
|
function URI_SOCKS(line: string): IProxySocks5Config {
|
||||||
line = line.split(/socks5:\/\//)[1];
|
line = line.split(/socks5:\/\//)[1];
|
||||||
line = decodeBase64OrOriginal(line);
|
|
||||||
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
||||||
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user