Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Root script for Asus Zenfone 2 for *NIX
#! /bin/bash
# How to use: save this in the folder where you extract the contents of this zip:
# Then chmod a+x it, and run it. Have your phone attached to the USB port with USB debugging enabled before starting.
# Setup
#echo "Working directory: $WORKINGDIR"
#echo "Launcher: $LAUNCHER"
#echo "Recovery: $RECOVERY"
#echo "Trigger: $TRIGGER"
# Push the SuperSU package on the device
adb wait-for-device
adb push "$SUPERSU" /sdcard/
# Reboot into fastboot
adb reboot-bootloader
# Getvars (wait for device to get online in fastboot mode)
fastboot getvar all
# Copy files to the device
fastboot flash /tmp/ "$RECOVERY"
fastboot flash /tmp/recovery.launcher "$LAUNCHER"
# Stop logcat before replacing it
fastboot oem start_partitioning
# Replace logcat binary
fastboot flash $OEMTRIGGER "$TRIGGER"
# Issue command to start CWM recovery
fastboot oem $OEMCMD
echo "Almost there! Disconnect and reconnect the device to start up CWM."
echo "Note that you will see some random stuff on screen for some time,"
echo "don't panic, it's normal. Also don't disconnect the device after"
echo "CWM has started, or you'll have to repeat the procedure from scratch."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.