Accessing root from the magic/Sapphire terminal emulator
Now that you have followed magic rooting to root your HTC magic/Sapphire, you will notice that it is not possible to gain a root from an application running on the phone. the only way to get root access is through the ADB shell. in order to be able to gain root access usingSuWith a terminal emulator applicationSuUtility in/System/xbin/suNeeds to be replaced. In Android 1.5,SuUtility was updated to allow onlyShellAndRootUsers to gain root access [1]. SinceADB ShellRuns as the shell user,SuUtility will give root access throughADB shell.These instructions will also work for G1/adp1 users who have upgraded to Android 1.5 and rooted their phone.
* ** Note: Installing the modifiedSuUtility opens up a security risk to your phone, since any app can gain root access. You have been warned ...***
- First, download the modifiedSuUtility (ZIP), and unzip it somewhere on your computer. The instructions below assumeC:/android.
- Make sure you have ADB installed on your PC, and that USB debugging is enabled on your phone. For details, see this post.
- Next, openDOS command promptWindow, and push a modifiedSuUtility to your phone. This utility will then be copied into the proper location to replace the existingSuUtility.
C:/Android>adb push su /data/local595 KB/s (76200 bytes in 0.125s)
- Next, useADBTo get a shell prompt on your phone:
C:/Android>adb shell
- GainRootAccess using the existing su utility:
$ su#
- Then, Remount/SystemPartition as read/write so you can replace the existingSu:
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
- TheSuUtility is located in/System/xbin. The following commands will back up your existingSuUtilityOsu, And install the modifiedSuUtility, and change the permissions appropriately.
# cd /system/xbin# mv su osu# cat /data/local/su > su# chmod 6755 su
- Now, check your work, and make sure the permissions on the newSuMatch those of the originalOsu.
# ls -l *su-rwsr-sr-x root root 76200 2008-08-01 05:00 osu-rwsr-sr-x root root 76200 2009-05-30 11:28 su
- Finally, if everything checks out, sync the filesystem, and reboot your phone:
# sync# reboot
- After your phone reboots, you will be ableSuTo root from the terminal emulator application.
Http://android-dls.com/wiki/index.php? Title = magic_root_access