Created
June 30, 2015 17:06
-
-
Save aphex3k/7cd2b5085830b5fba90d to your computer and use it in GitHub Desktop.
Remove the _CodeSignature folder from an existing .ipa iOS App archive
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 | |
#set -x | |
if [ "$*" == "" ] ; then | |
echo "USAGE: unsign App.ipa [App2.ipa] [App3.ipa] [...]" | |
exit 1 | |
fi | |
for var in "$@" | |
do | |
if [ ! -f ${var} ] | |
then | |
exit -1 | |
fi | |
DIR=`dirname ${var}` | |
BASE=`basename ${var} .ipa` | |
if [ -d ${DIR} ] | |
then | |
DIR="${DIR}/" | |
fi | |
TMP=${DIR}_unsign_tmp/ | |
if [ -d ${TMP} ] | |
then | |
rm -rf ${TMP} || exit -2 | |
fi | |
mkdir ${TMP} || exit -3 | |
cp ${var} ${DIR}${BASE}.zip | |
unzip -o -q -d ${TMP} ${DIR}${BASE}.zip | |
rm ${DIR}${BASE}.zip | |
rm -rf ${TMP}Payload/*.app/_CodeSignature | |
cd ${TMP} | |
zip -q -r ../${BASE}.ipa * | |
cd - 1>/dev/null | |
rm -rf ${TMP} | |
done | |
#set +x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment