-
-
Save lodalo/754a35b48d382ae99b25 to your computer and use it in GitHub Desktop.
#Unzip the IPA | |
unzip Application.ipa | |
#Remove old CodeSignature | |
rm -R "Payload/Application.app/_CodeSignature" | |
#Replace embedded mobile provisioning profile | |
cp "path-to-provisioning-profile/MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision" | |
#If you are resigning to submit to the AppStore you need to extract the entitlements to use later | |
#extract entithements | |
/usr/bin/codesign -d --entitlements :entitlements.plist Payload/Application.app | |
#determine the identity name to use for the next step | |
security find-identity -pcodesigning -v | |
#Re-sign with entitlements | |
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --entitlements entitlements.plist "Payload/Application.app" | |
# OR Re-sign without entitlements | |
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" "Payload/Application.app" | |
#Now, to verify what you have, you can do: | |
codesign -dvvv --entitlements - Payload/Application.app | |
#Re-package | |
zip -qr "Application.resigned.ipa" Payload | |
###OR you can use a GUI tool like AirSign (commercial) or iReSign (free). | |
#Tutorial for using iReSign: http://dev.mlsdigital.net/posts/how-to-resign-an-ios-app-from-external-developers/ | |
### | |
#Parts of this gist were adapted from: http://stackoverflow.com/questions/15634188/resigning-an-ios-provisioning-profile | |
#Useful information about including entitlements is found at the iReSign tutorial and also | |
# here: http://stackoverflow.com/questions/6896029/re-sign-ipa-iphone | |
#Unzip the IPA
unzip Application.ipa
#Remove old CodeSignature
rm -R "Payload/Application.app/_CodeSignature"
#Replace embedded mobile provisioning profile
cp "path-to-provisioning-profile/MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision"
#If you are resigning to submit to the AppStore you need to extract the entitlements to use later
#extract entithements
/usr/bin/codesign -d --entitlements :entitlements.plist Payload/Application.app
#determine the identity name to use for the next step
security find-identity -pcodesigning -v
#Re-sign with entitlements
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --entitlements entitlements.plist "Payload/Application.app"
OR Re-sign without entitlements
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" "Payload/Application.app"
#Now, to verify what you have, you can do:
codesign -dvvv --entitlements - Payload/Application.app
#Re-package
zip -qr "Application.resigned.ipa" Payload
###OR you can use a GUI tool like AirSign (commercial) or iReSign (free).
#Tutorial for using iReSign: http://dev.mlsdigital.net/posts/how-to-resign-an-ios-app-from-external-developers/
#Parts of this gist were adapted from: http://stackoverflow.com/questions/15634188/resigning-an-ios-provisioning-profile
#Useful information about including entitlements is found at the iReSign tutorial and also
#Unzip the IPA
unzip Application.ipa
#Remove old CodeSignature
rm -R "Payload/Application.app/_CodeSignature"
#Replace embedded mobile provisioning profile
cp "path-to-provisioning-profile/MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision"
#If you are resigning to submit to the AppStore you need to extract the entitlements to use later
#extract entithements
/usr/bin/codesign -d --entitlements :entitlements.plist Payload/Application.app
#determine the identity name to use for the next step
security find-identity -pcodesigning -v
#Re-sign with entitlements
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --entitlements entitlements.plist "Payload/Application.app"
OR Re-sign without entitlements
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" "Payload/Application.app"
#Now, to verify what you have, you can do:
codesign -dvvv --entitlements - Payload/Application.app
#Re-package
zip -qr "Application.resigned.ipa" Payload
###OR you can use a GUI tool like AirSign (commercial) or iReSign (free).
#Tutorial for using iReSign: http://dev.mlsdigital.net/posts/how-to-resign-an-ios-app-from-external-developers/
#Parts of this gist were adapted from: http://stackoverflow.com/questions/15634188/resigning-an-ios-provisioning-profile
#Useful information about including entitlements is found at the iReSign tutorial and also
here: http://stackoverflow.com/questions/6896029/re-sign-ipa-iphone