Created
June 17, 2016 12:12
-
-
Save TommyJerryMairo/bdc7331e88410b25117436d83da365f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#need ZenFoneRootKit_20150614.zip | |
#set -v | |
BASEDIR=$(dirname $0) | |
cd $BASEDIR | |
chmod +x files/adb.mac | |
chmod +x files/fastboot.mac | |
ADBBINARY="adb" | |
FASTBOOTBINARY="fastboot" | |
cd files | |
echo | |
echo | |
echo Connect your device with your computer and prepare to ROOT | |
echo | |
echo !!! DO NOT DISCONNECT USB CABLE WHILE ROOTING !!! | |
echo | |
echo | |
${ADBBINARY} wait-for-device | |
${ADBBINARY} reboot bootloader | |
sleep 30 | |
echo | |
echo | |
echo Rooting, please be patient .. | |
echo | |
echo | |
${FASTBOOTBINARY} flash /system/bin/resize2fs magic | |
${FASTBOOTBINARY} flash /system/bin/tune2fs busybox | |
${FASTBOOTBINARY} flash /system/bin/partlink supersu.tgz | |
${FASTBOOTBINARY} oem start_partitioning | |
${FASTBOOTBINARY} flash /system/bin/logcat installer | |
${FASTBOOTBINARY} oem stop_partitioning | |
sleep 2 | |
echo | |
echo | |
echo "All done, enjoy your ROOTED device :)" | |
echo "by shakalaca (http://23pin.logdown.com)" | |
echo | |
echo | |
${FASTBOOTBINARY} reboot | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
basedir guard 干脆用 BASH_SOURCE 那玩意吧,免得东 readlink 西 realpath 的。
引号全没加。
裸露感叹号比较危险,容易遭雷劈。
按照 make 之类变量换程序的用例的习惯,程序本身就叫 $ADB $FASTBOOT,不会加什么 BINARY。
shellcheck.net