简体   繁体   中英

re-sign IPA files

We have IPA file which is developed by another developer with his certificates.

We are trying to re-sign the IPA which is built and distributed using another developer certificate. Please let me know if you have done this before or have any idea about this.

Tried some solutions mentioned in below links however we were able to generate IPA but can't install it in a device.

We are trying it in iOS 8. Mac 10.10.

Re-signing is a multi-step process which can produce errors at each step. So please have patience and try to understand each step by itself.

# Start with files:
# .ipa-file 'MyApp.ipa'
# New provisioning profile 'profile.mobileprovision'

# Unpack the .ipa-file
unzip MyApp.ipa

# Extract the old entitlements from the binary
codesign -d --entitlements :- Payload/MyApp.app > entitlements_old.plist

# Extract the new entitlements from the provisioning profile
security cms -D -i profile.mobileprovision > profile.plist
/usr/libexec/PlistBuddy -x -c 'Print :Entitlements' profile.plist > entitlements.plist

Now there is a manual step to edit the entitlements.plist so the application-identifier is correct. Refer to the entitlements_old.plist as a reference, but note that the team identifiers at the beginning of the value should be different.

# Then replace the embedded provisioning profile
cp profile.mobileprovision Payload/MyApp.app/embedded.mobileprovision

# Re-sign the binary and update entitlements
#
# Note: replace "Firstname Lastname (TEAMID123)"
#       with your certificate name
#
codesign -f -s "Firstname Lastname (TEAMID123)" \
    --entitlements entitlements.plist \
    Payload/MyApp.app

# Create ipa
zip -r MyApp2.ipa Payload/

Sadly, the error messages when something is wrong do not give any special information about what exactly is wrong. But it may be:

  • Wrong signing identity used
  • Entitlements mismatch between the binary and the provisioning profile

Try this software. It was working fine for me for re-signing IPA with enterprise certificates.

https://github.com/maciekish/iReSign

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM