mirror of
https://github.com/X1a0He/Adobe-Downloader.git
synced 2025-11-25 11:18:53 +08:00
feat: 垃圾 SMAppService 赶紧滚,回退 SMJobBless Helper
This commit is contained in:
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user