Skip to content

Fix importing IPAs via the share sheet / "Open in Feather" - #1

Draft
xDifferentiate wants to merge 12 commits into
mainfrom
claude/feather-ipa-import-share-sheet-ectvul
Draft

xDifferentiate wants to merge 12 commits into
mainfrom
claude/feather-ipa-import-share-sheet-ectvul

Conversation

@xDifferentiate

@xDifferentiate xDifferentiate commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Problem

Feather registered as a document handler only for its own exported UTI, thewonderofyou.Feather.ipa. iOS usually types .ipa files from Safari, Files and Telegram as com.apple.itunes.ipa, so Feather often didn't appear for them.

When "Open with Feather" did start, nothing visible happened. Feather opened in place: iOS handed it a URL inside the sending app's container, and reading that URL needs a sandbox extension. iOS doesn't reliably grant one to a re-signed (sideloaded) Feather (see claration#581). The import also bypassed the progress UI that Import from Files uses, and it inserted into Core Data off the main thread. Apps that only offer Share for files (Telegram/Swiftgram) can't reach Feather at all without a share extension.

Changes

Opening files with Feather

  • Info.plist:
    • Add com.apple.itunes.ipa to the IPA document type and declare it in UTImportedTypeDeclarations.
    • Remove open-in-place: drop INFOPLIST_KEY_UISupportsDocumentBrowser and don't set LSSupportsOpeningDocumentsInPlace. iOS then copies opened files into Documents/Inbox itself, so no cross-app permission is needed.
    • Setting LSSupportsOpeningDocumentsInPlace = NO explicitly breaks the Mac Catalyst build, so the key is omitted.
  • FeatherApp:
    • Opened files go through the same path as Library → Import from Files, which is now DownloadManager.importPackageFiles. That gives the progress header and Library entry.
    • Copy the file into our temp dir first, using a coordinated read under security-scoped access.
    • Scan Documents/Inbox whenever the scene becomes active, so imports don't depend on the open-URL event arriving.
    • Show alerts for unsupported files and copy errors.
  • AppFileHandler: coordinated copy, lowercase extension before unzipping, and insert into Core Data on the main actor.

"Share to Feather" extension (FeatherShare, proposed in claration#581)

  • iOS-only app extension, filtered out of Mac Catalyst. NSExtensionActivationRule matches IPA/TIPA/zip attachments.
  • Copies shared files into FeatherShareInbox in Feather's App Group container, then opens feather://import-shared. The app imports that inbox on that URL and on every activation.
  • Signers rename App Groups, so both processes read the group ID from their own signed entitlements. They fall back to group.thewonderofyou.Feather from Info.plist. Without a usable group, the extension shows a message instead of doing nothing.
  • The App Group is added to both entitlements files. The Makefile ad-hoc signs the extension, then the app, with them on iOS.

Trade-off: Feather's Documents folder no longer appears under On My iPhone in Files. It's still available through Finder file sharing.

Build fix (main doesn't build either)

5cc5361 removed LicensePlist but left stale pins in the project-level Package.resolved that make uses. It also pinned SWCompression 4.8.6, while the project requires exactly 4.8.7. xcodebuild crashed while resolving packages (count of array (32) differs from count of index set (31)). This PR removes the stale pins.

CI

  • New .github/workflows/build.yml runs on PRs and manual dispatch. It builds with Xcode 26.3 and 26.2 and uploads Feather.ipa and Feather_Catalyst.zip.
  • release.yml also uploads its packages as an artifact.

Testing

  • Builds pass on Xcode 26.3 and 26.2 (iOS and Mac Catalyst).
  • I checked the built IPA:
    • It contains PlugIns/FeatherShare.appex (com.apple.share-services, principal class FeatherShare.ShareViewController, activation rule includes com.apple.itunes.ipa).
    • The app's Info.plist has no LSSupportsOpeningDocumentsInPlace or UISupportsDocumentBrowser.
  • Not yet tested on a device: "Open with Feather" from Files and Telegram, and Share → Feather with and without an App Group.

🤖 Generated with Claude Code

https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e

- Register com.apple.itunes.ipa (the system/standard IPA UTI) as a
  handled document type and declare it as an imported type, so Feather
  shows up in the share sheet for .ipa files that aren't typed as
  Feather's own exported UTI.
- Declare LSSupportsOpeningDocumentsInPlace explicitly.
- Always request security-scoped access for opened files and release it
  after the import finishes; previously access was only requested for
  some file-provider paths and was never released.
- Match .ipa/.tipa case-insensitively and normalise the extension before
  unzipping.
- Coordinate the read so iCloud / file-provider files are downloaded
  before copying.
- Insert the imported app into Core Data on the main actor instead of
  from a detached task (view context threading violation that kept
  imports from appearing in the Library).
- Surface import errors with an alert and haptics instead of silently
  dropping them; clean up Documents/Inbox copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e

Copy link
Copy Markdown
Owner Author

The Release build (run 43657163877) failed while resolving Swift packages, before any source files compiled. xcodebuild crashed with an internal Xcode exception: -[NSMutableArray insertObjects:atIndexes:]: count of array (32) differs from count of index set (31) in IDESwiftPackageCore DependencyPackagesGroup.sortedInsert, then Abort trap: 6.

This PR doesn't change any package references or project files, so the crash doesn't come from this diff. I've re-run it once. If it crashes the same way again, I'll add a separate step that resolves packages before make.


Generated by Claude Code

Xcode 26.3 on macos-latest crashes in xcodebuild while registering Swift
package dependencies for this project (also on main), so build with a
matrix of Xcode 26.x versions and upload the IPA/Catalyst zip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
5cc5361 removed LicensePlist and its dependencies from the project but only
updated Feather.xcworkspace's Package.resolved. The project-level file that
`make` (xcodebuild -project) uses still pinned 8 packages that are no longer
in the graph, plus SWCompression 4.8.6 while the project requires exactly
4.8.7. xcodebuild fetches the stale pins and then crashes while registering
dependency packages (count of array (32) differs from count of index set
(31)), on every Xcode 26.x and on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
…per PR update

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
Library > Import from Files gets a private copy of the picked file and
imports it through DownloadManager: it creates an archive entry (shown in
the download header with unpack progress), copies, extracts and adds the
app to the Library.

Opening an .ipa/.tipa from Files or another app's share sheet skipped all
of that and ran FR.handlePackageFile directly on the in-place,
security-scoped URL from a background task, so nothing visible happened.

- Add DownloadManager.importPackageFiles(_:completion:) holding the
  picker's import steps, and use it from LibraryView.
- On open, take security-scoped access, copy the file into our temporary
  directory (coordinated, so iCloud/file-provider files are downloaded),
  then run the same importPackageFiles path. Clean up the copy afterwards.
- Also accept files whose type conforms to an IPA type even without a
  .ipa extension.
- Show an alert when an import from Files or Open with fails, instead of
  only a haptic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
"Open with Feather" / share sheet opens still did nothing on re-signed
installs: Feather came to the foreground but nothing was imported and no
error appeared (see claration#581). With UISupportsDocumentBrowser
(which implies open-in-place) Feather receives a URL inside the sending
app's container and needs a sandbox extension to read it, which iOS does
not reliably grant to a sideloaded app whose bundle ID / application
identifier were changed by the signer.

- Turn off open-in-place (LSSupportsOpeningDocumentsInPlace = NO, drop
  INFOPLIST_KEY_UISupportsDocumentBrowser) so iOS copies the file into
  Feather's Documents/Inbox itself before handing it over.
- Scan Documents/Inbox whenever the scene becomes active and import any
  .ipa/.tipa found, so the import does not depend on the open URL event
  being delivered. The open URL handler and the scan share one path and
  skip files the other already consumed.
- Show an alert for files Feather can't import instead of returning
  silently.

Trade-off: Feather's Documents folder no longer appears under On My
iPhone in the Files app (still reachable through Finder file sharing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
Some apps (e.g. Telegram/Swiftgram) only offer a Share action for files,
not "Open in", so Feather never appeared there. Add a share extension,
as proposed in claration#581, activated by NSExtensionActivationRule
for IPA/TIPA (and zip) attachments.

- FeatherShare target (app extension, iOS only; filtered out of the Mac
  Catalyst build): loads each shared file, copies it into a
  FeatherShareInbox folder in Feather's App Group container and opens
  feather://import-shared.
- The main app imports everything in that inbox on feather://import-shared
  and whenever it becomes active, through the same path as Import from
  Files, and removes the inbox copies.
- Sideload signers rename App Groups, so both processes read the group ID
  from their own signed entitlements first and only fall back to
  group.thewonderofyou.Feather from Info.plist. If no group is usable the
  extension says so instead of silently doing nothing.
- Add the App Group to both entitlements files and sign the iOS build
  (extension first, then the app) with them, so signers that keep an
  app's entitlements can provision the group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
Mac Catalyst rejects LSSupportsOpeningDocumentsInPlace = NO at build time.
Leaving the key out (with UISupportsDocumentBrowser also gone) keeps the
iOS default of NO, so iOS still copies opened files into Documents/Inbox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
Turning off open-in-place removed Feather from "Open with" and hid its
Documents folder in the Files app. Put UISupportsDocumentBrowser and
LSSupportsOpeningDocumentsInPlace = YES back. Sharing from apps whose
files Feather can't read in place goes through the Share to Feather
extension instead; the Documents/Inbox scan stays for senders that copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
…importing

Opening an .ipa from Files, Safari, the share sheet or the Share to
Feather extension now posts .featherShowLibrary, and both tab bars
select the Library tab so the new import is visible. The iOS 18 tab bar
gets a selection binding for this; every tab now has a value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
…from the Catalyst app too

After make, _build/Payload holds the Mac Catalyst app, whose Info.plist is
at Contents/Info.plist, so Get Version failed and skipped the upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pbTqbdameqpCv6kqgpP5e
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