sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.17k stars 825 forks source link

[bug] iOS 16 Developer Mode breaks IPA signing workflow #573

Open Hamid-K opened 1 year ago

Hamid-K commented 1 year ago

iOS 16 has introduced "Developer Mode", which as the name implies and similar to Android, facilitates deployment of self-signed apps via Xcode. This also means pre-16 automatically generated provisioning profiles are no longer deployed on the device. Even when provisioning profiles are manually used (via Xcode settings), they are bound to the compiled and deployed app.

The issue is that, Objection's current process for repacking and signing the IPA will no longer work. The signed app installation will be rejected in iOS, as no matching provisioning profile exists for it.

Steps to reproduce the behavior:

  1. Configure accounts in XCode settings and make sure we can sign apps
  2. Create a blank app in XCode
  3. Enable "Developer Mode" in iOS. This is mandatory now, for deploying the app.
  4. Build and install the blank app and confirm it works, and check Settings > Device Management. No provisioning profile is installed or needed, as it used to, pre 16.0.
  5. security find-identity -p codesigning -v and select appropriate profile
  6. objection patchipa -s app.ipa -c xxxxx
  7. ideviceinstaller -i app-frida-codesigned.ipa
  8. The installation fails:

Expected behavior The resigned app, assuming correct settings and Bundle Identifier are used in XCode, should successfully install.

Evidence / Logs / Screenshots

$ ideviceinstaller -i xxxx-frida-codesigned.ipa

WARNING: could not locate iTunesMetadata.plist in archive!
WARNING: could not locate Payload/Runner.app/SC_Info/Runner.sinf in archive!
Copying 'xxxx-frida-codesigned.ipa' to device... DONE.
Installing '*'
Install: CreatingStagingDirectory (5%)
Install: ExtractingPackage (15%)
Install: InspectingPackage (20%)
Install: PreflightingApplication (30%)
Install: VerifyingApplication (40%)ERROR: Install failed. Got error "ApplicationVerificationFailed" with code 0xe8008015: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.wCGhrH/extracted/Payload/Runner.app/Frameworks/App.framework : 0xe8008015 (A valid provisioning profile for this executable was not found.)

Environment (please complete the following information):

01101sam commented 3 weeks ago

I hope I didn't ping you after 2 years of no response.

Here, try this solution (stackoverfow).

Since I had an Developer account, I just changed it to manual, then created a Provisioning Profile from Certificates, Identifiers & Profiles, downloaded it and build it again. After that, it should be fixed.

For free account, I havn't tested yet.