重新签署 IPA 文件

re-sign IPA files

我们有另一个开发者用他的证书开发的 IPA 文件。

我们正在尝试重新签署使用另一个开发人员证书构建和分发的 IPA。如果您以前做过或对此有任何想法,请告诉我。

尝试了以下链接中提到的一些解决方案,但我们能够生成 IPA,但无法将其安装到设备中。

我们正在尝试 iOS 8. Mac 10.10.

重新签名是一个多步骤的过程,每一步都可能产生错误。所以请耐心一点,尝试自己理解每一步。

# 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

现在有一个手动步骤来编辑 entitlements.plist,因此 application-identifier 是正确的。以entitlements_old.plist为参考,但注意值开头的团队标识符要不同。

# 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/

遗憾的是,出现问题时的错误消息不会提供任何关于具体问题的特殊信息。但它可能是:

  • 使用了错误的签名身份
  • 二进制文件和配置文件之间的权利不匹配

试试这个软件。使用企业证书重新签署 IPA 对我来说工作正常。

https://github.com/maciekish/iReSign