Skip to content

fix(packaging): 载荷必须在签名装订之后才复制(修公证 Invalid) - #364

Merged
wangzhizhou merged 1 commit into
mainfrom
dev
Nov 23, 2026
Merged

wangzhizhou merged 1 commit into
mainfrom
dev

Conversation

@wangzhizhou

Copy link
Copy Markdown
Contributor

第一次尝试的公证被判 Invalid,Apple 日志(这条日志正是刚加的 notarize() 打出来的)给了三条:

path: 安装萤火虫.app/Contents/Resources/Payload/LampyrisUpdateCheck.app/Contents/MacOS/LampyrisUpdateCheck
The signature does not include a secure timestamp. / The executable does not have the hardened runtime enabled.
The signature of the binary is invalid.

原因:载荷是复制的二进制,而我在更新程序签名之前就复制了它 → 安装器里带着一份未签名副本。

修法(顺序两头卡死):

  1. ci-sign.sh --app <更新程序> --also <卸载器>:签+公证+装订;
  2. stage-installer-payload.sh:把(验收 ZIP 里已装订的主机)+(已装订的更新程序)装成载荷;
  3. ci-sign.sh --app <安装器>:签+公证+装订安装器,把载荷封进签名;
  4. make-dmg.sh → ci-sign.sh --dmg。
    两次公证提交,脚本注释里写明顺序不可动。

新增守卫:stage-installer-payload.sh 拒绝缺 Contents/CodeResources 或 codesign --verify 失败的载荷(本机预览需显式 --unsigned-ok),测试覆盖「未签名载荷必须被拒」与「工作流顺序:先签更新程序 → 装载荷 → 签安装器」。

…pled

Apple rejected the first attempt: the payload copy inside the installer had
"invalid signature", "no secure timestamp" and "hardened runtime not
enabled", because it was copied before the updater was signed.

Order is now fixed at both ends and enforced where it can be checked:
sign+notarize+staple the updater and uninstaller, then stage the payload,
then sign+notarize+staple the installer (sealing the payload), then build
the DMG. stage-installer-payload.sh refuses payloads that lack a ticket or
fail codesign verification, so a bad copy fails locally instead of at
Apple; local previews must pass --unsigned-ok explicitly.

Signed-off-by: wangzhizhou <[email protected]>
@wangzhizhou
wangzhizhou merged commit 9edbd31 into main Nov 23, 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