Created
July 14, 2013 22:59
-
-
Save CommanderAlchemy/5996460 to your computer and use it in GitHub Desktop.
Linux script for rooting Android devices. Conversion from the Easy Rooting toolkit (v16.0)
http://forum.xda-developers.com/showthread.php?t=2327472
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/bash | |
| # Contributors (Linux) | |
| # LoveMyAndroid2010 ADB_check(), pause() | |
| # CommanderAlchemy Script conversion | |
| clear | |
| echo "===========================================================================" | |
| echo "Easy Rooting toolkit (v16.0)" | |
| echo " created by DooMLoRD" | |
| echo " pref_event exploit" | |
| echo " Credits go to all those involved in making this possible!" | |
| echo " Special thanks to: the_laser, Bin4ry, fi01, hiikezoe, [NUT]" | |
| echo " and to all those who are contributing to our git tree!" | |
| echo " Sources: https://github.com/android-rooting-tools" | |
| echo | |
| echo " Linux script conversion by CommanderAlchemy 14.07.2013" | |
| echo " Using ADB_check & pause() from LoveMyAndroid2010" | |
| echo | |
| echo " This version assumes you already have adb installed and" | |
| echo " does not use the tools in the 'files' directory." | |
| echo | |
| echo "===========================================================================" | |
| echo | |
| echo " [*] This script will:" | |
| echo " (1) root ur device using the pref_event exploit" | |
| echo " (2) install Busybox" | |
| echo " (3) install SU files" | |
| echo " [*] Before u begin:" | |
| echo " (1) make sure u have installed adb drivers for ur device" | |
| echo " (2) enable "USB DEBUGGING"" | |
| echo " from (Menu\Settings\Developer Options)" | |
| echo " (3) enable "UNKNOWN SOURCES"" | |
| echo " from (Menu\Settings\Security)" | |
| echo " (4) connect USB cable to PHONE and then connect to PC" | |
| echo " (5) skip "PC Companion Software" prompt on device" | |
| echo | |
| echo "###########################################################################" | |
| echo "Warning!" | |
| echo "This script is provided as is and no warranty is given that it" | |
| echo "will work as desired. You have been warned!" | |
| echo "###########################################################################" | |
| echo | |
| # This finds a working version of adb. First it assumes you already have the SDK installed | |
| # if not found, it will try the one supplied in the 'stuff' directory. | |
| adb_check() { | |
| ADB="" | |
| for test_adb in "adb" "files/adb" | |
| do | |
| $test_adb "kill-server" > /dev/null | |
| if [[ $? == 0 ]] | |
| then | |
| ADB=$test_adb | |
| break | |
| fi | |
| done | |
| } | |
| # Pause execution | |
| pause() { | |
| if [[ "$1" == "" ]] | |
| then | |
| pause "Press any key to continue." | |
| else | |
| read -s -n1 -p "$1"; echo | |
| fi | |
| return | |
| } | |
| if [[ "$1" == "-test" ]] | |
| then | |
| ADB="echo 'TEST_ADB'" | |
| else | |
| adb_check | |
| if [[ "$ADB" == "" ]] | |
| then | |
| echo "No valid version of adb can be executed. This script needs adb to work properly!" | |
| echo "Make sure adb is set for execution." | |
| echo "--- Quitting..." | |
| exit 1 | |
| fi | |
| fi | |
| pause "By pressing any key you have accepted the warning!" | |
| echo | |
| $ADB "wait-for-device" | |
| echo | |
| echo "--- Creating Temp..." | |
| $ADB shell "cd /data/local && mkdir tmp" | |
| echo | |
| echo "--- Cleaning..." | |
| $ADB shell "cd /data/local/tmp/ && rm *" | |
| echo | |
| echo "--- Pushing..." | |
| $ADB push files/doomed.sh /data/local/tmp/doomed.sh | |
| $ADB push files/doomed2 /data/local/tmp/. | |
| $ADB push files/run_root_shell /data/local/tmp/. | |
| $ADB push files/busybox /data/local/tmp/. | |
| $ADB push files/su /data/local/tmp/. | |
| $ADB push files/Superuser.apk /data/local/tmp/. | |
| $ADB shell "chmod 777 /data/local/tmp/doomed.sh" | |
| $ADB shell "/data/local/tmp/doomed.sh" | |
| echo "--- Cleaning..." | |
| $ADB shell "rm /data/local/tmp/*" | |
| echo "--- Rebooting Device..." | |
| $ADB reboot | |
| echo "#################" | |
| echo "Script Finished!" | |
| echo "#################" | |
| exit 0 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results from my Sony Xperia Z (C6603)
firmware (10.3.A.0.423)
Works OK but needs some tweaking since it cannot create the folder if its already there and cannot remove for some reason.
Phone reboots correctly and rootchecker shows that it has access to root.