Skip to content

Instantly share code, notes, and snippets.

@bryanjhv
Created February 4, 2021 05:33
Show Gist options
  • Save bryanjhv/d7d376d9cfc9d8c90f5dd11c15d20428 to your computer and use it in GitHub Desktop.
Save bryanjhv/d7d376d9cfc9d8c90f5dd11c15d20428 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ARGS:
# 1. MODEL (sample: SM-G930F)
# 2. REGION (sample: PEO)
# 3. OUTDIR (sample: ~/Downloads)
# DEPS:
# 1. Python 3
# 2. https://github.com/nlscc/samloader
[ $# -eq 3 ] || {
echo "ERROR: Missing arguments."
echo "Run as: $0 MODEL REGION OUTDIR"
exit 1
}
TMPDIR=$(mktemp -d)
cd $TMPDIR
SAMLOADER="samloader -m $1 -r $2"
$SAMLOADER download -v $($SAMLOADER checkupdate) -D -O .
mv *.zip $3
cd ..
rm -rf $TMPDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment