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 using su with a Terminal Emulator application the su utility in /system/xbin/su needs to be replaced. In Android 1.5, the su utility was updated to allow only the shell and rootusers to gain root access[1]. Since the adb shell runs as the shell user, the su utility will give root access through the adb shell. These instructions will also work for G1/ADP1 users who have upgraded to Android 1.5 and rooted their phone.
*** NOTE: Installing the modified su utility opens up a security risk to your phone, since any App can gain root access. You have been warned... ***
C:/Android>adb push su /data/local 595 KB/s (76200 bytes in 0.125s)
C:/Android>adb shell
$ su #
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /system/xbin # mv su osu # cat /data/local/su > su # chmod 6755 su
# 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
# sync # reboot
原文:http://android-dls.com/wiki/index.php?title=Magic_Root_Access