问题
I try to resign an .ipa file but I have some problems. I archived the project and exported it for Ad Hoc Deployment then I followed this tutorial: https://sholtz9421.wordpress.com/2012/06/08/digitally-resigning-ipa/ . During installation I had this error: "Application is missing the application-identifier entitlement." so I created an "entitlements.plist" file and I tried to resign with the argument --entitlements
codesign -f -v -s "MyIdentity" Payload/SampleApp.app --entitlements entitlements.plist
Now when I try to install the .ipa file I have this error: "Failed to verify code signature .. (The executable was signed with invalid entitlements)."
My entitlements.plist file is this:
<?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>{team-identifier}.{bundleId}</string>
<key>aps-environment</key>
<string>production</string>
<key>beta-reports-active</key>
<true/>
<key>com.apple.developer.associated-domains</key>
<string>*</string>
<key>com.apple.developer.team-identifier</key>
<string>{team-identifier}</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>{team-identifier}.*</string>
</array>
</dict>
</plist>
Any idea of the problem? Any help is appreciated.
回答1:
I have found a solution: I have used IReSign to resign .ipa file. The correct entitlements.plist file is this:
<?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>{team-identifier}.{bundleId}</string>
<key>aps-environment</key>
<string>production</string>
<key>com.apple.developer.team-identifier</key>
<string>{team-identifier}</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>{team-identifier}.{bundleId}</string>
</array>
来源:https://stackoverflow.com/questions/44819704/ios-how-to-resign-an-ipa-file