Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
6.0.1 (M4B30Z, Dec 2016)
#!/bin/sh
VENDOR=lge
DEVICE=hammerhead
echo "Please wait..."
wget -nc -q https://dl.google.com/dl/android/aosp/hammerhead-mmb29v-factory-62a68ee9.tgz
tar zxf hammerhead-mmb29v-factory-62a68ee9.tgz
cd hammerhead-mmb29v
unzip image-hammerhead-mmb29v.zip
cd ../
simg2img hammerhead-mmb29v/system.img system.ext4.img
mkdir system
sudo mount -o loop -t ext4 system.ext4.img system
BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $BASE/*
for FILE in `cat proprietary-blobs.txt | grep -v ^# | grep -v ^$ | sed -e 's#^/system/##g'| sed -e "s#^-/system/##g"`; do
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
echo "cp $FILE $BASE/$FILE"
cp system/$FILE $BASE/$FILE
done
sudo umount system
rm -rf system
rm -rf hammerhead-mmb29v
rm system.ext4.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment