Created
March 12, 2011 05:40
-
-
Save rpetrich/867066 to your computer and use it in GitHub Desktop.
Replace codesigning in iOS apps and generate IPA files. By design, does not work with encrypted apps
This file contains 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 characters
embedded.mobileprovision |
This file contains 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 characters
#!/bin/sh | |
BASE=`dirname $0` | |
if [ "$1" -a -d "$1" ] ; then | |
TDIR="$TMPDIR/$(basename $0).$$.tmp" | |
APPNAME=`basename "$1"` | |
IPANAME="${APPNAME%\.*}.ipa" | |
mkdir -p "$TDIR/Payload" | |
cp -r "$1" "$TDIR/Payload" | |
if [ "$2" -a -f "$2" ] ; then | |
cp "$2" "$TDIR/iTunesArtwork" | |
pushd "$TDIR" | |
zip -r "$IPANAME" Payload iTunesArtwork | |
else | |
pushd "$TDIR" | |
zip -r "$IPANAME" Payload | |
fi | |
popd | |
mv "$TDIR/$IPANAME" `dirname "$1"` | |
rm -r "$TDIR" | |
IPAPATH=`dirname "$1"`/$IPANAME | |
echo "Created $IPAPATH" | |
else | |
echo "Usage:\n\t$0 /path/to/Application.app\n\t$0 /path/to/Application.app /path/to/artwork.png" | |
fi |
This file contains 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 characters
<?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>get-task-allow</key> | |
<false/> | |
</dict> | |
</plist> |
This file contains 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 characters
#!/bin/sh | |
BASE=`dirname $0` | |
if [ -f "$BASE/embedded.mobileprovision" ] ; then | |
if [ "$2" -a -d "$2" ] ; then | |
rm -r "$2/_CodeSignature" "$2/CodeResources" 2> /dev/null | true | |
cp "$BASE/embedded.mobileprovision" "$2/embedded.mobileprovision" | |
export CODESIGN_ALLOCATE=`xcode-select -print-path`/usr/bin/codesign_allocate | |
/usr/bin/codesign -f -s "iPhone Distribution: $1" --resource-rules="$BASE/ResourceRules.plist" --entitlements "$BASE/Entitlements.plist" "$2" | |
else | |
echo "Usage: $0 \"Ryan Petrich\" /path/to/Application.app" | |
fi | |
else | |
echo "$BASE/embedded.mobileprovision is missing!" | |
fi |
This file contains 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 characters
<?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>rules</key> | |
<dict> | |
<key>.*</key> | |
<true/> | |
<key>Info.plist</key> | |
<dict> | |
<key>omit</key> | |
<true/> | |
<key>weight</key> | |
<real>10</real> | |
</dict> | |
<key>ResourceRules.plist</key> | |
<dict> | |
<key>omit</key> | |
<true/> | |
<key>weight</key> | |
<real>100</real> | |
</dict> | |
</dict> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment