mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-15 19:22:26 +08:00
chore: add base64 decode step
Some checks are pending
Alpha Build / alpha (macos-latest, aarch64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (macos-latest, x86_64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, aarch64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, armv7-unknown-linux-gnueabihf) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, i686-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (arm64, windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x86, windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / Update tag (push) Blocked by required conditions
Some checks are pending
Alpha Build / alpha (macos-latest, aarch64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (macos-latest, x86_64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, aarch64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, armv7-unknown-linux-gnueabihf) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, i686-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (arm64, windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x86, windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / Update tag (push) Blocked by required conditions
This commit is contained in:
parent
0183edd450
commit
38eb3123be
|
@ -83,7 +83,7 @@ function decodeBase64OrOriginal(str: string): string {
|
|||
function URI_SS(line: string): IProxyShadowsocksConfig {
|
||||
// parse url
|
||||
let content = line.split("ss://")[1];
|
||||
|
||||
content = decodeBase64OrOriginal(content);
|
||||
const proxy: IProxyShadowsocksConfig = {
|
||||
name: decodeURIComponent(line.split("#")[1]).trim(),
|
||||
type: "ss",
|
||||
|
@ -172,7 +172,7 @@ function URI_SS(line: string): IProxyShadowsocksConfig {
|
|||
|
||||
function URI_SSR(line: string): IProxyshadowsocksRConfig {
|
||||
line = decodeBase64OrOriginal(line.split("ssr://")[1]);
|
||||
|
||||
line = decodeBase64OrOriginal(line);
|
||||
// handle IPV6 & IPV4 format
|
||||
let splitIdx = line.indexOf(":origin");
|
||||
if (splitIdx === -1) {
|
||||
|
@ -411,6 +411,7 @@ function URI_VMESS(line: string): IProxyVmessConfig {
|
|||
|
||||
function URI_VLESS(line: string): IProxyVlessConfig {
|
||||
line = line.split("vless://")[1];
|
||||
line = decodeBase64OrOriginal(line);
|
||||
let isShadowrocket;
|
||||
let parsed = /^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||
if (!parsed) {
|
||||
|
@ -577,6 +578,7 @@ function URI_Trojan(line: string): IProxyTrojanConfig {
|
|||
|
||||
function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
||||
line = line.split(/(hysteria2|hy2):\/\//)[2];
|
||||
line = decodeBase64OrOriginal(line);
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
let [__, password, server, ___, port, ____, addons = "", name] =
|
||||
/^(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
||||
|
@ -625,6 +627,7 @@ function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
|||
|
||||
function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
||||
line = line.split(/(hysteria|hy):\/\//)[2];
|
||||
line = decodeBase64OrOriginal(line);
|
||||
let [__, server, ___, port, ____, addons = "", name] =
|
||||
/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||
let portNum = parseInt(`${port}`, 10);
|
||||
|
@ -720,7 +723,7 @@ function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
|||
|
||||
function URI_TUIC(line: string): IProxyTuicConfig {
|
||||
line = line.split(/tuic:\/\//)[1];
|
||||
|
||||
line = decodeBase64OrOriginal(line);
|
||||
let [__, uuid, password, server, ___, port, ____, addons = "", name] =
|
||||
/^(.*?):(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
||||
|
||||
|
@ -800,6 +803,7 @@ function URI_TUIC(line: string): IProxyTuicConfig {
|
|||
|
||||
function URI_Wireguard(line: string): IProxyWireguardConfig {
|
||||
line = line.split(/(wireguard|wg):\/\//)[2];
|
||||
line = decodeBase64OrOriginal(line);
|
||||
let [__, ___, privateKey, server, ____, port, _____, addons = "", name] =
|
||||
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||
|
||||
|
@ -882,6 +886,7 @@ function URI_Wireguard(line: string): IProxyWireguardConfig {
|
|||
|
||||
function URI_HTTP(line: string): IProxyHttpConfig {
|
||||
line = line.split(/(http|https):\/\//)[2];
|
||||
line = decodeBase64OrOriginal(line);
|
||||
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
||||
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||
|
||||
|
@ -946,6 +951,7 @@ function URI_HTTP(line: string): IProxyHttpConfig {
|
|||
|
||||
function URI_SOCKS(line: string): IProxySocks5Config {
|
||||
line = line.split(/socks5:\/\//)[1];
|
||||
line = decodeBase64OrOriginal(line);
|
||||
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
||||
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user