Finding x-callback-url / Deep Link of iOS Apps

I find often I like doing automations between apps. While you can use the Open App functionality with Shortcuts, trying to open an app from something like a Reminder requires a URL. This guide shows you how to get the iOS App from the App Store for investigation and then search through the file for the URL Scheme.

It would be worthwhile to check the following sites for any existing documentation on deep links or x-callback-urls before diving in yourself:


In this example, I am using my MacBook running macOS Monterey 12.3 with my iPhone 12 Pro Max running 15.4. The app we are going to look at is Tally by Reflectly ApS.

Getting an .ipa File (macOS only)

First we need to get a copy of the app for some light reverse engineering. The easiest way I have found comes from this 2019 Medium Article by Blazej SLEBODA, whose steps I have reproduced below:

1. Connect your device to your Mac and open Apple Configurator. Once the device loads, you can tap it on screen to load:

Our Device in Apple Configurator

2. On the top bar, Click the + Add button and click Apps. A new window will appear, sign in to your Apple account that contains the app you have already purchased/downloaded before:

Sign in

3. Once signed in, choose the app you wish to have a copy of. It will begin downloading on your Mac.

4. Wait until it downloads and a screen appears like so:

Downloaded App, waitinf for futher instruction

Don’t click anything! The location of the app can be found here:

~/Library/Group\ Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps

Navigate to it either in Finder (remove the \ from Group\ Containers) or in Terminal. It will be inside two more nested folders:

File

5. Copy this ipa to somewhere safe such as ~/Downloads. Now you may click Skip in Apple Configurator which will delete the file from this temp directory. Apple Configurator is no longer needed.

Opening the .ipa File

Using Terminal again, navigate to where you saved the file. So if it was in your Downloads, cd ~/Downloads. Next run the following to unzip the .ipa into a folder:

# the format is unzip app.ipa -d directory
$ unzip Tally\ 1.22.0.ipa -d AppFolder

Once finished, cd AppFolder to jump into the new extracted information (or look at it in Finder). In my case, there was a file in /Downloads/AppFolder/Payload/Tally.app. With finder, right-click and Show Package Contents or cd into it with Terminal.

Finding the Callback URL

The file we need is Info.plist. Open it in finder or display it in Terminal with cat Info.plist, you are looking for CFBundleURLSchemes:

....
    <key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleURLName</key>
        <string></string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>db-w65wxt0sdd1hjk2</string>
        </array>
      </dict>
    </array>
....

In my case, I see db-w65wxt0sdd1hjk2. On our iPhone, we can open Safari to test by going to db-w65wxt0sdd1hjk2:// in the address bar

Our deeplink works!

Example 2 – Shortcuts App

Some apps have many options, as seen below with Apple’s Shortcuts app. In this case, any one of the URL schemes will work in Safari / Shortcuts such as shortcuts:// or workflow://.

<dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>is.workflow.app.url-scheme</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>shortcuts-production</string>
          <string>shortcuts</string>
          <string>workflow</string>
          <string>workflow000000</string>
          <string>workflow1B9AF7</string>
          <string>workflow7B72E9</string>
          <string>workflow49E845</string>
          <string>workflow55DAE1</string>
          <string>workflow3871DE</string>
          <string>workflow19BD03</string>
          <string>workflowA9A9A9</string>
          <string>workflowDB49D8</string>
          <string>workflowED4694</string>
          <string>workflowFD6631</string>
          <string>workflowFE9949</string>
          <string>workflowFEC418</string>
          <string>workflowFF4351</string>
          <string>workflowFFD426</string>
        </array>
</dict>

Comments

No comments available.

Leave a Reply

Your email address will not be published.