diff --git a/Adobe Downloader.xcodeproj/xcshareddata/xcschemes/Adobe Downloader.xcscheme b/Adobe Downloader.xcodeproj/xcshareddata/xcschemes/Adobe Downloader.xcscheme index 00d55b3..b2edca4 100644 --- a/Adobe Downloader.xcodeproj/xcshareddata/xcschemes/Adobe Downloader.xcscheme +++ b/Adobe Downloader.xcodeproj/xcshareddata/xcschemes/Adobe Downloader.xcscheme @@ -31,7 +31,7 @@ shouldAutocreateTestPlan = "YES"> /dev/null 2>&1; then + echo "检测到已有运行中的 Helper,尝试停止..." + sudo launchctl bootout system/"$LABEL" 2>/dev/null || true +fi + +echo "重新加载 LaunchDaemon 配置..." + +# 优先使用新的 bootstrap / enable / kickstart 流程 +if command -v launchctl >/dev/null 2>&1; then + # bootstrap 会在 job 未加载时加载,在已加载时返回错误,忽略错误即可 + sudo launchctl bootstrap system "$PLIST" 2>/dev/null || true + + echo "确保 Helper 处于启用状态..." + sudo launchctl enable system/"$LABEL" 2>/dev/null || true + + echo "尝试立即启动 Helper..." + sudo launchctl kickstart -k system/"$LABEL" 2>/dev/null || true +else + echo "系统不支持新的 launchctl 子命令,尝试使用兼容模式加载..." + sudo /bin/launchctl unload "$PLIST" 2>/dev/null || true + sudo /bin/launchctl load -w "$PLIST" +fi + +echo +echo "操作已完成。" +echo "如果 Adobe Downloader 仍然提示「无法连接到 Helper」," +echo "请将本终端窗口的全部输出内容复制后反馈给开发者。" + diff --git a/Adobe Downloader/Views/CleanConfigView.swift b/Adobe Downloader/Views/CleanConfigView.swift index 21bd16e..212156b 100644 --- a/Adobe Downloader/Views/CleanConfigView.swift +++ b/Adobe Downloader/Views/CleanConfigView.swift @@ -33,12 +33,18 @@ struct CleanConfigView: View { Text("重置程序") }) { VStack(alignment: .leading, spacing: 8) { - HStack { + HStack(spacing: 8) { Button("重置程序") { showConfirmation = true } .buttonStyle(BeautifulButtonStyle(baseColor: .red.opacity(0.8))) .foregroundColor(.white) + + Button("修复 Helper") { + runFixHelperScript() + } + .buttonStyle(BeautifulButtonStyle(baseColor: .blue.opacity(0.8))) + .foregroundColor(.white) } .fixedSize(horizontal: false, vertical: true) } @@ -142,6 +148,41 @@ struct CleanConfigView: View { showAlert = true } } + + private func runFixHelperScript() { + do { + let downloadsURL = try FileManager.default.url(for: .downloadsDirectory, + in: .userDomainMask, + appropriateFor: nil, + create: false) + let scriptURL = downloadsURL.appendingPathComponent("fix-helper.sh") + + guard let scriptPath = Bundle.main.path(forResource: "fix-helper", ofType: "sh"), + let scriptContent = try? String(contentsOfFile: scriptPath, encoding: .utf8) else { + throw NSError(domain: "ScriptError", + code: 1, + userInfo: [NSLocalizedDescriptionKey: "无法读取修复脚本文件"]) + } + + try scriptContent.write(to: scriptURL, atomically: true, encoding: .utf8) + try FileManager.default.setAttributes([.posixPermissions: 0o755], + ofItemAtPath: scriptURL.path) + + let terminalURL = URL(fileURLWithPath: "/System/Applications/Utilities/Terminal.app") + NSWorkspace.shared.open([scriptURL], + withApplicationAt: terminalURL, + configuration: NSWorkspace.OpenConfiguration()) { _, error in + if let error = error { + alertMessage = "打开终端失败: \(error.localizedDescription)" + showAlert = true + return + } + } + } catch { + alertMessage = String(localized: "修复 Helper 失败: \(error.localizedDescription)") + showAlert = true + } + } } struct CleanupLog: Identifiable { diff --git a/Localizables/Localizable.xcstrings b/Localizables/Localizable.xcstrings index 470331f..545db4d 100644 --- a/Localizables/Localizable.xcstrings +++ b/Localizables/Localizable.xcstrings @@ -17,6 +17,7 @@ }, "(可能导致处理失败)" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -27,6 +28,7 @@ } }, "(无法使用安装功能)" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -146,6 +148,12 @@ }, "•" : { + }, + "✅" : { + + }, + "❌" : { + }, "1-10" : { @@ -293,7 +301,6 @@ }, "Debug 模式" : { - "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -396,6 +403,7 @@ } }, "Helper 未连接" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -437,7 +445,14 @@ } }, "Helper 重新安装成功,但权限不是root: %@" : { - + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Helper reinstalled successfully, but the permission is not root: %@" + } + } + } }, "Helper 重新连接成功" : { "localizations" : { @@ -450,7 +465,14 @@ } }, "Helper 重新连接成功,但权限不是root: %@" : { - + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Helper reconnected successfully, but the permission is not root: %@" + } + } + } }, "Helper服务需要批准" : { "extractionState" : "stale", @@ -479,9 +501,15 @@ }, "macOS %@" : { + }, + "Match:" : { + }, "OK" : { + }, + "Reason:" : { + }, "Setup 组件是 Adobe 官方的安装程序组件,我们需要对其进行修改以实现绕过验证的功能。如果没有下载并处理 Setup 组件,将无法使用安装功能。" : { "localizations" : { @@ -504,6 +532,7 @@ } }, "Setup 组件未处理,无法安装" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -522,6 +551,9 @@ } } } + }, + "Target:" : { + }, "v%@" : { @@ -907,6 +939,26 @@ } } }, + "修复 Helper" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Fix helper" + } + } + } + }, + "修复 Helper 失败: %@" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Fix helper failed: %@" + } + } + } + }, "修改 Setup 组件失败" : { "localizations" : { "en" : { @@ -1212,7 +1264,6 @@ } }, "可选模块" : { - "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -1618,7 +1669,6 @@ } }, "展开全部" : { - "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -1659,6 +1709,7 @@ } }, "已处理" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -1669,6 +1720,7 @@ } }, "已备份" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -1987,7 +2039,6 @@ } }, "折叠全部" : { - "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -1998,7 +2049,6 @@ } }, "持久化文件" : { - "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -2372,6 +2422,7 @@ } }, "未处理" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -2382,6 +2433,7 @@ } }, "未备份" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -2402,7 +2454,6 @@ } }, "未对 Setup 组件进行处理或者 Setup 组件不存在,无法使用安装功能\n你可以通过设置页面再次对 Setup 组件进行处理" : { - "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -2413,6 +2464,7 @@ } }, "未对 Setup 组件进行处理或者 Setup 组件不存在,无法使用安装功能\n你可以通过设置页面对 Setup 组件进行处理" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -2511,7 +2563,6 @@ } }, "条件: %@" : { - "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { diff --git a/analyze/channels.md b/analyze/channels.md deleted file mode 100644 index 811a202..0000000 --- a/analyze/channels.md +++ /dev/null @@ -1,91 +0,0 @@ -# channels 的分析 - -> 关于 Adobe 的 JSON 文件中 channels 的分析 - -channels是一个数组,有两个成员,两个成员结构大致相同,分别是 - -- sti -- ccm - -## sti - -sti 里的产品一般是 Adobe App 中的必要组件,主要有以下 -> 数据更新日为: 2025.02.25 - -- CAI -- Camera Raw -- Camera Raw CC -- Adobe Character Animator (Preview 4) -- CCX Process -- Codecs -- STI_ColorCommonSet_CMYK_HD -- STI_Color_MotionPicture_HD -- STI_Color_Photoshop_HD -- STI_Color_HD -- STI_ColorCommonSet_RGB_HD -- CoreSync -- Adobe Captivate Assets 2017 -- Adobe Captivate Voices 2017 -- Camera Raw Elements -- Animate HLAN -- HD_ASU -- Adobe Fonts -- CC Library -- Adobe Preview CC -- Substance 3D Viewer for Photoshop -- SeashellPSPlugin - -## ccm - -ccm 里的产品一般是 Adobe App 中的主程序版本,主要有以下 -> 数据更新日为: 2025.02.25 - -- Adobe Application Manager -- After Effects -- After Effects (Beta) -- Aero (Beta) -- Aero (Desktop) -- InCopy -- Media Encoder -- Media Encoder (Beta) -- Acrobat -- Scout CC -- Audition -- Audition (Beta) -- Character Animator -- Character Animator (Beta) -- Dreamweaver -- Dimension -- Flash Builder Premium -- Animate -- Fireworks CS6 -- Gaming SDK 1.4 -- InDesign -- InDesign (Beta) -- Illustrator -- Illustrator (Prerelease) -- Bridge -- Bridge (Beta) -- Creative Cloud -- Extension Manager CC -- Extendscript Toolkit CC -- Lightroom -- Lightroom Classic -- Muse CC -- Muse CC (2017) -- Photoshop -- Premiere Pro -- Premiere Pro (Beta) -- Premiere Rush -- Premiere Rush CC -- Premiere Rush (Beta) -- Substance 3D Sampler -- Substance Alchemist -- Substance 3D Designer -- Substance Designer -- Substance 3D Painter -- Substance Painter -- Substance 3D Viewer (Beta) -- Substance 3D Stager -- Touch App Plugins -- UXP Developer Tools \ No newline at end of file