renamed to koala clash
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "clash-verge",
|
"name": "koala-clash",
|
||||||
"version": "0.2.4",
|
"version": "0.2.4",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ async function resolvePortable() {
|
|||||||
|
|
||||||
const zip = new AdmZip();
|
const zip = new AdmZip();
|
||||||
|
|
||||||
zip.addLocalFile(path.join(releaseDir, "Clash Verge.exe"));
|
zip.addLocalFile(path.join(releaseDir, "Koala Clash.exe"));
|
||||||
zip.addLocalFile(path.join(releaseDir, "verge-mihomo.exe"));
|
zip.addLocalFile(path.join(releaseDir, "koala-mihomo.exe"));
|
||||||
zip.addLocalFile(path.join(releaseDir, "verge-mihomo-alpha.exe"));
|
zip.addLocalFile(path.join(releaseDir, "koala-mihomo-alpha.exe"));
|
||||||
zip.addLocalFolder(path.join(releaseDir, "resources"), "resources");
|
zip.addLocalFolder(path.join(releaseDir, "resources"), "resources");
|
||||||
zip.addLocalFolder(
|
zip.addLocalFolder(
|
||||||
path.join(
|
path.join(
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ async function resolvePortable() {
|
|||||||
}
|
}
|
||||||
const zip = new AdmZip();
|
const zip = new AdmZip();
|
||||||
|
|
||||||
zip.addLocalFile(path.join(releaseDir, "clash-verge.exe"));
|
zip.addLocalFile(path.join(releaseDir, "koala-clash.exe"));
|
||||||
zip.addLocalFile(path.join(releaseDir, "verge-mihomo.exe"));
|
zip.addLocalFile(path.join(releaseDir, "koala-mihomo.exe"));
|
||||||
zip.addLocalFile(path.join(releaseDir, "verge-mihomo-alpha.exe"));
|
zip.addLocalFile(path.join(releaseDir, "koala-mihomo-alpha.exe"));
|
||||||
zip.addLocalFolder(path.join(releaseDir, "resources"), "resources");
|
zip.addLocalFolder(path.join(releaseDir, "resources"), "resources");
|
||||||
zip.addLocalFolder(configDir, ".config");
|
zip.addLocalFolder(configDir, ".config");
|
||||||
|
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ function clashMetaAlpha() {
|
|||||||
const zipFile = `${name}-${META_ALPHA_VERSION}.${urlExt}`;
|
const zipFile = `${name}-${META_ALPHA_VERSION}.${urlExt}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: "verge-mihomo-alpha",
|
name: "koala-mihomo-alpha",
|
||||||
targetFile: `verge-mihomo-alpha-${SIDECAR_HOST}${isWin ? ".exe" : ""}`,
|
targetFile: `koala-mihomo-alpha-${SIDECAR_HOST}${isWin ? ".exe" : ""}`,
|
||||||
exeFile,
|
exeFile,
|
||||||
zipFile,
|
zipFile,
|
||||||
downloadURL,
|
downloadURL,
|
||||||
@@ -192,8 +192,8 @@ function clashMeta() {
|
|||||||
const zipFile = `${name}-${META_VERSION}.${urlExt}`;
|
const zipFile = `${name}-${META_VERSION}.${urlExt}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: "verge-mihomo",
|
name: "koala-mihomo",
|
||||||
targetFile: `verge-mihomo-${SIDECAR_HOST}${isWin ? ".exe" : ""}`,
|
targetFile: `koala-mihomo-${SIDECAR_HOST}${isWin ? ".exe" : ""}`,
|
||||||
exeFile,
|
exeFile,
|
||||||
zipFile,
|
zipFile,
|
||||||
downloadURL,
|
downloadURL,
|
||||||
@@ -381,7 +381,7 @@ const resolvePlugin = async () => {
|
|||||||
// service chmod
|
// service chmod
|
||||||
const resolveServicePermission = async () => {
|
const resolveServicePermission = async () => {
|
||||||
const serviceExecutables = [
|
const serviceExecutables = [
|
||||||
"clash-verge-service*",
|
"koala-clash-service*",
|
||||||
"install-service*",
|
"install-service*",
|
||||||
"uninstall-service*",
|
"uninstall-service*",
|
||||||
];
|
];
|
||||||
@@ -429,14 +429,14 @@ async function resolveLocales() {
|
|||||||
/**
|
/**
|
||||||
* main
|
* main
|
||||||
*/
|
*/
|
||||||
const SERVICE_URL = `https://github.com/clash-verge-rev/clash-verge-service/releases/download/${SIDECAR_HOST}`;
|
const SERVICE_URL = `https://github.com/coolcoala/koala-clash-service/releases/download/${SIDECAR_HOST}`;
|
||||||
|
|
||||||
const resolveService = () => {
|
const resolveService = () => {
|
||||||
let ext = platform === "win32" ? ".exe" : "";
|
let ext = platform === "win32" ? ".exe" : "";
|
||||||
let suffix = platform === "linux" ? "-" + SIDECAR_HOST : "";
|
let suffix = platform === "linux" ? "-" + SIDECAR_HOST : "";
|
||||||
resolveResource({
|
resolveResource({
|
||||||
file: "clash-verge-service" + suffix + ext,
|
file: "koala-clash-service" + suffix + ext,
|
||||||
downloadURL: `${SERVICE_URL}/clash-verge-service${ext}`,
|
downloadURL: `${SERVICE_URL}/koala-clash-service${ext}`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -489,13 +489,13 @@ const resolveWinSysproxy = () =>
|
|||||||
const tasks = [
|
const tasks = [
|
||||||
// { name: "clash", func: resolveClash, retry: 5 },
|
// { name: "clash", func: resolveClash, retry: 5 },
|
||||||
{
|
{
|
||||||
name: "verge-mihomo-alpha",
|
name: "koala-mihomo-alpha",
|
||||||
func: () =>
|
func: () =>
|
||||||
getLatestAlphaVersion().then(() => resolveSidecar(clashMetaAlpha())),
|
getLatestAlphaVersion().then(() => resolveSidecar(clashMetaAlpha())),
|
||||||
retry: 5,
|
retry: 5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "verge-mihomo",
|
name: "koala-mihomo",
|
||||||
func: () =>
|
func: () =>
|
||||||
getLatestReleaseVersion().then(() => resolveSidecar(clashMeta())),
|
getLatestReleaseVersion().then(() => resolveSidecar(clashMeta())),
|
||||||
retry: 5,
|
retry: 5,
|
||||||
|
|||||||
192
src-tauri/Cargo.lock
generated
192
src-tauri/Cargo.lock
generated
@@ -1059,80 +1059,6 @@ dependencies = [
|
|||||||
"inout",
|
"inout",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "clash-verge"
|
|
||||||
version = "0.2.4"
|
|
||||||
dependencies = [
|
|
||||||
"ab_glyph",
|
|
||||||
"aes-gcm",
|
|
||||||
"anyhow",
|
|
||||||
"async-trait",
|
|
||||||
"base64 0.22.1",
|
|
||||||
"boa_engine",
|
|
||||||
"chrono",
|
|
||||||
"deelevate",
|
|
||||||
"delay_timer",
|
|
||||||
"dirs 6.0.0",
|
|
||||||
"dunce",
|
|
||||||
"futures",
|
|
||||||
"gethostname 1.0.2",
|
|
||||||
"getrandom 0.3.3",
|
|
||||||
"hex",
|
|
||||||
"hmac",
|
|
||||||
"image",
|
|
||||||
"imageproc",
|
|
||||||
"lazy_static",
|
|
||||||
"libc",
|
|
||||||
"log",
|
|
||||||
"log4rs",
|
|
||||||
"machine-uid",
|
|
||||||
"mihomo_api",
|
|
||||||
"nanoid",
|
|
||||||
"network-interface",
|
|
||||||
"once_cell",
|
|
||||||
"open",
|
|
||||||
"os_info",
|
|
||||||
"parking_lot",
|
|
||||||
"percent-encoding",
|
|
||||||
"port_scanner",
|
|
||||||
"regex",
|
|
||||||
"reqwest",
|
|
||||||
"reqwest_dav",
|
|
||||||
"runas",
|
|
||||||
"scopeguard",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"serde_yaml",
|
|
||||||
"sha2 0.10.9",
|
|
||||||
"sys-locale",
|
|
||||||
"sysinfo",
|
|
||||||
"sysproxy",
|
|
||||||
"tauri",
|
|
||||||
"tauri-build",
|
|
||||||
"tauri-plugin-autostart",
|
|
||||||
"tauri-plugin-clipboard-manager",
|
|
||||||
"tauri-plugin-deep-link",
|
|
||||||
"tauri-plugin-devtools",
|
|
||||||
"tauri-plugin-dialog",
|
|
||||||
"tauri-plugin-fs",
|
|
||||||
"tauri-plugin-global-shortcut",
|
|
||||||
"tauri-plugin-notification",
|
|
||||||
"tauri-plugin-process",
|
|
||||||
"tauri-plugin-shell",
|
|
||||||
"tauri-plugin-updater",
|
|
||||||
"tauri-plugin-window-state",
|
|
||||||
"tempfile",
|
|
||||||
"tokio",
|
|
||||||
"tokio-tungstenite 0.27.0",
|
|
||||||
"tungstenite 0.27.0",
|
|
||||||
"url",
|
|
||||||
"users",
|
|
||||||
"warp",
|
|
||||||
"winapi",
|
|
||||||
"winreg 0.55.0",
|
|
||||||
"zip",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clipboard-win"
|
name = "clipboard-win"
|
||||||
version = "5.4.0"
|
version = "5.4.0"
|
||||||
@@ -3622,6 +3548,81 @@ dependencies = [
|
|||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "koala-clash"
|
||||||
|
version = "0.2.4"
|
||||||
|
dependencies = [
|
||||||
|
"ab_glyph",
|
||||||
|
"aes-gcm",
|
||||||
|
"anyhow",
|
||||||
|
"async-trait",
|
||||||
|
"base64 0.22.1",
|
||||||
|
"boa_engine",
|
||||||
|
"chrono",
|
||||||
|
"deelevate",
|
||||||
|
"delay_timer",
|
||||||
|
"dirs 6.0.0",
|
||||||
|
"dunce",
|
||||||
|
"futures",
|
||||||
|
"gethostname 1.0.2",
|
||||||
|
"getrandom 0.3.3",
|
||||||
|
"hex",
|
||||||
|
"hmac",
|
||||||
|
"image",
|
||||||
|
"imageproc",
|
||||||
|
"lazy_static",
|
||||||
|
"libc",
|
||||||
|
"log",
|
||||||
|
"log4rs",
|
||||||
|
"machine-uid",
|
||||||
|
"mihomo_api",
|
||||||
|
"nanoid",
|
||||||
|
"network-interface",
|
||||||
|
"once_cell",
|
||||||
|
"open",
|
||||||
|
"os_info",
|
||||||
|
"parking_lot",
|
||||||
|
"percent-encoding",
|
||||||
|
"port_scanner",
|
||||||
|
"regex",
|
||||||
|
"reqwest",
|
||||||
|
"reqwest_dav",
|
||||||
|
"runas",
|
||||||
|
"scopeguard",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"serde_yaml",
|
||||||
|
"sha2 0.10.9",
|
||||||
|
"sys-locale",
|
||||||
|
"sysinfo",
|
||||||
|
"sysproxy",
|
||||||
|
"tauri",
|
||||||
|
"tauri-build",
|
||||||
|
"tauri-plugin-autostart",
|
||||||
|
"tauri-plugin-clipboard-manager",
|
||||||
|
"tauri-plugin-deep-link",
|
||||||
|
"tauri-plugin-devtools",
|
||||||
|
"tauri-plugin-dialog",
|
||||||
|
"tauri-plugin-fs",
|
||||||
|
"tauri-plugin-global-shortcut",
|
||||||
|
"tauri-plugin-notification",
|
||||||
|
"tauri-plugin-process",
|
||||||
|
"tauri-plugin-shell",
|
||||||
|
"tauri-plugin-single-instance",
|
||||||
|
"tauri-plugin-updater",
|
||||||
|
"tauri-plugin-window-state",
|
||||||
|
"tempfile",
|
||||||
|
"tokio",
|
||||||
|
"tokio-tungstenite 0.27.0",
|
||||||
|
"tungstenite 0.27.0",
|
||||||
|
"url",
|
||||||
|
"users",
|
||||||
|
"warp",
|
||||||
|
"winapi",
|
||||||
|
"winreg 0.55.0",
|
||||||
|
"zip",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kuchikiki"
|
name = "kuchikiki"
|
||||||
version = "0.8.8-speedreader"
|
version = "0.8.8-speedreader"
|
||||||
@@ -3887,11 +3888,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "machine-uid"
|
name = "machine-uid"
|
||||||
version = "0.2.0"
|
version = "0.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1f1595709b0a7386bcd56ba34d250d626e5503917d05d32cdccddcd68603e212"
|
checksum = "0c4506fa0abb0a2ea93f5862f55973da0a662d2ad0e98f337a1c5aac657f0892"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winreg 0.6.2",
|
"libc",
|
||||||
|
"winreg 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -6846,9 +6848,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sysinfo"
|
name = "sysinfo"
|
||||||
version = "0.35.2"
|
version = "0.36.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c3ffa3e4ff2b324a57f7aeb3c349656c7b127c3c189520251a648102a92496e"
|
checksum = "252800745060e7b9ffb7b2badbd8b31cfa4aa2e61af879d0a3bf2a317c20217d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -7294,6 +7296,21 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tauri-plugin-single-instance"
|
||||||
|
version = "2.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50a0e5a4ce43cb3a733c3aef85e8478bc769dac743c615e26639cbf5d953faf7"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tauri",
|
||||||
|
"thiserror 2.0.12",
|
||||||
|
"tracing",
|
||||||
|
"windows-sys 0.60.2",
|
||||||
|
"zbus",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-plugin-updater"
|
name = "tauri-plugin-updater"
|
||||||
version = "2.9.0"
|
version = "2.9.0"
|
||||||
@@ -9323,15 +9340,6 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "winreg"
|
|
||||||
version = "0.6.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9"
|
|
||||||
dependencies = [
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winreg"
|
name = "winreg"
|
||||||
version = "0.10.1"
|
version = "0.10.1"
|
||||||
@@ -9568,9 +9576,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus"
|
name = "zbus"
|
||||||
version = "5.7.1"
|
version = "5.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d3a7c7cee313d044fca3f48fa782cb750c79e4ca76ba7bc7718cd4024cdf6f68"
|
checksum = "4bb4f9a464286d42851d18a605f7193b8febaf5b0919d71c6399b7b26e5b0aad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-broadcast",
|
"async-broadcast",
|
||||||
"async-executor",
|
"async-executor",
|
||||||
@@ -9602,9 +9610,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus_macros"
|
name = "zbus_macros"
|
||||||
version = "5.7.1"
|
version = "5.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a17e7e5eec1550f747e71a058df81a9a83813ba0f6a95f39c4e218bdc7ba366a"
|
checksum = "ef9859f68ee0c4ee2e8cde84737c78e3f4c54f946f2a38645d0d4c7a95327659"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate 3.3.0",
|
"proc-macro-crate 3.3.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "clash-verge"
|
name = "koala-clash"
|
||||||
version = "0.2.4"
|
version = "0.2.4"
|
||||||
description = "clash verge"
|
description = "koala clash"
|
||||||
authors = ["zzzgydi", "wonfen", "MystiPanda", "coolcoala"]
|
authors = ["zzzgydi", "wonfen", "MystiPanda", "coolcoala"]
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
repository = "https://github.com/coolcoala/clash-verge-rev-lite.git"
|
repository = "https://github.com/coolcoala/clash-verge-rev-lite.git"
|
||||||
default-run = "clash-verge"
|
default-run = "koala-clash"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
[package.metadata.bundle]
|
[package.metadata.bundle]
|
||||||
identifier = "io.github.clash-verge-rev.clash-verge-rev"
|
identifier = "io.github.koala-clash"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2.3.0", features = [] }
|
tauri-build = { version = "2.3.0", features = [] }
|
||||||
@@ -18,7 +18,7 @@ tauri-build = { version = "2.3.0", features = [] }
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
url = "2.5.4"
|
url = "2.5.4"
|
||||||
os_info = "3.0"
|
os_info = "3.0"
|
||||||
machine-uid = "0.2"
|
machine-uid = "0.5.3"
|
||||||
warp = "0.3.7"
|
warp = "0.3.7"
|
||||||
anyhow = "1.0.98"
|
anyhow = "1.0.98"
|
||||||
dirs = "6.0"
|
dirs = "6.0"
|
||||||
@@ -28,7 +28,7 @@ dunce = "1.0.5"
|
|||||||
log4rs = "1.3.0"
|
log4rs = "1.3.0"
|
||||||
nanoid = "0.4"
|
nanoid = "0.4"
|
||||||
chrono = "0.4.41"
|
chrono = "0.4.41"
|
||||||
sysinfo = "0.35.2"
|
sysinfo = "0.36.1"
|
||||||
boa_engine = "0.20.0"
|
boa_engine = "0.20.0"
|
||||||
serde_json = "1.0.140"
|
serde_json = "1.0.140"
|
||||||
serde_yaml = "0.9.34-deprecated"
|
serde_yaml = "0.9.34-deprecated"
|
||||||
@@ -110,6 +110,7 @@ users = "0.11.0"
|
|||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||||
tauri-plugin-autostart = "2.5.0"
|
tauri-plugin-autostart = "2.5.0"
|
||||||
tauri-plugin-global-shortcut = "2.3.0"
|
tauri-plugin-global-shortcut = "2.3.0"
|
||||||
|
tauri-plugin-single-instance = "2"
|
||||||
tauri-plugin-updater = "2.9.0"
|
tauri-plugin-updater = "2.9.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
chmod +x /usr/bin/install-service
|
chmod +x /usr/bin/install-service
|
||||||
chmod +x /usr/bin/uninstall-service
|
chmod +x /usr/bin/uninstall-service
|
||||||
chmod +x /usr/bin/clash-verge-service
|
chmod +x /usr/bin/koala-clash-service
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<false/>
|
<false/>
|
||||||
<key>com.apple.security.application-groups</key>
|
<key>com.apple.security.application-groups</key>
|
||||||
<array>
|
<array>
|
||||||
<string>io.github.clash-verge-rev.clash-verge-rev</string>
|
<string>io.github.koala-clash</string>
|
||||||
</array>
|
</array>
|
||||||
<key>com.apple.security.inherit</key>
|
<key>com.apple.security.inherit</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
|||||||
@@ -427,52 +427,52 @@ Function .onInit
|
|||||||
!endif
|
!endif
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
!macro CheckAllVergeProcesses
|
!macro CheckAllKoalaProcesses
|
||||||
; Check if clash-verge-service.exe is running
|
; Check if koala-clash-service.exe is running
|
||||||
!if "${INSTALLMODE}" == "currentUser"
|
!if "${INSTALLMODE}" == "currentUser"
|
||||||
nsis_tauri_utils::FindProcessCurrentUser "clash-verge-service.exe"
|
nsis_tauri_utils::FindProcessCurrentUser "koala-clash-service.exe"
|
||||||
!else
|
!else
|
||||||
nsis_tauri_utils::FindProcess "clash-verge-service.exe"
|
nsis_tauri_utils::FindProcess "koala-clash-service.exe"
|
||||||
!endif
|
!endif
|
||||||
Pop $R0
|
Pop $R0
|
||||||
${If} $R0 = 0
|
${If} $R0 = 0
|
||||||
DetailPrint "Kill clash-verge-service.exe..."
|
DetailPrint "Kill koala-clash-service.exe..."
|
||||||
!if "${INSTALLMODE}" == "currentUser"
|
!if "${INSTALLMODE}" == "currentUser"
|
||||||
nsis_tauri_utils::KillProcessCurrentUser "clash-verge-service.exe"
|
nsis_tauri_utils::KillProcessCurrentUser "koala-clash-service.exe"
|
||||||
!else
|
!else
|
||||||
nsis_tauri_utils::KillProcess "clash-verge-service.exe"
|
nsis_tauri_utils::KillProcess "koala-clash-service.exe"
|
||||||
!endif
|
!endif
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
; Check if verge-mihomo-alpha.exe is running
|
; Check if koala-mihomo-alpha.exe is running
|
||||||
!if "${INSTALLMODE}" == "currentUser"
|
!if "${INSTALLMODE}" == "currentUser"
|
||||||
nsis_tauri_utils::FindProcessCurrentUser "verge-mihomo-alpha.exe"
|
nsis_tauri_utils::FindProcessCurrentUser "koala-mihomo-alpha.exe"
|
||||||
!else
|
!else
|
||||||
nsis_tauri_utils::FindProcess "verge-mihomo-alpha.exe"
|
nsis_tauri_utils::FindProcess "koala-mihomo-alpha.exe"
|
||||||
!endif
|
!endif
|
||||||
Pop $R0
|
Pop $R0
|
||||||
${If} $R0 = 0
|
${If} $R0 = 0
|
||||||
DetailPrint "Kill verge-mihomo-alpha.exe..."
|
DetailPrint "Kill koala-mihomo-alpha.exe..."
|
||||||
!if "${INSTALLMODE}" == "currentUser"
|
!if "${INSTALLMODE}" == "currentUser"
|
||||||
nsis_tauri_utils::KillProcessCurrentUser "verge-mihomo-alpha.exe"
|
nsis_tauri_utils::KillProcessCurrentUser "koala-mihomo-alpha.exe"
|
||||||
!else
|
!else
|
||||||
nsis_tauri_utils::KillProcess "verge-mihomo-alpha.exe"
|
nsis_tauri_utils::KillProcess "koala-mihomo-alpha.exe"
|
||||||
!endif
|
!endif
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
; Check if verge-mihomo.exe is running
|
; Check if koala-mihomo.exe is running
|
||||||
!if "${INSTALLMODE}" == "currentUser"
|
!if "${INSTALLMODE}" == "currentUser"
|
||||||
nsis_tauri_utils::FindProcessCurrentUser "verge-mihomo.exe"
|
nsis_tauri_utils::FindProcessCurrentUser "koala-mihomo.exe"
|
||||||
!else
|
!else
|
||||||
nsis_tauri_utils::FindProcess "verge-mihomo.exe"
|
nsis_tauri_utils::FindProcess "koala-mihomo.exe"
|
||||||
!endif
|
!endif
|
||||||
Pop $R0
|
Pop $R0
|
||||||
${If} $R0 = 0
|
${If} $R0 = 0
|
||||||
DetailPrint "Kill verge-mihomo.exe..."
|
DetailPrint "Kill koala-mihomo.exe..."
|
||||||
!if "${INSTALLMODE}" == "currentUser"
|
!if "${INSTALLMODE}" == "currentUser"
|
||||||
nsis_tauri_utils::KillProcessCurrentUser "verge-mihomo.exe"
|
nsis_tauri_utils::KillProcessCurrentUser "koala-mihomo.exe"
|
||||||
!else
|
!else
|
||||||
nsis_tauri_utils::KillProcess "verge-mihomo.exe"
|
nsis_tauri_utils::KillProcess "koala-mihomo.exe"
|
||||||
!endif
|
!endif
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
@@ -509,22 +509,22 @@ FunctionEnd
|
|||||||
${EndIf}
|
${EndIf}
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
!macro StartVergeService
|
!macro StartKoalaService
|
||||||
; Check if the service exists
|
; Check if the service exists
|
||||||
SimpleSC::ExistsService "clash_verge_service"
|
SimpleSC::ExistsService "koala_clash_service"
|
||||||
Pop $0 ; 0:service exists;other: service not exists
|
Pop $0 ; 0:service exists;other: service not exists
|
||||||
; Service exists
|
; Service exists
|
||||||
${If} $0 == 0
|
${If} $0 == 0
|
||||||
Push $0
|
Push $0
|
||||||
; Check if the service is running
|
; Check if the service is running
|
||||||
SimpleSC::ServiceIsRunning "clash_verge_service"
|
SimpleSC::ServiceIsRunning "koala_clash_service"
|
||||||
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
|
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
|
||||||
Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)
|
Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)
|
||||||
${If} $0 == 0
|
${If} $0 == 0
|
||||||
Push $0
|
Push $0
|
||||||
${If} $1 == 0
|
${If} $1 == 0
|
||||||
DetailPrint "Restart Clash Verge Service..."
|
DetailPrint "Restart Koala Clash Service..."
|
||||||
SimpleSC::StartService "clash_verge_service" "" 30
|
SimpleSC::StartService "koala_clash_service" "" 30
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${ElseIf} $0 != 0
|
${ElseIf} $0 != 0
|
||||||
Push $0
|
Push $0
|
||||||
@@ -535,35 +535,35 @@ FunctionEnd
|
|||||||
${EndIf}
|
${EndIf}
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
!macro RemoveVergeService
|
!macro RemoveKoalaService
|
||||||
; Check if the service exists
|
; Check if the service exists
|
||||||
SimpleSC::ExistsService "clash_verge_service"
|
SimpleSC::ExistsService "koala_clash_service"
|
||||||
Pop $0 ; 0:service exists;other: service not exists
|
Pop $0 ; 0:service exists;other: service not exists
|
||||||
; Service exists
|
; Service exists
|
||||||
${If} $0 == 0
|
${If} $0 == 0
|
||||||
Push $0
|
Push $0
|
||||||
; Check if the service is running
|
; Check if the service is running
|
||||||
SimpleSC::ServiceIsRunning "clash_verge_service"
|
SimpleSC::ServiceIsRunning "koala_clash_service"
|
||||||
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
|
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
|
||||||
Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)
|
Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)
|
||||||
${If} $0 == 0
|
${If} $0 == 0
|
||||||
Push $0
|
Push $0
|
||||||
${If} $1 == 1
|
${If} $1 == 1
|
||||||
DetailPrint "Stop Clash Verge Service..."
|
DetailPrint "Stop Koala Clash Service..."
|
||||||
SimpleSC::StopService "clash_verge_service" 1 30
|
SimpleSC::StopService "koala_clash_service" 1 30
|
||||||
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
|
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
|
||||||
${If} $0 == 0
|
${If} $0 == 0
|
||||||
DetailPrint "Removing Clash Verge Service..."
|
DetailPrint "Removing Koala Clash Service..."
|
||||||
SimpleSC::RemoveService "clash_verge_service"
|
SimpleSC::RemoveService "koala_clash_service"
|
||||||
${ElseIf} $0 != 0
|
${ElseIf} $0 != 0
|
||||||
Push $0
|
Push $0
|
||||||
SimpleSC::GetErrorMessage
|
SimpleSC::GetErrorMessage
|
||||||
Pop $0
|
Pop $0
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Clash Verge Service Stop Error ($0)"
|
MessageBox MB_OK|MB_ICONSTOP "Koala Clash Service Stop Error ($0)"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${ElseIf} $1 == 0
|
${ElseIf} $1 == 0
|
||||||
DetailPrint "Removing Clash Verge Service..."
|
DetailPrint "Removing Koala Clash Service..."
|
||||||
SimpleSC::RemoveService "clash_verge_service"
|
SimpleSC::RemoveService "koala_clash_service"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${ElseIf} $0 != 0
|
${ElseIf} $0 != 0
|
||||||
Push $0
|
Push $0
|
||||||
@@ -764,7 +764,7 @@ Section Install
|
|||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
nsExec::Exec 'netsh int tcp res'
|
nsExec::Exec 'netsh int tcp res'
|
||||||
!insertmacro CheckIfAppIsRunning
|
!insertmacro CheckIfAppIsRunning
|
||||||
!insertmacro CheckAllVergeProcesses
|
!insertmacro CheckAllKoalaProcesses
|
||||||
|
|
||||||
; 清理自启动注册表项
|
; 清理自启动注册表项
|
||||||
DetailPrint "Cleaning auto-launch registry entries..."
|
DetailPrint "Cleaning auto-launch registry entries..."
|
||||||
@@ -772,32 +772,32 @@ Section Install
|
|||||||
StrCpy $R1 "Software\Microsoft\Windows\CurrentVersion\Run"
|
StrCpy $R1 "Software\Microsoft\Windows\CurrentVersion\Run"
|
||||||
|
|
||||||
SetRegView 64
|
SetRegView 64
|
||||||
; 清理旧版本的注册表项 (Clash Verge)
|
; 清理旧版本的注册表项 (Koala Clash)
|
||||||
ReadRegStr $R2 HKCU "$R1" "Clash Verge"
|
ReadRegStr $R2 HKCU "$R1" "Koala Clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKCU "$R1" "Clash Verge"
|
DeleteRegValue HKCU "$R1" "Koala Clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
ReadRegStr $R2 HKLM "$R1" "Clash Verge"
|
ReadRegStr $R2 HKLM "$R1" "Koala Clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKLM "$R1" "Clash Verge"
|
DeleteRegValue HKLM "$R1" "Koala Clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
; 清理新版本的注册表项 (clash-verge)
|
; 清理新版本的注册表项 (koala-clash)
|
||||||
ReadRegStr $R2 HKCU "$R1" "clash-verge"
|
ReadRegStr $R2 HKCU "$R1" "koala-clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKCU "$R1" "clash-verge"
|
DeleteRegValue HKCU "$R1" "koala-clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
ReadRegStr $R2 HKLM "$R1" "clash-verge"
|
ReadRegStr $R2 HKLM "$R1" "koala-clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKLM "$R1" "clash-verge"
|
DeleteRegValue HKLM "$R1" "koala-clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
; Delete old files before installation
|
; Delete old files before installation
|
||||||
; Delete clash-verge.desktop
|
; Delete koala-clash.desktop
|
||||||
IfFileExists "$INSTDIR\Clash Verge.exe" 0 +2
|
IfFileExists "$INSTDIR\Koala Clash.exe" 0 +2
|
||||||
Delete "$INSTDIR\Clash Verge.exe"
|
Delete "$INSTDIR\Koala Clash.exe"
|
||||||
|
|
||||||
; Copy main executable
|
; Copy main executable
|
||||||
File "${MAINBINARYSRCPATH}"
|
File "${MAINBINARYSRCPATH}"
|
||||||
@@ -815,7 +815,7 @@ Section Install
|
|||||||
File /a "/oname={{this}}" "{{@key}}"
|
File /a "/oname={{this}}" "{{@key}}"
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
!insertmacro StartVergeService
|
!insertmacro StartKoalaService
|
||||||
|
|
||||||
; Create uninstaller
|
; Create uninstaller
|
||||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||||
@@ -918,11 +918,11 @@ FunctionEnd
|
|||||||
Section Uninstall
|
Section Uninstall
|
||||||
;删除 window-state.json 文件
|
;删除 window-state.json 文件
|
||||||
SetShellVarContext current
|
SetShellVarContext current
|
||||||
Delete "$APPDATA\io.github.clash-verge-rev.clash-verge-rev\window-state.json"
|
Delete "$APPDATA\io.github.koala-clash\window-state.json"
|
||||||
|
|
||||||
!insertmacro CheckIfAppIsRunning
|
!insertmacro CheckIfAppIsRunning
|
||||||
!insertmacro CheckAllVergeProcesses
|
!insertmacro CheckAllKoalaProcesses
|
||||||
!insertmacro RemoveVergeService
|
!insertmacro RemoveKoalaService
|
||||||
|
|
||||||
; 清理自启动注册表项
|
; 清理自启动注册表项
|
||||||
DetailPrint "Cleaning auto-launch registry entries..."
|
DetailPrint "Cleaning auto-launch registry entries..."
|
||||||
@@ -930,26 +930,26 @@ Section Uninstall
|
|||||||
StrCpy $R1 "Software\Microsoft\Windows\CurrentVersion\Run"
|
StrCpy $R1 "Software\Microsoft\Windows\CurrentVersion\Run"
|
||||||
|
|
||||||
SetRegView 64
|
SetRegView 64
|
||||||
; 清理旧版本的注册表项 (Clash Verge)
|
; 清理旧版本的注册表项 (Koala Clash)
|
||||||
ReadRegStr $R2 HKCU "$R1" "Clash Verge"
|
ReadRegStr $R2 HKCU "$R1" "Koala Clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKCU "$R1" "Clash Verge"
|
DeleteRegValue HKCU "$R1" "Koala Clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
ReadRegStr $R2 HKLM "$R1" "Clash Verge"
|
ReadRegStr $R2 HKLM "$R1" "Koala Clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKLM "$R1" "Clash Verge"
|
DeleteRegValue HKLM "$R1" "Koala Clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
; 清理新版本的注册表项 (clash-verge)
|
; 清理新版本的注册表项 (koala-clash)
|
||||||
ReadRegStr $R2 HKCU "$R1" "clash-verge"
|
ReadRegStr $R2 HKCU "$R1" "koala-clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKCU "$R1" "clash-verge"
|
DeleteRegValue HKCU "$R1" "koala-clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
ReadRegStr $R2 HKLM "$R1" "clash-verge"
|
ReadRegStr $R2 HKLM "$R1" "koala-clash"
|
||||||
${If} $R2 != ""
|
${If} $R2 != ""
|
||||||
DeleteRegValue HKLM "$R1" "clash-verge"
|
DeleteRegValue HKLM "$R1" "koala-clash"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
; Delete the app directory and its content from disk
|
; Delete the app directory and its content from disk
|
||||||
@@ -966,9 +966,9 @@ Section Uninstall
|
|||||||
Delete "$INSTDIR\\{{this}}"
|
Delete "$INSTDIR\\{{this}}"
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
; Delete clash-verge.desktop
|
; Delete koala-clash.desktop
|
||||||
IfFileExists "$INSTDIR\Clash Verge.exe" 0 +2
|
IfFileExists "$INSTDIR\Koala Clash.exe" 0 +2
|
||||||
Delete "$INSTDIR\Clash Verge.exe"
|
Delete "$INSTDIR\Koala Clash.exe"
|
||||||
|
|
||||||
; Delete uninstaller
|
; Delete uninstaller
|
||||||
Delete "$INSTDIR\uninstall.exe"
|
Delete "$INSTDIR\uninstall.exe"
|
||||||
@@ -982,20 +982,20 @@ Section Uninstall
|
|||||||
!insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
!insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
||||||
!insertmacro UnpinShortcut "$DESKTOP\${PRODUCTNAME}.lnk"
|
!insertmacro UnpinShortcut "$DESKTOP\${PRODUCTNAME}.lnk"
|
||||||
; 兼容旧名称快捷方式
|
; 兼容旧名称快捷方式
|
||||||
!insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\clash-verge.lnk"
|
!insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\koala-clash.lnk"
|
||||||
!insertmacro UnpinShortcut "$DESKTOP\clash-verge.lnk"
|
!insertmacro UnpinShortcut "$DESKTOP\koala-clash.lnk"
|
||||||
|
|
||||||
; Remove start menu shortcut
|
; Remove start menu shortcut
|
||||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder
|
||||||
Delete "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
Delete "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk"
|
||||||
; 兼容旧名称快捷方式
|
; 兼容旧名称快捷方式
|
||||||
Delete "$SMPROGRAMS\$AppStartMenuFolder\clash-verge.lnk"
|
Delete "$SMPROGRAMS\$AppStartMenuFolder\koala-clash.lnk"
|
||||||
RMDir "$SMPROGRAMS\$AppStartMenuFolder"
|
RMDir "$SMPROGRAMS\$AppStartMenuFolder"
|
||||||
|
|
||||||
; Remove desktop shortcuts
|
; Remove desktop shortcuts
|
||||||
Delete "$DESKTOP\${PRODUCTNAME}.lnk"
|
Delete "$DESKTOP\${PRODUCTNAME}.lnk"
|
||||||
; 兼容旧名称快捷方式
|
; 兼容旧名称快捷方式
|
||||||
Delete "$DESKTOP\clash-verge.lnk"
|
Delete "$DESKTOP\koala-clash.lnk"
|
||||||
|
|
||||||
; Remove registry information for add/remove programs
|
; Remove registry information for add/remove programs
|
||||||
!if "${INSTALLMODE}" == "both"
|
!if "${INSTALLMODE}" == "both"
|
||||||
@@ -1017,7 +1017,7 @@ Section Uninstall
|
|||||||
|
|
||||||
;删除 window-state.json 文件
|
;删除 window-state.json 文件
|
||||||
SetShellVarContext current
|
SetShellVarContext current
|
||||||
Delete "$APPDATA\io.github.clash-verge-rev.clash-verge-rev\window-state.json"
|
Delete "$APPDATA\io.github.koala-clash\window-state.json"
|
||||||
|
|
||||||
${GetOptions} $CMDLINE "/P" $R0
|
${GetOptions} $CMDLINE "/P" $R0
|
||||||
IfErrors +2 0
|
IfErrors +2 0
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ impl IClashTemp {
|
|||||||
help::save_yaml(
|
help::save_yaml(
|
||||||
&dirs::clash_path()?,
|
&dirs::clash_path()?,
|
||||||
&self.0,
|
&self.0,
|
||||||
Some("# Generated by Clash Verge"),
|
Some("# Generated by Koala Clash"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ use once_cell::sync::OnceCell;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use tokio::time::{sleep, Duration};
|
use tokio::time::{sleep, Duration};
|
||||||
|
|
||||||
pub const RUNTIME_CONFIG: &str = "clash-verge.yaml";
|
pub const RUNTIME_CONFIG: &str = "koala-clash.yaml";
|
||||||
pub const CHECK_CONFIG: &str = "clash-verge-check.yaml";
|
pub const CHECK_CONFIG: &str = "koala-clash-check.yaml";
|
||||||
|
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
clash_config: Draft<Box<IClashTemp>>,
|
clash_config: Draft<Box<IClashTemp>>,
|
||||||
@@ -141,7 +141,7 @@ impl Config {
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.ok_or(anyhow!("failed to get runtime config"))?;
|
.ok_or(anyhow!("failed to get runtime config"))?;
|
||||||
|
|
||||||
help::save_yaml(&path, &config, Some("# Generated by Clash Verge"))?;
|
help::save_yaml(&path, &config, Some("# Generated by Koala Clash"))?;
|
||||||
Ok(path)
|
Ok(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ use crate::utils::{
|
|||||||
tmpl,
|
tmpl,
|
||||||
};
|
};
|
||||||
use anyhow::{bail, Context, Result};
|
use anyhow::{bail, Context, Result};
|
||||||
|
use base64::{engine::general_purpose::STANDARD, Engine as _};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_yaml::Mapping;
|
use serde_yaml::Mapping;
|
||||||
use std::{fs, time::Duration};
|
use std::{fs, time::Duration};
|
||||||
use base64::{engine::general_purpose::STANDARD, Engine as _};
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use super::Config;
|
use super::Config;
|
||||||
@@ -407,7 +407,8 @@ impl PrfItem {
|
|||||||
Some(value) => {
|
Some(value) => {
|
||||||
let str_value = value.to_str().unwrap_or("");
|
let str_value = value.to_str().unwrap_or("");
|
||||||
if let Some(b64_data) = str_value.strip_prefix("base64:") {
|
if let Some(b64_data) = str_value.strip_prefix("base64:") {
|
||||||
STANDARD.decode(b64_data)
|
STANDARD
|
||||||
|
.decode(b64_data)
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|bytes| String::from_utf8(bytes).ok())
|
.and_then(|bytes| String::from_utf8(bytes).ok())
|
||||||
} else {
|
} else {
|
||||||
@@ -423,7 +424,7 @@ impl PrfItem {
|
|||||||
bail!(announce_msg.clone());
|
bail!(announce_msg.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let announce_url = match header.get("announce-url") {
|
let announce_url = match header.get("announce-url") {
|
||||||
Some(value) => {
|
Some(value) => {
|
||||||
let str_value = value.to_str().unwrap_or("");
|
let str_value = value.to_str().unwrap_or("");
|
||||||
@@ -436,7 +437,8 @@ impl PrfItem {
|
|||||||
Some(value) => {
|
Some(value) => {
|
||||||
let str_value = value.to_str().unwrap_or("");
|
let str_value = value.to_str().unwrap_or("");
|
||||||
if let Some(b64_data) = str_value.strip_prefix("base64:") {
|
if let Some(b64_data) = str_value.strip_prefix("base64:") {
|
||||||
STANDARD.decode(b64_data)
|
STANDARD
|
||||||
|
.decode(b64_data)
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|bytes| String::from_utf8(bytes).ok())
|
.and_then(|bytes| String::from_utf8(bytes).ok())
|
||||||
} else {
|
} else {
|
||||||
@@ -448,7 +450,9 @@ impl PrfItem {
|
|||||||
|
|
||||||
let uid = help::get_uid("R");
|
let uid = help::get_uid("R");
|
||||||
let file = format!("{uid}.yaml");
|
let file = format!("{uid}.yaml");
|
||||||
let name = name.or(profile_title).unwrap_or(filename.unwrap_or("Remote File".into()));
|
let name = name
|
||||||
|
.or(profile_title)
|
||||||
|
.unwrap_or(filename.unwrap_or("Remote File".into()));
|
||||||
let data = resp.text_with_charset("utf-8").await?;
|
let data = resp.text_with_charset("utf-8").await?;
|
||||||
|
|
||||||
// process the charset "UTF-8 with BOM"
|
// process the charset "UTF-8 with BOM"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ impl IProfiles {
|
|||||||
help::save_yaml(
|
help::save_yaml(
|
||||||
&dirs::profiles_path()?,
|
&dirs::profiles_path()?,
|
||||||
self,
|
self,
|
||||||
Some("# Profiles Config for Clash Verge"),
|
Some("# Profiles Config for Koala Clash"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ pub struct IVergeTheme {
|
|||||||
|
|
||||||
impl IVerge {
|
impl IVerge {
|
||||||
/// 有效的clash核心名称
|
/// 有效的clash核心名称
|
||||||
pub const VALID_CLASH_CORES: &'static [&'static str] = &["verge-mihomo", "verge-mihomo-alpha"];
|
pub const VALID_CLASH_CORES: &'static [&'static str] = &["koala-mihomo", "koala-mihomo-alpha"];
|
||||||
|
|
||||||
/// 验证并修正配置文件中的clash_core值
|
/// 验证并修正配置文件中的clash_core值
|
||||||
pub fn validate_and_fix_config() -> Result<()> {
|
pub fn validate_and_fix_config() -> Result<()> {
|
||||||
@@ -257,10 +257,10 @@ impl IVerge {
|
|||||||
warn,
|
warn,
|
||||||
Type::Config,
|
Type::Config,
|
||||||
true,
|
true,
|
||||||
"启动时发现无效的clash_core配置: '{}', 将自动修正为 'verge-mihomo'",
|
"启动时发现无效的clash_core配置: '{}', 将自动修正为 'koala-mihomo'",
|
||||||
core
|
core
|
||||||
);
|
);
|
||||||
config.clash_core = Some("verge-mihomo".to_string());
|
config.clash_core = Some("koala-mihomo".to_string());
|
||||||
needs_fix = true;
|
needs_fix = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -268,16 +268,16 @@ impl IVerge {
|
|||||||
info,
|
info,
|
||||||
Type::Config,
|
Type::Config,
|
||||||
true,
|
true,
|
||||||
"启动时发现未配置clash_core, 将设置为默认值 'verge-mihomo'"
|
"启动时发现未配置clash_core, 将设置为默认值 'koala-mihomo'"
|
||||||
);
|
);
|
||||||
config.clash_core = Some("verge-mihomo".to_string());
|
config.clash_core = Some("koala-mihomo".to_string());
|
||||||
needs_fix = true;
|
needs_fix = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修正后保存配置
|
// 修正后保存配置
|
||||||
if needs_fix {
|
if needs_fix {
|
||||||
logging!(info, Type::Config, true, "正在保存修正后的配置文件...");
|
logging!(info, Type::Config, true, "正在保存修正后的配置文件...");
|
||||||
help::save_yaml(&config_path, &config, Some("# Clash Verge Config"))?;
|
help::save_yaml(&config_path, &config, Some("# Koala Clash Config"))?;
|
||||||
logging!(
|
logging!(
|
||||||
info,
|
info,
|
||||||
Type::Config,
|
Type::Config,
|
||||||
@@ -321,7 +321,7 @@ impl IVerge {
|
|||||||
pub fn get_valid_clash_core(&self) -> String {
|
pub fn get_valid_clash_core(&self) -> String {
|
||||||
self.clash_core
|
self.clash_core
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or_else(|| "verge-mihomo".to_string())
|
.unwrap_or_else(|| "koala-mihomo".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_system_language() -> String {
|
fn get_system_language() -> String {
|
||||||
@@ -340,18 +340,15 @@ impl IVerge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
match dirs::verge_path().and_then(|path| help::read_yaml::<IVerge>(&path)) {
|
dirs::verge_path().and_then(|path| help::read_yaml::<IVerge>(&path)).unwrap_or_else(|err| {
|
||||||
Ok(config) => config,
|
log::error!(target: "app", "{err}");
|
||||||
Err(err) => {
|
Self::template()
|
||||||
log::error!(target: "app", "{err}");
|
})
|
||||||
Self::template()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn template() -> Self {
|
pub fn template() -> Self {
|
||||||
Self {
|
Self {
|
||||||
clash_core: Some("verge-mihomo".into()),
|
clash_core: Some("koala-mihomo".into()),
|
||||||
language: Some(Self::get_system_language()),
|
language: Some(Self::get_system_language()),
|
||||||
theme_mode: Some("system".into()),
|
theme_mode: Some("system".into()),
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
@@ -415,7 +412,7 @@ impl IVerge {
|
|||||||
|
|
||||||
/// Save IVerge App Config
|
/// Save IVerge App Config
|
||||||
pub fn save_file(&self) -> Result<()> {
|
pub fn save_file(&self) -> Result<()> {
|
||||||
help::save_yaml(&dirs::verge_path()?, &self, Some("# Clash Verge Config"))
|
help::save_yaml(&dirs::verge_path()?, &self, Some("# Koala Clash Config"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// patch verge config
|
/// patch verge config
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ impl WebDavClient {
|
|||||||
reqwest::Client::builder()
|
reqwest::Client::builder()
|
||||||
.danger_accept_invalid_certs(true)
|
.danger_accept_invalid_certs(true)
|
||||||
.timeout(Duration::from_secs(op.timeout()))
|
.timeout(Duration::from_secs(op.timeout()))
|
||||||
.user_agent(format!("clash-verge/{APP_VERSION} ({OS} WebDAV-Client)"))
|
.user_agent(format!("koala-clash/{APP_VERSION} ({OS} WebDAV-Client)"))
|
||||||
.redirect(reqwest::redirect::Policy::custom(|attempt| {
|
.redirect(reqwest::redirect::Policy::custom(|attempt| {
|
||||||
// 允许所有请求类型的重定向,包括PUT
|
// 允许所有请求类型的重定向,包括PUT
|
||||||
if attempt.previous().len() >= 5 {
|
if attempt.previous().len() >= 5 {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ impl CoreManager {
|
|||||||
help::save_yaml(
|
help::save_yaml(
|
||||||
&runtime_path,
|
&runtime_path,
|
||||||
&Config::clash().latest().0,
|
&Config::clash().latest().0,
|
||||||
Some("# Clash Verge Runtime"),
|
Some("# Koala Clash Runtime"),
|
||||||
)?;
|
)?;
|
||||||
handle::Handle::notice_message(msg_type, msg_content);
|
handle::Handle::notice_message(msg_type, msg_content);
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -443,7 +443,7 @@ impl CoreManager {
|
|||||||
child_guard.as_ref().map(|child| child.pid())
|
child_guard.as_ref().map(|child| child.pid())
|
||||||
};
|
};
|
||||||
|
|
||||||
let target_processes = ["verge-mihomo", "verge-mihomo-alpha"];
|
let target_processes = ["koala-mihomo", "koala-mihomo-alpha"];
|
||||||
|
|
||||||
// 并行查找所有目标进程
|
// 并行查找所有目标进程
|
||||||
let mut process_futures = Vec::new();
|
let mut process_futures = Vec::new();
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ pub async fn check_ipc_service_status() -> Result<JsonResponse> {
|
|||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
logging!(error, Type::Service, true, "IPC通信失败: {}", e);
|
logging!(error, Type::Service, true, "IPC通信失败: {}", e);
|
||||||
bail!("无法连接到Clash Verge Service: {}", e)
|
bail!("无法连接到Koala Clash Service: {}", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -667,7 +667,7 @@ pub async fn check_service_version() -> Result<String> {
|
|||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
logging!(error, Type::Service, true, "IPC通信失败: {}", e);
|
logging!(error, Type::Service, true, "IPC通信失败: {}", e);
|
||||||
bail!("无法连接到Clash Verge Service: {}", e)
|
bail!("无法连接到Koala Clash Service: {}", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -814,7 +814,7 @@ pub(super) async fn start_with_existing_service(config_file: &PathBuf) -> Result
|
|||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
logging!(error, Type::Service, true, "启动核心IPC通信失败: {}", e);
|
logging!(error, Type::Service, true, "启动核心IPC通信失败: {}", e);
|
||||||
bail!("无法连接到Clash Verge Service: {}", e)
|
bail!("无法连接到Koala Clash Service: {}", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -910,7 +910,7 @@ pub(super) async fn stop_core_by_service() -> Result<()> {
|
|||||||
let payload = serde_json::json!({});
|
let payload = serde_json::json!({});
|
||||||
let response = send_ipc_request(IpcCommand::StopClash, payload)
|
let response = send_ipc_request(IpcCommand::StopClash, payload)
|
||||||
.await
|
.await
|
||||||
.context("无法连接到Clash Verge Service")?;
|
.context("无法连接到Koala Clash Service")?;
|
||||||
|
|
||||||
if !response.success {
|
if !response.success {
|
||||||
bail!(response.error.unwrap_or_else(|| "停止核心失败".to_string()));
|
bail!(response.error.unwrap_or_else(|| "停止核心失败".to_string()));
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ use sha2::{Digest, Sha256};
|
|||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
const IPC_SOCKET_NAME: &str = if cfg!(windows) {
|
const IPC_SOCKET_NAME: &str = if cfg!(windows) {
|
||||||
r"\\.\pipe\clash-verge-service"
|
r"\\.\pipe\koala-clash-service"
|
||||||
} else {
|
} else {
|
||||||
"/tmp/clash-verge-service.sock"
|
"/tmp/koala-clash-service.sock"
|
||||||
};
|
};
|
||||||
|
|
||||||
// 定义命令类型
|
// 定义命令类型
|
||||||
@@ -43,7 +43,7 @@ pub struct IpcResponse {
|
|||||||
fn derive_secret_key() -> Vec<u8> {
|
fn derive_secret_key() -> Vec<u8> {
|
||||||
// to do
|
// to do
|
||||||
// 从系统安全存储中获取或从程序安装时生成的密钥文件中读取
|
// 从系统安全存储中获取或从程序安装时生成的密钥文件中读取
|
||||||
let unique_app_id = "clash-verge-app-secret-fuck-me-until-daylight";
|
let unique_app_id = "koala-clash-app-secret-fuck-me-until-daylight";
|
||||||
let mut hasher = Sha256::new();
|
let mut hasher = Sha256::new();
|
||||||
hasher.update(unique_app_id.as_bytes());
|
hasher.update(unique_app_id.as_bytes());
|
||||||
hasher.finalize().to_vec()
|
hasher.finalize().to_vec()
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ impl Tray {
|
|||||||
|
|
||||||
if let Some(tray) = app_handle.tray_by_id("main") {
|
if let Some(tray) = app_handle.tray_by_id("main") {
|
||||||
let _ = tray.set_tooltip(Some(&format!(
|
let _ = tray.set_tooltip(Some(&format!(
|
||||||
"Clash Verge {version}\n{}: {}\n{}: {}\n{}: {}",
|
"Koala Clash {version}\n{}: {}\n{}: {}\n{}: {}",
|
||||||
t("SysProxy"),
|
t("SysProxy"),
|
||||||
switch_map[system_proxy],
|
switch_map[system_proxy],
|
||||||
t("TUN"),
|
t("TUN"),
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ impl ChainSupport {
|
|||||||
(self, core.as_str()),
|
(self, core.as_str()),
|
||||||
(ChainSupport::All, _)
|
(ChainSupport::All, _)
|
||||||
| (ChainSupport::Clash, "clash")
|
| (ChainSupport::Clash, "clash")
|
||||||
| (ChainSupport::ClashMeta, "verge-mihomo")
|
| (ChainSupport::ClashMeta, "koala-mihomo")
|
||||||
| (ChainSupport::ClashMetaAlpha, "verge-mihomo-alpha")
|
| (ChainSupport::ClashMetaAlpha, "koala-mihomo-alpha")
|
||||||
),
|
),
|
||||||
None => true,
|
None => true,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ pub fn get_exe_path() -> Result<PathBuf> {
|
|||||||
pub fn create_shortcut() -> Result<()> {
|
pub fn create_shortcut() -> Result<()> {
|
||||||
let exe_path = get_exe_path()?;
|
let exe_path = get_exe_path()?;
|
||||||
let startup_dir = get_startup_dir()?;
|
let startup_dir = get_startup_dir()?;
|
||||||
let shortcut_path = startup_dir.join("Clash-Verge.lnk");
|
let shortcut_path = startup_dir.join("Koala-Clash.lnk");
|
||||||
|
|
||||||
// 如果快捷方式已存在,直接返回成功
|
// 如果快捷方式已存在,直接返回成功
|
||||||
if shortcut_path.exists() {
|
if shortcut_path.exists() {
|
||||||
@@ -77,7 +77,7 @@ pub fn create_shortcut() -> Result<()> {
|
|||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub fn remove_shortcut() -> Result<()> {
|
pub fn remove_shortcut() -> Result<()> {
|
||||||
let startup_dir = get_startup_dir()?;
|
let startup_dir = get_startup_dir()?;
|
||||||
let shortcut_path = startup_dir.join("Clash-Verge.lnk");
|
let shortcut_path = startup_dir.join("Koala-Clash.lnk");
|
||||||
|
|
||||||
// 如果快捷方式不存在,直接返回成功
|
// 如果快捷方式不存在,直接返回成功
|
||||||
if !shortcut_path.exists() {
|
if !shortcut_path.exists() {
|
||||||
@@ -96,7 +96,7 @@ pub fn remove_shortcut() -> Result<()> {
|
|||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub fn is_shortcut_enabled() -> Result<bool> {
|
pub fn is_shortcut_enabled() -> Result<bool> {
|
||||||
let startup_dir = get_startup_dir()?;
|
let startup_dir = get_startup_dir()?;
|
||||||
let shortcut_path = startup_dir.join("Clash-Verge.lnk");
|
let shortcut_path = startup_dir.join("Koala-Clash.lnk");
|
||||||
|
|
||||||
Ok(shortcut_path.exists())
|
Ok(shortcut_path.exists())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ use std::{fs, path::PathBuf};
|
|||||||
use tauri::Manager;
|
use tauri::Manager;
|
||||||
|
|
||||||
#[cfg(not(feature = "verge-dev"))]
|
#[cfg(not(feature = "verge-dev"))]
|
||||||
pub static APP_ID: &str = "io.github.clash-verge-rev.clash-verge-rev";
|
pub static APP_ID: &str = "io.github.koala-clash";
|
||||||
#[cfg(not(feature = "verge-dev"))]
|
#[cfg(not(feature = "verge-dev"))]
|
||||||
pub static BACKUP_DIR: &str = "clash-verge-rev-backup";
|
pub static BACKUP_DIR: &str = "io.github.koala-clash-backup";
|
||||||
|
|
||||||
#[cfg(feature = "verge-dev")]
|
#[cfg(feature = "verge-dev")]
|
||||||
pub static APP_ID: &str = "io.github.clash-verge-rev.clash-verge-rev.dev";
|
pub static APP_ID: &str = "io.github.koala-clash.dev";
|
||||||
#[cfg(feature = "verge-dev")]
|
#[cfg(feature = "verge-dev")]
|
||||||
pub static BACKUP_DIR: &str = "clash-verge-rev-backup-dev";
|
pub static BACKUP_DIR: &str = "io.github.koala-clash-backup-dev";
|
||||||
|
|
||||||
pub static PORTABLE_FLAG: OnceCell<bool> = OnceCell::new();
|
pub static PORTABLE_FLAG: OnceCell<bool> = OnceCell::new();
|
||||||
|
|
||||||
@@ -188,13 +188,13 @@ pub fn profiles_path() -> Result<PathBuf> {
|
|||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn service_path() -> Result<PathBuf> {
|
pub fn service_path() -> Result<PathBuf> {
|
||||||
let res_dir = app_resources_dir()?;
|
let res_dir = app_resources_dir()?;
|
||||||
Ok(res_dir.join("clash-verge-service"))
|
Ok(res_dir.join("koala-clash-service"))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn service_path() -> Result<PathBuf> {
|
pub fn service_path() -> Result<PathBuf> {
|
||||||
let res_dir = app_resources_dir()?;
|
let res_dir = app_resources_dir()?;
|
||||||
Ok(res_dir.join("clash-verge-service.exe"))
|
Ok(res_dir.join("koala-clash-service.exe"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn service_log_file() -> Result<PathBuf> {
|
pub fn service_log_file() -> Result<PathBuf> {
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ fn init_dns_config() -> Result<()> {
|
|||||||
help::save_yaml(
|
help::save_yaml(
|
||||||
&dns_path,
|
&dns_path,
|
||||||
&default_dns_config,
|
&default_dns_config,
|
||||||
Some("# Clash Verge DNS Config"),
|
Some("# Koala Clash DNS Config"),
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,14 +274,14 @@ pub fn init_config() -> Result<()> {
|
|||||||
|
|
||||||
crate::log_err!(dirs::clash_path().map(|path| {
|
crate::log_err!(dirs::clash_path().map(|path| {
|
||||||
if !path.exists() {
|
if !path.exists() {
|
||||||
help::save_yaml(&path, &IClashTemp::template().0, Some("# Clash Vergeasu"))?;
|
help::save_yaml(&path, &IClashTemp::template().0, Some("# Koala Clash"))?;
|
||||||
}
|
}
|
||||||
<Result<()>>::Ok(())
|
<Result<()>>::Ok(())
|
||||||
}));
|
}));
|
||||||
|
|
||||||
crate::log_err!(dirs::verge_path().map(|path| {
|
crate::log_err!(dirs::verge_path().map(|path| {
|
||||||
if !path.exists() {
|
if !path.exists() {
|
||||||
help::save_yaml(&path, &IVerge::template(), Some("# Clash Verge"))?;
|
help::save_yaml(&path, &IVerge::template(), Some("# Koala Clash"))?;
|
||||||
}
|
}
|
||||||
<Result<()>>::Ok(())
|
<Result<()>>::Ok(())
|
||||||
}));
|
}));
|
||||||
@@ -291,7 +291,7 @@ pub fn init_config() -> Result<()> {
|
|||||||
|
|
||||||
crate::log_err!(dirs::profiles_path().map(|path| {
|
crate::log_err!(dirs::profiles_path().map(|path| {
|
||||||
if !path.exists() {
|
if !path.exists() {
|
||||||
help::save_yaml(&path, &IProfiles::template(), Some("# Clash Verge"))?;
|
help::save_yaml(&path, &IProfiles::template(), Some("# Koala Clash"))?;
|
||||||
}
|
}
|
||||||
<Result<()>>::Ok(())
|
<Result<()>>::Ok(())
|
||||||
}));
|
}));
|
||||||
@@ -371,8 +371,8 @@ pub fn init_scheme() -> Result<()> {
|
|||||||
|
|
||||||
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||||
let (clash, _) = hkcu.create_subkey("Software\\Classes\\Clash")?;
|
let (clash, _) = hkcu.create_subkey("Software\\Classes\\Clash")?;
|
||||||
clash.set_value("", &"Clash Verge")?;
|
clash.set_value("", &"Koala Clash")?;
|
||||||
clash.set_value("URL Protocol", &"Clash Verge URL Scheme Protocol")?;
|
clash.set_value("URL Protocol", &"Koala Clash URL Scheme Protocol")?;
|
||||||
let (default_icon, _) = hkcu.create_subkey("Software\\Classes\\Clash\\DefaultIcon")?;
|
let (default_icon, _) = hkcu.create_subkey("Software\\Classes\\Clash\\DefaultIcon")?;
|
||||||
default_icon.set_value("", &app_exe)?;
|
default_icon.set_value("", &app_exe)?;
|
||||||
let (command, _) = hkcu.create_subkey("Software\\Classes\\Clash\\Shell\\Open\\Command")?;
|
let (command, _) = hkcu.create_subkey("Software\\Classes\\Clash\\Shell\\Open\\Command")?;
|
||||||
@@ -384,7 +384,7 @@ pub fn init_scheme() -> Result<()> {
|
|||||||
pub fn init_scheme() -> Result<()> {
|
pub fn init_scheme() -> Result<()> {
|
||||||
let output = std::process::Command::new("xdg-mime")
|
let output = std::process::Command::new("xdg-mime")
|
||||||
.arg("default")
|
.arg("default")
|
||||||
.arg("clash-verge.desktop")
|
.arg("koala-clash.desktop")
|
||||||
.arg("x-scheme-handler/clash")
|
.arg("x-scheme-handler/clash")
|
||||||
.output()?;
|
.output()?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ pub mod network;
|
|||||||
pub mod notification;
|
pub mod notification;
|
||||||
pub mod resolve;
|
pub mod resolve;
|
||||||
pub mod server;
|
pub mod server;
|
||||||
|
pub mod sys_info;
|
||||||
pub mod tmpl;
|
pub mod tmpl;
|
||||||
pub mod window_manager;
|
pub mod window_manager;
|
||||||
pub mod sys_info;
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ impl NetworkManager {
|
|||||||
// 创建专用的异步运行时,线程数限制为4个
|
// 创建专用的异步运行时,线程数限制为4个
|
||||||
let runtime = Builder::new_multi_thread()
|
let runtime = Builder::new_multi_thread()
|
||||||
.worker_threads(4)
|
.worker_threads(4)
|
||||||
.thread_name("clash-verge-network")
|
.thread_name("koala-clash-network")
|
||||||
.enable_io()
|
.enable_io()
|
||||||
.enable_time()
|
.enable_time()
|
||||||
.build()
|
.build()
|
||||||
@@ -323,8 +323,8 @@ impl NetworkManager {
|
|||||||
use crate::utils::resolve::VERSION;
|
use crate::utils::resolve::VERSION;
|
||||||
|
|
||||||
let version = match VERSION.get() {
|
let version = match VERSION.get() {
|
||||||
Some(v) => format!("clash-verge/v{v}"),
|
Some(v) => format!("koala-clash/v{v}"),
|
||||||
None => "clash-verge/unknown".to_string(),
|
None => "koala-clash/unknown".to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
builder = builder.user_agent(version);
|
builder = builder.user_agent(version);
|
||||||
|
|||||||
@@ -549,7 +549,7 @@ pub async fn resolve_scheme(param: String) -> Result<()> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if link_parsed.scheme() == "clash" || link_parsed.scheme() == "clash-verge" {
|
if link_parsed.scheme() == "clash" || link_parsed.scheme() == "koala-clash" {
|
||||||
let mut name: Option<String> = None;
|
let mut name: Option<String> = None;
|
||||||
let mut url_param: Option<String> = None;
|
let mut url_param: Option<String> = None;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Some config file template
|
//! Some config file template
|
||||||
|
|
||||||
/// template for new a profile item
|
/// template for new a profile item
|
||||||
pub const ITEM_LOCAL: &str = "# Profile Template for Clash Verge
|
pub const ITEM_LOCAL: &str = "# Profile Template for Koala Clash
|
||||||
|
|
||||||
proxies: []
|
proxies: []
|
||||||
|
|
||||||
@@ -11,13 +11,13 @@ rules: []
|
|||||||
";
|
";
|
||||||
|
|
||||||
/// enhanced profile
|
/// enhanced profile
|
||||||
pub const ITEM_MERGE: &str = "# Profile Enhancement Merge Template for Clash Verge
|
pub const ITEM_MERGE: &str = "# Profile Enhancement Merge Template for Koala Clash
|
||||||
|
|
||||||
profile:
|
profile:
|
||||||
store-selected: true
|
store-selected: true
|
||||||
";
|
";
|
||||||
|
|
||||||
pub const ITEM_MERGE_EMPTY: &str = "# Profile Enhancement Merge Template for Clash Verge
|
pub const ITEM_MERGE_EMPTY: &str = "# Profile Enhancement Merge Template for Koala Clash
|
||||||
|
|
||||||
";
|
";
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ function main(config, profileName) {
|
|||||||
";
|
";
|
||||||
|
|
||||||
/// enhanced profile
|
/// enhanced profile
|
||||||
pub const ITEM_RULES: &str = "# Profile Enhancement Rules Template for Clash Verge
|
pub const ITEM_RULES: &str = "# Profile Enhancement Rules Template for Koala Clash
|
||||||
|
|
||||||
prepend: []
|
prepend: []
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ delete: []
|
|||||||
";
|
";
|
||||||
|
|
||||||
/// enhanced profile
|
/// enhanced profile
|
||||||
pub const ITEM_PROXIES: &str = "# Profile Enhancement Proxies Template for Clash Verge
|
pub const ITEM_PROXIES: &str = "# Profile Enhancement Proxies Template for Koala Clash
|
||||||
|
|
||||||
prepend: []
|
prepend: []
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ delete: []
|
|||||||
";
|
";
|
||||||
|
|
||||||
/// enhanced profile
|
/// enhanced profile
|
||||||
pub const ITEM_GROUPS: &str = "# Profile Enhancement Groups Template for Clash Verge
|
pub const ITEM_GROUPS: &str = "# Profile Enhancement Groups Template for Koala Clash
|
||||||
|
|
||||||
prepend: []
|
prepend: []
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
],
|
],
|
||||||
"resources": ["resources", "resources/locales/*"],
|
"resources": ["resources", "resources/locales/*"],
|
||||||
"publisher": "Koala Clash",
|
"publisher": "Koala Clash",
|
||||||
"externalBin": ["sidecar/verge-mihomo", "sidecar/verge-mihomo-alpha"],
|
"externalBin": ["sidecar/koala-mihomo", "sidecar/koala-mihomo-alpha"],
|
||||||
"copyright": "GNU General Public License v3.0",
|
"copyright": "GNU General Public License v3.0",
|
||||||
"category": "DeveloperTool",
|
"category": "DeveloperTool",
|
||||||
"shortDescription": "Koala Clash",
|
"shortDescription": "Koala Clash",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"devUrl": "http://localhost:3000/"
|
"devUrl": "http://localhost:3000/"
|
||||||
},
|
},
|
||||||
"productName": "Koala Clash",
|
"productName": "Koala Clash",
|
||||||
"identifier": "io.github.clash-verge-rev.clash-verge-rev",
|
"identifier": "io.github.koala-clash",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"updater": {
|
"updater": {
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IERCQjQ1QjQ0QUJDQTU1RTkKUldUcFZjcXJSRnUwMjdXSERoZVQ1R0hHRDMrT3VkSmpvbDJmb01sN3ZpYWhVYnEwaWpYUWU4YU0K",
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IERCQjQ1QjQ0QUJDQTU1RTkKUldUcFZjcXJSRnUwMjdXSERoZVQ1R0hHRDMrT3VkSmpvbDJmb01sN3ZpYWhVYnEwaWpYUWU4YU0K",
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
},
|
},
|
||||||
"deep-link": {
|
"deep-link": {
|
||||||
"desktop": {
|
"desktop": {
|
||||||
"schemes": ["clash", "clash-verge"]
|
"schemes": ["clash", "koala-clash"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"identifier": "io.github.clash-verge-rev.clash-verge-rev",
|
"identifier": "io.github.koala-clash",
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"targets": ["deb", "rpm"],
|
"targets": ["deb", "rpm"],
|
||||||
"linux": {
|
"linux": {
|
||||||
"deb": {
|
"deb": {
|
||||||
"depends": ["openssl"],
|
"depends": ["openssl"],
|
||||||
"desktopTemplate": "./packages/linux/clash-verge.desktop",
|
"desktopTemplate": "./packages/linux/koala-clash.desktop",
|
||||||
"provides": ["clash-verge"],
|
"provides": ["koala-clash"],
|
||||||
"conflicts": ["clash-verge"],
|
"conflicts": ["koala-clash"],
|
||||||
"replaces": ["clash-verge"],
|
"replaces": ["koala-clash"],
|
||||||
"postInstallScript": "./packages/linux/post-install.sh",
|
"postInstallScript": "./packages/linux/post-install.sh",
|
||||||
"preRemoveScript": "./packages/linux/pre-remove.sh"
|
"preRemoveScript": "./packages/linux/pre-remove.sh"
|
||||||
},
|
},
|
||||||
"rpm": {
|
"rpm": {
|
||||||
"depends": ["openssl"],
|
"depends": ["openssl"],
|
||||||
"desktopTemplate": "./packages/linux/clash-verge.desktop",
|
"desktopTemplate": "./packages/linux/koala-clash.desktop",
|
||||||
"provides": ["clash-verge"],
|
"provides": ["koala-clash"],
|
||||||
"conflicts": ["clash-verge"],
|
"conflicts": ["koala-clash"],
|
||||||
"obsoletes": ["clash-verge"],
|
"obsoletes": ["koala-clash"],
|
||||||
"postInstallScript": "./packages/linux/post-install.sh",
|
"postInstallScript": "./packages/linux/post-install.sh",
|
||||||
"preRemoveScript": "./packages/linux/pre-remove.sh"
|
"preRemoveScript": "./packages/linux/pre-remove.sh"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"externalBin": [
|
"externalBin": [
|
||||||
"./resources/clash-verge-service",
|
"./resources/koala-clash-service",
|
||||||
"./resources/install-service",
|
"./resources/install-service",
|
||||||
"./resources/uninstall-service",
|
"./resources/uninstall-service",
|
||||||
"./sidecar/verge-mihomo",
|
"./sidecar/koala-mihomo",
|
||||||
"./sidecar/verge-mihomo-alpha"
|
"./sidecar/koala-mihomo-alpha"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"identifier": "io.github.clash-verge-rev.clash-verge-rev",
|
"identifier": "io.github.koala-clash",
|
||||||
"productName": "Koala Clash",
|
"productName": "Koala Clash",
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"targets": ["app", "dmg"],
|
"targets": ["app", "dmg"],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"identifier": "io.github.clash-verge-rev.clash-verge-rev",
|
"identifier": "io.github.koala-clash",
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"targets": ["nsis"],
|
"targets": ["nsis"],
|
||||||
"windows": {
|
"windows": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"identifier": "io.github.clash-verge-rev.clash-verge-rev",
|
"identifier": "io.github.koala-clash",
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"targets": ["nsis"],
|
"targets": ["nsis"],
|
||||||
"windows": {
|
"windows": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"identifier": "io.github.clash-verge-rev.clash-verge-rev",
|
"identifier": "io.github.koala-clash",
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"targets": ["nsis"],
|
"targets": ["nsis"],
|
||||||
"windows": {
|
"windows": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"identifier": "io.github.clash-verge-rev.clash-verge-rev",
|
"identifier": "io.github.koala-clash",
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"targets": ["nsis"],
|
"targets": ["nsis"],
|
||||||
"windows": {
|
"windows": {
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ import { showNotice } from "@/services/noticeService";
|
|||||||
|
|
||||||
// Константы и интерфейсы
|
// Константы и интерфейсы
|
||||||
const VALID_CORE = [
|
const VALID_CORE = [
|
||||||
{ name: "Mihomo", core: "verge-mihomo", chip: "Release Version" },
|
{ name: "Mihomo", core: "koala-mihomo", chip: "Release Version" },
|
||||||
{ name: "Mihomo Alpha", core: "verge-mihomo-alpha", chip: "Alpha Version" },
|
{ name: "Mihomo Alpha", core: "koala-mihomo-alpha", chip: "Alpha Version" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
|
export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
|
||||||
@@ -44,7 +44,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
close: () => setOpen(false),
|
close: () => setOpen(false),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const { clash_core = "verge-mihomo" } = verge ?? {};
|
const { clash_core = "koala-mihomo" } = verge ?? {};
|
||||||
|
|
||||||
const onCoreChange = useLockFn(async (core: string) => {
|
const onCoreChange = useLockFn(async (core: string) => {
|
||||||
if (core === clash_core) return;
|
if (core === clash_core) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user