Created
May 18, 2016 21:30
-
-
Save tehnoir/520e61d540363b013c71d4c849112967 to your computer and use it in GitHub Desktop.
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/bash | |
# This script will check an IPA and determine if the specified UDID is in the embedded provisioning profile | |
IPA=$1 | |
UDID=$2 | |
# Eventually if no UDID is specified, we'll print all UDIDs. | |
if [ $# -eq "1" ] | |
then | |
echo "Please specify a UDID to check for." | |
elif [ $# -eq "2" ] | |
then | |
mkdir -p /tmp/unzippedIPAs | |
cd /tmp/unzippedIPAs | |
## Unzip only the embedded.mobileprovision file and pipe to standard output where we can grep for the UDID | |
unzip -p $IPA Payload/*/embedded.mobileprovision | grep -qo --binary-files=text $UDID; RESULT=$?; | |
if [ $RESULT -eq 1 ] | |
then | |
tput setaf 1 | |
tput bold | |
echo -e "No Match Found." | |
tput sgr0 | |
else | |
tput setaf 2 | |
tput bold | |
echo "UDID Found!" | |
tput sgr0 | |
fi | |
rm -rf /tmp/unzippedIPAs | |
else | |
echo "Usage: ./checkipaforudid [IPAName.ipa] [UDID]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment