Personal tools

Mobile/Fennec/Android/Rooting

From MozillaWiki

Jump to: navigation, search

Contents

Rooting Android Devices

Motivation

"rooting" an Android device is the process by which one gains root access on the device. There's a few reasons why this is desirable for Firefox development:

  • Run gdb more easily
  • Can install additional tools (busybox!) to make development easier
  • Install a variety of custom ROMs to test Firefox under different conditions

It's important to note that these instructions come with no warranty whatsoever. You could easily brick your device or unknowingly install a rootkit. There's lots of legitimate reasons to do this, but be careful!

Guide to rooting individual devices

Galaxy Tab

These are the steps I used to root the galaxy tab 10.1 machine I got at the Mozilla All Hands in September 2011 (running Android 3.1). FIXME: These instructions have not worked for most people who have tried them. Please see below for Windows-only instructions (or help out by adding additional steps/corrections).

This tutorial is based on: http://www.addictivetips.com/mobile/how-to-root-samsung-galaxy-tab-10-1/. I'm putting this here here for a few reasons:

  • Brevity
  • There's a few tricky bits (like how to get to the boot screen) which cry out for more explanation

Conceptually it's quite simple, though it can be tricky. Follow these instructions carefully, and please update this page if you think anything could be described more clearly:

adb push Samsung_Galaxy_Tab_10.1_root.zip /sdcard/Samsung_Galaxy_Tab_10.1_root.zip
  • Disconnect USB Cable
  • Disable USB Debugging
  • Connect USB Cable
  • Reboot the device in bootloader mode (Power off then press volume down + power at the same time. You may need to keep holding until you see two icons. You should see the Samsung Galaxy Tab 10.1 logo first, followed by the icons. Let go. If that doesn't work, try: Power off. Press Power on, wait 1 second, then hold volume down until the "Downloading..." icon appears.)
  • You'll see a misleading icon saying "Downloading...". Ignore it and press the volume button up button, then the power button, to select the other option.
  • Select the option to apply an update from SD card, using volume up/down to navigate and power to select (FIXME: that's inexact-- after having completed this, I can't get to this screen anymore).
  • That's it! You should now be rooted. Reboot. If it didn't work, try doing that again (sometimes it might not take). Basically all the above script does is install a specially crafted program called "su" and give the regular user permission to run it. Yes, it's that simple.

Should the previous approach not work

Follow this guide with the following notes. You will require a Windows machine :(

Note: Turn off USB debugging while rooting, it may lead to problems. You'll be moving files over via ODIN.

This other guide has a nice step-by-step with great detail. Also requires Windows; a VM in Fusion doesn't work because mac doesn't recognize the tablet.

LG G2x

See: http://wiki.cyanogenmod.com/wiki/LG_G2x:_Full_Update_Guide (just the jailbreaking part, unless you want to install Cyanogenmod)

Droid Pro

You may wish to upgrade to 2.3 before rooting your device. Upgrading the device will undo the rooting on 2.2

Upgrade to 2.3

  1. go to Settings -> Wireless & Network Settings -> Mobile Network Settings
  2. set the Network Mode to GSM/UMTS
  3. set the Wi-FI settings to a wifi spot that you have network access to
  4. go to Settings -> about phone -> System Update

This should cause it to check for the latest system udpate for the droid pro

Rooting

This should work both for 2.2 and 2.3:

  1. Download a version of droid easy root v7d
  2. unzip the file
  3. go to the folder that it uncompressed and run: ./run_to_root_your_droid3.sh
  4. once the daemon runs, plugin the phone
  5. let the phone reboot 2 or 3 times
  6. it will automatically install superuser on your device
  7. verify that you have root by doing an adb shell to the device.

Nexus S

Brick (House)

Galaxy Nexus

This is over-kill if you just want root, but one option is to build your own roms, as described at http://source.android.com/source/initializing.html. The userdebug and eng configurations (full_maguro-eng) provide root.

HTC Desire

It's possible that you may get something like this: run-as: Package 'org.mozilla.fennec_jrmuizel' has corrupt installation.

This happens because run-as checks the permissions of the directories under the app to make sure they are correct: https://groups.google.com/forum/#!msg/android-ndk/cubyLmLNTXQ/wGRopPum69cJ

On my HTC Desire /data/data was owned by root:root and had permissions of 777

I needed to root the phone to fix this. I was able to do this by using the temporary root option of zroot.

I then needed to install SuperUser so that /system/bin/su would work.

Samsung Galaxy S3

These instructions worked for me running Android 4.0 on a Verizon branded phone: http://forum.xda-developers.com/showthread.php?t=1790104.

I used the version of su used for automated testing as described on Auto-tools/Projects/Pandaboard_Setup rather than the one included in the package.

What to do after rooting your device

  • After rooting, every application that requires root access will ask for permission to run, and you will have the option to allow it or not. If you do want it to run, hit 'allow', but be warned, if you do not hit 'allow', then instead of exiting, the application may timeout or hang, or any other unexpected event. If you regret this and do not want it to run, go to the Superuser app you have just installed and remove the permission.* Install the ROM Manager app from the Android store (should help manage updating your device in the future)
  • Before you go and do whatever fun development you're planning to do, backup your current image with ROM manager and remember to copy the image off the device and into a safe place! If you wipe your device's internal memory, then your backups get wiped too, so to avoid this pitfall, just store a backup now.
  • Another recommended app is Titanium Backup which will backup your apps.
  • The default shell on Android sucks. Do better by installing busybox (look on the Android store for a busybox installer, or install manually from a zip archive from Cyanogenmod).