3
echo "Installing Cyanogenmod 10.2.1 without Gapps"
6
echo "Please boot your Nexus 7 into bootloader/fastboot mode by pressing Power & Volume Down (-)"
9
echo -n "Is your Nexus 7 in bootloader/fastboot mode now? [Y] "; read bootloadermode
10
if [ "$bootloadermode"==Y -o "$bootloadermode"==y -o "$bootloadermode"=="" ]; then
13
echo "Detecting device"
16
fastboot devices > /tmp/AttachedDevices
18
if grep 'device$\|fastboot$' /tmp/AttachedDevices
20
echo "Device detected !"
23
fastboot format system
25
fastboot format userdata
26
fastboot reboot-bootloader
30
echo "Downloading TWRP recovery"
32
wget -c --quiet --show-progress --tries=10 -P $HOME/.cache/magic-device-tool/ http://mdt-files.com/downloads/magic-device-tool/recoverys/twrp-tilapia.img
35
echo "Downloading Cyanogenmod 10.2.1"
38
wget -c --quiet --show-progress --tries=10 -P $HOME/.cache/magic-device-tool/ http://mdt-files.com/downloads/magic-device-tool/cyanogenmod/cm-10.2.1-tilapia.zip
43
echo "Installing TWRP recovery"
45
fastboot flash recovery $HOME/.cache/magic-device-tool/twrp-tilapia.img
48
echo "Rebooting device.."
50
echo "This will take ~35 seconds. Don't disconnect your device!"
52
fastboot reboot-bootloader
54
fastboot boot $HOME/.cache/magic-device-tool/twrp-tilapia.img
61
echo "Pushing zip's to device"
64
echo "Please wait this can take a while"
66
echo "You may see a prompt asking you for read/write permissions"
67
echo "Ignore that prompt, the tool will take care of the installation"
69
echo " → Cyanogenmod 10.2.1 zip "
70
adb push -p $HOME/.cache/magic-device-tool/cm-10.2.1-tilapia.zip /sdcard/
72
echo "========================================="
75
echo "Installing Cyanogenmod 10.2.1"
77
adb shell twrp install /sdcard/cm-10.2.1-tilapia.zip
82
adb shell twrp wipe cache
83
adb shell twrp wipe dalvik
86
echo "The device is now rebooting. Give it time to flash the new ROM. It will boot on its own."
91
rm -f /tmp/AttachedDevices
94
echo "Exiting script. Bye Bye"
98
echo "Device not found"
99
rm -f /tmp/AttachedDevices