feat: 垃圾 SMAppService 赶紧滚,回退 SMJobBless Helper

This commit is contained in:
X1a0He
2025-08-17 14:04:13 +08:00
parent 4d44dc264f
commit e2e3fb44ce
19 changed files with 935 additions and 1153 deletions

View File

@@ -11,7 +11,7 @@ struct CleanConfigView: View {
@State private var showAlert = false
@State private var alertMessage = ""
@State private var chipInfo: String = ""
@State private var helperStatus: ModernPrivilegedHelperManager.HelperStatus = .notInstalled
@State private var helperStatus: PrivilegedHelperAdapter.HelperStatus = .noFound
private func getChipInfo() -> String {
var size = 0
@@ -85,7 +85,9 @@ struct CleanConfigView: View {
chipInfo = getChipInfo()
}
.task {
helperStatus = await ModernPrivilegedHelperManager.shared.getHelperStatus()
PrivilegedHelperAdapter.shared.getHelperStatus { status in
helperStatus = status
}
}
}
@@ -108,7 +110,7 @@ struct CleanConfigView: View {
ofItemAtPath: scriptURL.path)
if helperStatus == .installed {
ModernPrivilegedHelperManager.shared.executeCommand("open -a Terminal \(scriptURL.path)") { output in
PrivilegedHelperAdapter.shared.executeCommand("open -a Terminal \(scriptURL.path)") { output in
if output.starts(with: "Error") {
alertMessage = String(localized: "清空配置失败: \(output)")
showAlert = true