fix: bundle vphone-amfidont in Resources, not MacOS (unbreaks .app signing)

The v1.0.2 release build failed at the bundle codesign step:

  .build/vphone-cli.app/Contents/MacOS/vphone-cli: code object is not signed at all
  In subcomponent: .../Contents/MacOS/vphone-amfidont

Contents/MacOS is the bundle's nested-code directory, so signing the main
executable seals everything there and rejected the vphone-amfidont shell
script as unsigned nested code. (A script only gets a "generic" xattr
signature that wouldn't survive the release zip anyway.)

Move the bundled helper to Contents/Resources/vphone-amfidont, where it is
sealed as an ordinary resource (hashed, survives zip). Resources sits at the
same depth under Contents as MacOS, so the script's `${0:A:h:h:h}` .app
resolution is unchanged. The Homebrew `binary` stanza should point at
Contents/Resources/vphone-amfidont.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y4VDqWf5pVakcFLqB23CKe
This commit is contained in:
zqxwce
2026-07-28 17:26:26 +03:00
committed by zqxwce
co-authored by Claude Opus 4.8
parent 766d1555fb
commit 8b6ffd2e26
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -52,10 +52,6 @@ cp -f "sources/AppIcon.icns" "${BUNDLE}/Contents/Resources/AppIcon.icns"
cp -f "scripts/vphoned/signcert.p12" "${BUNDLE}/Contents/Resources/signcert.p12"
cp -f "$(command -v ldid)" "${BUNDLE}/Contents/MacOS/ldid"
codesign --force --sign - "${BUNDLE}/Contents/MacOS/ldid"
# vphone-amfidont helper (allows this .app through amfid). Bundled next to the
# main binary so a Homebrew `binary` symlink can put it on PATH.
cp -f "scripts/vphone-amfidont" "${BUNDLE}/Contents/MacOS/vphone-amfidont"
chmod +x "${BUNDLE}/Contents/MacOS/vphone-amfidont"
codesign --force --sign - --entitlements "$ENTITLEMENTS" "$BUNDLE_BIN"
echo " bundled → ${BUNDLE}"
@@ -103,7 +99,12 @@ cp -f requirements.txt "${RES}/requirements.txt"
# = the Tested-Environments table fw_prepare.sh reads to label Supported firmwares.
cp -f debs.list "${RES}/debs.list"
cp -f README.md "${RES}/README.md"
echo " bundled: scripts/ (patchers+resources), tools/, .tools/bin/{trustcache,insert_dylib}, vphoned.signed, requirements.txt, debs.list, README.md"
# vphone-amfidont helper (allows this .app through amfid). Kept in Resources —
# NOT MacOS — so bundle signing doesn't reject it as unsigned nested code; a
# Homebrew `binary` symlink exposes it on PATH.
cp -f scripts/vphone-amfidont "${RES}/vphone-amfidont"
chmod +x "${RES}/vphone-amfidont"
echo " bundled: scripts/ (patchers+resources), tools/, .tools/bin/{trustcache,insert_dylib}, vphoned.signed, requirements.txt, debs.list, README.md, vphone-amfidont"
# Re-sign: codesign seals Contents/Resources at sign time, so the earlier
# bundle-step signature (made before these assets existed) is now stale —
+1 -1
View File
@@ -4,7 +4,7 @@
# step. amfidont: https://github.com/zqxwce/amfidont
set -euo pipefail
# The enclosing .app (this lives at vphone-cli.app/Contents/MacOS/vphone-amfidont;
# The enclosing .app (this lives at vphone-cli.app/Contents/Resources/vphone-amfidont;
# `:A` resolves a Homebrew symlink back into the bundle).
app="${0:A:h:h:h}"
[[ "${app:e}" == app && -x "$app/Contents/MacOS/vphone-cli" ]] \