Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

Stop patching app.asar by byte offset#1

Open
moxw wants to merge 1 commit into
maria-rcks:mainfrom
moxw:semantic-bundle-patcher
Open

Stop patching app.asar by byte offset#1
moxw wants to merge 1 commit into
maria-rcks:mainfrom
moxw:semantic-bundle-patcher

Conversation

@moxw
Copy link
Copy Markdown

@moxw moxw commented Mar 14, 2026

I use this package on Linux, and the current byte-level app.asar patching finally broke for me when the upstream desktop bundle moved to the Vite-style bootstrap.js -> main-*.js layout. This PR is the cleanup that fell out of that breakage.

Instead of replacing fixed byte sequences inside app.asar, this changes the build to extract the archive, patch the real bundled main file semantically, and pack it again.

Concretely, this:

  • adds scripts/patch_codex_main.js
  • updates scripts/build_prepatched_bundle.sh to extract, patch, and repack app.asar while keeping node_modules unpacked
  • installs npm in CI because this path uses npx @electron/asar
  • checks for the patch script in the workflow validation step

It keeps the Linux-specific changes this package already ships, including the Zed-specific ones added here:

  • autoHideMenuBar
  • Linux Zed open-target support
  • editor-link target selection that prefers Zed when available

I also ran scripts/build_prepatched_bundle.sh locally against the current Codex.dmg with CODEX_ELECTRON_TARGET=40.0.0. It completed successfully and produced codex-desktop-prepatched-26.311.21342-d276b7962a64-x86_64.tar.gz.

@moxw moxw changed the title improvement(build): make bundle patching semantic Replace brittle app.asar byte patches Mar 14, 2026
- replace byte-offset app.asar edits with extract-patch-repack flow
- add a dedicated patch_codex_main.js script in the repo
- patch the resolved Vite main bundle for Linux menu and Zed support
- install npm in CI because the bundle build now uses npx
- validate the new patch script in the workflow layout check
@moxw moxw force-pushed the semantic-bundle-patcher branch from de9b5b4 to 254ca26 Compare March 14, 2026 07:55
@moxw moxw changed the title Replace brittle app.asar byte patches Stop patching app.asar by byte offset Mar 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant