Skip to content

Instantly share code, notes, and snippets.

@aphex3k
Created June 30, 2015 17:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aphex3k/7cd2b5085830b5fba90d to your computer and use it in GitHub Desktop.
Save aphex3k/7cd2b5085830b5fba90d to your computer and use it in GitHub Desktop.
Remove the _CodeSignature folder from an existing .ipa iOS App archive
#!/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