How to re-sign the ION iOS app
This page describes the steps required to re-sign an iOS app using a different bundle ID and developer account.
Assumptions
XCode 10+ installed on Mac
Original .ipa file downloaded (named in this guide as <original>.ipa). This must be an .ipa file that was originally exported and signed for AppStore deployment.
App ID set up in the Apple developer account for the new app (named in this guide as new.app.id)
Distribution certificates created in the Apple developer account and private keys installed on local key chain (certificate named in this guide as distribution certificate name)
Distribution (AppStore) provisioning profiles set up in the Apple developer account for the new App ID and downloaded to the local machine (named in this guide as Jado.mobileprovision)
Team ID is known (visible in the Apple developer account portal membership tab (named in this guide as newteamid)
How to re-sign the OpenTV ION iOS app
Rename
<original>.ipato<original>.zipDouble-click the zip to extract the zip contents. A folder (named
Rootin this example) withPayloadandSwiftSupportsubfolders will be extracted.Navigate to the folder containing
Rootin Terminal.Remove the existing code signature by executing command:
BASHrm -r Root/Payload/Jado.app/_CodeSignatureRight-click on
Root/Payload/Jado.appand select Show Package Contents.Open
Root/Payload/Jado.app/Info.plist.Change the
CFBundleIdentifier (BundleIdentifier)value to new.app.idCopy new provisioning profiles (
Jado.mobileprovision) by executing command:BASHcp Jado.mobileprovision Root/Payload/Jado.app/embedded.mobileprovisionCreate a file named
entitlements.xmlwith contents:XML<?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>newteamid.new.app.id</string> <key>aps-environment</key> <string>production</string> <key>com.apple.developer.team-identifier</key> <string>newteamid</string> <key>beta-reports-active</key> <true/> <key>com.apple.external-accessory.wireless-configuration</key> <true/> <key>get-task-allow</key> <false/> </dict> </plist>Ensure that the value of
application-identifieris set to your team and App ID, for example:XML<key>application-identifier</key> <string>QHDQWE45DU.com.nagra.jado</string>and the value of
com.apple.developer.team-identifieris set to your team ID, for example:CODE<key>com.apple.developer.team-identifier</key> <string>QHDQWE45DU</string>Sign each file within the
Payload/Jado.app/Frameworksfolder with the following command:BASHfind Root/Payload \( -name "*.framework" -o -name "*.dylib" \) -exec codesign -f --deep -s "distribution certificate name""{}" \;Sign the app with command:
BASHcodesign --entitlements entitlements.xml -f --deep -s "distribution certificate name" Root/Payload/Jado.app/Change the directory to
Root.Zip the
Payloadfolder and create the new .ipa file by executing command:BASHzip -qr resigned.ipa Payload/ SwiftSupport/Upload
<resigned>.ipausing Application Loader.