- 
      
 - 
        
Save ippy04/9eaddd59a19cc2769314 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
RichardBronosky revised this gist
Mar 29, 2013 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ #!/usr/bin/env bash if [[ ! ( # any of the following are not true @@ -40,7 +39,7 @@ cd "$TMP" [[ $CLEANUP_TEMP -ne 1 ]] && echo "Using temp dir: $TMP" unzip -q "$IPA" echo App has AppID $(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' Payload/*.app/Info.plist) security cms -D -i Payload/AtlantaJournal.app/embedded.mobileprovision > mobileprovision.plist echo "Trying to resign with '$(/usr/libexec/PlistBuddy -c "Print :Name" mobileprovision.plist)', which supports '$(/usr/libexec/PlistBuddy -c "Print :Entitlements:application-identifier" mobileprovision.plist)'" rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources cp "$PROVISION" Payload/*.app/embedded.mobileprovision  - 
        
RichardBronosky revised this gist
Jul 18, 2012 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ #!/usr/bin/env bash if [[ ! ( # any of the following are not true @@ -14,7 +15,6 @@ if [[ ! ( # any of the following are not true ) ]]; then echo ' Usage: resign.sh Application.ipa foo/bar.mobileprovision "iPhone Distribution: I can haz code signed"' exit; fi @@ -39,6 +39,9 @@ CLEANUP_TEMP=0 # Do not remove this line or "set -o nounset" will error on check cd "$TMP" [[ $CLEANUP_TEMP -ne 1 ]] && echo "Using temp dir: $TMP" unzip -q "$IPA" echo App has AppID $(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' Payload/*.app/Info.plist) security cms -D -i /var/folders/74/kpcwmb6j1pn92kr8mtvm2mwh0000gn/T/./resign.I9DrKi7B/Payload/AtlantaJournal.app/embedded.mobileprovision > mobileprovision.plist echo "Trying to resign with '$(/usr/libexec/PlistBuddy -c "Print :Name" mobileprovision.plist)', which supports '$(/usr/libexec/PlistBuddy -c "Print :Entitlements:application-identifier" mobileprovision.plist)'" rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources cp "$PROVISION" Payload/*.app/embedded.mobileprovision /usr/bin/codesign -f -s "$CERTIFICATE" --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app  - 
        
RichardBronosky revised this gist
Jul 6, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,7 @@ if [[ ! ( # any of the following are not true ) ]]; then echo ' Usage: resign.sh Application.ipa foo/bar.mobileprovision "iPhone Distribution: I can haz code signed"' echo ' ## That last string argument is the name of the certificate as seen in Keychain Access.' exit; fi  - 
        
RichardBronosky renamed this gist
Jun 5, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. - 
        
RichardBronosky created this gist
Jun 5, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ #!/usr/bin/env bash if [[ ! ( # any of the following are not true # 1st arg is an existing regular file -f "$1" && # ...and it has a .ipa extension "${1##*.}" == "ipa" && # 2nd arg is an existing regular file -f "$2" && # ...and it has an .mobileprovision extension "${2##*.}" == "mobileprovision" && # 3rd arg is a non-empty string -n "$3" ) ]]; then echo ' Usage: resign.sh Application.ipa foo/bar.mobileprovision "iPhone Distribution: I can haz code signed"' exit; fi ## Exit on use of an uninitialized variable set -o nounset ## Exit if any statement returns a non-true return value (non-zero) set -o errexit ## Announce commands #set -o xtrace realpath(){ echo "$(cd "$(dirname "$1")"; echo -n "$(pwd)/$(basename "$1")")"; } TMP="$(mktemp -d -t ./resign)" IPA="$(realpath $1)" IPA_NEW="$(pwd)/$(basename $IPA .ipa).resigned.ipa" PROVISION="$(realpath $2)" CERTIFICATE="$3" CLEANUP_TEMP=0 # Do not remove this line or "set -o nounset" will error on checks below #CLEANUP_TEMP=1 # Uncomment this line if you want this script to clean up after itself cd "$TMP" [[ $CLEANUP_TEMP -ne 1 ]] && echo "Using temp dir: $TMP" unzip -q "$IPA" rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources cp "$PROVISION" Payload/*.app/embedded.mobileprovision /usr/bin/codesign -f -s "$CERTIFICATE" --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app zip -qr "$IPA_NEW" Payload [[ $CLEANUP_TEMP -eq 1 ]] && rm -rf "$TMP"