How to revert back to stock? - Nexus 4 Q&A, Help & Troubleshooting

SO i rooted my device as i recall to my prior knowledge and i did correctly. Now i've been searching and while i'm confident the steps i have to make are correct i thought i'd still ask to save me from future trouble.
So JDQ39 is the stock firmware i have and of which i made a back up.
Lets say a new update comes out, 4.2.3 or whatever you want to call it. So basically all i would have to do is restore my nandroid backup.
So far so good, next thing i would have to do is install the stock recovery.img (fastboot flash recovery recovery.img) which i got from the zip located here: https://developers.google.com/android/nexus/images with the title: "Factory Images "occam" for Nexus 4
Android 4.2.2 (JDQ39)"
Basically extract the recovery.img, flash it
and then proceed to fastboot oem lock and voila i'm done?
can anyone confirm please? thank you

Download the stock google image file from google for nexus 4 and extract the files in your fast boot directory adb then run the script job done.

Read whole OP
http://forum.xda-developers.com/showthread.php?t=2010312
It sounds like a lot but if you your computer recognizes your device (fastboot devices), it is really easy.
Small extraction:
C. Download the required files to your computer and extract them
1) All of the files that are required, need to be in one (i.e., the same) directory. It does not matter what it is called, but all the files need to be in there, with NO subfolders. EVERYTHING needs to be extracted into this one directory;
2) Download the attachment from the end of this post and extract the contents to the directory created in step 1. Note: if all you want to do is unlock your bootloader, skip to step 7 in this section (C).
3) Download the version of Android you want from https://developers.google.com/android/nexus/images. Make sure you are using an occam image which is for the Nexus 4. Most old versions are not usually available on that site; however, there is a mirror on this site: Random Phantasmagoria.
4) Download the appropriate version (for your computer) of 7-zip from here and install it.
5) Extract the files from within the .tgz file which you downloaded in step 3 using 7-zip, not WinZip or WinRAR or whatever.
6) Make sure you have extracted ALL the files (including extracting any files in any archives inside the .tgz file). You should have six (6) files ending with .img in the directory you created in step 1. The other files you extracted from the .tgz are not necessary;
7) Reboot your device into bootloader mode (by turning it off, hold volume down, and press and hold power) and plug it into your computer;
8) Open a command prompt in the same directory (i.e., make sure you are in the same directory as your files are located). You can hold the shift key when you are in the folder in Windows explorer and right-click in a blank spot and it will open a command prompt.

shadehh said:
SO i rooted my device as i recall to my prior knowledge and i did correctly. Now i've been searching and while i'm confident the steps i have to make are correct i thought i'd still ask to save me from future trouble.
So JDQ39 is the stock firmware i have and of which i made a back up.
Lets say a new update comes out, 4.2.3 or whatever you want to call it. So basically all i would have to do is restore my nandroid backup.
So far so good, next thing i would have to do is install the stock recovery.img (fastboot flash recovery recovery.img) which i got from the zip located here: https://developers.google.com/android/nexus/images with the title: "Factory Images "occam" for Nexus 4
Android 4.2.2 (JDQ39)"
Basically extract the recovery.img, flash it
and then proceed to fastboot oem lock and voila i'm done?
can anyone confirm please? thank you
Click to expand...
Click to collapse
if you simply rooted and would want to get future updates, there is no need to restore your nandroid. if with your root you installed a custom recovery, you are correct that you need to flash stock recovery to install an ota, however with custom recovery installed, someone will surely post a link to the update zip so you can do the update manually using your custom recovery. bootloader won't matter in getting a new update so there is no need to lock it back. you can keep it unlocked and updates will work fine. do note that when an update arrives and installs, if you don't have rootkeeper, you'll lose root so just keep an updated supersu flashable zip in your virtual sdcard so you can simply re-root thru custom rcovery after receiving an update.

Related

[HOW TO] Revert to latest stock ROM (GRI40)

I personally have tried lots of ROM's but all I really want is the stock ROM with the option to root if I want. After lots of research, I couldn't find a comprehensive tutorial on how to do this. There is of course the GRI40 image available in update.zip format for custom recoveries which is helpful for most. However, if your a bit anal like me, and want the official update directly from Google servers, follow this guide. This might also be helpful for people who can't get into the custom recovery any more.
NOTE: I will not provide help for anybody. This guide assumes you have the Android SDK in order to use adb. There may be other ways of doing this, I am not an experienced programmer, this works for me, it will work for you.
[GUIDE]
Download the following files:
Stock Froyo Image (Contains stock recovery image)
Stock GRI40 Image
Instructions
You first have to revert to stock Froyo image to get the stock recovery back. This is needed to install the GRI40 update ZIP
1. Disable backup my settings under privacy settings.
2. Unzip the original Froyo shipping ROM and put it somewhere you can find
3. Plug in Nexus One with USB to computer (enable USB Debugging)
4. Open command prompt, navigate to SDK folder which contains adb. Type
Code:
adb reboot bootloader
(which will boot into the bootloader)
5. Confirm fastboot connection with
Code:
fastboot devices
6. Type
Code:
fastboot erase userdata
7. Type
Code:
fastboot erase cache
*If step 6 and 7 does not work, and if you have a custom recovery installed, you can do a factory data wipe from there. Also perform a dalvik-cache wipe.
Alternately, you can also do a factory data wipe within Android. Settings => Privacy Settings => Factory Data Reset.
8. Go to the directory that you stored your unzipped files from the official Froyo ROM, for ease of use, copy these into the directory containing adb.exe
9. Type
Code:
fastboot flash userdata userdata.img
10. Type
Code:
fastboot flash boot boot.img
11. Type
Code:
fastboot flash system system.img
12. Type
Code:
fastboot flash recovery recovery.img
13. Type
Code:
fastboot reboot
14. Once phone has started, skip all account setup. Copy the new GRI40 .zip from Google servers to the root of your SD card. Ensure it has been renamed to update.zip if necessary.
15. Reboot into bootloader mode (hold trackball when switching on), select recovery, you will see an exclamation mark with a little green Android.
16. Hold power button and press Vol. Up to see recovery menu. Select 'Apply: Update.zip'
17. After the system boots up and while setting up skip setting up with the google account and you can setup accounts later. This will prevent the phone from pulling down the previous settings (downloaded apps, wallpaper etc) from google.
18. You are done. Enjoy.
If you want to root:
Download the following:
Latest Clockworkmod Recovery
su.zip
Instructions
How to root the stock ROM
1. Download su.zip and copy to root of your SD card
2. Download a recovery image file and for ease of use, copy into same directory containing fastboot on your PC
3. Turn on USB debugging and connect phone to PC
4. Open command prompt, navigate to SDK folder which contains adb. Type
Code:
adb reboot bootloader
(which will boot into the bootloader)
5. Type
Code:
fastboot flash recovery recovery.img
where 'recovery.img' is the name of your recovery image file (easy thing to do is rename the file to 'recovery.img'!)
6. It will upload, once complete, disconnect you phone from computer
7. On your phone, select Bootloader, then Recovery to boot into your new recovery
8. Now select ‘Apply Update.zip’ and find the su.zip file (Turn off signature verification if using Amon RA)
Note:Custom recovery will be overwritten with the stock recovery on reboot but root privelages will still be in place.
No need to do that. Flash the stock rom. Done.
Sent from my Nexus One using XDA App
albundy2010 said:
No need to do that. Flash the stock rom. Done.
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
You mean you can flash the official GRI40 zip from Google server with a custom recovery?
Iggy82 said:
You mean you can flash the official GRI40 zip from Google server with a custom recovery?
Click to expand...
Click to collapse
Yes!
Make sure it's the full image (80+meg), and not just the update (40+ meg). Recovery should restore to stock after a reboot...
Sent from my Nexus One using XDA Premium App
Well that serves me right for assuming Google would not allow an official update zip to install from a custom recovery!
Did the official update ZIP from Google come out after dsixda made his own update zip then?
The link above is for the full update zip from Google (80MB or so)
Sent from my Nexus One using Tapatalk
usually the official updates come out and people edit them to allow root, busybox, etc.
or just a stock rom that won't over write your custom recovery, etc.
Thanks for this. I have been looking for a stock image all morning!

[Q] How To Install Clockwork?

Hello All!
So my gt540 has already been rooted and fastboot works. I have been running a 2.2 rom flashed through fastboot for a few months now, but I would like to get clockwork recovery working now for the added features of flashing zips and restoring and whatnot.
I have has a lot of trouble finding clear directions on how and what to do to get clockwork recovery on this device. Like I said, I already have root and fastboot is working as well. Can anyone please provide me with instructions on what I need to do from this point?
I have looked at this thread already, http://forum.xda-developers.com/showthread.php?t=817903, but I am still unsure of what exactly I am to do. Also, the mirrors are broken on this page.
Thank you for your help!
download the app root toolbox from the market
and then download a recovery .img and go to advance
flash recovery, find the file and press on it.
wait until finish and then all done!
Or here are better instructions!!
http://forum.xda-developers.com/showpost.php?p=16783348&postcount=1
Installing recovery:
You have multiple choices to choose from.
ClockworkMod Recovery 2.5.1.8 (Recommended)
ClockworkMod Recovery 4.x (Recommended but you may run into incompatible .zip files, download the recovery_clockwork_x.x.x.x_swift.zip file)
Amon RA 2.2.1 (Recommended)
Amon RA 1.7.0.1 (Not recommended due to incompatibility with zip files and recovery backups. Also .zips must be signed)
Download the recovery image of your choice (I strongly recommend Clockwork 2.5.1.8)
Next put your phone in Fastboot mode by rebooting then holding Camera+Power, make sure USB Cable is plugged in. Also let Windows search Windows Update for drivers.
Download fastboot.exe from here: http://adf.ly/2M8Hi and extract it to the desktop. Also put the recovery image you downloaded onto the desktop too.
Be sure to have your fastboot drivers installed, if you use Vista/Windows 7 then the driver should be auto-downloaded from Windows Update, if you use XP or the drivers won't install from Windows Update, then look at this.
Open a command prompt and type the following:
Code:
cd Desktop
fastboot devices (if you see ? fastboot then your device is recognized)
fastboot flash recovery name_of_recovery.img
fastboot reboot
When fastboot says rebooting, hold down HOME and wait. You should see clockwork pop up. Recovery is now on your phone. You can delete the fastboot, kdz and recovery file from your pc because we won't be needing them again. Unless you need to use fastboot.exe again, but just download the fastboot.zip again if you need it) The other files, we don't need.
(NOTE: If your phone reboots with no boot logos (LG logo and animation), or when you flash recovery and it doesn't come up, follow the steps found here. Thanks to fishears for the post!)
Now, installing custom ROMs. Pick any ROM you'd like from the ROM Development section, if you can, get the recovery version, it is much easier to install. Determine if it is a recovery backup, or update.zip
Recovery backups usually contain some .img files and a nandroid.md5 file. The folder containing these files will need to go in the sdcard\clockworkmod\backup folder. Flash them by going to Backup/Restore>Restore>Then pick the backup folder.
Recovery update.zips contain three (or four) files/folders:
boot.img (file)
install-busybox.sh (file, only appears in SOME ROMs)
system (folder)
META-INF (folder)
DO NOT EXTRACT THESE, just put the .zip file on your sdcard, then go into recovery and go to install .zip from sdcard>choose .zip>pick the .zip you downloaded. (NOTE FOR SWIFTDROID: You MUST put the update-cm-xxxxx.zip file found in the SwiftDroid_x.x.x.x_Recovery.zip on your sdcard for it to install!!!)
THANKS TO EFFORTLESS FOR INSTRUCTIONS!!
Thank you thank you very much sir!
kweng_ca said:
Thank you thank you very much sir!
Click to expand...
Click to collapse
Ur welcome!
Just thank me!
Sent from my GT540

[Q] Question with manually applying 4.3

So I downloaded the newest stock image and I've done all I need to do in terms of drivers and such. But the file is a .tgz and when I try to push it it says "adb cannot read sideload." My device is being detected by adb in cmd. I also notice if you unpack the file there IS a zip, but there's also a new bootloader and such.
Do I have to have an unlocked bootloader for this to work? Or will flashing the .zip be okay?
I did this same thing today but I had to unlock my bootloader. ( which wipes all your data). I also had to extract a few levels deep in that file. You should research doing a factory image install because there are a few steps to do with fast boot besides pushing the 1 file over.
Sent from my Nexus 10 using Tapatalk 4 Beta
Recon0212 said:
So I downloaded the newest stock image and I've done all I need to do in terms of drivers and such. But the file is a .tgz and when I try to push it it says "adb cannot read sideload." My device is being detected by adb in cmd. I also notice if you unpack the file there IS a zip, but there's also a new bootloader and such.
Do I have to have an unlocked bootloader for this to work? Or will flashing the .zip be okay?
Click to expand...
Click to collapse
Hi! I also got the same sideload error when I tried to update my nexus 4 to 4.3. Turns out the drivers were faulty. I recommend that you uninstall and delete your current drivers from device manager and install the Universal Naked Driver from here and then sideload the file.
It worked for me.. Lets see if it works for you too.
About the .tgz part, extract the file, move all IMG files into one place and flash them one by one (reboot bootloader each time). Now erase the cache (fastboot erase cache and fastboot format cache), clear the cache again from recovery mode then to a factory reset.

How To Correctly Apply OTA Updates

I should ask for a sticky for this but these instruction will work EVERY TIME if you are running either custom recovery or Root.
You will need the latest adb/fastboot from google, you can either install the SDK or download any of the many smaller adb/fastboot and libs for your OS
You will need STOCK 4.4/4.3/4.2 recovery depending on what version of android you are currently on. Download the factory image from here. Open the zip within the package and pull out recovery.img and rename it stockrecovery.img
Copy your custom recovery to the adb folder name it twrp.zip or short name for whatever you are using I am using twrp.
You will need the correct OTA you are seeking to apply - rename it to something short simple and obvious - for this example I will use otaupdate.zip
If you wish to root get the latest patch (I believe its up to 1.75 now) and copy it to the adb/fastboot folder.
BACKUP YOUR DEVICE FIRST AND COPY IT TO YOUR PC
If you are already Rooted:
If you are using SuperSU - go to the application options and completely unroot and reboot if needed
BACKUP YOUR DEVICE FIRST AND COPY IT TO YOUR PC
If not rooted start here:
I am assuming most of you are Windows users. Open your file explorer and open the ADB folder.
On the left hand folder where ADB is located, press shift and right click the ADB folder and select "Open command window from here". This will open a command prompt window for you to run all your adb/fastboot commands from. This is the same folder where you copied your recoveries and updates to.
BACKUP YOUR DEVICE FIRST AND COPY IT TO YOUR PC
Copy your custom recovery and stock recovery to your adb folder
Copy and rename the OTA to the adb folder
Copy your root.zip patch to the /sdcard downloads folder (if you wish root)
>adb reboot bootloader - if you are already stuck in bootloop you can attempt >fastboot reboot-bootloader to run these steps
>fastboot flash recovery stockrecovery.img
>fastboot reboot-bootloader
Go into recovery and wait till dead droid appears
Press power and Volume Up at same time to go into the stock recovery menu
Using the volume buttons move and down the blue list of options and select: Apply update from ADB
You will now have orange text at the bottom of the screen - follow the instructions to side load by typing >adb sideload otaupdate.zip in your command prompt window
Wait and watch the progress, at this point you should see the ota processing steps of which there a few and will vary depending on the package. When its complete there will be a "install complete" or similar message
Reboot and let the update complete the system optimizations and go in validate your device is working and the version is what you wanted
>adb reboot bootloader
>fastboot flash twrp.zip
>fastboot reboot-recovery
Using your newly installed custom recovery you can now apply zips/root etc
Reboot as needed and update root if using older .zip to current binaries and enjoy your updated device.
And yes you only need to backup once prior to starting but many people skip that step -DON'T BE ONE OF THOSE PEOPLE.
Hopefully I've not missed a bit.
You can also use these same instructions if you're stuck in boot loop or applied a patch without first replacing stock or unrooting - just boot to bootloader using fastboot and replace recovery and apply the patches. This will usually work just fine and prevent much heart ache on your part.

[Q] [Help!] Forgot to activate USB debug mode before wiping, but CWM works

I decided to go to Android 5.0.1 from CM10.2 on my Nexus 4. I guess I did not think it though that well and relied on some crappy guides too much.
I have CWM Recovery 6.4.3 installed, so I thought I just place the factory image on the phone and install it via CWM. So:
1) Copied occam-....tgz on the phone;
2) Rebooted into CWM recovery;
3) Did wipe cache/format system/wipe dalvik;
4) Went to install .zip menu... and figured out that the file is no longer on my phone.
I thought OK, I do it via ADB and cable, so installed ADB, drivers etc. and connected my phone to my computer. However, adb does not see it most of the time (when at logo, bootloader, recovery) and only once adb managed to see it (*some number* device unauthorized) while the phone was at Google logo. And I realized I forgot to set up the USB debug option. What are my options now? I can go into CWM recovery, but ADB does not see the device, as I forgot to set up recovery before flashing. Help, please?
The computer sees the phone as MLP, but I still cannot see its storage in Explorer, so I cannot copy the .zip file.
Update
I managed to make adb recognize the phone, but consistently says that it is not authorized, which makes sense. And there is not way I can mount it as an external storage .
first of all, you have a serious lack of knowledge. not activating USB debugging in android settings has no effect whatsoever on ADB usage ability when you are in recovery mode. Secondly, installing factory images is not done through recovery (the downloaded factory image zip is not even flashable so it would work not in recovery), as factory images also contain RADIO and BOOTLOADER images that are flashable through fastboot (not the recovery). The only thing from factory image that you could flash via recovery is a zip file named - in case of 5.0.1 factory image - image-occam-lrx22c.zip (you can find it if you unpack the downloaded factory image on your PC). And this zip file is a classic ROM (system,userdata,boot,cache,recovery partitions). However, even if you were to flash the correct zip (rather than the zip containing entire factory image complete with ROM, RADIO and BOOTLOADER) Android 5.0 (or 5.0.1) comes with updated RADIO (maybe bootloader aswell, i did not check), so you are supposed to update that aswell prior to switching to 5.0/5.0.1
now here is what you should do:
1. download 5.0.1 factory image from gooogle
2. make sure you have ADB and drivers for Nexus4 correctly set up (in order to check wheter it works go see point 3 of this instruction set)
3. boot to fastboot mode (vol down+power) and check if 'fastboot devices' gives you back device id (you should open command prompt in platform-tools folder, where both adb.exe and fastboot.exe are present)
4. proceed with this instruction, start at step 8 http://androidforums.com/threads/guide-how-to-flash-a-nexus-factory-image-manually.706533/ (in step 11, name of zip file is the one that is INSIDE downloaded factiory image file (image-occam-lrx22c.zip) and you either do the single zip flash or flashing each of .img files separately (system,boot,userdata,cache,recovery)
ps. 1st android 5.0.1 boot after flashing will take up to 15 minutes. (it took 10 in my case)
Update 2
Thanks dzumagos! Sure, I do not claim to be a specialist by any means. I managed to successfully install Cyanogenmod many times, so thought I would give this one a go as well.
I read your post after I fixed the issue. Basically I did exactly what you suggested, but following another guide and it worked fine, also took it around 15 minutes to load the first time. I noticed I do miss a few tricks from Cyanogenmod

Categories

Resources