Skip to content

Instantly share code, notes, and snippets.

@elmimmo
Last active January 23, 2018 18:43
Show Gist options
  • Save elmimmo/9206672 to your computer and use it in GitHub Desktop.
Save elmimmo/9206672 to your computer and use it in GitHub Desktop.
Script to schedule automated batch-downloading of all SHSH blobs from Apple that it's currently signing for all iOS devices you own. You are expected to have ran TinyUmbrella at east once. Requires https://github.com/Neal/savethemblobs.
<?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>Label</key>
<string>local.shared.savethemblobs</string>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>19</integer>
<key>ProgramArguments</key>
<array>
<string>bash</string>
<string>-c</string>
<string>~/.shsh/savethemblobs.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>12</integer>
<key>Weekday</key>
<integer>3</integer>
</dict>
</dict>
</plist>
#!/bin/bash
set -e
renice 19 -p $$
if ! $(python -c "import sys, os, argparse, requests, json, six" &> /dev/null); then
echo "ERROR: Required Python modules are missing" >&2
exit 1
fi
: ${SHSH_DIR:="${HOME}/.shsh/"}
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for FILE in "${SHSH_DIR}.known_devices/"*.plist
do
ECID="$(grep -A1 UniqueChipID "$FILE" \
| tail -1 \
| sed 's/^.*\<integer\>//;s/\<\/integer\>.*$//;')"
PRODUCTTYPE="$(grep -A1 ProductType "$FILE" \
| tail -1 \
| sed 's/^.*\<string\>//;s/\<\/string\>.*$//;')"
DEVICENAME="$(grep -A1 DeviceName "$FILE" \
| tail -1 \
| sed 's/^.*\<string\>//;s/\<\/string\>.*$//;')"
echo "※ Downloading SHSH blobs for $DEVICENAME"
python ${SHSH_DIR}savethemblobs.py \
--save-dir "$SHSH_DIR" \
$ECID $PRODUCTTYPE
done
IFS=$SAVEIFS
@elmimmo
Copy link
Author

elmimmo commented Feb 25, 2014

  1. Make sure you have write permissions on the path set to $SHSH_DIR.
  2. Copy the file local.shared.savethemblobs.plist into your Home folder's ~/Library/LaunchAgents/.
  3. Open the file with a text editor, such as TextEdit and change the value of the following line
<string>~/.shsh/savethemblobs.sh</string>

so that it points to the path where savethemblobs.sh resides. Note that savethemblobs.sh also expects savethemblobs.py from https://github.com/Neal/savethemblobs to exist in the same folder you are saving SHSH blobs in.
4. Open Terminal and type:

launchctl load ~/Library/LaunchAgents/local.shared.savethemblobs.plist

The script will run every wednesday at 12h noon. Edit the appropriate segment of local.shared.savethemblobs.plist to change that schedule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment