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
Open
Conversation
- 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
de9b5b4 to
254ca26
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I use this package on Linux, and the current byte-level
app.asarpatching finally broke for me when the upstream desktop bundle moved to the Vite-stylebootstrap.js -> main-*.jslayout. 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:
scripts/patch_codex_main.jsscripts/build_prepatched_bundle.shto extract, patch, and repackapp.asarwhile keepingnode_modulesunpackednpmin CI because this path usesnpx @electron/asarIt keeps the Linux-specific changes this package already ships, including the Zed-specific ones added here:
autoHideMenuBarI also ran
scripts/build_prepatched_bundle.shlocally against the currentCodex.dmgwithCODEX_ELECTRON_TARGET=40.0.0. It completed successfully and producedcodex-desktop-prepatched-26.311.21342-d276b7962a64-x86_64.tar.gz.