IOS - How to resign an ipa file?

妖精的绣舞 提交于 2019-12-08 02:58:07

问题


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

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