Skip to content

Hand games to and from Provenance through the shared App Group - #111

Merged
JoeMatt merged 4 commits into
developfrom
feature/ecosystem-handoff
Nov 17, 2026
Merged

JoeMatt merged 4 commits into
developfrom
feature/ecosystem-handoff

Conversation

@JoeMatt

@JoeMatt JoeMatt commented Nov 17, 2026

Copy link
Copy Markdown
Member

What this adds

iCube's side of the drop box Provenance, iFly and iCube share on one device, in the App Group group.org.provenance-emu.provenance. A game moves between the apps without the system share sheet and without the sender staying alive.

This is contract version 1, the same contract as iFly develop d7178e576 (the header of its EcosystemHandoff.swift) and the Provenance branch feature/ecosystem-handoff-inbox. Nothing in the contract was changed for iCube. Part of #55 (the "iCube ↔ Provenance on one iPhone/iPad" journey); it does not close it.

  • Presence. Ecosystem/Apps/dolphinios.json is written at launch and on every activation: handoff: 1, accepts: ["game"], systems: ["gamecube", "wii"].
  • Send. "Send to Provenance" and an approved dolphinios://requestGame clone the disc image into Handoff/provenance/.<id>.staging/, rename it to <id>, then open provenance://handoff?id=…&from=dolphinios. This route is taken when Provenance is installed and its presence entry takes a game for the title's system. For an older Provenance, or when staging fails, the share sheet is used as before.
  • Apple TV. tvOS has no share sheet, so its game menu offers "Send to Provenance" only when the direct route exists and the game's file is on the device.
  • Receive. On activation and on dolphinios://handoff, every complete hand-off addressed to iCube is moved into Software/ and its directory deleted. A manifest path must be relative, with no empty, dot-prefixed or .. component; the file must be a regular file with a disc-image extension; a file already in the library is never replaced. Staging directories, a newer version, another kind and another to are left alone.
  • Clean-up. iCube's own hand-offs older than 7 days and staging directories older than an hour are removed on activation.
  • Settings › Connected Apps describes the new route.

Things a reviewer may want to know

  • The receive does not go through ImportFileManager.importFiles(at:). That call is iOS-only, asks Copy/Move/Cancel for a single disc image, refuses URLs that are not security-scoped, and reports no completion to delete the hand-off after. The receive uses ImportStaging.stagedMove, the staged move that importer itself uses.
  • EcosystemBridge.peerInstalled now probes on tvOS as well (canOpenURL exists there); it used to return false off iOS.
  • The first commit is a whitespace-only swiftformat of the four existing ecosystem files, kept separate so the feature diff is readable.
  • The branch carries a merge of develop (Scan-to-pair QR, add-source choices and a compact empty library #110 landed while this was in progress); both sides had appended entries to Core.strings, and both are kept.
  • Sideload, TrollStore and jailbreak artefacts are signed with Project/Entitlements/Public.entitlements / Private.entitlements, which do not list the shared group. Those builds get no presence and no direct route, and keep the share sheet. Not changed here.

Checks

Run on the merged branch (428b95f784):

  • 59 iOS simulator tests pass (iPhone 17 Pro, iOS 27.0): EcosystemHandoffTests (21, new), EcosystemBridgeTests (21), ConnectedAppsModelBuilderTests (4), UniversalLinkRouterTests (13). The new tests use a temporary directory in place of the group container and cover the staging layout and wire format, the rename into place, presence gating, inbox filtering, unsafe paths and symbolic links, and clean-up.
  • make gate-release: Release (Non-Jailbroken) compiles for iOS and tvOS.
  • swiftformat and swiftlint: nothing on changed lines. Design-token ratchet and localized-key coverage pass.

Not checked

  • No real transfer. Nothing was run on a device, and the simulator build is not a member of the App Group, so no game has actually moved between iCube and Provenance in either direction.
  • No tvOS run. tvOS only compiles; the new menu row and whether canOpenURL / open reach Provenance on Apple TV are untested.
  • No Mac build. Mac Catalyst was not built. EcosystemHandoff.sharedRoot returns nil there unless the group container is writable; that guard is untested.
  • The full test suite was not run locally, only the four classes above.

Whitespace only (two-space indent, per .swiftformat), ahead of the
drop-box change that rewrites most of these files.
… App Group

iCube's side of the drop box Provenance, iFly and iCube share in
group.org.provenance-emu.provenance (contract version 1, the same text
as iFly's EcosystemHandoff.swift).

- Presence: Apps/dolphinios.json is written at launch and on every
  activation (handoff 1, accepts game, systems gamecube and wii).
- Send: "Send to Provenance" and an approved requestGame clone the disc
  image into Handoff/<peer>/ under a staging name, rename it, then open
  <peer>://handoff. Used when the peer is installed and its presence
  entry takes a game for the title's system; otherwise, and when
  staging fails, the share sheet as before. Apple TV has no share
  sheet, so its context menu offers the send only when the direct route
  exists.
- Receive: on activation and on dolphinios://handoff, every complete
  hand-off addressed to iCube is moved into Software/ through
  ImportStaging (the importer's staged move) and deleted. Manifest
  paths must be relative with no empty, dot-prefixed or .. components,
  the file must be a regular file with a disc-image extension, and an
  existing library file is never replaced.
- Clean-up: iCube's own hand-offs older than 7 days and staging
  directories older than an hour are removed on activation.

ImportFileManager.importFiles(at:) is not used for the receive: it is
iOS-only, asks Copy/Move/Cancel for a single disc image, refuses URLs
that are not security-scoped and reports no completion to delete the
hand-off after.

EcosystemBridge.peerInstalled now probes on tvOS too (canOpenURL exists
there). Settings › Connected Apps describes the new route.
Core.strings: both sides appended entries at the end of the file; kept both.
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T08:19:38.262843Z 428b95f 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 428b95f784

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…mes apart, probe peers on tvOS

Review findings on the drop-box receiver:

- A move that fails (no space, an unwritable folder) no longer deletes
  the hand-off. It stays in the inbox, the next activation tries again,
  files an earlier pass moved count as present, and the user is told
  once per launch that the import will be retried instead of being told
  the format is unsupported.
- A file already in the library under the same name is only treated as
  the same game when its bytes match. A different file is placed beside
  it as "name (2).ext". Size alone cannot tell: every full GameCube
  image is the same size.
- Info-TV.plist had no LSApplicationQueriesSchemes, so canOpenURL could
  never see Provenance on Apple TV and the direct send was never
  offered there.
@JoeMatt
JoeMatt merged commit 3198e54 into develop Nov 17, 2026
5 checks passed
@JoeMatt
JoeMatt deleted the feature/ecosystem-handoff branch November 17, 2026 09:05
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