Skip to content

docs(macos): DMG 内附首次打开引导(ad-hoc 签名 Gatekeeper 提示)#318

Merged
Sway-Chan merged 1 commit into
dododook:mainfrom
Sway-Chan:feat/macos-dmg-open-guide
Jul 17, 2026
Merged

docs(macos): DMG 内附首次打开引导(ad-hoc 签名 Gatekeeper 提示)#318
Sway-Chan merged 1 commit into
dododook:mainfrom
Sway-Chan:feat/macos-dmg-open-guide

Conversation

@Sway-Chan

Copy link
Copy Markdown
Collaborator

问题

macOS 包为 ad-hoc 签名(codesign --force --deep --sign -,无付费 Developer ID / 公证)。用户从浏览器下载 DMG → OS 打 com.apple.quarantine → 拖出的 app 继承 → Gatekeeper 判定 ad-hoc + quarantine + 未公证 = 「"FlowZ.app" 已损坏,无法打开,应将它移到废纸篓」。

关键:此提示("damaged")「右键→打开」无效(那只对"无法验证开发者"有效),必须 xattr -cr 清除隔离属性才能打开。普通用户不知道,直接以为软件坏了。

修复(过渡止血)

DMG 内附一份中英文首次打开引导 build/macos-dmg-open-guide.txt,教用户拖入 Applications 后运行:

xattr -cr /Applications/FlowZ.app

文件名带序号 0 让它在 Finder 里排到 FlowZ.app 前、更显眼。

为什么不是自动修复

打包侧无法在 app 首次打开前自动清 quarantine——quarantine 是用户下载时 OS 加的,而 app 被 Gatekeeper 拦住根本没启动,app 内逻辑跑不了;DMG 内放 .command 脚本同样带 quarantine 被拦。所以只能引导用户手动清。

根治方向(另行评估)

Developer ID + 公证(Apple Developer $99/年)是唯一零用户操作的解:下载拖入即开,顺带根治 ad-hoc 的 TCC 逐版重置 / Keychain ACL / 登录项等债。本 PR 是拿到证书前的过渡。

验证

release.yml YAML 校验通过。DMG 实际产出需下次 release 的 CI(macOS runner + hdiutil)验证:挂载 DMG 确认说明文件在、文件名中文正常显示、排在 app 前。本地 Linux 无法跑 hdiutil。

macOS 包为 ad-hoc 签名(codesign --sign -,无付费 Developer ID / 公证),
用户从下载的 DMG 拖出的 app 带 com.apple.quarantine,首次打开报「已损坏,
应移到废纸篓」,且「右键→打开」对此提示无效,须 xattr -cr 清除隔离属性。

在 DMG 内附一份中英文首次打开引导(build/macos-dmg-open-guide.txt),教用户
拖入 Applications 后运行 xattr -cr /Applications/FlowZ.app。文件名带序号 0 让它
在 Finder 里排到 app 前、更显眼。

过渡止血方案;根治需 Developer ID + 公证(零操作打开),另行评估。
@Sway-Chan
Sway-Chan merged commit 144fd90 into dododook:main Jul 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant