fix(hook-codex): stop snapshotting Codex.app's Info.plist#1
Merged
Conversation
`enableHook` copied the full Info.plist to ~/.plaipin/state/ and `disableHook` restored it byte-for-byte. The plist contains data Codex owns - most importantly ElectronAsarIntegrity, whose SHA-256 of app.asar is rewritten by Codex's auto-updater. After any auto-update between install and uninstall, the snapshot's hash no longer matches the on-disk app.asar, and restoring it causes Electron's EnableEmbeddedAsarIntegrityValidation fuse to abort at launch (SIGTRAP in asar_util.cc).
Plaipin only ever needs to mutate :LSEnvironment:CODEX_CLI_PATH, so:
- drop BACKUP_INFO_PLIST and all whole-file copy/restore
- enableHook: surgically delete only :LSEnvironment:CODEX_CLI_PATH (was wiping the whole :LSEnvironment dict, clobbering any other env vars Codex or the user set), add parent dict idempotently, then add our key
- disableHook: single PlistBuddy delete + ad-hoc re-sign
- cmd-uninstall: delegate to cmdHookCodex({disable:true}) for one source of truth
- drop `codesign --deep` (deprecated; editing Info.plist only invalidates the outer bundle signature)
Uninstall is now purely declarative against the live Info.plist, so no stale-snapshot bug is possible across Codex auto-updates
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.
enableHookcopied the full Info.plist to ~/.plaipin/state/ anddisableHookrestored it byte-for-byte. The plist contains data Codex owns - most importantly ElectronAsarIntegrity, whose SHA-256 of app.asar is rewritten by Codex's auto-updater. After any auto-update between install and uninstall, the snapshot's hash no longer matches the on-disk app.asar, and restoring it causes Electron's EnableEmbeddedAsarIntegrityValidation fuse to abort at launch (SIGTRAP in asar_util.cc).Plaipin only ever needs to mutate :LSEnvironment:CODEX_CLI_PATH, so:
codesign --deep(deprecated; editing Info.plist only invalidates the outer bundle signature)Uninstall is now purely declarative against the live Info.plist, so no stale-snapshot bug is possible across Codex auto-updates