yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] slugger410ft:
Efrant,

I have read and understand that you haven't had the time to compile a new zip and test it. I was curious to know if there is some where I can obtain these files individually so that I could put together a flashable zip myself. Are you pulling them from the stock image? My USB is shot AND I have yellow spots. Looking to get an RMA as soon as possible. Thanks in advance for your help and direction.
[Nexus 4 General] zainqaiser:
I need help. I was rooted...bootloader unlocked...then I unrooted it and locked the bootloader...I mean I return to complete stock state. Today I got OTA update. It downloaded fine and then went to installing screen..in the middle it gave an error with android laying down with the red triangle on it. I tried several times but still the same issue. Any idea what I am doing wrong?
[Nexus 4 General] magictwins:
Now I am stuck at step 9

how long is this supposed to take? i realize it's a 500MB img file, but i am stuck for about 5 mins...
[Nexus 4 General] efrant:
I'll test it out tomorrow.

Yes, you can pull them from the factory image. Extract all the files from the system image and place them in a folder called system. Then zip up that folder along with the stock boot image in a zip file along with an updater-script (which you will have to write...) and binary.

Or, look in the development section for a stock odexed ROM, flash it and the remove root and busybox if included.

Ask in El Daddy's stickied help-desk thread.

By the way, root and an unlocked bootloader have no impact on your ability to receive /install OTA updates.
[Nexus 4 General] chrone:
Fastboot erase cache bug is still there on 4.2.2. Stuck on X logo for a long time. This occurs when flashing from 4.2.1 stock images and live update with cwm recovery to 4.2.2 ota.

N4 16GB with hardware revision 11.

Sent from my Nexus 4
[Nexus 4 General] sonikk4ever:
I managed to keep my root after ota, how is this possible?

Edit:

I received that update via Google itself, so that's prbly the reason?
[Nexus 4 General] efrant:
No, that's not the reason. It's probably because you are using OTA rootkeeper or the built in function of supersu.
[Nexus 4 General] Rakeesh_j:
Why do the instructions say to not use winrar? I used winrar and it works fine.

I like winrar because it supports almost every compression format out there, and has some very nifty shortcuts for doing all sorts of things quickly. You can get a free registered copy from real networks, just sign up for that trial thing and then cancel right afterwards, doesn't cost a dime.
[Nexus 4 General] magictwins:
winrar doesn't support .7z

and 7z is free
[Nexus 4 General] efrant:
Some people were having issue with WinRAR a while back, although it may work on later versions (I originally had written up this guide for the Nexus One, so I kept a lot of the same elements in there.)

In any case, 7-zip has never given anyone any issues.

^^ This. And it is open source.
[Nexus 4 General] efrant:
You can do it this way:

1) Use segv11's BootUnlocker app to relock your bootloader.

2) Download the factory 4.2.2 factory image and extract the boot.img and recovery.img files from inside.

3) Download this odexed version of this ROM.

4) Replace the boot.img in the zip in step 3 with the one you downloaded in step 2.

5) Flash the new zip in CWM or TWRP.

6) Delete the following files from your ROM:

/system/app/Superuser.apk

/system/xbin/busybox

/system/xbin/su

7) Now you are on the stock ROM and kernel with a locked bootloader. All that remains is to flash the stock recovery. To do that, grab a flashable zip from the TWRP or CWM threads, replace the image inside with the stock recovery which you downloaded in step 2 and flash it.

Done.
[Nexus 4 General] schmitzekater:
Thanks for this guide!

I was having some problems today flashing the 4.2.2 stock image, but managed to get it done with this guide!

Screw those toolkits, i learned a lot today with your help, so thank you!

Now gonna install francos kernel and i'm lucky again. ;)
[Nexus 4 General] TeutonJon78:
So, let's say I've changed the recovery and flashed a ROM. If I want to keep the altered recovery but go back to stock, can I basically just run the last few commands only?

It's my first Nexus (coming from Droid X), so not use to actually having freedom.
[Nexus 4 General] slugger410ft:
Thanks for this Efrant. I went the same route last night, but I hadn't got around to deleting SU and busybox or flashing the stock recovery before I went to bed. You saved me a bit more reading and research this morning. :good: I'm sure this will help out many other too!
[Nexus 4 General] tonysac:
Does anyone please has a link for stock kernel and stock recovery for 4.2.2?:confused:

Keep walking Greece
[Nexus 4 General] wonderwalker:
Is it safe to assume that if you re-lock the bootloader and flash a stock rom that the warranty is now valid? Is there any other way they can tell that it was unlocked?
[Nexus 4 General] gianton:
Extract them from the stock image, download here.

Sent from my Nexus 4
[Nexus 4 General] slugger410ft:
According to post #492, and what I just finished doing, you also need to get rid of all the busybox files and su and superuser.apk

As far as I can tell, I am as stock as I can be after wiping my sdcard.
[Nexus 4 General] tonysac:
Thanks but actually I need these 2 files to be flashable through recovery

Keep walking Greece
[Nexus 4 General] gianton:
Try to learn fastboot flashing, much safer.

Sent from my Nexus 4
[Nexus 4 General] wonderwalker:
Ah, good catch. Would've forgotten about that. Thanks
[Nexus 4 General] efrant:
To answer your two questions: Yes (assuming you flash the stock ROM, kernel, radio and recovery, if you changed any of them). No.

Yup.
[Nexus 4 General] efrant:
Stock occam JDQ39 boot and recovery images

As Gianton said, you should learn how to use fastboot.

In any case, here are the files:

Stock JDQ39 boot: http://d-h.st/j96

Stock JDQ39 recovery: http://d-h.st/jSl
[Nexus 4 General] sonikk4ever:
Yes indeed i have the app called voodoo ota rootkeeper !

Ah stupid stupid me :p
[Nexus 4 General] hkkla:
Edit: sorry wrong thread
[Nexus 4 General] slugger410ft:
Welp, Finished everything and in the end I somehow borked my radio. Data was working but no voice. I tried factory resetting and it just made it worse. It boots up, but I have no data, voice, or wifi (though it can detect AP's). In any case, once booted, all seems to be stock; no root, no busybox, no superuser. And with a faulty USB (the reason its going back to begin with), I have no worries that the RMA will go smoothly. New phone ships within a week. Till then, back to the ole trusty Nexus S.

Edit: I don't believe I did anything wrong, I'd assume I got a bad download somewhere.
[Nexus 4 General] samcrocr:
Thanks a lot it is a breeze when you follow the steps to the dot :victory:
[Nexus 4 General] chrone:
flashing factory image reset step by step as on first post didn't trigger the fastboot erase cache bug, although it stuck on boot animation for a minute or two, wait for it, and voila, here comes 4.2.2! :D
[Nexus 4 General] samcrocr:
I was stucked in the boot animation. I flashed CWM , wiped data and cache, reboote. after that it booted up in like 1 and a half minute :victory:
[Nexus 4 General] penzoilguy:
Thanks!
[Nexus 4 General] chrone:
yeah that will do the trick. :) are you on hardware revision 10 or 12? mine is 11.

i'll try later when finish testing battery life after factory image reset. Used to stuck at boot animation after doing only fastboot erase cache command after install-reinstall-uninstall multiple apps, much faster than entering recovery mode. :P
[Nexus 4 General] joho5:
Is it necessary to reboot bootloader after each flash in fastboot?
[Nexus 4 General] efrant:
No, just after the flashes as indicated in the first post, i.e., bootloader and radio.
[Nexus 4 General] :
hi efrant,

just got my nexus 4, followed your instructions step-by-step, works like a charm, thanks!

I'm now trying to get CWM to stick, followed your instructions from here but cannot find either files

googled around, saw a method here, tried it but still when i go into fastboot and select recovery, the default recovery is present and not CWM.

Can you assist? Thanks.
[Nexus 4 General] JimMorrison723:
Thanks for the Guide, it helped me, when i wanted to upgrade 4.2.1.

Now i wanted to upgrade to 4.2.2 with the same method, but i get boot loop after the proccess :( (sideload OTA update didnt work)

I though this methid will work now again, but it looks like i was wrong :/
[Nexus 4 General] efrant:
You are probably using the wrong command.

This will temporarily boot CWM from your PC: fastboot boot cwm.img

This will flash CWM to your device: fastboot flash recovery cwm.img

assuming you name the CWM image cwm.img in both cases of course.

It should work just the same. Flash the new bootloader, radio, boot, system and recovery images. Then boot into CWM and wipe cache, and it should boot fine.
[Nexus 4 General] JimMorrison723:
Ahha! i didn't flash the recovery image... And i dont even have CWM installed. Thanks, i'll try again.
[Nexus 4 General] :
oh wow, you're right. thanks! i totally missed it.
[Nexus 4 General] vicstarman:
Efrant, please help! (?)

Efrant! Just the person I'm looking to ask this of. I am certain I'm screwed, but please tell me if you thing otherwise. I'm trying to restore my Nexus 4 to EXACTLY what you have listed in the above comment for your device with links provided. Here's my story of woe:

ACTION: Tried to force Android 4.2.2 update to apply (auto push from Google failed). Downloaded update from the web and pushed using ROM Manager (Clockwork)

RESULT: Failed to update.

ACTION: Change Kernel back from custom (Faux 123) to Nexus 4 Stock kernel to try again.

RESULT: Success on kernel update. Failure (still) for 4.2.2 to successfully push.

ACTION: Randomly decided to try a DIFFERENT Kernel in the middle of the night when tired, not realizing that it was designed only for use with a custom ROM.

RESULT: **** hits fan. It's all a blur, but things started failing left and right. GAPPS were failing but I could still get into most apps and settings to turn USB debugging back on after resets.

ACTION: Upon realizing I'd flashed a kernel that requires cutom ROM, re-flashed Faux 123 from SD card.

RESULT: Still receiving app crashes and errors. Realized I had loaded GAPPS for 4.2.2 but am still running 4.2.1. Cluster**** of errors and crashes commence.

ACTION: Used nexus 4 Toolkit to restore Android version to the latest available on free version (4.2.0) figuring I could allow update later.

ACTION: Also randomly decided it would be a good idea to use Toolkit to restore everything to STOCK. I kept ROOT, but allowed it to set everything else back to stock:

Bootloader, Android 4.2.0, stock everything... INCLUDING (like an idiot) REMOVING CUSTOM RECOVERY, and resetting to STOCK RECOVERY.

****TY RESULT: Somehow the ENTIRE system is wiped. I will boot to a black screen and a constant message that Setup Wizard can't run. I can pull down settings but not access them (or anything else)...

Therefore I cannot re-set Developer Options to allow USB Debugging. And since I wiped THE ENTIRE PHONE including SD Card, all the ZIPS for Kernels, ROMS, and Adroid versions are GONE.

I cannot push via APK / ADP from the computer because USB Debugging is not an option since the phone is wiped and I can't access settings.

And with no files on the SD Card, at all, there's nothing to flash.

And even if I COULD try flashing them, I was stupid enough to remove Clockwork MOD custom recovery and return the stock recovery which doesn't allow for flashing at all.

If the Nexus 4 had a removable SD card, this would all be easily remedied. But I can't remove it to put files on it from my PC. And since I can't use USB debugging....

I'm screwed!
[Nexus 4 General] El Daddy:
Just follow the guide in the OP and flash 4.2.2 with fastboot.
[Nexus 4 General] zevim2005:
Can i use this method to go from PA 4.21 to Stock 4.2.2?
[Nexus 4 General] 3rdstring:
Yes
[Nexus 4 General] vicstarman:
Thank you for this reply. Sounds hopeful.... but ready for the stupid question of the day ? (I blame exhaustion from no sleep working on this for 14 hours now)....

What is "OP"?
[Nexus 4 General] El Daddy:
"Original Post". Also known as the first post of the thread.
[Nexus 4 General] vicstarman:
and yes, now I feel like an idiot :P

I'll look at that now. My fear is that it's not as simple as you say because of this fact (quote from MSKIP):

MAKE SURE YOU ENABLE USB DEBUGGING IN SETTINGS, DEVELOPER OPTIONS BEFORE CONNECTING THE USB CABLE IN ADB MODE SO THAT THE PC CAN DETECT THE PHONE PROPERLY.

I cannot go back into developer options because my phone is wiped clean. No OS, No nothing. So I can't do anything from my PC. I can technically transfer the files to the downloads folder on the device, but I can't go into the phone to launch anything.

Oh, how I wish I had not wiped the system/data/cache/davlik cache AND reset stock recovery (deleting Clockwork Mod Recovery).

I can't believe I did this. I was so tired and frustrated I wasn't thinking. I'm embarrassed :(
[Nexus 4 General] El Daddy:
This is not a toolkit. Its fastboot. You don't need USB debugging enabled.

Just follow efrants guide step by step and you'll be fine. Consider this a learning experience and comprehend what you are doing when following the steps.

Next time you get in a mess you'll know how to fix it.
[Nexus 4 General] vicstarman:
Sorry El Daddy... still can't figure it out (?)

Thank you El Daddy! You're very kind, and wise for sure. I am definitely taking this as the ultimate challenge so far in my experience with Android. It's not exactly fun... but I like learning.

To be clear, I realize this is not a "tool kit", but I still can't see how to proceed. I looked at the original post you referenced and realized this is exactly the page I started this whole thing with last night. I just reviewed it, made sure I had, in fact, installed the proper drivers (I had), etc.

The problem I'm running into the is the very next step in the OP....."Note that the driver has to install twice: once when your device is booted normally (not required for this tutorial) with USB Debugging enabled in Settings, and once when your device is booted in fastboot (i.e., bootloader) mode (which is required for this tutorial)."

I can't get into USB Debugging. I can't do ANYTHING on the phone. No settings are available. It's just wiped clean. Black screen and a locked message that start up processes failed. I'd take a screen shot, but even that won't work.

Please forgive my ignorance! I don't want to make you repeat yourself. But I must be missing SOMETHING if you keep telling me I don't need to use debugging. I don't see how to transfer the files to the phone without. I've followed every step of the OP perfectly. Drivers are correct, in the correct folder, etc. But how to get them to the phone?

I must be missing something. I'd totally pay at this point for a direct learning tutorial. I just wish I had someone in Portland who knew this stuff (well, someone I knew!)

At least my bootloader is still unlocked, so I have that going for me, even if I did reload stock recovery and stock kernel... like a douche :P
[Nexus 4 General] El Daddy:
It says right there in parentheses. "Not required for this tutorial"

Since you used the toolkit already you should have the drivers installed already. As well as adb and fastboot.

Download the 4.2.2 image https://developers.google.com/android/nexus/images#occam

Then follow the guide from section C4.
[Nexus 4 General] vicstarman:
Thanks much! I'm going to try to figure this out. I think I keep confusing "having a fastboot" with the Fastboot Mode on my phone, which I'm using. Maybe the same. I'm just trying to learn this stuff deeper so I am not reliant on toolkits, (although MSkip's is amazing!)

---------- Post added at 03:17 PM ---------- Previous post was at 03:12 PM ----------

Hmm... that's the image download link I used last night. Same link even. I started having problems then because I was trying to use 4.2.2 image and gapps but still running 4.2.1 and getting all the app fails. then eventually.... kaput.... everything (due to my own ignorance certainly). I'd give anything to have a one on one in person. I can be a bit dense and miss the obvious quite often. Example, misreading the parentheses portions you referenced. I just get all frazzled

---------- Post added at 03:25 PM ---------- Previous post was at 03:17 PM ----------

Okay, so in device manager, Android Phone shows up. Below that Google Nexus 4 Bootloader Interface. I've clicked on that a gazillion times and clicked Check for Updates, upon which I get confirmation that everything is up to date.

Now what? Am I to put the 4.2.2 image in that folder if it's possible? or in the Android Phone master folder?

And if so, it's going to the device, right?

And if so, what state should my phone be in? I have it plugged into the usb drive and set to the Fastbook Mode screen.

Nothing "happens"....

---------- Post added at 03:56 PM ---------- Previous post was at 03:25 PM ----------

Put all the files in one folder. Used 7 Zip to unzip the image file(s). Opened command prompt from within the folder. "Fastboot" is not a recognizable command....

Dammit what am I missing?

Cash money if anyone wants me to send this to them to restore the device and send it back. I love learning, but I don't have time frankly, and it's proving frustrating as hell!
[Nexus 4 General] 3rdstring:
You need to un-zip the platform-tools attached to the op in the same folder as the image files, open a command prompt in that folder then type the commands (fastboot flash ...)
[Nexus 4 General] efrant:
I don't think you have really read and understood the first post in its entirety. First of all, you are quoting instructions from a "toolkit" thread -- do not try to mishmash instructions from one method to another.

Read the entire first post again, and stop after each step to make sure you understand what the step is asking you to do. It tells you what files you need and where to place each file . Take your time. It seems like you are rushing through the process in order to get your phone "fixed" -- but your phone is not broken. You just need to flash the stock firmware back on to it. Patience. Everything is in the OP. And if you don't understand some of the terminology, have a read of the stickied "101" thread.
[Nexus 4 General] jet_silver:
History from a successful factory image flash for Mac

In case the information is helpful for anybody here's the entire session where I did a stock 4.2.2 reflash on my Nexus 4 from a Mac. If this is boring or not of help then mods please delete it.

sh-3.2# ./fastboot-mac devices

[valid number here]	fastboot

sh-3.2# ./fastboot-mac oem unlock

...

FAILED (remote: Already Unlocked)

finished. total time: 0.001s

sh-3.2# ./fastboot-mac reboot-bootloader

rebooting into bootloader...

OKAY [ 0.001s]

finished. total time: 0.001s

sh-3.2# ./fastboot-mac flash bootloader bootloader-mako-makoz10o.img

sending 'bootloader' (2188 KB)...

OKAY [ 0.138s]

writing 'bootloader'...

OKAY [ 0.345s]

finished. total time: 0.484s

sh-3.2# ./fastboot-mac reboot-bootloader

rebooting into bootloader...

OKAY [ 0.001s]

finished. total time: 0.001s

sh-3.2# ./fastboot-mac flash radio radio-mako-m9615a-cefwmazm-2.0.1700.48.img

sending 'radio' (54593 KB)...

OKAY [ 3.413s]

writing 'radio'...

OKAY [ 3.500s]

finished. total time: 6.913s

sh-3.2# ./fastboot-mac reboot-bootloader

rebooting into bootloader...

OKAY [ 0.001s]

finished. total time: 0.001s

sh-3.2# ./fastboot-mac flash system system.img

erasing 'system'...

OKAY [ 0.848s]

sending 'system' (523357 KB)...

OKAY [ 32.696s]

writing 'system'...

OKAY [ 35.829s]

finished. total time: 69.372s

sh-3.2# ./fastboot-mac flash userdata userdata.img

erasing 'userdata'...

OKAY [ 2.082s]

sending 'userdata' (98413 KB)...

OKAY [ 6.150s]

writing 'userdata'...

OKAY [ 6.238s]

finished. total time: 14.469s

sh-3.2# ./fastboot-mac flash boot boot.img

sending 'boot' (5898 KB)...

OKAY [ 0.370s]

writing 'boot'...

OKAY [ 0.391s]

finished. total time: 0.762s

sh-3.2# ./fastboot-mac flash recovery recovery.img

sending 'recovery' (6398 KB)...

OKAY [ 0.401s]

writing 'recovery'...

OKAY [ 0.421s]

finished. total time: 0.823s

sh-3.2# ./fastboot-mac erase cache

******** Did you mean to fastboot format this partition?

erasing 'cache'...

OKAY [ 0.161s]

finished. total time: 0.161s

sh-3.2# ./fastboot-mac reboot

rebooting...

finished. total time: 0.001s

sh-3.2#

I could not get past the X on reboot, but going to recovery in bootloader mode and wiping the cache fixed that.

This worked well, thanks.
[Nexus 4 General] efrant:
Updated post #2.
[Nexus 4 General] efrant:
This was the quote I was talking about:

Ok, Let's go through the steps you mentioned:

This may be my fault, because I didn't specify what you should see, but if this worked, you should see a string of numbers and letters, which would indicate that your device is connected. If you seen nothing, then your computer is not recognizing your device, and you have a driver problem.

Ok, good.

You only see this if you unlock your bootloader as per step two. This is the prompt you receive when you type in fastboot oem unlock.

If you don't have the fastboot driver installed, it certainly won't do anything.

If you would have extracted the files from the file you downloaded as per the instructions earlier in the OP, you would have seen an image called bootloader-mako-yadayadayad.img. If you have "Hide extensions of know file types" enabled in Windows (which it is by default), you won't see the ".img" at the end...

I'll stop here for now.

I have a few minutes tonight. send me a PM and I can help you through it via Teamviewer if you want.
[Nexus 4 General] vicstarman:
Your frustration

Efrant, El Daddy and others on this thread, I can see and understand your frustration. I was reading more from even just a year ago when people were just starting to root and jank up their phones via took kits and whatnot. And they/we come running without understanding the basic. It's like people who demand to drive only automatic transmission cars because they never took the time to learn WHAT happens when you depress and release a clutch, and manually control rpms and torque, etc.

I, for example am a downright pro at driving clutches, as well as at my profession as a wine expert (and other fermentables) as well as a highly regarded food and beverage consultant. And ALL DAY LONG I have to deal with noobs in my industry. Or with my neice who REFUSES to learn to drive a clutch or try to understand how a transmission (or an engine, or air pressure, etc.) works.

Please believe me that I feel your pain. I've tinkered with electronics since they were first in America's homes. And I'm pretty savvy in general. But I fully fall at your feet imploring mercy when it comes to the latest in pocket pc (aka cell phone) technology. And to think, the ONLY reason I rooted was to have WiFi tethering and a kernel that allows my Nexus 4 to go beyond 3.5 hours. Otherwise, I wouldn't even bother.

Just giving you guys credit, and asking your patience and understanding with a relative newbie like me. Some of the old-school user commentary on here is downright scathing towards people who do exactly what I did. But I don't really blame y'all at all! I perfectly understand. I'm super embarrassed that even I made a comment earlier that I'd PAY someone to just fix it for me. That's the exhaustion talking.

Thanks for all you guys do! I will NOT be returning anything for warranty like one aforementioned person did (LOL). I wanna get in there and learn this stuff! And if I may say so as humbly as possible, I have the brains to do it. It's not my first area of interests, just like multi millionaires who I work with don't know shiz about wine! They're smart as hell, but they have to invest their time where it really counts.

Thanks for your help, El Daddy, and the rest of you pros. :)

Neil