简体   繁体   中英

IOS - How to resign an ipa file?

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.

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>

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