Skip to content

feat(install): support custom bundle identifier in Apple ID mode - #209

Merged
bitxeno merged 1 commit into
masterfrom
feat/apple-id-custom-bundle-id
Oct 11, 2026
Merged

bitxeno merged 1 commit into
masterfrom
feat/apple-id-custom-bundle-id

Conversation

@bitxeno

@bitxeno bitxeno commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Why

The signing engine already accepts --custom-identifier together with --apple-id, but every entry point refused the combination, so Apple ID installs could not use a custom bundle identifier at all.

Worse, an Apple ID record was keyed by the bundle identifier of the IPA plus the account. Installing the same IPA with and without a custom identifier therefore collapsed into a single record, and the second install silently overwrote the identifier of the first.

How

Key the record by the app actually on the device. The Apple ID match key becomes COALESCE(NULLIF(signed_bundle_identifier,''), NULLIF(custom_identifier,''), bundle_identifier), so a custom identifier gives the install its own record. NULLIF matters: columns added by AutoMigrate are NULL on existing rows, not empty. This mirrors what external certificate records already did, so both modes now agree.

Pass the identifier to the engine in both modes, including the refresh path. A refresh re-signs the stored IPA, which still carries the original bundle identifier — without the flag the app would be refreshed under another App ID.

Open the three entry points (/api/install, the /ws/install message, the MCP install_app tool) and validate the identifier there instead of rejecting it.

Two latent bugs fixed on the way

  • The MCP tool validated custom_identifier but stored it only for external certificates, so an Apple ID install would have passed validation and then dropped the value.
  • installOperationKey did not include the identifier, so two installs of the same IPA under different identifiers were treated as duplicates and the second was dropped.

UI

The field is now shown in both modes, using the tooltip style of the app name field, and the placeholder previews the bundle identifier of the chosen IPA (read in the browser for a picked file, since an Apple ID install never reaches the server before the install is queued). The identifier is validated before submitting, and the home page shows it so two records sharing a bundle identifier can be told apart.

Testing

  • TestStartAppleIDPassesCustomIdentifier drives startAppleID against a fake engine and asserts the argument for install, refresh and no-identifier cases. Removing the wiring makes it fail.
  • TestSaveAppKeepsSigningModesApart grows from 10 to 17 cases covering Apple ID custom/plain splits and legacy rows whose added columns are NULL. Its historical helper now NULLs every added column, not just signing_mode.
  • TestNewInstallRecordKeepsCustomIdentifier covers the MCP regression above.
  • Three frontend tests cover the placeholder preview and its reset on mode change.

golangci-lint clean, full Go suite green, 70 frontend tests green.

Note for the reviewer

The engine flag combination is new to this project, and CI pins plumesign v2.2.3-patch.9 while this was developed against 2.2.2. Please confirm on real hardware that an Apple ID install with a custom identifier registers the App ID and installs as expected before merging. Also worth noting: each distinct identifier consumes another App ID slot, and there is currently no dedicated error for exhausting that quota.

The signing engine accepts --custom-identifier together with --apple-id,
but every entry point refused the combination. Worse, an Apple ID record
was keyed by the bundle identifier of the IPA and the account, so
installing the same IPA with and without a custom identifier collapsed
into a single record and the second install overwrote the identifier of
the first.

Key the record by the bundle identifier actually installed on the device
(COALESCE of signed_bundle_identifier, custom_identifier and
bundle_identifier, so the columns AutoMigrate leaves NULL on existing
rows are ignored) and pass the identifier to the engine in both signing
modes. A refresh passes it again: the stored IPA still carries the
original bundle identifier, so without it the app would be refreshed
under another App ID. The install is thus a second app on the device,
with its own record, App ID and expiry.

Also keep the identifier when the MCP tool queues an Apple ID install
(it validated the value but stored it only for external certificates)
and add it to the install queue key, so two installs of the same IPA
under different identifiers are both queued.

The install page shows the field in both modes in the tooltip style of
the app name field, previews the identifier of the chosen IPA, and
validates it before submitting.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T11:52:13.114717Z e5ff707 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bitxeno
bitxeno merged commit ee8ffde into master Oct 11, 2026
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.

1 participant

⌂ 换网址