Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resigning an iOS provisioning profile [duplicate]

Tags:

My client has an iOS app with In-app purchase, Game-kit and Push notifications enabled, it is currently on the app store. I would like to resign the application using an in-house enterprise distribution certificate, to test internally, but still be able to test services tied to the original provisioning profile. Is this possible?

like image 861
Koko Carl Avatar asked Mar 26 '13 10:03

Koko Carl


People also ask

What happens when Apple provisioning profile expires?

When an Apple iOS provisioning profile expires, device users cannot access the associated application, and new device users cannot install the application.

How do I delete a provisioning profile?

In the Mobile device management commands window, proceed to the Remove provisioning profile section and click the Send command button. You can also send the command to the mobile device by selecting All commands from the context menu and then selecting Remove provisioning profile.


2 Answers

I ended up doing this, which is a combination of :-

  • Very tricky question about iPhone/iPad resigned builds behaviors

and

  • Re-sign IPA (iPhone)

1) Create Entitlements plist, prevent issues with the Keychain etc

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>GBA9L2EABG.com.your.bundle.id.MyApp</string>
    <key>get-task-allow</key>
    <false/>
</dict>

2) Unzip the IPA

unzip Application.ipa

3) Remove the old code signature

rm -r "Payload/Application.app/_CodeSignature" "Payload/Application.app/CodeResources" 2> /dev/null | true

4) Replace embedded mobile provisioning profile

cp "MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision"

5) Resign

/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --resource-rules "Payload/Application.app/ResourceRules.plist" --entitlements Entitlements.plist "Payload/Application.app"

6) Re-package

zip -qr "Application.resigned.ipa" Payload
like image 152
Koko Carl Avatar answered Oct 02 '22 01:10

Koko Carl


To resign an app a bit easier than what @Koko Carl has said, we have adapted the floatsign script, which can be found at https://gist.github.com/Weptun/5406993. Makes the process really easy:

sh floatsign.sh  ~/Downloads/File.ipa "iPhone Distribution: CertificateName" -b new.bundle.id -p /Path/To/Profile/Appstore.mobileprovision   App-resigned.ipa
like image 44
Blitz Avatar answered Oct 02 '22 02:10

Blitz