Rooting Android

From Android Wiki

(Difference between revisions)
Jump to: navigation, searcha
(Instructions for adb port forwarding)
 
(20 intermediate revisions not shown)
Line 1: Line 1:
-
=Obtaining a root shell on the G1=
 
-
 
==Start and connect to telnetd==
==Start and connect to telnetd==
-
This has been tested and is known to work on [[OTA Updates]] RC19 and RC29 on the G1. Google has already promised to patch this so check you version.<br>
+
This has been tested and is known to work on [[OTA Updates|RC19 and RC29]] on the G1. This has been patched in RC30 so if you have RC30+ you need to [[Root For RC30|downgrade to RC29]] first.
-
1: download [http://android-dls.com/files/src.com.poidio.terminal.apk pterminal] and run it<br>
+
 
-
2: start the telnetd service ("cd /system/bin" then "telnetd")<br>
+
#Restart your phone
-
3: telnet into the device<br>
+
#At your phones desktop hit the <enter> key twice and then type "telnetd" and press <enter> again
-
<br>
+
#Download an [http://android-dls.com/files/apps/Telnet.apk Android Telnet client] and connect to localhost. If you are unable to connect, try steps 1 and 2 over again until you can.
-
This gives you a root shell (basically, but not technically.... its confusing, dont ask) which you can use to gain more power.
+
#you now have root!
 +
 
 +
Alternatively if you have adb installed, you can use adb to forward a local port on your linux host to a port on the phone. This avoids the need to install a terminal on the phone:
 +
 
 +
# At your phones desktop hit the <enter> key twice and then type "telnetd" and press <enter> again, then on your desktop:
 +
adb forward tcp:9988 tcp:23
 +
telnet localhost 9988
 +
 
 +
If your phone is not found by ADB, please refer to [http://androidcommunity.com/forums/f4/how-to-install-apps-using-adb-4482/ this page] for information how to enable debugging-mode on G1.
 +
 
 +
 
 +
'''Source(s):'''  [http://www.downloadranking.com  Android solutions]
-
Alternatively, you can use adb to forward a local port on your linux host to a port on the phone.  This avoids the need to install a terminal on the phone:
 
-
<pre>
 
-
# Type "telnetd\r" ON THE PHONE KEYBOARD, then:
 
-
adb forward tcp:9988 tcp:23
 
-
telnet localhost 9988
 
-
</pre>
 
==Add busybox==
==Add busybox==
-
1: [http://android-dls.com/files/apps/busybox.xxx download busybox by tapping and holding (long pressing) this file] and choosing save link to your sd card (using android browser)<br>
+
#[http://android-dls.com/files/apps/busybox.xxx download busybox by tapping and holding (long pressing) this file] and choosing save link to your sd card (using android browser)
-
2: remount system as read-write<br>
+
#remount system as read-write
 +
#*<pre> mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system</pre>
 +
#copy and rename busybox.asc to /system/bin/busybox
 +
#*<pre>dd if=/sdcard/download/busybox.asc of=/system/bin/busybox</pre>
 +
#make it executable
 +
#*<pre>chmod 4755 /system/bin/busybox</pre>
 +
#go there
 +
#*<pre>cd /system/bin/</pre>
 +
#this gives you cp (great for making more symlinks)
 +
#*<pre>busybox cp -s busybox cp</pre>
 +
#start sh (this is busybox sh and has more commands and is easier to use)
 +
#*<pre>busybox sh</pre>
 +
 
 +
You will not need to create any more symlinks if you plan on installing any recent JF update as he has done this for you.
 +
 
 +
P.S. If you have adb running you can paste this in to do all of the previous commands at once (much faster).
<pre>
<pre>
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
-
</pre>
+
dd if=/sdcard/download/busybox.asc of=/system/bin/busybox
-
3: copy and rename busybox.xxx to /system/bin/busybox
+
-
<pre>
+
-
dd if=/sdcard/download/busybox.xxx of=/system/bin/busybox
+
-
</pre>
+
-
4: make it executable<br>
+
-
<pre>
+
chmod 4755 /system/bin/busybox
chmod 4755 /system/bin/busybox
-
</pre>
 
-
5: go there<br>
 
-
<pre>
 
cd /system/bin/
cd /system/bin/
-
</pre>
 
-
6: this gives you cp (great for making more symlinks)<br>
 
-
<pre>
 
busybox cp -s busybox cp
busybox cp -s busybox cp
-
</pre>
 
-
7: start sh (on emulator enables up/down command memory)<br>
 
-
<pre>
 
busybox sh
busybox sh
</pre>
</pre>
-
8: to make more symlinks (busybox has hundreds of commands that are missing on G1) you do:<br>
 
-
<pre>
 
-
cp -s busybox <command>
 
-
</pre>
 
-
for example, "cp -s busybox tar" will give you tar command :)<br>
 
-
I would recommend you DO NOT OVERWRITE ANY EXISTING SYMLINKS!!! G1 has toolbox for most commands and the syntax is different. If you change the syntax, updates or scripts (like init.rc) could stop working.<br>
 
-
P.S. if you want it all at once so you can paste it in one chunk, here you go:<br>
+
'''Source(s):'''  [http://www.downloadranking.com  Android solutions]
-
<pre>
+
 
-
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
+
 
-
dd if=/sdcard/download/busybox.xxx of=/system/bin/busybox
+
==Protect your root==
-
chmod 4755 /system/bin/busybox
+
New updates from google are geared at taking all of this away from you. You should now install one of JF's modified roms so you can [[Keeping Root|keep root after you update]]. It is recommended that you do not merely block updates and stay at your current version because some bugs (especially the [[G1 Root Bug Explained|root bug]]) can pose a serious risk to security and privacy if left un-patched.
-
cd /system/bin/
+
 
-
busybox cp -s busybox cp
+
==Easier ways to root==
-
busybox sh
+
The above instructions are for manually rooting a G1. Today it's much easier, though. There are a number of tools available to [http://rescueroot.com root a variety of Android phones]. Some programs are capable of performing a [http://www.oneclickroot.com one click root] on android devices. You can check [http://bit.ly/gW912g here] for a discussion of [http://rootingandroid.com rooting Android] and a list of tools.
-
</pre>
+
 
 +
 
 +
'''Source(s):'''  [http://www.downloadranking.com  Android solutions]

Latest revision as of 15:16, 1 February 2013

Contents

Start and connect to telnetd

This has been tested and is known to work on RC19 and RC29 on the G1. This has been patched in RC30 so if you have RC30+ you need to downgrade to RC29 first.

  1. Restart your phone
  2. At your phones desktop hit the <enter> key twice and then type "telnetd" and press <enter> again
  3. Download an Android Telnet client and connect to localhost. If you are unable to connect, try steps 1 and 2 over again until you can.
  4. you now have root!

Alternatively if you have adb installed, you can use adb to forward a local port on your linux host to a port on the phone. This avoids the need to install a terminal on the phone:

  1. At your phones desktop hit the <enter> key twice and then type "telnetd" and press <enter> again, then on your desktop:
adb forward tcp:9988 tcp:23
telnet localhost 9988

If your phone is not found by ADB, please refer to this page for information how to enable debugging-mode on G1.


Source(s): Android solutions


Add busybox

  1. download busybox by tapping and holding (long pressing) this file and choosing save link to your sd card (using android browser)
  2. remount system as read-write
    •  mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
  3. copy and rename busybox.asc to /system/bin/busybox
    • dd if=/sdcard/download/busybox.asc of=/system/bin/busybox
  4. make it executable
    • chmod 4755 /system/bin/busybox
  5. go there
    • cd /system/bin/
  6. this gives you cp (great for making more symlinks)
    • busybox cp -s busybox cp
  7. start sh (this is busybox sh and has more commands and is easier to use)
    • busybox sh

You will not need to create any more symlinks if you plan on installing any recent JF update as he has done this for you.

P.S. If you have adb running you can paste this in to do all of the previous commands at once (much faster).

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
dd if=/sdcard/download/busybox.asc of=/system/bin/busybox
chmod 4755 /system/bin/busybox
cd /system/bin/
busybox cp -s busybox cp
busybox sh


Source(s): Android solutions


Protect your root

New updates from google are geared at taking all of this away from you. You should now install one of JF's modified roms so you can keep root after you update. It is recommended that you do not merely block updates and stay at your current version because some bugs (especially the root bug) can pose a serious risk to security and privacy if left un-patched.

Easier ways to root

The above instructions are for manually rooting a G1. Today it's much easier, though. There are a number of tools available to root a variety of Android phones. Some programs are capable of performing a one click root on android devices. You can check here for a discussion of rooting Android and a list of tools.


Source(s): Android solutions

Personal tools