[How-to] Flash stock images for the Nexus 4 using Fastboot
1. Yes, this guide is redundant information on the web. Plenty of similar writings have been done. I don't care.
2. The procedure technically can be applied to all supported Nexus devices; however, this guide concerns itself with only the Nexus 4 because of the fuckery known as the Windows operating system.
3. Backup.
4. I'll add images when I have the time.
5. Yes, this can brick your phone, which is why you made a backup in step 3 above. You did, right? And yes, unlocking your bootloader (fastboot oem unlock) will terminate your warranty on the phone. And yes, you can re-lock your bootloader, effectively eliminating evidence of you having terminated said warranty. You have been warned; don't follow the guide if you're going to blame me for bad things happening.
Preparations: You can skip pretty much all of this if you don't use a Windows computer
2. The procedure technically can be applied to all supported Nexus devices; however, this guide concerns itself with only the Nexus 4 because of the fuckery known as the Windows operating system.
3. Backup.
4. I'll add images when I have the time.
5. Yes, this can brick your phone, which is why you made a backup in step 3 above. You did, right? And yes, unlocking your bootloader (fastboot oem unlock) will terminate your warranty on the phone. And yes, you can re-lock your bootloader, effectively eliminating evidence of you having terminated said warranty. You have been warned; don't follow the guide if you're going to blame me for bad things happening.
Preparations: You can skip pretty much all of this if you don't use a Windows computer
- Enable ADB Debugging on your device:
- On your device, go to Settings > About Phone > tap the Build Number entry 65656u5456 times. This will give you access to the Developer Options settings.
- So go there (Settings > Developer Options) and find something that says "enable" and "debugging" and check the box to enable it.
- Download adb and fastboot: You can achieve this in many ways (the most official way is to download Google's Android SDK (as well as the SDK toolset). But it's huge and you most likely won't use 99% of it. So instead download a lightweight adb/fastboot package here. Install it.
- Test your adb/fastboot tools: Let's test the adb and fastboot that you just downloaded. Surprise: they won't work. But go ahead and try anyway:
- Launch the program that you just installed. Everyone has their favorite way to run something so I'll leave it to your discretion.
Here's what I do, for the clueless: Hit your Windows key and type incmd
, then right-click on the program Minimal adb and fastboot and choose to "Open as Administrator" which just simply opens a Command Prompt terminal and navigate to where you installed adb/fastboot. Alternatively, just open the Command Prompt (as admin) and move there yourself with thecd
command. - Now that you have a black box with some white text on it, type in
adb devices
to check your connected devices. You'll probably see no such things being listed. - Well, ain't that swell. At least you know what to do when I tell you in the future to "run adb".
- Install drivers for your device: Download this driver for the Nexus 4 (use this one for the Nexus 5), I've found it to be the most reliable. These are a few things to keep in mind:
- For simplicity, I uploaded only the driver itself. It might depend on some other files that I have on my computer but did not upload. If you cannot install this thing, let me know so I can give you the whole package.
- There are other drivers that will get your Nexus 4 connected to adb/fastboot. I've found this one to be particularly painless to use, but if it doesn't work for some reason, find something that does.
- How do you install it anyway? Follow the numbered guide:
- Connect your device via USB to the Windows computer. Hit the Windows key on your computer and type in
Device Manager
to find the app with that name, launch it. - Look for an entry (most likely with a yellow exclamation mark) that is related to your device. It likely either says "Nexus 4" or "Android".
- Right-click it and choose to "Update driver softwares.."
- "Browse my computer for Driver Software"
- "Let me pick from a list of device drivers on my computer"
- Click "Next"
- Click "Have disk"
- A small window will pop up, click "Browse.." and go to the driver that I gave you earlier named
winusb_driver.inf
, I think - Go back to the main view on Device Manager, you should now see an entry up top that says Android Phone, expand it and you should find Android ADB Interface underneath.
- Your adb should now work.
- So "run adb" and type this command into the black box:
adb reboot bootloader
- When your device is in bootloader mode (with an image of the Android being dissected), you can use the fastboot tool. Unfortunately, typing
fastboot devices
to test probably won't work. So: - Go back to step 1 and go through to step 8 again.
- Your fastboot should now work.
- Download the stock images from Google: from this page, find your device, then download the version of Android that you want (4.4 is most updated as of this writing). This will give you a .tgz file.
- Also, download and install 7zip: here.
Procedure:
- Go to the .tgz from just now. Right click > 7zip > extract it (I don't care how). You should get a .tar file.
- Right click the .tar file > 7zip > extract it. You should get a folder with your device codename and the build number for this version of Android. E.g. occam-krt16o
- Copy (or cut) the folder and paste it into your Minimal ADB and Fastboot folder.
- "run adb"
- If you haven't unlocked your bootloader (when you boot the device, you don't see an unlocked lock icon), you can do so here, simply type in
fastboot oem unlock
then confirm on your device. This will wipe everything on your SD-card, however. Too bad. You should do this as soon after you receive your phone as possible. - Assuming you want to keep your data on the SD-card, we'll opt to do it the hard way:
- Extract the zip file inside the folder, you'll get a folder which contains these files:
android-info, boot, recovery, system, and userdata
- Using fastboot, flash most of these components:
- fastboot flash bootloader occam-krt16o\bootloader-mako-makoz20i.img
- fastboot reboot-bootloader
- fastboot flash radio occam-krt16o\radio-mako-m9615a-cefwmazm-2.0.1700.84.img
- fastboot reboot-bootloader
- fastboot flash system occam-krt16o\image-occam-krt16o\system.img
- fastboot flash boot occam-krt16o\image-occam-krt16o\boot.img
- fastboot format cache
- You should be done. You do need to redo your root if you had it before:
- Download the SuperSU v1.69 (as of this writing) from chainfire.eu
- Put it on your phone (remember where you put it)
- Go into your custom recovery mode (CWM or TWRP) and flash that zip.
- Boom. Rooted.
Comments
Post a Comment