Wednesday, 27 June 2012

Root and Custom Firmware for Android Phone

Was hacking my mate's phone the other night and realised how few people actually mess with android or know how, and how little instruction is provided on websites so I figured I would do my own for the lulz.

The whole point of android is that its the open alternative to apple, so why not open it up? This is the google equivalent of the always popular iPod "Jailbreak".

Rooting your phone allows you to do far more stuff with it:
  • install "recovery" which allows you to backup your phones current state to SD card and restore it if installing something breaks it
  • install custom firmware ROMs which give better functionality e.g. newer versions of android, added tools/options, themes, overclocking of the CPU, etc.
  • Custom firmware also allows apps to be installed on SD card memory, reducing the space usage on your phones internal memory.
This tut is for an LG Optimus One p500 but should work for any android phone. The stock firmware for this phone has a bug which causes mad lags whenever you have a finger touching the screen (multi-touch implementation, it is looping waiting for more touches) which means you can't play angry birds. Someone has to do something!


As with anything this should work but there is potential to brick your phone and that will be your problem...
You will want a fully charged phone and an evening to waste watching it do things, as this does take a while.

Before you start you should backup your contacts (you can export them to sd card and it will make a .vcf file), and anything else you want off the phone e.g. music and photos, because this will wipe it. When you connect it to copy programs onto it you can copy that data off it.


First Step - Rooting

Depending on your make of phone and the firmware on it, some root programs work and some don't. You can generally find one that works by typing "android <version> root <phone model>" into google e.g. "android 2.2.1 root optimus p500" comes up with a load of links ( version can be found in settings>about).

SuperOneClick is the first result but from experience this does not actually work on this phone model with the 2.2.1 firmware, but should work on most things on android 2.3 and above.

the third result is from xda (which is the main source for anything android/hackage, so generally go with anything from here) and suggests a newer rooting program GingerBreak.
http://forum.xda-developers.com/showthread.php?t=1049944

After downloading gingerbreak.apk, connect your phone to the computer, mount usb storage and copy the .apk on. While you are doing this, you can copy off your photos, music and backed up contacts list so it is not lost (as installing new firmware wipes your phone).

If you cannot get usb storage to show up on your computer, you may need to download the usb driver for your phone. That is your problem, go google it.

Rooting requires USB debugging enabled (even if it isnt plugged into the computer) via    settings>applications>development>USB debugging. Always read the instructions on the page you get programs from because some of them are fiddly.

Unmount, and go into file manager to browse the SD card. if you do not have an sd card browser, go to the market and install OI file manger. Open it, click on gingerbreak.apk and install it. Once installed, open it and press "root".


Step Two - Install Recovery

Now to install recovery, go to the market and find ROM Manager. Don't get premium, the free one is fine. Open ROM Manager, select "install recovery" and pick your phone model. This should all be very straightforward. There are two options for the p500, old bb (baseband) and new baseband. Choosing old is the safer bet, doesn't change much I don't think.

You now have a dual-boot phone which if you hold the right buttons while booting (or tell it to boot into recovery from android) will boot up and give you access to hardware control.


Step Three - Picking a ROM

Before you start messing with stuff proper you will want to select a ROM to install.

Googling "xda rom <phone model>" should come up with something good, or you can go to xda and browse the forum development threads yourself to find the best one for you. I chose a Gingerbread ROM called "Ginger Snap", because it is pared down so should be slick and fast on this now ageing and haggard phone, plus you can put themes on it which makes it look cool.

Read the blurbs about each of them and pick the one that sounds right for you, I would advise picking up a CyanogenMod (CM) version because this is the widest developed android framework so it should give you a good working phone at the end of it.

This ROM need separate installation of google apps, and a theme if you so choose so these need to be downloaded as well. The files were provided on the page and all rom pages should have these links if you need things. The phone had issues opening the google apps.zip so I extracted it on the computer and re-packed it with no compression which solved the problem.


Step Four - The Hackage

With root, recovery and a ROM you have everything you need to do this thing.

If you open up ROM Manager there is an option to "Backup", select this and it will reboot the phone into recovery. 

1 - Create a backup of your phone, this may take a while.
2 - Mounts/storage > mount usb
3 - Get all of your stuff off the SD card including the backup, because its gonna get formatted.
4 - Eject from my computer and unmount usb.

5 - In order to add app storage on your SD card (which is required for CM ROMs), follow the instructions at  http://www.jayceooi.com/2011/01/12/how-to-create-ext3-partition-on-sd-card-with-clockworkmod-recovery/  to make an EXT3 partition on your card. Probably only need 256M max, my phone has 150M internal storage so that like triples it.

THIS WILL FORMAT YOUR PHONE SO ANYTHING ON THERE NOW IS GOOOOOONE

6 - go back and mount USB again
7 - copy all of the .zip files for ROM, apps, themes, etc onto the sd card.
8 - eject and unmount

9 - Before you install a ROM you need to "mounts and storage>format cache, data, system"
10 - install zip from sd card - install the ROM.zip
11 - install any other zips that need to be installed, there is possibly an order but the ROM page will tell you


Step Five - Behold the Glory

If you have done everything right, you should be able to boot into a bright shiny new phone.

When you first boot up you will need to set it up with your google account again, in this case that didn't work properly because it wanted me to fold out the keyboard which this phone doesn't have. Skipping this and then opening market allowed me to set it up properly, and then you can download all your apps again.

In this case the cell data is not working, but this is a known problem for this paricular ROM and instructions are provided on the page...
--> go into terminal app, (menu>toggle soft keyboard), type "su", "fixbb" and that fixes the problem
can also turn off the boot-up noise the phone makes which is annoying, so type "su", "bootfxoff".

Then plug it into your computer and return all of your stuff to it. Importing contacts worked but they did not show up until I changed display options to show all contact groups.

Data settings are also gone, but for 2degrees at least there is a sim toolkit app which allows you to request the data settings and they are sent to your phone.

You will probably want to go around messing with settings and stuff, google is your friend and will tell you how to change almost anything in the UI. Go have an explore, especially the settings>cyanogenmod settings because that is where a lot of the cool stuff is.

###############################################################
if it doesn't work, you can always restore your phone to how it was before.
boot into recovery (turn off, then turn on and hold some buttons -
http://wiki.cyanogenmod.com/wiki/Howto:_Using_the_Recovery

restore your backup and your phone should be as before
###############################################################


Step Six - Angry Birds

You know you want to.



Enjoi.
T

1 comment: