refactor: Fix macOS standalone application

This commit is contained in:
世界
2026-01-05 01:21:24 +08:00
parent ef1c924c64
commit 59317f3c79
66 changed files with 2799 additions and 585 deletions
@@ -0,0 +1,25 @@
#if os(macOS)
import Foundation
import ServiceManagement
public enum HelperServiceManager {
private static var rootHelperService: SMAppService {
SMAppService.daemon(plistName: "\(AppConfiguration.rootHelperBundleID).plist")
}
public static var rootHelperStatus: SMAppService.Status {
rootHelperService.status
}
public static func registerRootHelper() throws {
if rootHelperService.status == .enabled {
try rootHelperService.unregister()
}
try rootHelperService.register()
}
public static func unregisterRootHelper() throws {
try rootHelperService.unregister()
}
}
#endif