Re-signing an IPA that contains a Framework

旧巷老猫 提交于 2020-01-12 08:02:27

问题


I'm re-signing an iOS app (using iResign) in order to upload it to the App Store; and as part of this I'm changing the bundle ID. I only have the IPA (not the source code).

The app contains a third party framework.

The resign appears to go fine; but when I upload using Application Loader, I get the following error:

ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature 
contains code signing entitlements that are not supported on iOS. 
Specifically, value 'XXXXXXXXXX.COM.X.Y.Z.A' for key 'application-identifier' in 
'Payload/APPNAME.app/Frameworks/FRAMEWORKNAME.framework/FRAMEWORKNAME' is not supported. 
This value should be a string starting with your TEAMID, followed by a dot '.', followed by
the bundle identifier."

(Obviously I've changed the values shown in CAPS)

I'm assuming that the problem is that the application-identifier in my entitlements.plist matches the Bundle identifier in my app, but does not match the Bundle identifier in the framework.

Just to rule it out, I set the same Bundle identifier on the framework and the app. This did allow me to upload to the app store; but failed with an error when I tried to install the app onto an iPad.

Do I need to provide a separate entitlements file for the framework? How can I get around this issue?

UPDATE: Just to rule it out, I've tried using a wildcard provisioning profile and entitlements plist; but that gives the same error


回答1:


You must re-sign the frameworks too.

Just open your .ipa and find the frameworks used under

Payload/MyApp.app/Frameworks

Try to sign them with command below

/usr/bin/codesign -f -s "iPhone Developer: Some Body (XXXXXXXXXX)" --entitlements entitlements.plist Payload/MyApp.app/Frameworks/*

After that re-zip it.

Additionally, lots of people got good results with AirSign.




回答2:


Assuming you run all your regular actions like removing app signature then remove the old signature on frameworks and resign those frameworks without including the entitlements:

rm -r Payload/"$ipaExe"/Frameworks/*/_CodeSignature
codesign -f -s "$certificate" Payload/"$ipaExe"/Frameworks/*

Then sign your app itself:

codesign -f -s "$certificate" --entitlements $entitlementFile Payload/"$ipaExe"



回答3:


It might be late, and you might already resolve your problem. But i hope my answer will help you and other people

I assume you already tried the command 'codesign -f -s "iPhone Distribution: ...." ' to resign or sign your app/frameworks/embedded libraries. I usually use this command to resign my apps, but suddenly it's stopped working when I upgraded to iOS 10 and xcode 8.2. And I got the same problem as your with third party framework in my IPA file.

So I did some researches and found that XCode uses this command to sign app

/usr/bin/codesign '-vvv' '--force' '--sign' 'CFE5D63E6.......1CBCF2271B844' '--preserve-metadata=identifier,resource-rules' '--entitlements' '/var/folders/86/kd0n_tjd56v9thg5x5qwnx500000gp/T/XcodeDistPipeline.uqv/entitlementsWgXqGE' '/var/folders/86/kd0n_tjd56v9thg5x5qwnx500000gp/T/XcodeDistPipeline.uqv/Root/Payload/FrameworkTesting.app/Frameworks/......'

Notice that "CFE5D63E6.......1CBCF2271B844" identifier! It's the identifier of your certificate. So this is the solution to make the codesign work.

  1. Use this command to list all identifiers of your certificates

    security find-identity -v -p codesigning

You will get a list look like this:

  1) 4BEC631CE717.......8C7CB311093548D4 "iPhone Developer: xxxx (xxxxx)"
  2) 4BEC631......BB678C7CB311093548D4 "iPhone Developer: xxxx (xxxx)"
  3) .......D45590A63E99A27D2977C573..... "iPhone Developer: xxxx (xxxx)"
  4) CF........6FDD78ECB161CBCF2271B844 "iPhone Distribution: xxxx (xxxx)"
  5) C4973F........352F620D2F49 "iPhone Developer: xxxx (xxxx)"
  6) 225........B6D70672E880479860ED6 "iPhone Distribution: xxxx (xxxx)"
     6 valid identities found
  1. Use this command to sign your app/frameworks/libraries

    codesign -vvv --force --sign "[pick an identifier above]" Payload/yourAppp.app/Frameworks/yourFramework.framework

    codesign -vvv --force --sign "[pick an identifier above]" --entitlements entitlements.plist Payload/yourAppp.app

Hope this will help!



来源:https://stackoverflow.com/questions/39078983/re-signing-an-ipa-that-contains-a-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!