mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 02:12:10 +08:00
fix(core): upgrade mihomo atomically instead of letting it self-update
mihomo's updater truncates its own running executable in place; macOS kills that under Hardened Runtime and leaves a 0-byte core. Verge now downloads the release, verifies a staged copy next to the target, and renames it into place, which never touches the inode the running core executes from. Closes #6834
This commit is contained in:
@@ -210,6 +210,17 @@ export async function restartCore() {
|
||||
return invoke<void>('restart_core')
|
||||
}
|
||||
|
||||
export interface CoreUpgradeReport {
|
||||
/** False when the managed core was already at the latest version. */
|
||||
upgraded: boolean
|
||||
from: string
|
||||
to: string
|
||||
}
|
||||
|
||||
export async function upgradeClashCore(force = false) {
|
||||
return invoke<CoreUpgradeReport>('upgrade_clash_core', { force })
|
||||
}
|
||||
|
||||
export async function restartApp() {
|
||||
return invoke<void>('restart_app')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user