After a few hours wracking braincells, here's how I did it:
NOTE: I haven't currently tested this against iOS 8.1.2 or lower (proceed with caution!)
For apps that have ALREADY been signed with your OWN enterprise certificate, all you have to do (as mentioned by RAStudios in his edit) is to edit the manifest.plist:
Before:
<key>bundle-identifier</key>
<string>uk.co.acme.AcmeApp</string>
After:
<key>bundle-identifier</key>
<string>S836XXACME.uk.co.acme.AcmeApp</string>
For apps that have been signed by a third party that you're resigning with your enterprise certificate (this walkthrough is assuming the ipa file is AcmeApp.ipa, your entitlements file is entitlements.plist and your provisioning profile is provProvile.mobileprovision; all files are in the Desktop folder (Mac OSX), and S836XXACME is your team identifier):
Create a new entitlements.plist file:
<?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>S836XXACME.uk.co.acme.AcmeApp</string>
<key>get-task-allow</key>
<false/>
</dict>
</plist>
Unzip the ipa:
cd ~/Desktop
unzip AcmeApp.ipa
Remove the Code Signature:
rm -r Payload/AcmeApp.app/_CodeSignature/
Copy in the mobileprovision file:
cp provProfile.mobileprovision Payload/AcmeApp.app/embedded.mobileprovision
Codesign:
codesign -f -s "iPhone Distribution: ACME Corporation Limited" --entitlements entitlements.plist Payload/AcmeApp.app
Zip it up as the resigned ipa:
zip -qr AcmeApp_resigned.ipa Payload/
You also need to amend the manifest.plist file as per the 'ALREADY' signed part earlier:
<key>bundle-identifier</key>
<string>S836XXACME.uk.co.acme.AcmeApp</string>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…