Skip to content

build_ipa.sh: DM_COPY_ROMFS=NO for the unsigned IPA; entitlements in the executable's signature - #478

Closed
v0lumehi wants to merge 1 commit into
seedds:mainfrom
v0lumehi:ipa-slim
Closed

v0lumehi wants to merge 1 commit into
seedds:mainfrom
v0lumehi:ipa-slim

Conversation

@v0lumehi

Copy link
Copy Markdown
Contributor

What and why

NX2Apple carries this as a patch (patch_build_ipa); part of #388 (fewer patches for forks).

  • build_ipa.sh takes DM_COPY_ROMFS=NO, the switch the Xcode build phase (stage_resources.sh) already has: the RomFS stays out of the unsigned IPA. A large game's full package can exceed what iOS extracts; the app then takes Documents/romfs.img (scripts/push_romfs.sh, main.m). Default unchanged: the docs treat the separate image as the "Quick reinstalls" option, not the normal route. Add-on content stays in the IPA (main.m only looks for <App>/aoc).
  • Cause of the lost entitlement: the unsigned build (CODE_SIGNING_ALLOWED=NO) has no signature, and only the Xcode path wrote entitlements. The executable now gets codesign --sign - --entitlements (DM_ENTITLEMENTS as for the Xcode project: default Increased Memory Limit, empty = none). _CodeSignature is not packed, the executable's embedded signature is what a sideloader reads. Only the executable is signed (no hashing of resources packed from elsewhere).

Checked

  • Tests: dm/ios/tests/test_ipa_unsigned.py (new: default packs RomFS and aoc/, DM_COPY_ROMFS=NO leaves RomFS out, entitlements read back with codesign -d --entitlements - from a stand-in executable, none with empty DM_ENTITLEMENTS), test_profile_pack, test_xcode_workflow, test_pack_ipa, test_docs, test_env_switches; lint ratchet: 0 new.
  • No game runs, no device, nothing signed with a real identity.

Docs

  • README, docs/development.md (Quick reinstalls), docs/env_switches.tsv
  • No chain tool changed
  • No game files, keys or data in the change

…the executable carries the entitlements

The Xcode build phase already takes DM_COPY_ROMFS=NO (the app then reads Documents/romfs.img, scripts/push_romfs.sh); the unsigned IPA now takes it too, so a large game's package stays within what iOS extracts. The default is unchanged.

An unsigned build has no signature for a sideloader to read entitlements from, so the Increased Memory Limit request was lost. The executable now gets an ad-hoc signature with the entitlements (DM_ENTITLEMENTS as for the Xcode project).
seedds added a commit that referenced this pull request Oct 28, 2026
Apply DM_COPY_ROMFS=NO to unsigned IPA packing as well as the Xcode resource phase. Keep add-on content bundled. Carry the requested entitlements in an ad-hoc executable signature for the sideloader to read; an empty DM_ENTITLEMENTS opts out.

Validated 43 focused iOS packing, Xcode workflow, documentation and environment tests. No on-device install or startup claim.

Co-authored-by: v0lumehi <[email protected]>
@seedds

seedds commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Taken into main first as 32ae3b11bb85. Thanks @v0lumehi — the slim IPA packing and executable entitlement request are useful, and your contribution is retained with Co-authored-by credit.

DM_COPY_ROMFS=NO now covers unsigned IPA packing as well as the Xcode resource phase; the default remains bundled and add-on content remains included. Checked 43 focused packing, Xcode workflow, documentation and environment tests before taking #493 on top.

On-device sideloader entitlement preservation is not claimed. Closing as integrated; #493 supplies the supported NSP-script route and startup identity check.

@seedds seedds closed this Oct 28, 2026
Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
…#478)

Apply DM_COPY_ROMFS=NO to unsigned IPA packing as well as the Xcode resource phase. Keep add-on content bundled. Carry the requested entitlements in an ad-hoc executable signature for the sideloader to read; an empty DM_ENTITLEMENTS opts out.

Validated 43 focused iOS packing, Xcode workflow, documentation and environment tests. No on-device install or startup claim.

Co-authored-by: v0lumehi <[email protected]>
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.

2 participants