iOS Mobileprovision expired? No problem!
I ran across an issue with an app I had distributed with an enterprise distribution certificate. The problem is, after a year, the certificate expired.
What to do? Download the code again, recompile the app, make sure everything works with the latest iOS SDK, etc. I ran into multiple issues doing so as the application I needed to update the embedded provisioning profile where, because of changes in the iOS SDK, some of my code was simply not compatible anymore. It’s a legacy app and nobody wants to update that stuff, no time, no budget, etc.
Then, I came across this brilliant website that explained how to extract the app, inject a new mobile provisioning profile, resign the app and repackage everything. Here’s the code for it:
unzip app.ipa
rm -rf Payload/MyApp.app/_CodeSignature/
cp ~/Downloads/MyProfile.mobileprovision Payload/MyApp.app/embedded.mobileprovision
codesign -f -s “iPhone Distribution: Name Of My Certificate” –resource-rules Payload/MyApp.app/ResourceRules.plist Payload/MyApp.app
zip -qr app-resigned.ipa Payload/
Genius! Worked like a charm and saved me the headache of re-compiling everything.
Enjoy!
Source: http://blog.favo.org/post/21905923260/how-to-manually-re-sign-an-ipa-with-a-new-provisioning