5,597,937 Members 38,616 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] Root, unlock, and install a custom firmware!

Tip us?
 
carrett
Old
(Last edited by carrett; 25th August 2013 at 07:08 AM.)
#1  
carrett's Avatar
Senior Member - OP
Thanks Meter 252
Posts: 366
Join Date: Dec 2011
Location: Glendale, CA
Default [GUIDE] Root, unlock, and install a custom firmware!

The aim of this guide is to enable you to install a custom firmware on your Optimus G while being as clear, accurate and succinct as possible. This guide is intended for use by Windows users with an AT&T Optimus G (AKA LGE970).

I've presented the following sections in a specific order for a reason: you need to root to unlock, and you need to unlock to install a custom firmware. If you're currently running what the manufacturer gave you, you need to start with rooting, then unlocking, then trying other firmwares. Be careful, good luck, and have fun!

How to "root" your Optimus G
 
  1. (Optional if you have another means of un-RARing) Download and install 7-zip from here. You need this to open certain types of archives (specifically .rar, but you might also want to open .tar, .bz2, or other types of archives in the future). This program is supremely awesome in its ability to open almost any archive you throw at it. It's also unobtrusive and efficient.
  2. Download and install LG USB Drivers from here. Without these drivers, your computer won't be able to effectively communicate with your phone. This is vital for the steps we will be taking.
  3. Enable USB debugging by going to Settings->(General)->Developer options" and checking the box next to "USB debugging." You will get warnings. You can probably ignore them. This setting will allow you to run commands on your phone from your computer (via USB). For more info on the Android Debug Bridge, click here.
  4. Download and extract (using 7-zip (or whatever)) the root exploit from here.
  5. Connect your phone to the computer with your USB cable.
  6. Put the phone into "Charge Only" mode at Settings->General->PC connection->USB connection type
  7. Open CurrentRoot.bat and follow its prompts. You will need to change from "Charge Only" to "Media sync (MTP)" mode. The setting is in the same place.
  8. Run SuperSU (now in your apps drawer) it and make sure it works. This program allows others to gain access to superuser privileges. For more info on rooting and what kind of stuff it lets you do, click here and/or use Google.

If that didn't work for you, try following instructions from the thread where this root method came from.


How to unlock the bootloader
 

The bootloader is the first program your phone runs and its main job is to load the operating system. The stock bootloader is locked and will only run versions of Android that LG and AT&T want it to. Since our goal is to install and run custom firmwares, we must circumvent this locked bootloader. Luckily, thecubed and Shellnut2 have found a way to do this for us. What you want to do is buy Shelnutt's app. There are several reasons you should throw down some cash on this:
  1. It's way easy to use
  2. It'll make backups of your stock recovery/bootloader for you, it'll also make restoring these backups easy
  3. The money is for a good cause

If you're still confused, visit thecubed's thread. He is the man, thank him a billion times. Then thank him again for being a nice guy.

For the convenience of those interested, here is the more laborious/error prone/manual way to unlock (NOTE: this method does NOT work if you've updated to Jelly Bean, you need to use the app):
 
  1. If you haven't already, download and install 7-Zip and the LG USB drivers, and make sure you have USB Debugging turned on (see above).
  2. Download the latest version of the bootloader unlock here (latest version has the highest version number).
  3. Ensure that your screen is on and unlocked (I'd go to "Settings->Display->Screen timeout" and set the timeout to never to make sure the screen doesn't go off during this process). Your screen must remain on because SuperSU will ask you to grant superuser privileges to the unlock script and you want to be able to tap "Yes" when the time comes.
  4. Connect your phone to the computer with your USB cable, and run the freegee.bat script in extracted files on your computer. Do NOT run this script as administrator. The install will fail if you do. Follow the prompts. You can ignore "No space left on the device" errors, but "adb.exe not found" or "tar: invalid magic" errors are not negligible and indicate either you skipping a step, a funky download, or something very bad.
  5. Once the script finishes, make sure you have a populated "backups" folder in the folder where freegee.bat lives. The backups folder contains your original stock/locked bootloader, which you might want if you ever want to revert to stock.
  6. If you're sure the script ran successfully, power off the phone. Next, hold down the power and volume up keys simultaneously to enter fastboot mode. You should see a screen that looks like this:

In fastboot mode, there is a menu, but it's hidden. To navigate it, remember that volume up moves the cursor up, volume down moves it down, and power selects the currently highlighted option. The options are, in order:
  1. Start - boot the phone normally [highlighted by default]
  2. Restart Bootloader - reboot into bootloader
  3. Recovery Mode - enter ClockworkMod recovery (more on this later)
  4. Power Off - (duh)

Here is a video of thecubed showing you how to get to ClockworkMod from the bootloader (like a boss):



Using Team Win Recovery Project
 

Team Win Recovery Project (AKA TWRP) is a recovery, which basically allows you to install new firmwares and apply updates/modifications to already-installed firmwares (and a bunch of other things, like mounting and formatting portions of your phone's memory). It is the default recovery option when you use the Freegee app to unlock your phone (the other is Clockworkmod, which is so similar I won't be writing a separate guide on how to use it). Navigating TWRP is fairly self explanatory. Many great guides on how to use TWRP have been written and can be found via Google. Here is the first search result that came up for me. It's a pretty good guide.

One thing I will vehemently recommend is that you make a backup every time you install a new firmware. Personally, I backup apps and texts with Titanium Backup and my current firmware via TWRP (the linked guide explains how to make a backup in TWRP). Backups are a good idea and people should always make them. ALWAYS.


Installing custom firmwares
 

Follow the firmware author's instructions EXACTLY. These guys know what they are doing, certainly more than you or I. Check out the development threads for ROMs to try out.

Note: Be sure that if you are installing ROMs that require the Jelly Bean OTA update that you have taken that update.
There are two ways to do this: receive the update as intended (Over The Air) or use LGNPST (guide on using that under FAQ 3.a of this post) or autoprime's awesome tool, TeenyBin.

FAQs
  1. How do I upgrade FreeGee? The easiest thing to do is simply install the new version of FreeGee the way you did the old one. It will work. Make sure you keep your original locked bootloader in a different, safe place though, just in case you ever want to revert to stock (if you try to return your phone, for example).
  2. How do I disable that pesky OTA update notification? This comes courtesy of shawnchalfant and adfurgerson (visit ad's thread for more details): go into Titanium Backup and freeze the following programs: com.lge.lgfota.permission 4.0.4-91f513f88d AND com.lge.omadmclient 3.2.21
  3. How can I re-lock and un-root my phone?
    1. How to LGNPST to restore a factory image.
       
      Obtain the following files: AutoLGNPST-tSilenzio.zip (available on IRC), and the firmware. Unzip AutoLGNPST-tSilenzio.zip and follow the instructions in "READ ME FIRST.txt" (mad props to tSilenzio for automating this process).

    2. Here's the laborious/error prone/manual method for LGNPST-ing back to stock.
       
      You need to obtain the following files: LGNPST-PhantomPhreak53.zip, LGNPST_ACG_2.2.3_Lab.zip, and the firmware. Follow the following steps (please note: I am less experienced with this process and find it much more tedious. Also, IMHO, I don't think the people you're returning the phone to will care if you leave some minor traces of your unlocking shenanigans. I think the process above this is more than sufficient and simpler). Credits go to Jhoopes517 for this process, he showed me how to do it in his thread.
      1. (Install LG USB drivers)
      2. Extract LGNPST_ACG_2.2.3_Lab.zip, run the installer. Open file explorer to C:\Program Files\LG Electronics\LGNPST and replace the current LGNPST_ACG.exe with the one in the extracted folder (if you are on a 64-bit version of windows, go to C:\Program Files (x86)\LG Electronics\LGNPST)
      3. Extract LGNPST-PhantomPhreak53.zip and run LGNPST_GenericModels_Ver_5_0_12_0.exe and then run LGNPST_Components_Ver_5_0_20_0.exe
      4. In file exlorer, navigate to C:\LG Electronics\LGNPST and copy over the "Models" folder from the extracted Phantom zip folder
      5. Run cmd as administrator and execute the following

        Code:
        regsvr32 "C:\LG Electronics\LGNPST\Models\LGNPST_LS970.dll"
      6. Extract LGE970AT-01-V20j-310-410-MAR-08-2013.zip and change the extension of the .tot file to .bin
      7. Connect phone to computer, power off, and then power on, holding down the power button and both volume buttons
      8. Run the newly replaced LGNPST_ACG.exe from step 2. Select the DLL from step 5 and the .bin from step 6.
      9. Press Start
      10. If LGNPST errors out at 85%, turn your phone off and hold the power button until the phone powers on, then release. DO NOT disconnect the cable before LGNPST is done doing its thing. Your phone may reboot. This is OK.

    3. (If you are using Shelnutt's app, simply use the button in the app to re-lock and install the stock stuff).
    4. Here's the laborious/error prone/manual method for re-locking the phone and installing the stock recovery/bootloader/kernel.
       
      Remember the backups of the locked bootloader that you kept? You're going to need them. Obviously, you'll need USB Debugging enabled and LG USB drivers installed. Copy them to your phone's "Internal Storage" in a folder, in this example it's called "backups." Connect the phone to your computer via USB, open a command line (cmd) and type the following:

      Code:
      cd C:/some/folder/where/you/have/adb.exe/eg/your/freegee/download
      adb shell
      su
      dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/recovery
      dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/boot
      dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/aboot
      dd if=/sdcard/backups/aboot-att-backup.img of=/dev/block/platform/msm_sdcc.1/by-name/aboot
      dd if=/sdcard/recovery-att-backup of=/dev/block/platform/msm_sdcc.1/by-name/recovery
      dd if=/sdcard/boot-att-backup.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
      dd basically copies from the if= location and writes to the of= location. The first three dd steps write a bunch of zeros to the recovery, boot, and aboot partitons, the last three write the backups to aboot, recovery, and boot. If you want to know more, read all about dd here and/or Google. If you lost your backups, you can try writing mine.

      Now you've restored the stock bootloader and recovery, but your phone is still rooted. To unroot it, open SuperSU, go to its settings, and tap "Full unroot." Do a factory reset (Settings->General->Backup & reset->Factory data reset) and you should be good to return the phone to AT&T (or whatever).

    Be careful with these last two methods if you have removed any bloatware or installed a custom firmware, you may prefer to LGNPST back to stock (LGNPST is almost always a safe way to return to stock).
  4. Quote:
    Originally Posted by blenkows View Post
    Haha I wish I had seen this earlier. I had screenshots before and after so I could see exactly what was removed but I had just deleted them. From memory, it doesn't seem like too much was removed. All the AT&T apps are gone but it appears LG's apps are still here.


    Here is a list of apps I had shortly after factory reset on stock for people to compare with theirs. I have struck out the ones I was able to remove without my phone blowing up. Let me know if you safely removed one and I'll strike it out. Also let me know if I missed any or included an app which isn't part of stock. Thanks!
     

    AAT
    Adobe Flash Player 11.1
    Adobe Reader
    Amazon Kindle

    Android keyboard
    Android live wallpapers
    Android system
    Aspect ratio correction
    AT&T address book
    AT&T code scanner
    AT&T family map
    AT&T hot spots
    AT&T locker
    AT&T messages
    AT&T navigator
    AT&T ready2go
    AT&T smart wi-fi

    Bluetooth share
    Browser
    Bt/wifi test
    Bubbles
    Calculator
    Calendar
    Calendar storage
    Calendar widget
    Camera
    Car home
    Certificate installer
    City ID
    Clock
    com.android.backupconfirm
    com.android.providers.partnerbookmarks
    com.android.providers.settings
    com.android.sharedstoragebackup
    com.lge.lgdrm.permission
    com.lge.lgfota.permission
    com.lge.lockscreen
    com.lge.omadmclient
    Contacts
    Contacts storage
    DeviceHelp
    Download manager
    Downloads
    DRM protected content storage
    DRM service
    Email
    Email widget

    EmailServices
    Face unlock
    Facebook
    Favorite contacts widget
    File manager
    File networking
    FileShare
    Finance
    Gallery
    GestureOverlayService
    Gmail
    Google account manager
    Google backup transport
    Google calendar sync
    Google contacts sync
    Google partner setup
    Google play books
    Google play magazines
    Google play movies & tv
    Google play music

    Google play services
    Google play store
    Google search
    Google services framework
    Google text-to-speech engine
    Google+
    Home
    Home selector
    Home theme - Biz
    Home theme - cozywall
    Home theme - marshmallow
    HTML viewer
    Key chain
    Lg keyboard
    Lg tag+
    Lg voicecommand speechpack
    Lgapduservice
    Lgatcmd service
    Lgsmartcard service
    Lgsystemserver
    Live tv
    Live wallpaper picker
    Local search
    Lock screen settings
    Maps
    Marionette
    Market feedback agent
    Media home
    Media storage
    Messaging
    Multi-photo live wallpaper
    Music
    Music
    Musicfx
    My uploads
    MyAT&T
    Network location
    News
    NFC service
    Nfsservicemanager
    Note pad
    Note pad widget
    On-screen phone
    Package access helper
    Package installer
    Phone
    Phone/messaging storage
    Photo frame
    Playready cert test
    Polaris office 4.0
    Power control widget
    Quickmemo
    Search applications provider
    Settings
    Setup wizard
    Shutdown monitor
    Sim toolkit
    Smartshare
    Social+

    Streaming player
    System ui
    Talk
    Task manager
    Today+ widget
    Tom's diner
    Twitter
    User dictionary
    Usermode
    Vidclip
    Video wiz
    Videos
    Voice command
    Voice search
    Voicemail
    VPN client
    Vpndialogs
    Wap service
    Weather
    Widevine keybox test
    Wiper app
    Wise screen
    World clock widget
    YouTube
    Yp mobile
  5. I can't root. What do I do?
    Double check that you have followed all the steps in this guide (USB drivers, correct settings, etc.) If your software version ends in "c," you need to LGNPST to the version that ends in "o" (see the section on LGNPST in this post).
  6. Why shouldn't I run the Nexus 4 conversion?
    See this post by thecubed. Don't be impatient, a legit, safe ROM is forthcoming here. Messing with partition tables is needlessly risky.
  7. My shiny new firmware has no APNs and I don't get mobile data! What do I do?
    Use the APN settings in this post. They have always worked for me. If they don't try setting the "APN" variable to "pta" instead of "Phone."
... (ask me more questions!)

I hope you found this useful. Obviously this is a work in progress. I am way open to suggestion, please leave a comment below! If you liked this post, hit the thanks button and/or rate this thread so that others know this guide is legit. Thanks!
Check out my guide on rooting, unlocking, and installing custom firmware on the LGE970!

I'm against picketing but I don't know how to show it.
Every hour my servant takes my temperature and gives me another.
The Following 134 Users Say Thank You to carrett For This Useful Post: [ Click to Expand ]
 
Kiserai
Old
#2  
Kiserai's Avatar
Senior Member
Thanks Meter 20
Posts: 248
Join Date: May 2010
Location: Spokane, WA
Very nice, man. This is great for people who don't want to have to hop between threads for all the different information.

I recommend we sticky it.
Phone: Nexus 5 ROM: PA 4.0 BETA4
Tablet: Nexus 7 (Flo) ROM: PA 4.0 BETA4
Wife's Phone: Galaxy Note 3 ROM: Stock, rooted
Former Devices: Nexus One, Captivate, Inspire 4G, AT&T GS2, AT&T GS4, AT&T Optimus G
 
sawdey21
Old
#3  
Member
Thanks Meter 5
Posts: 36
Join Date: Nov 2012
Location: Rochester
this is definitely appreciated. i was looking for a guide when i first rooted and unlocked, just to read along with making sure i was doing it right. more just to double check my process than actually needing it.
 
IrateCustomer
Old
#4  
Senior Member
Thanks Meter 31
Posts: 123
Join Date: Apr 2011
This is the best root/ROM guide I've ever seen. Excellent job.

Sent from my LG Optimus G
The Following User Says Thank You to IrateCustomer For This Useful Post: [ Click to Expand ]
 
cpus456
Old
#5  
Junior Member
Thanks Meter 1
Posts: 11
Join Date: Nov 2012
anyone try this on E97110d

should it work?
 
carrett
Old
#6  
carrett's Avatar
Senior Member - OP
Thanks Meter 252
Posts: 366
Join Date: Dec 2011
Location: Glendale, CA
Quote:
Originally Posted by cpus456 View Post
anyone try this on E97110d

should it work?
I haven't so I can't recommend trying it.
 
showstopper03
Old
#7  
Member
Thanks Meter 15
Posts: 80
Join Date: Jan 2012
Awesome work! someone please sticky
 
dimsler
Old
#8  
Junior Member
Thanks Meter 3
Posts: 11
Join Date: Dec 2009
all worked great!
 
karelson
Old
#9  
Member
Thanks Meter 2
Posts: 92
Join Date: Nov 2012
can you please also post a guide on how to lock back the device and unroot.
and also how to update to a new version of freegee if it comes out.

Please
?

Thank you.
 
carrett
Old
#10  
carrett's Avatar
Senior Member - OP
Thanks Meter 252
Posts: 366
Join Date: Dec 2011
Location: Glendale, CA
Quote:
Originally Posted by karelson View Post
can you please also post a guide on how to lock back the device and unroot.
and also how to update to a new version of freegee if it comes out.

Please
?

Thank you.
Both of those requests are covered in the OP. Specifically, look at FAQ #2...If you can't understand that, I can't help you.
Check out my guide on rooting, unlocking, and installing custom firmware on the LGE970!

I'm against picketing but I don't know how to show it.
Every hour my servant takes my temperature and gives me another.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes