Graft

Getting an IPA

A build needs a decrypted IPA of the app. There are three ways to get one.

  • From the App Store. Once you've signed in and set up decryption (see App Store Downloads), the app's Source IPA section has Get latest from App Store. Graft downloads the app, decrypts it on this Mac, and stages it. If that version is already staged, by Get latest, a drop or a dump, it says "Already have <version>" and downloads nothing; Get Again downloads it anyway. Get an older version… beside it gets one of the app's earlier versions instead (see Get an older version).
  • An IPA you already have. Drop it on the app's pane.
  • A dump from your own jailbroken device, from the device's Decrypt card. See Decrypt on a jailbroken device.

These are for personal use: your own Apple ID, apps you own or get for free, on your own devices. Don't redistribute decrypted or modified IPAs.

An app pane with no IPA yet, showing a drop area, a Choose IPA button, and Get an older version and Get latest from App Store buttons.
An app with no IPA yet: drop one on the pane, choose a file, or get one from the App Store.

Details for each way

Each way stages the IPA in ~/.cache/graft/ipas/, and a build uses it from there. Graft checks every Mach-O binary in it before injecting and warns if any is still encrypted; the build carries on, but the app will most likely not launch. With nothing staged, the build stops and lists the ways to get one.

The App Store route has its own page, App Store Downloads.

Bring your own

Drop the IPA on the app's pane, or choose it in Add App's Manual mode. Graft checks that the IPA's bundle id matches the app's and stages it under its canonical name.

An IPA that is still encrypted (straight from the App Store) is decrypted with UnfairPlay on the way in if decryption is set up, and refused if it isn't.

Decrypt on a jailbroken device

The device's Decrypt card dumps an installed app off your own jailbroken iPhone or iPad, and Add as app turns the dump into an app.

Where What it needs
The device A jailbreak, OpenSSH (from Sileo) and frida-server 16. The setup Graft is tested with is frida-server 16.6.6 on a rootless jailbreak. Set up… on the card gives the steps.
This Mac Nothing to install. Graft reaches the device's SSH itself, over USB, and Graft.app carries the rest: frida-ios-dump and frida 16.6.6.
Optional bagbak, a second dump tool, which needs Node: npm install -g bagbak@4.0.3 for frida-server 16. Graft tries it only when it's installed, and it's unproven (see below).

The switch. Turn on Dump apps from a jailbroken device in Settings › Jailbreak, and each device's page has the Decrypt card. It's off by default. With it off, the card still shows on a device that looks jailbroken, under the line "This iPhone looks jailbroken." and a Turn on dumping button. While the card is hidden, Dump in the device's list of apps waits, and says why.

To tell, Graft checks whether an SSH server answers on the device, which a stock iPhone or iPad doesn't have. It checks when the device connects (not again within 5 minutes of an answer) and each time you open its page. That check only reads the server's greeting: it never logs in and sends no password. It asks over USB, so for a device on Wi-Fi alone it can't, and only the switch shows the card.

The card. Its first line says whether a dump can run: "Ready", "Ready to try" when the tool that would run hasn't been seen to dump against the device's frida-server, or what's in the way and its fix. The checks under it say the same in full, and Re-check asks again. With the card showing, opening the page also runs these checks, which log in to the device as root with the password you stored, or your key. On a device with no jailbreak, the card says so in one line instead, with Show details for the checks.

A jailbroken iPhone XS's page with the Decrypt card: Ready, then frida reachable, SSH login and App on screen checked, and Decrypt Forum.
The Decrypt card on a jailbroken device's page.

The card's Decrypt button dumps the app on screen. Dump on a row of the device's apps dumps that app, opening it first.

The root password. Graft copies the app off the device over SSH, so it needs the device's root password. Set root password… stores it in your login Keychain, for that device only. With none stored, the button is right under the card's first line. Graft never tries a password you didn't enter: with no root password stored and no key set, the check says so and nothing logs in. (Both dump tools would otherwise try the jailbreak's stock password.) To use an SSH key instead, set GRAFT_SSH_KEY (and GRAFT_SSH_USER if it isn't root).

Set up jailbreak dumping. While nothing can dump, or the device runs another frida-server, Set up… under the card's first line opens a sheet that lists what the device still needs, each with what to do. Check again asks the device again; with nothing left, the sheet says "Nothing is missing." Graft shows the steps and never runs them. The sheet can list:

  • Root password, with Set root password…. Until one is stored, the sheet can't give the frida-server steps: Graft logs in to read which frida-server the device runs and which jailbreak it has. It checks again once the password is saved.

  • SSH login, when nothing answers on the device: install OpenSSH from Sileo, or, if it's installed, it has stopped, so respring or restart it. It's here too when the stored password was refused, with Set root password….

  • frida-server 16.6.6, when the device runs another frida-server, or none answers. The package comes from frida's GitHub release, and Graft picks it for the jailbreak type it found:

    Jailbreak Package SHA-256
    Rootless frida_16.6.6_iphoneos-arm64.deb 2049b5a22f41997f253481788de0fc61d222de95b65383f1b321af9fb4b30a70
    Rootful (marked untested: never installed on a rootful device) frida_16.6.6_iphoneos-arm.deb e0a58b8b050c895ddb76b09131917e7ecce9cbfa735e79370588952e308e8536

    The sheet gives two commands to run in Terminal on this Mac, in order, with Copy. The first downloads the package. The second checks it against that SHA-256, and only if it matches, copies it to the device and installs it as root, held with apt-mark hold re.frida.server so the package manager leaves it. They reach the device over USB through Graft itself (graft --usbmux-connect, as ssh's ProxyCommand), so there's nothing to install, and ssh asks for the device's root password unless you use a key.

    If dpkg -i fails, frida-server is left unheld, and the old one is still installed and running. Read dpkg's message (most often a broken apt state, fixed by apt-get -f install), then run the second command again, or put the hold back with apt-mark hold re.frida.server.

  • frida reachable, when frida-server doesn't answer, with its fix. A device that no longer trusts this Mac shows up here: unlock it, unplug it and plug it back in, and tap Trust.

  • Dump tools, while nothing can dump: why each tool can't run.

The Set up jailbreak dumping sheet for an iPhone on frida-server 17: frida-server 16.6.6, the rootless package's SHA-256, the two commands with Copy, and frida reachable.
Set up jailbreak dumping, with the frida-server commands to copy.

How a dump runs. Graft picks the dump tool, and falls back to the other on its own:

  • frida-ios-dump, the one Graft is tested with, against frida-server 16.6.6. It attaches to the running app: Graft brings the app to the foreground first, launching it if needed, then copies the bundle over SSH.
  • bagbak, optional and unproven, tried only when it's installed. bagbak 4.0.3 works with frida-server 16 and copies the bundle over SSH with the stored root password; it can't use a key. It hasn't finished a dump on the device we tested. On frida-server 17, which the bundled frida-ios-dump doesn't speak, Graft tries bagbak 5: it decrypts the main app, Graft copies the rest over SSH, and the extensions are left out. It didn't decrypt on the device we tested. When bagbak is the tool that would run, the card says "Ready to try", not "Ready".

A dump is always of the whole app, which is what gets verified and staged. A dump that leaves app extensions encrypted (an extension built for a newer iOS than the device runs) drops them and stages the rest, and says what it removed. The app keeps working, minus those widgets and share extensions.

Staged IPAs

Cache lists every staged IPA, and marks the one a build uses when a bundle id has more than one. From there you can add a dump as an app, install it on this Mac with PlayCover, or delete it. Staged IPAs are never pruned.