Skip to content

fix(corp/mac): consistent ad-hoc signature for KeepMind Corp.app + strict verify - #25

Draft
criptogus wants to merge 1 commit into
mainfrom
fix/corp-mac-adhoc-signature
Draft

criptogus wants to merge 1 commit into
mainfrom
fix/corp-mac-adhoc-signature

Conversation

@criptogus

Copy link
Copy Markdown
Owner

Draft. Do not merge, tag or release without Gustavo's OK.

Problem: the published corp-v0.2.6 KeepMind.Corp-0.2.6-arm64.dmg, installed on macos-latest, fails spctl --assess with code has no resources but signature indicates they must be present. The bundle seal is inconsistent: only part of the bundle is ad-hoc signed, and resources and Info.plist change afterwards. Real users can see "app is damaged". Evidence: https://github.com/criptogus/keepmind/actions/runs/43621824757 (artifact install-smoke-macos-latest, corp-spctl.log).

Fix

  • electron-builder.corp.yml: mac.identity: null + afterSign: scripts/mac-adhoc-sign.cjs.
  • scripts/mac-adhoc-sign.cjs (macOS only, a no-op elsewhere) does three things:
    • runs codesign --force --deep --sign - on the whole KeepMind Corp.app;
    • runs codesign --verify --deep --strict --verbose=2, which fails the build on error;
    • logs codesign -dv.
  • The hook runs for dmg, zip and --mac --dir. In app-builder-lib 25.1.8, signApp returns true even with identity: null, so afterSign runs after every plist and resource change.
  • The main KeepMind app is unchanged. src/main/store.ts warns that re-signing can orphan secrets sealed through safeStorage/keychain. Corp already shipped with an (inconsistent) ad-hoc signature, so the risk there doesn't change.
  • No workflow was changed. The existing installed-apps.yml runs on this PR because it touches electron-builder*.yml. It builds Corp with --mac --dir on macos-latest, so the hook's verification runs there.

Tests: tests/mac-adhoc-sign.test.ts (7, child_process mocked) checks the path, args, that verify runs, the non-darwin skip, the failure on a bad verify, and the config wiring. The local vitest run (mac-adhoc-sign + release-artifact-names + release-gates) gave 21/21; typecheck passed.

Real validation on a macOS dmg/zip build: separate test branch test/0.2.7-package-dryrun-1411 (prep 0.2.7 + this fix), no publish.

Open: the app is still not notarized, so Gatekeeper still warns. The PR only removes the "damaged" state; the first-launch flow from the docs PR is still needed.

This branch has not been deployed

No deployments
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