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

@@ -84,14 +84,14 @@ class ModifySetup {
if isSetupBackup() {
print("检测到备份文件,尝试从备份恢复...")
ModernPrivilegedHelperManager.shared.executeCommand("/bin/cp -f '\(backupPath)' '\(setupPath)'") { result in
PrivilegedHelperAdapter.shared.executeCommand("/bin/cp -f '\(backupPath)' '\(setupPath)'") { result in
if result.starts(with: "Error:") {
print("从备份恢复失败: \(result)")
}
completion(!result.starts(with: "Error:"))
}
} else {
ModernPrivilegedHelperManager.shared.executeCommand("/bin/cp -f '\(setupPath)' '\(backupPath)'") { result in
PrivilegedHelperAdapter.shared.executeCommand("/bin/cp -f '\(setupPath)' '\(backupPath)'") { result in
if result.starts(with: "Error:") {
print("创建备份失败: \(result)")
completion(false)
@@ -100,7 +100,7 @@ class ModifySetup {
if !result.starts(with: "Error:") {
if FileManager.default.fileExists(atPath: backupPath) {
ModernPrivilegedHelperManager.shared.executeCommand("/bin/chmod 644 '\(backupPath)'") { chmodResult in
PrivilegedHelperAdapter.shared.executeCommand("/bin/chmod 644 '\(backupPath)'") { chmodResult in
if chmodResult.starts(with: "Error:") {
print("设置备份文件权限失败: \(chmodResult)")
}
@@ -138,7 +138,7 @@ class ModifySetup {
return
}
ModernPrivilegedHelperManager.shared.executeCommand(commands[index]) { result in
PrivilegedHelperAdapter.shared.executeCommand(commands[index]) { result in
if result.starts(with: "Error:") {
print("命令执行失败: \(commands[index])")
print("错误信息: \(result)")