From d531432f4a13a22db1febac47e2289da82a1b19e Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sat, 11 Oct 2025 23:40:37 +0800 Subject: [PATCH] fix: improve Service connection method and permissions for Windows and Unix --- UPDATELOG.md | 1 + scripts/prebuild.mjs | 30 +- src-tauri/Cargo.lock | 714 +++++++++++++---------- src-tauri/Cargo.toml | 8 +- src-tauri/packages/linux/post-install.sh | 4 +- src-tauri/packages/linux/pre-remove.sh | 2 +- src-tauri/src/cmd/service.rs | 9 +- src-tauri/src/core/core.rs | 4 +- src-tauri/src/core/mod.rs | 1 - src-tauri/src/core/service.rs | 145 +++-- src-tauri/src/core/service_ipc.rs | 347 ----------- src-tauri/src/utils/dirs.rs | 17 +- src-tauri/src/utils/init.rs | 2 - src-tauri/src/utils/resolve/mod.rs | 21 +- src-tauri/tauri.linux.conf.json | 4 +- src/hooks/useServiceInstaller.ts | 5 +- 16 files changed, 535 insertions(+), 779 deletions(-) delete mode 100644 src-tauri/src/core/service_ipc.rs diff --git a/UPDATELOG.md b/UPDATELOG.md index 74de2388..bde8494c 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -24,6 +24,7 @@ - Linux 现在在新生成的配置中默认将 TUN 栈恢复为 mixed 模式 - 为代理延迟测试的 URL 设置增加了保护以及添加了安全的备用 URL - 更新了 Wayland 合成器检测逻辑,从而在 Hyprland 会话中保留原生 Wayland 后端 +- 改进 Windows 和 Unix 的 服务连接方式以及权限,避免无法连接服务或内核 ### 🐞 修复问题 diff --git a/scripts/prebuild.mjs b/scripts/prebuild.mjs index 514b2df9..2e343136 100644 --- a/scripts/prebuild.mjs +++ b/scripts/prebuild.mjs @@ -1,14 +1,14 @@ +import AdmZip from "adm-zip"; +import { execSync } from "child_process"; import fs from "fs"; import fsp from "fs/promises"; -import zlib from "zlib"; -import { extract } from "tar"; -import path from "path"; -import AdmZip from "adm-zip"; -import fetch from "node-fetch"; -import { HttpsProxyAgent } from "https-proxy-agent"; -import { execSync } from "child_process"; -import { log_info, log_debug, log_error, log_success } from "./utils.mjs"; import { glob } from "glob"; +import { HttpsProxyAgent } from "https-proxy-agent"; +import fetch from "node-fetch"; +import path from "path"; +import { extract } from "tar"; +import zlib from "zlib"; +import { log_debug, log_error, log_info, log_success } from "./utils.mjs"; const cwd = process.cwd(); const TEMP_DIR = path.join(cwd, "node_modules/.verge"); @@ -383,8 +383,8 @@ const resolvePlugin = async () => { const resolveServicePermission = async () => { const serviceExecutables = [ "clash-verge-service*", - "install-service*", - "uninstall-service*", + "clash-verge-service-install*", + "clash-verge-service-uninstall*", ]; const resDir = path.join(cwd, "src-tauri/resources"); for (let f of serviceExecutables) { @@ -430,7 +430,7 @@ async function resolveLocales() { /** * main */ -const SERVICE_URL = `https://github.com/clash-verge-rev/clash-verge-service/releases/download/${SIDECAR_HOST}`; +const SERVICE_URL = `https://github.com/clash-verge-rev/clash-verge-service-ipc/releases/download/${SIDECAR_HOST}`; const resolveService = () => { let ext = platform === "win32" ? ".exe" : ""; @@ -445,8 +445,8 @@ const resolveInstall = () => { let ext = platform === "win32" ? ".exe" : ""; let suffix = platform === "linux" ? "-" + SIDECAR_HOST : ""; resolveResource({ - file: "install-service" + suffix + ext, - downloadURL: `${SERVICE_URL}/install-service${ext}`, + file: "clash-verge-service-install" + suffix + ext, + downloadURL: `${SERVICE_URL}/clash-verge-service-install${ext}`, }); }; @@ -455,8 +455,8 @@ const resolveUninstall = () => { let suffix = platform === "linux" ? "-" + SIDECAR_HOST : ""; resolveResource({ - file: "uninstall-service" + suffix + ext, - downloadURL: `${SERVICE_URL}/uninstall-service${ext}`, + file: "clash-verge-service-uninstall" + suffix + ext, + downloadURL: `${SERVICE_URL}/clash-verge-service-uninstall${ext}`, }); }; diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ee6e771d..ff2ba03f 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "addr2line" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ "gimli", ] @@ -112,9 +112,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anyhow" @@ -140,11 +140,11 @@ dependencies = [ "clipboard-win", "image", "log", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", "objc2-core-graphics", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "parking_lot 0.12.5", "percent-encoding", "windows-sys 0.60.2", @@ -275,7 +275,7 @@ dependencies = [ "polling 3.11.0", "rustix 1.1.2", "slab", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -370,7 +370,7 @@ dependencies = [ "rustix 1.1.2", "signal-hook-registry", "slab", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -566,9 +566,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.75" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ "addr2line", "cfg-if", @@ -576,7 +576,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-link 0.2.1", ] [[package]] @@ -647,11 +647,11 @@ dependencies = [ [[package]] name = "block2" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "340d2f0bdb2a43c1d3cd40513185b2bd7def0aa1052f956455114bc98f82dcf2" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" dependencies = [ - "objc2 0.6.2", + "objc2 0.6.3", ] [[package]] @@ -723,7 +723,7 @@ dependencies = [ "static_assertions", "tap", "thin-vec", - "thiserror 2.0.16", + "thiserror 2.0.17", "time", ] @@ -835,18 +835,18 @@ checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytemuck" -version = "1.23.2" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.10.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f154e572231cb6ba2bd1176980827e3d5dc04cc183a75dea38109fbdd672d29" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", @@ -910,9 +910,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1de8bc0aa9e9385ceb3bf0c152e3a9b9544f6c4a912c8ae504e80c1f0368603" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" dependencies = [ "serde_core", ] @@ -937,7 +937,7 @@ dependencies = [ "semver 1.0.27", "serde", "serde_json", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] @@ -964,9 +964,9 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.2.38" +version = "1.2.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" +checksum = "e1d05d92f4b1fd76aad469d46cdd858ca761576082cd37df81416691e50199fb" dependencies = [ "find-msvc-tools", "jobserver", @@ -1024,7 +1024,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -1173,13 +1173,18 @@ dependencies = [ [[package]] name = "clash_verge_service_ipc" -version = "2.0.7" -source = "git+https://github.com/clash-verge-rev/clash-verge-service-ipc#119aef152cc4d172d597429cfa704c1915b7c395" +version = "2.0.14" +source = "git+https://github.com/clash-verge-rev/clash-verge-service-ipc#0b78603344302de33712d2f7554329bdb0091e1e" dependencies = [ + "anyhow", + "kode-bridge", + "log", + "once_cell", "serde", + "serde_json", "strum", "strum_macros", - "windows-service", + "tokio", ] [[package]] @@ -1227,7 +1232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -1703,9 +1708,9 @@ dependencies = [ [[package]] name = "deflate64" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" +checksum = "26bf8fc351c5ed29b5c2f0cbbac1b209b74f60ecd62e675a998df72c49af5204" [[package]] name = "delay_timer" @@ -1734,12 +1739,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d630bccd429a5bb5a64b5e94f693bfc48c9f8566418fda4c494cc94f911f87cc" +checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071" dependencies = [ "powerfmt", - "serde", + "serde_core", ] [[package]] @@ -1879,7 +1884,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -1895,9 +1900,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ "bitflags 2.9.4", - "block2 0.6.1", + "block2 0.6.2", "libc", - "objc2 0.6.2", + "objc2 0.6.3", ] [[package]] @@ -1917,7 +1922,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.8", + "libloading 0.8.9", ] [[package]] @@ -1952,6 +1957,12 @@ dependencies = [ "const-random", ] +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + [[package]] name = "document-features" version = "0.2.11" @@ -2089,7 +2100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -2221,9 +2232,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" +checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3" [[package]] name = "fixedbitset" @@ -2233,9 +2244,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9" dependencies = [ "crc32fast", "libz-rs-sys", @@ -2252,7 +2263,7 @@ dependencies = [ "log", "nu-ansi-term", "regex", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] @@ -2623,9 +2634,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "gio" @@ -2720,11 +2731,11 @@ checksum = "b9247516746aa8e53411a0db9b62b0e24efbcf6a76e0ba73e5a91b512ddabed7" dependencies = [ "crossbeam-channel", "keyboard-types", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "once_cell", "serde", - "thiserror 2.0.16", + "thiserror 2.0.17", "windows-sys 0.59.0", "x11rb", "xkeysym", @@ -2833,12 +2844,13 @@ dependencies = [ [[package]] name = "half" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +checksum = "e54c115d4f30f52c67202f079c5f9d8b49db4691f460fdb0b4c2e838261b2ba5" dependencies = [ "cfg-if", "crunchy", + "zerocopy", ] [[package]] @@ -3184,7 +3196,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.0", + "socket2 0.5.10", "system-configuration", "tokio", "tower-service", @@ -3204,7 +3216,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.61.2", + "windows-core 0.62.2", ] [[package]] @@ -3537,6 +3549,21 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "futures-core", + "libc", + "recvmsg", + "tokio", + "widestring", + "windows-sys 0.52.0", +] + [[package]] name = "intrusive-collections" version = "0.9.7" @@ -3732,9 +3759,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.80" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852f13bec5eba4ba9afbeb93fd7c13fe56147f055939ae21c43a29a0ecb2702e" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" dependencies = [ "once_cell", "wasm-bindgen", @@ -3773,6 +3800,34 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "kode-bridge" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b158d8b9ab9f07c892a3f1b5d44a79e6c74e97541bf66488025796d429cf7aac" +dependencies = [ + "bytes", + "futures", + "http 1.3.1", + "httparse", + "interprocess", + "libc", + "parking_lot 0.12.5", + "path-tree", + "pin-project-lite", + "rand 0.9.2", + "serde", + "serde_json", + "thiserror 2.0.17", + "tokio", + "tokio-stream", + "tokio-util", + "toml 0.9.7", + "tracing", + "url", + "widestring", +] + [[package]] name = "kuchikiki" version = "0.8.8-speedreader" @@ -3839,12 +3894,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-targets 0.53.3", + "windows-link 0.2.1", ] [[package]] @@ -3855,7 +3910,7 @@ checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ "bitflags 2.9.4", "libc", - "redox_syscall 0.5.17", + "redox_syscall 0.5.18", ] [[package]] @@ -3980,8 +4035,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119c8490084af61b44c9eda9d626475847a186737c0378c85e32d77c33a01cd4" dependencies = [ "cc", - "objc2 0.6.2", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", "time", ] @@ -4052,9 +4107,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "memmem" @@ -4131,9 +4186,9 @@ dependencies = [ [[package]] name = "moxcms" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08" +checksum = "1cc7d85f3d741164e8972ad355e26ac6e51b20fcae5f911c7da8f2d8bbbb3f33" dependencies = [ "num-traits", "pxfm", @@ -4149,14 +4204,14 @@ dependencies = [ "dpi", "gtk", "keyboard-types", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "png 0.17.16", "serde", - "thiserror 2.0.16", + "thiserror 2.0.17", "windows-sys 0.60.2", ] @@ -4250,7 +4305,7 @@ dependencies = [ "cc", "libc", "serde", - "thiserror 2.0.16", + "thiserror 2.0.17", "winapi", ] @@ -4448,9 +4503,9 @@ dependencies = [ [[package]] name = "objc2" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561f357ba7f3a2a61563a186a163d0a3a5247e1089524a3981d49adb775078bc" +checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05" dependencies = [ "objc2-encode", "objc2-exception-helper", @@ -4458,77 +4513,104 @@ dependencies = [ [[package]] name = "objc2-app-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ "bitflags 2.9.4", - "block2 0.6.1", + "block2 0.6.2", "libc", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-cloud-kit", "objc2-core-data", "objc2-core-foundation", "objc2-core-graphics", "objc2-core-image", - "objc2-foundation 0.3.1", - "objc2-quartz-core 0.3.1", + "objc2-core-text", + "objc2-core-video", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", ] [[package]] name = "objc2-cloud-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17614fdcd9b411e6ff1117dfb1d0150f908ba83a7df81b1f118005fe0a8ea15d" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" dependencies = [ "bitflags 2.9.4", - "objc2 0.6.2", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-core-data" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291fbbf7d29287518e8686417cf7239c74700fd4b607623140a7d4a3c834329d" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" dependencies = [ "bitflags 2.9.4", - "objc2 0.6.2", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-core-foundation" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.9.4", "dispatch2", - "objc2 0.6.2", + "objc2 0.6.3", ] [[package]] name = "objc2-core-graphics" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989c6c68c13021b5c2d6b71456ebb0f9dc78d752e86a98da7c716f4f9470f5a4" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ "bitflags 2.9.4", "dispatch2", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-core-foundation", "objc2-io-surface", ] [[package]] name = "objc2-core-image" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b3dc0cc4386b6ccf21c157591b34a7f44c8e75b064f85502901ab2188c007e" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" dependencies = [ - "objc2 0.6.2", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.9.4", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-core-video" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" +dependencies = [ + "bitflags 2.9.4", + "objc2 0.6.3", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-io-surface", ] [[package]] @@ -4560,22 +4642,22 @@ dependencies = [ [[package]] name = "objc2-foundation" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ "bitflags 2.9.4", - "block2 0.6.1", + "block2 0.6.2", "libc", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-core-foundation", ] [[package]] name = "objc2-io-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71c1c64d6120e51cd86033f67176b1cb66780c2efe34dec55176f77befd93c0a" +checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" dependencies = [ "libc", "objc2-core-foundation", @@ -4583,22 +4665,22 @@ dependencies = [ [[package]] name = "objc2-io-surface" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" dependencies = [ "bitflags 2.9.4", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-core-foundation", ] [[package]] name = "objc2-javascript-core" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9052cb1bb50a4c161d934befcf879526fb87ae9a68858f241e693ca46225cf5a" +checksum = "2a1e6550c4caed348956ce3370c9ffeca70bb1dbed4fa96112e7c6170e074586" dependencies = [ - "objc2 0.6.2", + "objc2 0.6.3", "objc2-core-foundation", ] @@ -4616,14 +4698,14 @@ dependencies = [ [[package]] name = "objc2-osa-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26bb88504b5a050dbba515d2414607bf5e57dd56b107bc5f0351197a3e7bdc5d" +checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0" dependencies = [ "bitflags 2.9.4", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", ] [[package]] @@ -4641,59 +4723,59 @@ dependencies = [ [[package]] name = "objc2-quartz-core" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ffb6a0cd5f182dc964334388560b12a57f7b74b3e2dec5e2722aa2dfb2ccd5" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" dependencies = [ "bitflags 2.9.4", - "objc2 0.6.2", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-security" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1f8e0ef3ab66b08c42644dcb34dba6ec0a574bbd8adbb8bdbdc7a2779731a44" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" dependencies = [ "bitflags 2.9.4", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-core-foundation", ] [[package]] name = "objc2-ui-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b1312ad7bc8a0e92adae17aa10f90aae1fb618832f9b993b022b591027daed" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ "bitflags 2.9.4", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", ] [[package]] name = "objc2-web-kit" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91672909de8b1ce1c2252e95bbee8c1649c9ad9d14b9248b3d7b4c47903c47ad" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" dependencies = [ "bitflags 2.9.4", - "block2 0.6.1", - "objc2 0.6.2", + "block2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "objc2-javascript-core", "objc2-security", ] [[package]] name = "object" -version = "0.36.7" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "memchr", ] @@ -4703,6 +4785,9 @@ name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "parking_lot_core 0.9.12", +] [[package]] name = "oorandom" @@ -4823,12 +4908,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b" dependencies = [ - "objc2 0.6.2", - "objc2-foundation 0.3.1", + "objc2 0.6.3", + "objc2-foundation 0.3.2", "objc2-osa-kit", "serde", "serde_json", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] @@ -4905,9 +4990,9 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.17", + "redox_syscall 0.5.18", "smallvec", - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -4916,6 +5001,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "path-tree" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a97453bc21a968f722df730bfe11bd08745cb50d1300b0df2bda131dece136" +dependencies = [ + "smallvec", +] + [[package]] name = "pathdiff" version = "0.2.3" @@ -4950,20 +5044,19 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e0a3a33733faeaf8651dfee72dd0f388f0c8e5ad496a3478fa5a922f49cfa8" +checksum = "989e7521a040efde50c3ab6bbadafbe15ab6dc042686926be59ac35d74607df4" dependencies = [ "memchr", - "thiserror 2.0.16", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc58706f770acb1dbd0973e6530a3cff4746fb721207feb3a8a6064cd0b6c663" +checksum = "187da9a3030dbafabbbfb20cb323b976dc7b7ce91fcd84f2f74d6e31d378e2de" dependencies = [ "pest", "pest_generator", @@ -4971,9 +5064,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d4f36811dfe07f7b8573462465d5cb8965fffc2e71ae377a33aecf14c2c9a2f" +checksum = "49b401d98f5757ebe97a26085998d6c0eecec4995cad6ab7fc30ffdf4b052843" dependencies = [ "pest", "pest_meta", @@ -4984,9 +5077,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.8.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42919b05089acbd0a5dcd5405fb304d17d1053847b81163d09c4ad18ce8e8420" +checksum = "72f27a2cfee9f9039c4d86faa5af122a0ac3851441a34865b8a043b46be0065a" dependencies = [ "pest", "sha2 0.10.9", @@ -5279,7 +5372,7 @@ dependencies = [ "hermit-abi 0.5.2", "pin-project-lite", "rustix 1.1.2", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -5551,8 +5644,8 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.6.0", - "thiserror 2.0.16", + "socket2 0.5.10", + "thiserror 2.0.17", "tokio", "tracing", "web-time", @@ -5573,7 +5666,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.16", + "thiserror 2.0.17", "tinyvec", "tracing", "web-time", @@ -5588,16 +5681,16 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.0", + "socket2 0.5.10", "tracing", "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" dependencies = [ "proc-macro2", ] @@ -5744,6 +5837,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + [[package]] name = "redox_syscall" version = "0.2.16" @@ -5755,9 +5854,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.17" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags 2.9.4", ] @@ -5781,23 +5880,23 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.16", "libredox", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] name = "ref-cast" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", @@ -5919,17 +6018,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" dependencies = [ "ashpd", - "block2 0.6.1", + "block2 0.6.2", "dispatch2", "glib-sys", "gobject-sys", "gtk-sys", "js-sys", "log", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "raw-window-handle", "wasm-bindgen", "wasm-bindgen-futures", @@ -6057,7 +6156,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -6086,9 +6185,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.6" +version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8572f3c2cb9934231157b45499fc41e1f58c589fdfb81a844ba873265e80f8eb" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ "ring", "rustls-pki-types", @@ -6128,7 +6227,7 @@ version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -6399,9 +6498,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.14.1" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c522100790450cf78eeac1507263d0a350d4d5b30df0c8e1fe051a10c22b376e" +checksum = "6093cd8c01b25262b84927e0f7151692158fab02d961e04c979d3903eba7ecc5" dependencies = [ "base64 0.22.1", "chrono", @@ -6410,8 +6509,7 @@ dependencies = [ "indexmap 2.11.4", "schemars 0.9.0", "schemars 1.0.4", - "serde", - "serde_derive", + "serde_core", "serde_json", "serde_with_macros", "time", @@ -6419,9 +6517,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.14.1" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327ada00f7d64abaac1e55a6911e90cf665aa051b9a561c7006c157f4633135e" +checksum = "a7e6c180db0816026a61afa1cff5344fb7ebded7e4d3062772179f2501481c27" dependencies = [ "darling", "proc-macro2", @@ -6689,7 +6787,7 @@ dependencies = [ "objc2-foundation 0.2.2", "objc2-quartz-core 0.2.2", "raw-window-handle", - "redox_syscall 0.5.17", + "redox_syscall 0.5.18", "wasm-bindgen", "web-sys", "windows-sys 0.59.0", @@ -6729,9 +6827,9 @@ checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "static_assertions" @@ -6932,7 +7030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "959469667dbcea91e5485fc48ba7dd6023face91bb0f1a14681a70f99847c3f7" dependencies = [ "bitflags 2.9.4", - "block2 0.6.1", + "block2 0.6.2", "core-foundation 0.10.1", "core-graphics", "crossbeam-channel", @@ -6949,9 +7047,9 @@ dependencies = [ "ndk", "ndk-context", "ndk-sys", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "parking_lot 0.12.5", "raw-window-handle", @@ -7023,9 +7121,9 @@ dependencies = [ "log", "mime", "muda", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "objc2-ui-kit", "objc2-web-kit", "percent-encoding", @@ -7042,7 +7140,7 @@ dependencies = [ "tauri-runtime", "tauri-runtime-wry", "tauri-utils", - "thiserror 2.0.16", + "thiserror 2.0.17", "tokio", "tracing", "tray-icon", @@ -7096,7 +7194,7 @@ dependencies = [ "sha2 0.10.9", "syn 2.0.106", "tauri-utils", - "thiserror 2.0.16", + "thiserror 2.0.17", "time", "url", "uuid", @@ -7145,7 +7243,7 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] @@ -7160,7 +7258,7 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] @@ -7177,7 +7275,7 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-utils", - "thiserror 2.0.16", + "thiserror 2.0.17", "tracing", "url", "windows-registry", @@ -7225,7 +7323,7 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror 2.0.16", + "thiserror 2.0.17", "url", ] @@ -7246,7 +7344,7 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-utils", - "thiserror 2.0.16", + "thiserror 2.0.17", "toml 0.9.7", "url", ] @@ -7263,7 +7361,7 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] @@ -7284,7 +7382,7 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror 2.0.16", + "thiserror 2.0.17", "tokio", "url", "urlpattern", @@ -7307,12 +7405,12 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.16", + "thiserror 2.0.17", "tokio", "tokio-tungstenite", "ts-rs", "urlencoding", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -7329,7 +7427,7 @@ dependencies = [ "serde_repr", "tauri", "tauri-plugin", - "thiserror 2.0.16", + "thiserror 2.0.17", "time", "url", ] @@ -7361,7 +7459,7 @@ dependencies = [ "shared_child", "tauri", "tauri-plugin", - "thiserror 2.0.16", + "thiserror 2.0.17", "tokio", ] @@ -7389,7 +7487,7 @@ dependencies = [ "tauri", "tauri-plugin", "tempfile", - "thiserror 2.0.16", + "thiserror 2.0.17", "time", "tokio", "url", @@ -7409,7 +7507,7 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.16", + "thiserror 2.0.17", ] [[package]] @@ -7423,14 +7521,14 @@ dependencies = [ "gtk", "http 1.3.1", "jni", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-ui-kit", "objc2-web-kit", "raw-window-handle", "serde", "serde_json", "tauri-utils", - "thiserror 2.0.16", + "thiserror 2.0.17", "url", "webkit2gtk", "webview2-com", @@ -7447,9 +7545,9 @@ dependencies = [ "http 1.3.1", "jni", "log", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "percent-encoding", "raw-window-handle", @@ -7495,7 +7593,7 @@ dependencies = [ "serde_json", "serde_with", "swift-rs", - "thiserror 2.0.16", + "thiserror 2.0.17", "toml 0.9.7", "url", "urlpattern", @@ -7520,22 +7618,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b1e66e07de489fe43a46678dd0b8df65e0c973909df1b60ba33874e297ba9b9" dependencies = [ "quick-xml 0.37.5", - "thiserror 2.0.16", + "thiserror 2.0.17", "windows 0.61.3", "windows-version", ] [[package]] name = "tempfile" -version = "3.22.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84fa4d11fadde498443cca10fd3ac23c951f0dc59e080e9f4b93d4df4e4eea53" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand 2.3.0", "getrandom 0.3.3", "once_cell", "rustix 1.1.2", - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -7629,11 +7727,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.16" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.16", + "thiserror-impl 2.0.17", ] [[package]] @@ -7649,9 +7747,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.16" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", @@ -7823,9 +7921,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f63835928ca123f1bef57abbcd23bb2ba0ac9ae1235f1e65bda0d06e7786bd" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls", "tokio", @@ -8218,15 +8316,15 @@ dependencies = [ "dirs 6.0.0", "libappindicator", "muda", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", "objc2-core-graphics", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "once_cell", "png 0.17.16", "serde", - "thiserror 2.0.16", + "thiserror 2.0.17", "windows-sys 0.59.0", ] @@ -8254,7 +8352,7 @@ version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ef1b7a6d914a34127ed8e1fa927eb7088903787bcded4fa3eef8f85ee1568be" dependencies = [ - "thiserror 2.0.16", + "thiserror 2.0.17", "ts-rs-macros", ] @@ -8283,7 +8381,7 @@ dependencies = [ "log", "rand 0.9.2", "sha1", - "thiserror 2.0.16", + "thiserror 2.0.17", "utf-8", ] @@ -8295,9 +8393,9 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "ucd-trie" @@ -8612,9 +8710,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.103" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab10a69fbd0a177f5f649ad4d8d3305499c42bab9aef2f7ff592d0ec8f833819" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" dependencies = [ "cfg-if", "once_cell", @@ -8625,9 +8723,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.103" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb702423545a6007bbc368fde243ba47ca275e549c8a28617f56f6ba53b1d1c" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" dependencies = [ "bumpalo", "log", @@ -8639,9 +8737,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.53" +version = "0.4.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0b221ff421256839509adbb55998214a70d829d3a28c69b4a6672e9d2a42f67" +checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" dependencies = [ "cfg-if", "js-sys", @@ -8652,9 +8750,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.103" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc65f4f411d91494355917b605e1480033152658d71f722a90647f56a70c88a0" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8662,9 +8760,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.103" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc003a991398a8ee604a401e194b6b3a39677b3173d6e74495eb51b82e99a32" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", @@ -8675,9 +8773,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.103" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "293c37f4efa430ca14db3721dfbe48d8c33308096bd44d80ebaa775ab71ba1cf" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" dependencies = [ "unicode-ident", ] @@ -8770,9 +8868,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.80" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbe734895e869dc429d78c4b433f8d17d95f8d05317440b4fad5ab2d33e596dc" +checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" dependencies = [ "js-sys", "wasm-bindgen", @@ -8834,9 +8932,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" +checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" dependencies = [ "rustls-pki-types", ] @@ -8851,8 +8949,8 @@ dependencies = [ "webview2-com-sys", "windows 0.61.3", "windows-core 0.61.2", - "windows-implement 0.60.0", - "windows-interface 0.59.1", + "windows-implement 0.60.2", + "windows-interface 0.59.3", ] [[package]] @@ -8872,7 +8970,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36695906a1b53a3bf5c4289621efedac12b73eeb0b89e7e1a89b517302d5d75c" dependencies = [ - "thiserror 2.0.16", + "thiserror 2.0.17", "windows 0.61.3", "windows-core 0.61.2", ] @@ -8897,9 +8995,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" [[package]] name = "winapi" @@ -8923,7 +9021,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.0", + "windows-sys 0.61.2", ] [[package]] @@ -8938,10 +9036,10 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" dependencies = [ - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "raw-window-handle", "windows-sys 0.59.0", "windows-version", @@ -8998,13 +9096,26 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.0", - "windows-interface 0.59.1", + "windows-implement 0.60.2", + "windows-interface 0.59.3", "windows-link 0.1.3", "windows-result 0.3.4", "windows-strings 0.4.2", ] +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + [[package]] name = "windows-future" version = "0.2.1" @@ -9029,9 +9140,9 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.60.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", @@ -9051,9 +9162,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.1" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", @@ -9068,9 +9179,9 @@ checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-link" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-numerics" @@ -9112,14 +9223,12 @@ dependencies = [ ] [[package]] -name = "windows-service" -version = "0.8.0" +name = "windows-result" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193cae8e647981c35bc947fdd57ba7928b1fa0d4a79305f6dd2dc55221ac35ac" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "bitflags 2.9.4", - "widestring", - "windows-sys 0.59.0", + "windows-link 0.2.1", ] [[package]] @@ -9141,6 +9250,15 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -9183,16 +9301,16 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.3", + "windows-targets 0.53.5", ] [[package]] name = "windows-sys" -version = "0.61.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -9243,19 +9361,19 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.3" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.1.3", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -9269,11 +9387,11 @@ dependencies = [ [[package]] name = "windows-version" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e061eb0a22b4a1d778ad70f7575ec7845490abb35b08fa320df7895882cacb" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" dependencies = [ - "windows-link 0.2.0", + "windows-link 0.2.1", ] [[package]] @@ -9296,9 +9414,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -9320,9 +9438,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -9344,9 +9462,9 @@ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" @@ -9356,9 +9474,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -9380,9 +9498,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -9404,9 +9522,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -9428,9 +9546,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -9452,9 +9570,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" @@ -9520,7 +9638,7 @@ dependencies = [ "os_pipe", "rustix 0.38.44", "tempfile", - "thiserror 2.0.16", + "thiserror 2.0.17", "tree_magic_mini", "wayland-backend", "wayland-client", @@ -9548,12 +9666,12 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wry" -version = "0.53.3" +version = "0.53.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f0e9642a0d061f6236c54ccae64c2722a7879ad4ec7dff59bd376d446d8e90" +checksum = "6d78ec082b80fa088569a970d043bb3050abaabf4454101d44514ee8d9a8c9f6" dependencies = [ "base64 0.22.1", - "block2 0.6.1", + "block2 0.6.2", "cookie", "crossbeam-channel", "dirs 6.0.0", @@ -9568,10 +9686,10 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc2 0.6.2", + "objc2 0.6.3", "objc2-app-kit", "objc2-core-foundation", - "objc2-foundation 0.3.1", + "objc2-foundation 0.3.2", "objc2-ui-kit", "objc2-web-kit", "once_cell", @@ -9580,7 +9698,7 @@ dependencies = [ "sha2 0.10.9", "soup3", "tao-macros", - "thiserror 2.0.16", + "thiserror 2.0.17", "tracing", "url", "webkit2gtk", @@ -9632,9 +9750,9 @@ checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" [[package]] name = "xattr" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3a19837351dc82ba89f8a125e22a3c475f05aba604acc023d62b2739ae2909" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", "rustix 1.1.2", @@ -9810,9 +9928,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d7fc9a1f..7f0e7936 100755 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -85,8 +85,12 @@ console-subscriber = { version = "0.4.1", optional = true } tauri-plugin-devtools = { version = "2.0.1" } tauri-plugin-mihomo = { git = "https://github.com/clash-verge-rev/tauri-plugin-mihomo" } clash_verge_logger = { version = "0.1.0", git = "https://github.com/clash-verge-rev/clash-verge-logger" } -clash_verge_service_ipc = { version = "2.0.7", git = "https://github.com/clash-verge-rev/clash-verge-service-ipc" } - +clash_verge_service_ipc = { version = "2.0.14", features = [ + "client", +], git = "https://github.com/clash-verge-rev/clash-verge-service-ipc" } +# clash_verge_service_ipc = { version = "2.0.14", features = [ +# "client", +# ], path = "../../clash-verge-service-ipc" } [target.'cfg(windows)'.dependencies] runas = "=1.2.0" diff --git a/src-tauri/packages/linux/post-install.sh b/src-tauri/packages/linux/post-install.sh index f398791c..e3e75baf 100644 --- a/src-tauri/packages/linux/post-install.sh +++ b/src-tauri/packages/linux/post-install.sh @@ -1,4 +1,4 @@ #!/bin/bash -chmod +x /usr/bin/install-service -chmod +x /usr/bin/uninstall-service +chmod +x /usr/bin/clash-verge-service-install +chmod +x /usr/bin/clash-verge-service-uninstall chmod +x /usr/bin/clash-verge-service diff --git a/src-tauri/packages/linux/pre-remove.sh b/src-tauri/packages/linux/pre-remove.sh index 984ffec6..481a47f6 100644 --- a/src-tauri/packages/linux/pre-remove.sh +++ b/src-tauri/packages/linux/pre-remove.sh @@ -1,2 +1,2 @@ #!/bin/bash -/usr/bin/uninstall-service +/usr/bin/clash-verge-service-uninstall diff --git a/src-tauri/src/cmd/service.rs b/src-tauri/src/cmd/service.rs index efb4070d..01abdc81 100644 --- a/src-tauri/src/cmd/service.rs +++ b/src-tauri/src/cmd/service.rs @@ -1,9 +1,6 @@ use super::CmdResult; use crate::{ - core::{ - CoreManager, - service::{self, SERVICE_MANAGER, ServiceStatus}, - }, + core::service::{self, SERVICE_MANAGER, ServiceStatus}, utils::i18n::t, }; @@ -17,10 +14,6 @@ async fn execute_service_operation_sync(status: ServiceStatus, op_type: &str) -> let emsg = format!("{} Service failed: {}", op_type, e); return Err(t(emsg.as_str()).await); } - if CoreManager::global().restart_core().await.is_err() { - let emsg = "Restart Core failed"; - return Err(t(emsg).await); - } Ok(()) } diff --git a/src-tauri/src/core/core.rs b/src-tauri/src/core/core.rs index c8c27a21..fe81e1ee 100644 --- a/src-tauri/src/core/core.rs +++ b/src-tauri/src/core/core.rs @@ -870,7 +870,6 @@ impl CoreManager { } pub async fn prestart_core(&self) -> Result<()> { - SERVICE_MANAGER.lock().await.refresh().await?; match SERVICE_MANAGER.lock().await.current() { ServiceStatus::Ready => { self.set_running_mode(RunningMode::Service); @@ -912,6 +911,9 @@ impl CoreManager { pub async fn restart_core(&self) -> Result<()> { logging!(info, Type::Core, "Restarting core"); self.stop_core().await?; + if SERVICE_MANAGER.lock().await.init().await.is_ok() { + logging_error!(Type::Setup, SERVICE_MANAGER.lock().await.refresh().await); + } self.start_core().await?; Ok(()) } diff --git a/src-tauri/src/core/mod.rs b/src-tauri/src/core/mod.rs index 5972458b..2a01fe23 100644 --- a/src-tauri/src/core/mod.rs +++ b/src-tauri/src/core/mod.rs @@ -7,7 +7,6 @@ pub mod handle; pub mod hotkey; pub mod logger; pub mod service; -pub mod service_ipc; pub mod sysopt; pub mod timer; pub mod tray; diff --git a/src-tauri/src/core/service.rs b/src-tauri/src/core/service.rs index 9169fa07..0a752ced 100644 --- a/src-tauri/src/core/service.rs +++ b/src-tauri/src/core/service.rs @@ -1,16 +1,19 @@ use crate::{ config::Config, - core::service_ipc::{IpcCommand, send_ipc_request}, logging, logging_error, - utils::{dirs, logging::Type}, + utils::{dirs, init::service_writer_config, logging::Type}, }; use anyhow::{Context, Result, bail}; +use clash_verge_service_ipc::CoreConfig; use once_cell::sync::Lazy; -use std::{env::current_exe, path::PathBuf, process::Command as StdCommand}; +use std::{ + env::current_exe, + path::{Path, PathBuf}, + process::Command as StdCommand, + time::Duration, +}; use tokio::sync::Mutex; -const REQUIRED_SERVICE_VERSION: &str = "1.1.2"; // 定义所需的服务版本号 - #[derive(Debug, Clone, PartialEq, Eq)] pub enum ServiceStatus { Ready, @@ -35,7 +38,7 @@ async fn uninstall_service() -> Result<()> { use std::os::windows::process::CommandExt; let binary_path = dirs::service_path()?; - let uninstall_path = binary_path.with_file_name("uninstall-service.exe"); + let uninstall_path = binary_path.with_file_name("clash-verge-service-uninstall.exe"); if !uninstall_path.exists() { bail!(format!("uninstaller not found: {uninstall_path:?}")); @@ -70,7 +73,7 @@ async fn install_service() -> Result<()> { use std::os::windows::process::CommandExt; let binary_path = dirs::service_path()?; - let install_path = binary_path.with_file_name("install-service.exe"); + let install_path = binary_path.with_file_name("clash-verge-service-install.exe"); if !install_path.exists() { bail!(format!("installer not found: {install_path:?}")); @@ -119,7 +122,8 @@ async fn uninstall_service() -> Result<()> { logging!(info, Type::Service, "uninstall service"); use users::get_effective_uid; - let uninstall_path = tauri::utils::platform::current_exe()?.with_file_name("uninstall-service"); + let uninstall_path = + tauri::utils::platform::current_exe()?.with_file_name("clash-verge-service-uninstall"); if !uninstall_path.exists() { bail!(format!("uninstaller not found: {uninstall_path:?}")); @@ -159,7 +163,8 @@ async fn install_service() -> Result<()> { logging!(info, Type::Service, "install service"); use users::get_effective_uid; - let install_path = tauri::utils::platform::current_exe()?.with_file_name("install-service"); + let install_path = + tauri::utils::platform::current_exe()?.with_file_name("clash-verge-service-install"); if !install_path.exists() { bail!(format!("installer not found: {install_path:?}")); @@ -218,7 +223,7 @@ async fn uninstall_service() -> Result<()> { logging!(info, Type::Service, "uninstall service"); let binary_path = dirs::service_path()?; - let uninstall_path = binary_path.with_file_name("uninstall-service"); + let uninstall_path = binary_path.with_file_name("clash-verge-service-uninstall"); if !uninstall_path.exists() { bail!(format!("uninstaller not found: {uninstall_path:?}")); @@ -254,7 +259,7 @@ async fn install_service() -> Result<()> { logging!(info, Type::Service, "install service"); let binary_path = dirs::service_path()?; - let install_path = binary_path.with_file_name("install-service"); + let install_path = binary_path.with_file_name("clash-verge-service-install"); if !install_path.exists() { bail!(format!("installer not found: {install_path:?}")); @@ -314,21 +319,17 @@ pub async fn force_reinstall_service() -> Result<()> { async fn check_service_version() -> Result { let version_arc: Result = { logging!(info, Type::Service, "开始检查服务版本 (IPC)"); - let payload = serde_json::json!({}); - let response = send_ipc_request(IpcCommand::GetVersion, payload).await?; - - let data = response - .data - .ok_or_else(|| anyhow::anyhow!("服务版本响应中没有数据"))?; - - if let Some(nested_data) = data.get("data") - && let Some(version) = nested_data.get("version").and_then(|v| v.as_str()) - { - // logging!(info, Type::Service, true, "获取到服务版本: {}", version); - Ok(version.to_string()) - } else { - Ok("unknown".to_string()) + let response = clash_verge_service_ipc::get_version() + .await + .context("无法连接到Clash Verge Service")?; + if response.code > 0 { + let err_msg = response.message; + logging!(error, Type::Service, "获取服务版本失败: {}", err_msg); + return Err(anyhow::anyhow!(err_msg)); } + + let version = response.data.unwrap_or("unknown".to_string()); + Ok(version) }; match version_arc.as_ref() { @@ -340,7 +341,7 @@ async fn check_service_version() -> Result { /// 检查服务是否需要重装 pub async fn check_service_needs_reinstall() -> bool { match check_service_version().await { - Ok(version) => version != REQUIRED_SERVICE_VERSION, + Ok(version) => version != clash_verge_service_ipc::VERSION, Err(_) => false, } } @@ -356,35 +357,25 @@ pub(super) async fn start_with_existing_service(config_file: &PathBuf) -> Result let bin_ext = if cfg!(windows) { ".exe" } else { "" }; let bin_path = current_exe()?.with_file_name(format!("{clash_core}{bin_ext}")); - let payload = serde_json::json!({ - "core_type": clash_core, - "bin_path": dirs::path_to_str(&bin_path)?, - "config_dir": dirs::path_to_str(&dirs::app_home_dir()?)?, - "config_file": dirs::path_to_str(config_file)?, - // TODO 迁移 Service日志后删除 - "log_file": dirs::path_to_str(&dirs::service_log_file()?)?, - }); + let payload = clash_verge_service_ipc::ClashConfig { + core_config: CoreConfig { + config_path: dirs::path_to_str(config_file)?.to_string(), + core_path: dirs::path_to_str(&bin_path)?.to_string(), + config_dir: dirs::path_to_str(&dirs::app_home_dir()?)?.to_string(), + }, + log_config: service_writer_config().await?, + }; - let response = send_ipc_request(IpcCommand::StartClash, payload) + let response = clash_verge_service_ipc::start_clash(&payload) .await .context("无法连接到Clash Verge Service")?; - if !response.success { - let err_msg = response.error.unwrap_or_else(|| "启动核心失败".to_string()); + if response.code > 0 { + let err_msg = response.message; + logging!(error, Type::Service, "启动核心失败: {}", err_msg); bail!(err_msg); } - if let Some(data) = &response.data - && let Some(code) = data.get("code").and_then(|c| c.as_u64()) - && code != 0 - { - let msg = data - .get("msg") - .and_then(|m| m.as_str()) - .unwrap_or("未知错误"); - bail!("启动核心失败: {}", msg); - } - logging!(info, Type::Service, "服务成功启动核心"); Ok(()) } @@ -405,53 +396,51 @@ pub(super) async fn run_core_by_service(config_file: &PathBuf) -> Result<()> { pub(super) async fn stop_core_by_service() -> Result<()> { logging!(info, Type::Service, "通过服务停止核心 (IPC)"); - let payload = serde_json::json!({}); - let response = send_ipc_request(IpcCommand::StopClash, payload) + let response = clash_verge_service_ipc::stop_clash() .await .context("无法连接到Clash Verge Service")?; - if !response.success { - let err_msg = response.error.unwrap_or_else(|| "停止核心失败".to_string()); + if response.code > 0 { + let err_msg = response.message; logging!(error, Type::Service, "停止核心失败: {}", err_msg); bail!(err_msg); } - if let Some(data) = &response.data - && let Some(code) = data.get("code") - { - let code_value = code.as_u64().unwrap_or(1); - let msg = data - .get("msg") - .and_then(|m| m.as_str()) - .unwrap_or("未知错误"); - - if code_value != 0 { - logging!( - error, - Type::Service, - "停止核心返回错误: code={}, msg={}", - code_value, - msg - ); - bail!("停止核心失败: {}", msg); - } - } - logging!(info, Type::Service, "服务成功停止核心"); Ok(()) } /// 检查服务是否正在运行 pub async fn is_service_available() -> Result<()> { - check_service_version().await?; + clash_verge_service_ipc::connect().await?; Ok(()) } +pub fn is_service_ipc_path_exists() -> bool { + Path::new(clash_verge_service_ipc::IPC_PATH).exists() +} + impl ServiceManager { pub fn default() -> Self { Self(ServiceStatus::Unavailable("Need Checks".into())) } + pub fn config() -> Option { + Some(clash_verge_service_ipc::IpcConfig { + default_timeout: Duration::from_millis(30), + retry_delay: Duration::from_millis(250), + max_retries: 6, + }) + } + + pub async fn init(&mut self) -> Result<()> { + if let Err(e) = clash_verge_service_ipc::connect().await { + self.0 = ServiceStatus::Unavailable("服务连接失败: {e}".to_string()); + return Err(e); + } + Ok(()) + } + pub fn current(&self) -> ServiceStatus { self.0.clone() } @@ -487,31 +476,26 @@ impl ServiceManager { match status { ServiceStatus::Ready => { logging!(info, Type::Service, "服务就绪,直接启动"); - Ok(()) } ServiceStatus::NeedsReinstall | ServiceStatus::ReinstallRequired => { logging!(info, Type::Service, "服务需要重装,执行重装流程"); reinstall_service().await?; self.0 = ServiceStatus::Ready; - Ok(()) } ServiceStatus::ForceReinstallRequired => { logging!(info, Type::Service, "服务需要强制重装,执行强制重装流程"); force_reinstall_service().await?; self.0 = ServiceStatus::Ready; - Ok(()) } ServiceStatus::InstallRequired => { logging!(info, Type::Service, "需要安装服务,执行安装流程"); install_service().await?; self.0 = ServiceStatus::Ready; - Ok(()) } ServiceStatus::UninstallRequired => { logging!(info, Type::Service, "服务需要卸载,执行卸载流程"); uninstall_service().await?; self.0 = ServiceStatus::Unavailable("Service Uninstalled".into()); - Ok(()) } ServiceStatus::Unavailable(reason) => { logging!( @@ -521,9 +505,10 @@ impl ServiceManager { reason ); self.0 = ServiceStatus::Unavailable(reason.clone()); - Err(anyhow::anyhow!("服务不可用: {}", reason)) + return Err(anyhow::anyhow!("服务不可用: {}", reason)); } } + Ok(()) } } diff --git a/src-tauri/src/core/service_ipc.rs b/src-tauri/src/core/service_ipc.rs deleted file mode 100644 index 5e78cfe9..00000000 --- a/src-tauri/src/core/service_ipc.rs +++ /dev/null @@ -1,347 +0,0 @@ -use crate::{logging, utils::logging::Type}; -use anyhow::{Context, Result, bail}; -use backoff::{Error as BackoffError, ExponentialBackoff}; -use hmac::{Hmac, Mac}; -use serde::{Deserialize, Serialize}; -use sha2::{Digest, Sha256}; -use std::time::{Duration, SystemTime, UNIX_EPOCH}; -use tokio::io::{AsyncReadExt, AsyncWriteExt}; -#[cfg(unix)] -use tokio::net::UnixStream; -#[cfg(windows)] -use tokio::net::windows::named_pipe::ClientOptions; - -const IPC_SOCKET_NAME: &str = if cfg!(windows) { - r"\\.\pipe\clash-verge-service" -} else { - "/tmp/clash-verge-service.sock" -}; - -// 定义命令类型 -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum IpcCommand { - GetClash, - GetVersion, - StartClash, - StopClash, -} - -// IPC消息格式 -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct IpcRequest { - pub id: String, - pub timestamp: u64, - pub command: IpcCommand, - pub payload: serde_json::Value, - pub signature: String, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct IpcResponse { - pub id: String, - pub success: bool, - pub data: Option, - pub error: Option, - pub signature: String, -} - -// 密钥派生函数 -fn derive_secret_key() -> Vec { - // to do - // 从系统安全存储中获取或从程序安装时生成的密钥文件中读取 - let unique_app_id = "clash-verge-app-secret-fuck-me-until-daylight"; - let mut hasher = Sha256::new(); - hasher.update(unique_app_id.as_bytes()); - hasher.finalize().to_vec() -} - -// 创建带签名的请求 -pub fn create_signed_request( - command: IpcCommand, - payload: serde_json::Value, -) -> Result { - let id = nanoid::nanoid!(32); - let timestamp = SystemTime::now() - .duration_since(UNIX_EPOCH) - .unwrap_or_default() - .as_secs(); - - let unsigned_request = IpcRequest { - id: id.clone(), - timestamp, - command: command.clone(), - payload: payload.clone(), - signature: String::new(), - }; - - let unsigned_json = serde_json::to_string(&unsigned_request)?; - let signature = sign_message(&unsigned_json)?; - - Ok(IpcRequest { - id, - timestamp, - command, - payload, - signature, - }) -} - -// 签名消息 -fn sign_message(message: &str) -> Result { - type HmacSha256 = Hmac; - - let secret_key = derive_secret_key(); - let mut mac = HmacSha256::new_from_slice(&secret_key).context("HMAC初始化失败")?; - - mac.update(message.as_bytes()); - let result = mac.finalize(); - let signature = hex::encode(result.into_bytes()); - - Ok(signature) -} - -// 验证响应签名 -pub fn verify_response_signature(response: &IpcResponse) -> Result { - let verification_response = IpcResponse { - id: response.id.clone(), - success: response.success, - data: response.data.clone(), - error: response.error.clone(), - signature: String::new(), - }; - - let message = serde_json::to_string(&verification_response)?; - let expected_signature = sign_message(&message)?; - - Ok(expected_signature == response.signature) -} - -fn create_backoff_strategy() -> ExponentialBackoff { - ExponentialBackoff { - initial_interval: Duration::from_millis(50), - max_interval: Duration::from_secs(1), - max_elapsed_time: Some(Duration::from_secs(3)), - multiplier: 1.5, - ..Default::default() - } -} - -pub async fn send_ipc_request( - command: IpcCommand, - payload: serde_json::Value, -) -> Result { - let command_type = format!("{command:?}"); - - let operation = || async { - match send_ipc_request_internal(command.clone(), payload.clone()).await { - Ok(response) => Ok(response), - Err(e) => { - logging!( - warn, - Type::Service, - "IPC请求失败,准备重试: 命令={}, 错误={}", - command_type, - e - ); - Err(BackoffError::transient(e)) - } - } - }; - - match backoff::future::retry(create_backoff_strategy(), operation).await { - Ok(response) => { - // logging!( - // info, - // Type::Service, - // true, - // "IPC请求成功: 命令={}, 成功={}", - // command_type, - // response.success - // ); - Ok(response) - } - Err(e) => { - logging!( - error, - Type::Service, - "IPC请求最终失败,重试已耗尽: 命令={}, 错误={}", - command_type, - e - ); - Err(anyhow::anyhow!("IPC请求重试失败: {}", e)) - } - } -} - -// 内部IPC请求实现(不带重试) -async fn send_ipc_request_internal( - command: IpcCommand, - payload: serde_json::Value, -) -> Result { - #[cfg(target_os = "windows")] - { - send_ipc_request_windows(command, payload).await - } - #[cfg(target_family = "unix")] - { - send_ipc_request_unix(command, payload).await - } -} - -// IPC连接管理-win -#[cfg(target_os = "windows")] -async fn send_ipc_request_windows( - command: IpcCommand, - payload: serde_json::Value, -) -> Result { - let request = create_signed_request(command, payload)?; - let request_json = serde_json::to_string(&request)?; - let request_bytes = request_json.as_bytes(); - let len_bytes = (request_bytes.len() as u32).to_be_bytes(); - - let mut pipe = match ClientOptions::new().open(IPC_SOCKET_NAME) { - Ok(p) => p, - Err(e) => { - logging!(error, Type::Service, "连接到服务命名管道失败: {}", e); - return Err(anyhow::anyhow!("无法连接到服务命名管道: {}", e)); - } - }; - - logging!(info, Type::Service, "服务连接成功 (Windows)"); - - pipe.write_all(&len_bytes).await?; - pipe.write_all(request_bytes).await?; - pipe.flush().await?; - - let mut response_len_bytes = [0u8; 4]; - pipe.read_exact(&mut response_len_bytes).await?; - let response_len = u32::from_be_bytes(response_len_bytes) as usize; - - let mut response_bytes = vec![0u8; response_len]; - pipe.read_exact(&mut response_bytes).await?; - - let response: IpcResponse = serde_json::from_slice(&response_bytes) - .map_err(|e| anyhow::anyhow!("解析响应失败: {}", e))?; - - if !verify_response_signature(&response)? { - logging!(error, Type::Service, "服务响应签名验证失败"); - bail!("服务响应签名验证失败"); - } - - Ok(response) -} - -// IPC连接管理-unix -#[cfg(target_family = "unix")] -async fn send_ipc_request_unix( - command: IpcCommand, - payload: serde_json::Value, -) -> Result { - let request = create_signed_request(command, payload)?; - let request_json = serde_json::to_string(&request)?; - - let mut stream = match UnixStream::connect(IPC_SOCKET_NAME).await { - Ok(s) => s, - Err(e) => { - logging!(error, Type::Service, "连接到Unix套接字失败: {}", e); - return Err(anyhow::anyhow!("无法连接到服务Unix套接字: {}", e)); - } - }; - - let request_bytes = request_json.as_bytes(); - let len_bytes = (request_bytes.len() as u32).to_be_bytes(); - - stream.write_all(&len_bytes).await?; - stream.write_all(request_bytes).await?; - stream.flush().await?; - - // 读取响应长度 - let mut response_len_bytes = [0u8; 4]; - stream.read_exact(&mut response_len_bytes).await?; - let response_len = u32::from_be_bytes(response_len_bytes) as usize; - - let mut response_bytes = vec![0u8; response_len]; - stream.read_exact(&mut response_bytes).await?; - - let response: IpcResponse = serde_json::from_slice(&response_bytes) - .map_err(|e| anyhow::anyhow!("解析响应失败: {}", e))?; - - if !verify_response_signature(&response)? { - logging!(error, Type::Service, "服务响应签名验证失败"); - bail!("服务响应签名验证失败"); - } - - Ok(response) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_create_signed_request() { - let command = IpcCommand::GetVersion; - let payload = serde_json::json!({"test": "data"}); - - let result = create_signed_request(command, payload); - assert!(result.is_ok()); - - if let Ok(request) = result { - assert!(!request.id.is_empty()); - assert!(!request.signature.is_empty()); - assert_eq!(request.command, IpcCommand::GetVersion); - } - } - - #[test] - fn test_sign_and_verify_message() { - let test_message = "test message for signing"; - - let signature_result = sign_message(test_message); - assert!(signature_result.is_ok()); - - if let Ok(signature) = signature_result { - assert!(!signature.is_empty()); - - // 测试相同消息产生相同签名 - if let Ok(signature2) = sign_message(test_message) { - assert_eq!(signature, signature2); - } - } - } - - #[test] - fn test_verify_response_signature() { - let response = IpcResponse { - id: "test-id".to_string(), - success: true, - data: Some(serde_json::json!({"result": "success"})), - error: None, - signature: String::new(), - }; - - // 创建正确的签名 - let verification_response = IpcResponse { - id: response.id.clone(), - success: response.success, - data: response.data.clone(), - error: response.error.clone(), - signature: String::new(), - }; - - if let Ok(message) = serde_json::to_string(&verification_response) - && let Ok(correct_signature) = sign_message(&message) - { - let signed_response = IpcResponse { - signature: correct_signature, - ..response - }; - - let verification_result = verify_response_signature(&signed_response); - assert!(verification_result.is_ok()); - if let Ok(is_valid) = verification_result { - assert!(is_valid); - } - } - } -} diff --git a/src-tauri/src/utils/dirs.rs b/src-tauri/src/utils/dirs.rs index f7d12aa6..8b39425e 100644 --- a/src-tauri/src/utils/dirs.rs +++ b/src-tauri/src/utils/dirs.rs @@ -144,21 +144,6 @@ pub fn service_path() -> Result { Ok(res_dir.join("clash-verge-service.exe")) } -// TODO 迁移 Service日志后删除 -pub fn service_log_file() -> Result { - use chrono::Local; - - let log_dir = app_logs_dir()?.join("service"); - - let local_time = Local::now().format("%Y-%m-%d-%H%M").to_string(); - let log_file = format!("{local_time}.log"); - let log_file = log_dir.join(log_file); - - let _ = std::fs::create_dir_all(&log_dir); - - Ok(log_file) -} - pub fn sidecar_log_dir() -> Result { let log_dir = app_logs_dir()?.join("sidecar"); let _ = std::fs::create_dir_all(&log_dir); @@ -207,7 +192,7 @@ pub fn get_encryption_key() -> Result> { #[cfg(unix)] pub fn ensure_mihomo_safe_dir() -> Option { - ["/var/tmp", "/tmp"] + ["/tmp"] .iter() .map(PathBuf::from) .find(|path| path.exists()) diff --git a/src-tauri/src/utils/init.rs b/src-tauri/src/utils/init.rs index f8704a40..1758dfb0 100644 --- a/src-tauri/src/utils/init.rs +++ b/src-tauri/src/utils/init.rs @@ -93,8 +93,6 @@ pub async fn sidecar_writer() -> Result { .try_build()?) } -// TODO 后续迁移新 service 时使用 -#[allow(dead_code)] pub async fn service_writer_config() -> Result { let (log_max_size, log_max_count) = { let verge_guard = Config::verge().await; diff --git a/src-tauri/src/utils/resolve/mod.rs b/src-tauri/src/utils/resolve/mod.rs index 5a712dbf..78834947 100644 --- a/src-tauri/src/utils/resolve/mod.rs +++ b/src-tauri/src/utils/resolve/mod.rs @@ -3,7 +3,11 @@ use anyhow::Result; use crate::{ config::Config, core::{ - CoreManager, Timer, handle, hotkey::Hotkey, service::SERVICE_MANAGER, sysopt, tray::Tray, + CoreManager, Timer, handle, + hotkey::Hotkey, + service::{SERVICE_MANAGER, ServiceManager, is_service_ipc_path_exists}, + sysopt, + tray::Tray, }, logging, logging_error, module::lightweight::{auto_lightweight_mode_init, run_once_auto_lightweight}, @@ -46,7 +50,7 @@ pub fn resolve_setup_async() { "Version: {}", env!("CARGO_PKG_VERSION") ); - init_service_manager().await; + futures::join!(init_service_manager()); futures::join!( init_work_config(), @@ -189,7 +193,18 @@ pub(super) async fn init_verge_config() { pub(super) async fn init_service_manager() { logging!(info, Type::Setup, "Initializing service manager..."); - logging_error!(Type::Setup, SERVICE_MANAGER.lock().await.refresh().await); + clash_verge_service_ipc::set_config(ServiceManager::config()).await; + if !is_service_ipc_path_exists() { + logging!( + warn, + Type::Setup, + "Service IPC path does not exist, service may be unavailable" + ); + return; + } + if SERVICE_MANAGER.lock().await.init().await.is_ok() { + logging_error!(Type::Setup, SERVICE_MANAGER.lock().await.refresh().await); + } } pub(super) async fn init_core_manager() { diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 398bff03..0d5c0de3 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -25,8 +25,8 @@ }, "externalBin": [ "./resources/clash-verge-service", - "./resources/install-service", - "./resources/uninstall-service", + "./resources/clash-verge-service-install", + "./resources/clash-verge-service-uninstall", "./sidecar/verge-mihomo", "./sidecar/verge-mihomo-alpha" ] diff --git a/src/hooks/useServiceInstaller.ts b/src/hooks/useServiceInstaller.ts index 6422f17e..612da388 100644 --- a/src/hooks/useServiceInstaller.ts +++ b/src/hooks/useServiceInstaller.ts @@ -3,6 +3,7 @@ import { useCallback } from "react"; import { installService, restartCore } from "@/services/cmds"; import { showNotice } from "@/services/noticeService"; +import { useSystemState } from "./use-system-state"; const executeWithErrorHandling = async ( operation: () => Promise, @@ -23,6 +24,8 @@ const executeWithErrorHandling = async ( }; export const useServiceInstaller = () => { + const { mutateRunningMode, mutateServiceOk } = useSystemState(); + const installServiceAndRestartCore = useCallback(async () => { await executeWithErrorHandling( () => installService(), @@ -31,6 +34,6 @@ export const useServiceInstaller = () => { ); await executeWithErrorHandling(() => restartCore(), "Restarting Core..."); - }, []); + }, [mutateRunningMode, mutateServiceOk]); return { installServiceAndRestartCore }; };