[Optimus One, P500 Android Development] victortangocharlie:
This thread is primarily intended for n00bs.

​

I would like to say thanks to xda forum members: Noejn, Zecanilis, drellisdee, The_ERROR etc. Also thanks is due to Godlike! at tech-mania.com for his tutorials. Thanks is due especially to The_ERROR for proofreading the post and to other users for their suggestions written in the thread.[/SIZE]

---------------------------------------------------------------------------------------------

NEW - 3 May 2011 - Simplified Guide to Root & install version 1.2 of Custom Thunderg Recovery by AmonRa/modified by Drellisdee on LG P500

ALWAYS MAKE A BACKUP BEFORE CUSTOMISING YOUR PHONE.

[CUSTOMISING A PHONE USUALLY INVOLVES: ROOTING >>>> INSTALLING CUSTOM RECOVERY >>>> INSTALLING CUSTOM ROM]

The instructions written below have been tested by me using an Indian unbranded GSM model of LG P500 which came with stock Android 2.2.1 (V10C). The procedure to be followed for any LG P500 phone is the same.

This post is split into 4 major sections -

1. INSTRUCTIONS FOR ROOTING

2. INSTALLING ANDROID SDK ON A WINDOWS PC (This step is needed to install Custom Recovery on phone using adb from PC. Can be omitted if Recovery is installed from phone using Terminal Emulator)

3. INSTALLING A CUSTOM RECOVERY

4. INSTALLING CUSTOM ROMs

MUST READ: If you haven't read this thread already, please do read it - Dictionary for n00b - What is.../What does ...mean?

---------------------------------------------------------------------------------------------

1. INSTRUCTIONS FOR ROOTING

To know your present firmware version - Go to Settings/About Phone

Only phones which come with stock android 2.2 could be rooted till recently.

UPDATE - 24 April 2011 : A tool called 'GingerBreak APK' is able to root phones running stock android 2.2, 2.2.1 & 2.2.2. Read about it HERE. This tool enables rooting without the need for downgrading the firmware to 2.2.

If 'GingerBreak APK' doesn't work out for you, continue reading to understand the procedure to root your phone after downgrading your firmware.

Note: 'GingerBreak APK' permanently roots your phone. Also,GingerBreak might not install BusyBox and SuperUser apps properly on your phone. These apps are required by many rooted apps for their proper functioning. So, use Root Checker from android market to verify the proper installation of these 2 apps.

If your phone runs stock android 2.2, enable 'USB Debugging' on Phone (Settings/Applications/Development). Install z4root (copy the apk file to the sd card and open the file after browsing to the location using the phone's file manager), run it and root the phone. Find it HERE.

Choose the permanent root option as it is still possible to force unroot if needed.

Restart the phone and launch z4root to check the root status. A successful rooting should show 'Unroot' option when z4root app is opened.

{Note: z4root automatically installs Busybox and Superuser application(which appears as an icon in your app drawer) on the phone.}

If rooting fails with z4root, there is another application called SuperOneClick which can root your phone. Read about it HERE

For phones that came with stock 2.2.1 or 2.2.2 installed, rooting first involves downgrading the firmware to 2.2.

Downgrading the firmware can be done with KDZ-FW-UPD.exe (procedure outlined below)

(KDZ-FW-UPD.exe has been claimed to work best with windows xp 32bit.)

FIRST: DOWNLOAD THE Android 2.2 FIRMWARE FOR YOUR DEVICE. For this, go to: [ROMS] Original LG Firmware list and read about the procedure to download the original firmware.

{Tips: Use Ctrl+F in browser to search for Country name, Remember to change the alphabet in 2 places in the final link to download the firmware, Do not bother about the 'CDMA' tag attached to country code. It works for the GSM model phones too. If the link to find out the country codes doesn't work, use the 2nd method mentioned in the post to find out the country code using your phone's IMEI or ESN number }

Download the required Firmware onto your PC.

Links to Original firmware versions for Indian P500 are mentioned in THIS POST

Procedure to install original firmware using KDZ-FW-UPD.exe ( KDZ FIRMWARE UPDATER )

This procedure can also be used to restore the stock firmware and recovery onto your phone in case you want to give your phone to the service centre during warranty period as the phone will appear similar to as you bought it from the store.

[Note: This procedure was used to install V10B_00.kdz(android2.2) over V10C_00.kdz(android2.2.1) on an unbranded Indian GSM model of LG P500 using a Windows 7 Ultimate 64bit updated to date PC.]

1. Install LG PC Suite IV from SD card which came with phone by connecting the phone to PC through USB cable.

This is done to install the drivers for the phone on the PC

(the procedure is as follows)

- Enable the 'USB Mass Storage Only' mode in the phone's Settings/SDcard & Phone Storage menu.

- Connect phone to PC with the USB Cable.

- Press the 'Turn on USB Storage' button which appears on phone.

- Browse to the folder containing the 'LG PC Suite IV' on the phone's SD card using Windows Explorer and run the LG Installer file. PC Suite will now install on your system along with the required drivers for your phone.

- Cancel setting up PC Suite or continue setting up PC Suite if you want to Sync or backup the phone data.

- After closing PC Suite, Safely remove the USB device from your system.

- Press the 'Turn off USB Storage' button on phone screen.

- Detach the USB Cable.

- Disable the 'USB Mass Storage Only' mode in the phone's Settings/SDcard &Phone Storage menu.

Alternatively, I also tried installing the latest drivers via LG Mobile Support Tool from LG's website (available HERE) but KDZ-FW-UPD.exe (mentioned below) crashes when run. This could be happening only to me, so please try for yourself before writing off this method.

2. For my comfort more than anything else, I switched off the screensaver and other power saving features on the PC and also set the screen timeout delay on the phone to 30 minutes.(Settings/Display/Screen Timeout)

3. Charge the phone to the maximum.

4. Enable USB Debugging on Phone (Settings/Applications/Development).

5. Detach all other peripherals from your PC. Exit all running applications on your PC especially other PC suites if any. Also exit running programs from the notification bar on the desktop. (Also uninstall Nokia or other phone drivers & microsoft visual ++ runtime environments - not an essential step.)

6. Disable 'LGE Virtual Modem' in PC's Device Manager. (In your Windows operating system, go to Control Panel > System > Hardware > Device Manager > Modems > Right click on LGE Virtual Modem and click Disable.)

7. Unmount the SD card from the phone (Settings/SDcard & Phone Storage).

8. Open phone back and remove the SD Card.

9. Download KDZ_FW_UPD_EN.7z onto your PC and extract it to a folder. Available HERE.Direct Download Link. (MD5 of 7zip file - 813A28BE9182AB604A1D43E745CE7AD7)

10. Run the msxml.msi file and complete the installation.

11. Connect the phone to PC with USB Cable.( If you are using a desktop PC, make sure you use USB ports that are in the back of your PC, avoid the front ports.)

12. Run KDZ_FW_UPD.exe from the extracted folder.

13. Chose TYPE as 3GQCT & Phone Mode as DIAG.

14. In the 'KDZ file' space, browse for the firmware you want to install. (In this case V10B_00.kdz)

15. Press the 'Launch software update' button.

16. The firmware flashing process is now underway.

If all goes well, in 5-10 minutes the phone will be flashed with the new firmware.

I shall describe in detail what happened with my phone - 10-15 seconds after launching software update on PC, my phone screen turned blank and in a couple of seconds the phone entered the 'Emergency Mode'. During this mode the screen was yellow with Emergency Mode written along the middle of the screen. The phone stayed in the same way till the Software update procedure finished on the pc and the phone turned blank. I waited a while for it to reboot but after a minute or so, I manually switched on the phone. The phone came alive and following the LG boot animation, the android logo screen came up. The phone spent about 2 whole minutes in that state before booting up fully and entering the home screen. Update: Wait till phone reboots by itself or wait for a while before manually switching it on.

17. After booting up fully, detach the phone from the pc.

(If the phone gets stuck in the android boot logo screen during first boot, doing a hard reset by pressing and holding the VolDown+Home+Power buttons may resolve the problem.)

Go to 'About Phone' in Settings and confirm the change from 2.2.1 or 2.2.2 to 2.2.

Root the phone using z4root as mentioned before.

If rooting fails with z4root, there is another application called

SuperOneClick

which can root your phone. Read about it HERE

IN CASE OF PROBLEMS DURING DOWNGRADING FIRMWARE, read the following thread completely. Various types of errors and various measures to correct them including some innovative ones like shaking the phone etc. are mentioned here - [HOWTO] Phone not responding at all - last chance to repair. It is advisable to read this thread completely before attempting to downgrade the firmware using KDZ_FW_UPD.exe to become aware of all the possible problems you might encounter and their possible solutions.

PS:

Here is the link to the phone drivers that came with my SD card. One user reported a problem wherein kdz updater would recognise the phone but the update process would fail during kdz unpacking. the problem was resolved by using the drivers i sent him. So, if anyone has the same issue, it might be worthwhile to try out the following drivers. I wouldn't advise everyone to follow this method, but those of you who are feeling lucky might try it out. Download Link

---------------------------------------------------------------------------------------------

2. INSTALLING ANDROID SDK ON YOUR WINDOWS PC

This step is required to install Custom Recovery on your phone using adb from your PC. Using a Custom Recovery, you can make a backup of your current ROM, restore backups, create partitions on your SD card, wipe your phone and the SD card and then also go on to install Custom ROMs using the Flash from Zip option.

Installing a Custom Recovery can also be done in other ways. Using Android SDK from your PC is just one method.

(Custom Recovery can alternatively be installed on your rooted phone using the commands given in the next section using a Terminal Emulator. This method removes the need for installing Android SDK on your PC and connecting your phone to PC. Download Terminal Emulator from Android Market. Install on phone. Run it and give it root permissions when prompted by the 'Superuser' application. As mentioned in the next section, copy the 2 files (flash_image & the custom recovery image file) needed to install Custom Recovery onto the root directory of SD card. Reboot phone. Open terminal emulator and type 'su' without the quotes and press Enter. This will take you to the root shell (#) from the default user shell($). Carefully type in the 7 commands mentioned in the next section one after the other. After typing in the last command (reboot recovery) and pressing enter, WAIT. The phone will reboot. Custom Recovery will have been succesfully installed on your device.

Hint: Copy the installation commands as a text file to phone & copy and paste the commands one by one into terminal emulator using a text editor. Please make the necessary changes to the installation commands depending on the recovery version used)

To install Android SDK on PC

, there are a few requirements/downloads which have to be completed first:

JDK (Java Development Kit) - Download Here

JRE (Java Runtime Environment) - Download Here

Android SDK installer - Download here

So after all the downloads are completed, you are good to go. Run PC as Administrator.

First of all install the JDK, then the JRE and then the SDK Installer.

{If when android sdk installer is run, you get an error that JDK or JRE is not detected even after their installation, wait for a while, shut down the computer and restart and run the SDK installer once again.}

Make sure that while installing the android sdk, the installation directory should be the root of a partition i.e. it should be in the following form: C:\android-sdk, where you should replace the letter C with the letter you have assigned to the partition that you want to install it in.

Now that the Android-SDK is installed, go to the installation directory and start the SDK Manager. You need to add the components of the Android SDK to your installation. Before that I would like to inform you that you can save time if you download only what is necessary. If you are on Android 2.1 then you should download the 2.1 sdk, for 2.2 the 2.2 sdk and so on. You do not need to have all the versions for this thing to work. Just your version would do. So to start adding components, I recommend that you read THIS

After installing the desired components, you need to do perform some simple steps in order to use the adb terminal just like the cmd terminal for Windows.

For that purpose, here are the steps to be followed:

Right click My Computer, select Properties, and click Advanced System Settings. (Windows XP users - Right click My computer and just click Properties and select the Advanced Tab)

Click on Environment Variables, in the System Variables box, scroll down to the variable name 'Path' and double click to edit it

It would read something like " %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static".

Here you need to add a semicolon ( ; ) and add the path of the tools folder in android-sdk.

It should finally be like this " %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\android-sdk\platform-tools

{or the location where adb.exe resides on your system}

Click OK wherever asked and then restart your computer.

Now open a command prompt window and type adb and hit enter. If a terminal window is displayed, you have done it all right.

If it gives some error message, read the article carefully and see what you have messed up with.

---------------------------------------------------------------------------------------------

Tip:

Using adb - How to install apps from PC without having to copy them first to the SD card?

If you want to install apps in one click, all you need to do is download the .apk file of your application to your PC and set the open with option to this batch file which you can download HERE

Save the batch file on the desktop of your PC before setting the option to 'Open With'.

---------------------------------------------------------------------------------------------

3. INSTALLING A CUSTOM RECOVERY

(Procedure of installing Custom Recovery using a terminal emulator from your phone instead of installing android SDK on your PC and connecting your phone to PC is mentioned in the last section.)

UPDATE - 3 May 2011 : Very simple way of installing Custom Thunderg Recovery by AmonRa/modified by Drellisdee version 1.2. Originally posted by ungaze in this post

.

1. Download Android Terminal Emulator from Android Market. Install it on your rooted phone.

2. Download the file "amon_ra_recovery_installer.zip" from here or here. Check the MD5 hash value of the downloaded 'zip' file using tools like HashTab etc. before proceeding further. Correct MD5 value : 86db8a52b01f049cadb8f097a4c5bd9e

3. Extract the contents of the 'zip' file to the root of the sd card (ie. not inside any folder) using tools like 7-Zip or WinRAR or any other similar tool.

4. Open the terminal emulator app on your phone and type in the command 'su' without the qoutes. This will prompt a popup on your phone from the SuperUser app asking you whether you want to give root permissions to the terminal emulator app. Click 'Allow' and proceed. You will notice that the shell prompt has changed from the previous user shell '$' to root shell '#' in the emulator app.

5. While in the root shell '#', type in the following command and press Enter. Wait and the phone will reboot into the Custom Recovery.

sh /sdcard/rf.sh

Once you are up and running with a rooted phone, you will need to download the 2 files needed to install the Custom Recovery. They are:

Download No:1

: flash_image - (This file is the same one needed to install any of the 3 versions of Custom Thunderg Recovery by Drellisdee given below)

Download Link (MD5 of zip file - 13FED5DF927214D744A256DAB4C3DC06)

Mirror Link (MD5 of zip file - 13FED5DF927214D744A256DAB4C3DC06)

Mirror Link - requires registration at androidforums.com. (MD5 of zip file - 13FED5DF927214D744A256DAB4C3DC06)

Download No:2

: Custom Recovery image file - Choose & download any version among the 3 available after reading what is written below.

Custom Thunderg Recovery by Drellisdee has versions 1.1, 1.2 and 1.2.1 at the time of writing this. I personally prefer version 1.2 as it supports backup & restoration of ext4 Partition on SD Card. Version 1.2.1 is a little experimental in nature & it may not fit all devices as it has a size near 5 MB.

Link to xda-forum thread for Custom Recovery P500/Thunderg - HERE.

The different versions of the Custom Recovery image files are available at the following pages

Custom Recovery P500/Thunderg v1.1

Direct Download link - (MD5 of zip file - eb4ea2ffb26f387a891bb4d7261a0e5f)

Mirror Link - (MD5 of zip file - eb4ea2ffb26f387a891bb4d7261a0e5f)

Custom Recovery P500/Thunderg v1.2

Direct Download link - (MD5 of zip file - 217FC9115899A41195CF124CAF07B880)

Custom Recovery P500/Thunderg v1.2.1

Direct Download link - (MD5 of zip file - 388aac16b1184ab15b5500b2b32d914c)

Please check the MD5 hash values of downloaded files to ensure that files are not corrupted using tools like HashTab etc.

Now to install Custom Recovery, Copy the two files [ the chosen recovery image file (*.img) & the flash_image file (flash_image) ] and paste in the root of your SD card (root means the directory L:\ where L is the letter for your Phone's USB Storage. In short, don't create a folder and paste the files inside it on your SD card).

{Note that the recovery image file should have an .img extension and flash_image file should have no extension when placed on the SD card}

Reboot the phone. Connect phone to PC.

The next step requires Android SDK to be installed on your PC.If you have installed the Android SDK, follow these steps:

Go to Start Menu & Run and type cmd (run as Administrator)

In the cmd window, type adb. If you have installed it correctly, you will see a lot of text on the screen. If you get an error message then you have probably not installed the Android SDK properly.

Type adb shell and hit enter

Type su and hit enter

See your phone at this time and touch the 'Allow' option which SuperUser shows you

Now the terminal window will have a # sign appended to it instead of the previous $ sign. See this screenshot for a better understanding

Now one by one, copy the following lines, in the serial order and paste it into the terminal window and press enter following each line(right click on window and paste, CTRL + V won't work)

Wait. The phone will reboot now.

Note:

{If you get this error after step 4

mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak

failed on '/system/etc/install-recovery.sh' - No such file or directory

Simply move on to the next step.

If you get any errors other that those mentioned here, please do not proceed with the last command of 'reboot recovery'. If you do so, recovery may not be correctly installed and you will lose all data on the phone as the phone will be reset to factory defaults. Please go back to the instructions and see what you have done wrong.

NOTE: If on booting into the recovery you get the following message at the bottom of the screen -

E: 'Bad Boot Message'

Don't panic, it's perfectly normal and you can proceed with what you want to do from the recovery.}

Detach the phone from the PC.

To access the Custom Recovery, turn off the phone and then press & hold Home+Vol Down+Power buttons to boot into the Custom Recovery.

---------------------------------------------------------------------------------------------

Once you have booted into the recovery, the touch screen won't work. The actions assigned to the different buttons are given here. Use them to navigate through the different options in Custom Recovery.

Up & down

: vol-up and vol-down key

Select

: Menu key (left most)

Back

: Back (3rd from left)

---------------------------------------------------------------------------------------------

What does Custom Recovery look like & What does it do?

Note:

In Custom Recovery versions 1.2 and above, zips can be extracted from inside folders. So, save the zips in a folder named AAA and flash the zip after browsing inside the folder through recovery. The folder name should be named 'AAA' so that it appears among the first on the recovery screen, since scrolling is not an option in recovery.

Note: There is also an unofficial port of ClockworkMod Recovery availble. I do not recommend this recovery for newbies as it isn't compatible with all Custom ROM's out there.

---------------------------------------------------------------------------------------------

4. INSTALLING CUSTOM ROMs

BEFORE FLASHING ANY ROM, DO A NANDROID BACKUP FROM CUSTOM RECOVERY

Since all the ROMs have their own kinds of partitions to be created and other requirements, you can check them at the ROM specific pages.

General procedure to follow for installing a Custom ROM

Boot into Custom Recovery

Wipe your cache, dalvik cache, SD card

Make partitions according to the ROM requirement

Wipe cache again.

Connect Phone to PC

Toggle USB MS and paste the ROM zip file to a folder called AAA in the root of the SD card

Disable USB MS.

Detach phone from PC.

Select 'Flash from zip' option in Custom Recovery menu

Select the ROM file

Flash the ROM file

After flashing is finished, Reboot the phone.

Note: It will take some time to flash and reboot into your new Custom ROM. The phone may stay with the boot logo displayed for a number of minutes. Do not switch off phone during this period.

---------------------------------------------------------------------------------------------

In case of problems with phone, read:

[HOWTO] Phone not responding at all - last chance to repair

Also read: [READ FIRST] [REF] Repository of howto's, roms, kernel, etc.

If you feel benefited by this thread, I humbly request you to rate this thread and vote it to the front page. The option to rate and vote is present in the title bar of the thread on the right side.

Please post your feedback. Also THANKS is always welcome. Use the THANKS button (below right) if you feel that I deserve it.​

Update - 24 April 2011 - New rooting method without needing to downgrade firmware.

Update - 3 May 2011 - Very simple way of installing Custom Thunderg Recovery

Update - 3 May 2011 - Added Simplified Guide to Root & install Custom Recovery on P500