#!/bin/bash
varadb=adb-mac
echo "---------------------------------------------------------------"
echo "	              Easy rooting toolkit for Transformer Prime!"
echo "                  Script by Max Lee from TransformerPrimeRoot.com"
echo "  Credits go to XDA users sparkym3 and Dan Rosenburg for exploit."
echo "---------------------------------------------------------------"
echo " [*] This script will:"
echo "     (1) root your Transformer Prime on ICS"
echo "     (2) install Busybox "
echo "     (3) install SU files "
echo " [*] Before u begin:   "
echo "     (4) Make sure to read full instructions at TransformerPrimeRoot.com!"
echo "---------------------------------------------------------------"
echo " CONFIRM ALL THE ABOVE THEN "
echo "Rooting..."
./$varadb wait-for-device
echo "Start Rooting..."
./$varadb shell mv /data/local/tmp /data/local/tmp.bak
./$varadb shell ln -s /data /data/local/tmp
./$varadb reboot
echo "reboot #1 - DO NOT DISCONNECT YOUR DEVICE!"
sleep 5
./$varadb wait-for-device
./$varadb shell "echo \"ro.kernel.qemu=1\" > /data/local.prop"
./$varadb reboot
echo "reboot #2 - DO NOT DISCONNECT YOUR DEVICE!"
sleep 5
./$varadb wait-for-device
./$varadb remount
sleep 1
./$varadb push su /system/bin/su
./$varadb shell "chown root.shell /system/bin/su"
./$varadb shell "chmod 06755 /system/bin/su"
./$varadb shell "rm /system/xbin/su"
./$varadb shell "ln -s /system/bin/su /system/xbin/su"
./$varadb push Superuser.apk /system/app/.
./$varadb shell rm /data/local.prop
./$varadb shell rm /data/local/tmp
./$varadb shell mv /data/local/tmp.bak /data/local/tmp
./$varadb push busybox /data/local/tmp/.
./$varadb shell "chmod 755 /data/local/tmp/busybox"
./$varadb shell "/data/local/tmp/busybox mount -o remount,rw /system"
./$varadb shell "dd if=/data/local/tmp/busybox of=/system/xbin/busybox"
./$varadb shell "chown root.shell /system/xbin/busybox"
./$varadb shell "chmod 04755 /system/xbin/busybox"
./$varadb shell "/system/xbin/busybox --install -s /system/xbin"
./$varadb shell "rm -r /data/local/tmp/busybox"
echo "rebooting"
./$varadb reboot
echo "All Done rooting Transformer Prime, check out TransformerPrimeRoot.com for more cool stuff!"
