fix(mac): improve macOS installation stability with build verification, signing hardening, and diagnostics#838
Draft
hazeone wants to merge 2 commits into
Draft
fix(mac): improve macOS installation stability with build verification, signing hardening, and diagnostics#838hazeone wants to merge 2 commits into
hazeone wants to merge 2 commits into
Conversation
…d startup integrity check Phase 1: Add CI verification step after macOS build that runs: - codesign --verify --deep --strict (same as VSCode CI) - Secure timestamp validation - spctl --assess (Gatekeeper acceptance) - xcrun stapler validate (notarization staple) Prevents shipping silently broken signatures. Phase 2: Add explicit Apple TSA timestamp server to electron-builder.yml. Ensures secure timestamp is always embedded, preventing Gatekeeper rejection when signing cert expires. Phase 3: Add startup code signature self-check on macOS (diagnostic). Logs a warning if the running .app bundle has a broken signature, helping diagnose 'can't be opened' reports from failed auto-updates. Also improves updater logging for post-mortem debugging. Co-authored-by: Haze <hazeone@users.noreply.github.com>
…th macOS troubleshooting
Phase 4: Add integrity verification to after-pack.cjs:
- Log final file count and size of Resources directory
- Verify critical patched modules contain expected marker strings
- Fail the build if any integrity check fails (catches silent
write failures or encoding corruption before signing)
Phase 5: Improve release notes template with detailed macOS
troubleshooting in Chinese and English:
- Instructions for 'damaged' (已损坏) error: xattr -cr fix
- Instructions for 'can't be opened' (已不能再打开): reinstall steps
- First-launch Gatekeeper bypass: right-click → Open
- Structured by platform (macOS/Windows/Linux)
Co-authored-by: Haze <hazeone@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses recurring macOS installation stability issues ("应用程序'ClawX'已不能再打开" / "文件已损坏") through a 5-phase improvement plan based on deep analysis of the ClawX build pipeline, CI logs, and best practices from VSCode, ClashParty/Mihomo Party, and the electron-builder ecosystem.
Root Causes Identified
Changes
Phase 1: CI Post-Build Verification (CRITICAL)
Verify macOS code signature and notarizationstep torelease.ymlcodesign --verify --deep --strict(same as VSCode CI)spctl --assess(Gatekeeper acceptance test)xcrun stapler validate(notarization staple verification)Phase 2: Explicit Timestamp Server
timestamp: "http://timestamp.apple.com/ts01"toelectron-builder.ymlPhase 3: Startup Signature Self-Check + Updater Logging
quitAndInstall()for post-mortem debuggingPhase 4: afterPack Integrity Verification
after-pack.cjsPhase 5: macOS Troubleshooting in Release Notes
xattr -crfixRelated Issue(s)
Addresses recurring macOS "file is damaged" and "can't be opened" installation reports.
Type of Change
Validation
pnpm run lint— passes cleanlypnpm run typecheck— pre-existing failure (unrelateduse-stick-to-bottommodule)pnpm test— pre-existing 5 test failures (unrelatedplugin-install.test.tsmock issue)node -c scripts/after-pack.cjs— syntax check passesChecklist