Created
June 20, 2011 14:51
-
-
Save xslim/1035753 to your computer and use it in GitHub Desktop.
Recodesign ipa
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 characters
#!/bin/sh | |
SAVEDIR=`pwd` | |
WORKDIR=/tmp/ipa_$RANDOM$RANDOM | |
WORKIPA=/tmp/ipa_$RANDOM$RANDOM.ipa | |
echo unpacking $1 | |
mkdir -p $WORKDIR | |
unzip "$1" -d $WORKDIR > /dev/null || exit | |
cd $WORKDIR | |
SAVEIFS=$IFS | |
IFS=$'\n' | |
for f in $(find Payload -mindepth 1 -maxdepth 2 -type d); do | |
echo Processing "$f" | |
rm -rf "$f"/_CodeSignature | |
cat >"$f"/ResourceRules.plist <<XXX | |
<?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> | |
XXX | |
codesign -f -s "iPhone Developer" -vvv "$f" | |
done | |
IFS=$SAVEIFS | |
echo repacking | |
zip -9yr $WORKIPA * > /dev/null | |
cd $SAVEDIR && mv "$1" "$1.$RANDOM$RANDOM.bak" && mv $WORKIPA "$1" && rm -rf $WORKIPA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment