mirror of
https://github.com/X1a0He/Adobe-Downloader.git
synced 2025-11-25 11:18:53 +08:00
fix: Fixed the issue of installation failure with error code 255
- Added a new feature: in Debug mode, the handling and backup status of the CC component will not be checked - Adjusted the translation of some installation prompt messages
This commit is contained in:
@@ -122,7 +122,9 @@ struct Adobe_DownloaderApp: App {
|
||||
if needsSetup {
|
||||
showCreativeCloudAlert = true
|
||||
} else if needsBackup {
|
||||
#if !DEBUG
|
||||
showBackupAlert = true
|
||||
#endif
|
||||
}
|
||||
|
||||
if storage.isFirstLaunch {
|
||||
|
||||
@@ -216,15 +216,15 @@ class PrivilegedHelperManager: NSObject {
|
||||
}
|
||||
|
||||
static var getHelperStatus: Bool {
|
||||
var status = false
|
||||
let semaphore = DispatchSemaphore(value: 0)
|
||||
|
||||
shared.getHelperStatus { helperStatus in
|
||||
status = helperStatus == .installed
|
||||
semaphore.signal()
|
||||
if let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String,
|
||||
let installedBuild = UserDefaults.standard.string(forKey: "InstalledHelperBuild"),
|
||||
currentBuild != installedBuild {
|
||||
return false
|
||||
}
|
||||
semaphore.wait()
|
||||
return status
|
||||
|
||||
let helperURL = Bundle.main.bundleURL.appendingPathComponent("Contents/Library/LaunchServices/" + machServiceName)
|
||||
guard CFBundleCopyInfoDictionaryForURL(helperURL as CFURL) != nil else { return false }
|
||||
return FileManager.default.fileExists(atPath: "/Library/PrivilegedHelperTools/\(machServiceName)")
|
||||
}
|
||||
|
||||
func reinstallHelper(completion: @escaping (Bool, String) -> Void) {
|
||||
|
||||
@@ -122,10 +122,10 @@ class ModifySetup {
|
||||
|
||||
let commands = [
|
||||
"""
|
||||
perl -0777pi -e 'BEGIN{$/=\\1e8} s|\\x55\\x48\\x89\\xE5\\x53\\x50\\x48\\x89\\xFB\\x48\\x8B\\x05\\x70\\xC7\\x03\\x00\\x48\\x8B\\x00\\x48\\x89\\x45\\xF0\\xE8\\x24\\xD7\\xFE\\xFF\\x48\\x83\\xC3\\x08\\x48\\x39\\xD8\\x0F|\\x6A\\x01\\x58\\xC3\\x53\\x50\\x48\\x89\\xFB\\x48\\x8B\\x05\\x70\\xC7\\x03\\x00\\x48\\x8B\\x00\\x48\\x89\\x45\\xF0\\xE8\\x24\\xD7\\xFE\\xFF\\x48\\x83\\xC3\\x08\\x48\\x39\\xD8\\x0F|gs' '\(setupPath)'
|
||||
perl -0777pi -e 'BEGIN{$/=\\1e8} s|\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x41\\x55\\x41\\x54\\x53\\x48\\x83\\xEC\\x48\\x48\\x89\\xFB\\x48\\x8B\\x05\\x8B\\x82\\x05\\x00\\x48\\x8B\\x00\\x48\\x89\\x45\\xD0\\x48\\x8D|\\x6A\\x01\\x58\\xC3\\x53\\x50\\x48\\x89\\xFB\\x48\\x8B\\x05\\x70\\xC7\\x03\\x00\\x48\\x8B\\x00\\x48\\x89\\x45\\xF0\\xE8\\x24\\xD7\\xFE\\xFF\\x48\\x83\\xC3\\x08\\x48\\x39\\xD8\\x0F|gs' '\(setupPath)'
|
||||
""",
|
||||
"""
|
||||
perl -0777pi -e 'BEGIN{$/=\\1e8} s|\\xFF\\xC3\\x00\\xD1\\xF4\\x4F\\x01\\xA9\\xFD\\x7B\\x02\\xA9\\xFD\\x83\\x00\\x91\\xF3\\x03\\x00\\xAA\\x1F\\x20\\x03\\xD5\\x68\\xA1\\x1D\\x58\\x08\\x01\\x40\\xF9\\xE8\\x07\\x00\\xF9|\\x20\\x00\\x80\\xD2\\xC0\\x03\\x5F\\xD6\\xFD\\x7B\\x02\\xA9\\xFD\\x83\\x00\\x91\\xF3\\x03\\x00\\xAA\\x1F\\x20\\x03\\xD5\\x68\\xA1\\x1D\\x58\\x08\\x01\\x40\\xF9\\xE8\\x07\\x00\\xF9|gs' '\(setupPath)'
|
||||
perl -0777pi -e 'BEGIN{$/=\\1e8} s|\\xFF\\x43\\x02\\xD1\\xFA\\x67\\x04\\xA9\\xF8\\x5F\\x05\\xA9\\xF6\\x57\\x06\\xA9\\xF4\\x4F\\x07\\xA9\\xFD\\x7B\\x08\\xA9\\xFD\\x03\\x02\\x91\\xF3\\x03\\x00\\xAA\\x1F\\x20\\x03\\xD5|\\x20\\x00\\x80\\xD2\\xC0\\x03\\x5F\\xD6\\xFD\\x7B\\x02\\xA9\\xFD\\x83\\x00\\x91\\xF3\\x03\\x00\\xAA\\x1F\\x20\\x03\\xD5\\x68\\xA1\\x1D\\x58\\x08\\x01\\x40\\xF9\\xE8\\x07\\x00\\xF9|gs' '\(setupPath)'
|
||||
""",
|
||||
"codesign --remove-signature '\(setupPath)'",
|
||||
"codesign -f -s - --timestamp=none --all-architectures --deep '\(setupPath)'",
|
||||
@@ -189,9 +189,9 @@ class ModifySetup {
|
||||
|
||||
guard FileManager.default.fileExists(atPath: setupPath) else { return false }
|
||||
|
||||
let intelPattern = Data([0x55, 0x48, 0x89, 0xE5, 0x53, 0x50, 0x48, 0x89, 0xFB, 0x48, 0x8B, 0x05, 0x70, 0xC7, 0x03, 0x00, 0x48, 0x8B, 0x00, 0x48, 0x89, 0x45, 0xF0, 0xE8, 0x24, 0xD7, 0xFE, 0xFF, 0x48, 0x83, 0xC3, 0x08, 0x48, 0x39, 0xD8, 0x0F])
|
||||
|
||||
let armPattern = Data([0xFF, 0xC3, 0x00, 0xD1, 0xF4, 0x4F, 0x01, 0xA9, 0xFD, 0x7B, 0x02, 0xA9, 0xFD, 0x83, 0x00, 0x91, 0xF3, 0x03, 0x00, 0xAA, 0x1F, 0x20, 0x03, 0xD5, 0x68, 0xA1, 0x1D, 0x58, 0x08, 0x01, 0x40, 0xF9, 0xE8, 0x07, 0x00, 0xF9])
|
||||
let intelPattern = Data([0x55, 0x48, 0x89, 0xE5, 0x41, 0x57, 0x41, 0x56, 0x41, 0x55, 0x41, 0x54, 0x53, 0x48, 0x83, 0xEC, 0x48, 0x48, 0x89, 0xFB, 0x48, 0x8B, 0x05, 0x8B, 0x82, 0x05, 0x00, 0x48, 0x8B, 0x00, 0x48, 0x89, 0x45, 0xD0, 0x48, 0x8D])
|
||||
|
||||
let armPattern = Data([0xFF, 0x43, 0x02, 0xD1, 0xFA, 0x67, 0x04, 0xA9, 0xF8, 0x5F, 0x05, 0xA9, 0xF6, 0x57, 0x06, 0xA9, 0xF4, 0x4F, 0x07, 0xA9, 0xFD, 0x7B, 0x08, 0xA9, 0xFD, 0x03, 0x02, 0x91, 0xF3, 0x03, 0x00, 0xAA, 0x1F, 0x20, 0x03, 0xD5])
|
||||
|
||||
do {
|
||||
let fileData = try Data(contentsOf: URL(fileURLWithPath: setupPath))
|
||||
|
||||
@@ -756,6 +756,11 @@ struct SetupComponentRow: View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Text("X1a0He CC 备份状态: ")
|
||||
#if DEBUG
|
||||
Image(systemName: "ladybug.fill")
|
||||
.foregroundColor(.yellow)
|
||||
Text("Debug 模式")
|
||||
#else
|
||||
if ModifySetup.isSetupBackup() {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.green)
|
||||
@@ -765,10 +770,16 @@ struct SetupComponentRow: View {
|
||||
.foregroundColor(.red)
|
||||
Text("(可能导致处理 Setup 组件失败)")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Divider()
|
||||
HStack {
|
||||
Text("X1a0He CC 处理状态: ")
|
||||
#if DEBUG
|
||||
Image(systemName: "ladybug.fill")
|
||||
.foregroundColor(.yellow)
|
||||
Text("Debug 模式")
|
||||
#else
|
||||
if ModifySetup.isSetupModified() {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.green)
|
||||
@@ -778,6 +789,7 @@ struct SetupComponentRow: View {
|
||||
.foregroundColor(.red)
|
||||
Text("(将导致无法使用安装功能)")
|
||||
}
|
||||
#endif
|
||||
Spacer()
|
||||
|
||||
Button(action: {
|
||||
@@ -792,7 +804,11 @@ struct SetupComponentRow: View {
|
||||
}
|
||||
Divider()
|
||||
HStack {
|
||||
Text("X1a0He CC 版本信息: \(viewModel.setupVersion) [\(AppStatics.cpuArchitecture)]")
|
||||
Text("X1a0He CC 版本信息: ")
|
||||
Image(systemName: "info.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
Text("\(viewModel.setupVersion)")
|
||||
Text(" [\(AppStatics.cpuArchitecture)]")
|
||||
Spacer()
|
||||
|
||||
if viewModel.isDownloadingSetup {
|
||||
|
||||
@@ -208,7 +208,7 @@ struct DownloadProgressView: View {
|
||||
InstallProgressView(
|
||||
productName: task.displayName,
|
||||
progress: 1.0,
|
||||
status: "安装完成",
|
||||
status: String(localized: "安装完成"),
|
||||
onCancel: {
|
||||
isInstalling = false
|
||||
},
|
||||
@@ -218,7 +218,7 @@ struct DownloadProgressView: View {
|
||||
InstallProgressView(
|
||||
productName: task.displayName,
|
||||
progress: 0,
|
||||
status: "安装失败: \(error.localizedDescription)",
|
||||
status: String(localized: "安装失败: \(error.localizedDescription)"),
|
||||
onCancel: {
|
||||
isInstalling = false
|
||||
},
|
||||
@@ -232,7 +232,7 @@ struct DownloadProgressView: View {
|
||||
InstallProgressView(
|
||||
productName: task.displayName,
|
||||
progress: 0,
|
||||
status: "准备安装...",
|
||||
status: String(localized: "准备安装..."),
|
||||
onCancel: {
|
||||
networkManager.cancelInstallation()
|
||||
isInstalling = false
|
||||
|
||||
Reference in New Issue
Block a user