yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] wrench588:
Thank you so much for your guide. I have bookmarked when the time comes!
[Nexus 4 General] lapocompris:
My Nexus is unlocked and rooted with stock 4.4.2.

To unroot and relock bootloader, do I need to flash a stock ROM ?
[Nexus 4 General] sordna:
No, you already are on stock ROM. You can unroot and lock boot loader without flashing anything. You should only flash if you made changes to your /system (such as DPI or modified system apk's) to avoid OTA's from failing.
[Nexus 4 General] lapocompris:
As I understand, the command "Fastboot oem lock" will lock the bootloader. How to unroot ?
[Nexus 4 General] efrant:
What is the goal of you doing all of this? If it's to return your device to out-of-the-box condition, then I would flash the images as per the OP. If you just want to be ready for the OTA when it comes, I would flash just the boot and system images (that way, you keep your data, and your recovery).
[Nexus 4 General] saaln:
I'm trying to return to stock Android from the latest release of CM. I've followed the instructions in OP twice now, however when I reboot the phone it takes me through another CM set up, only with yellow accents instead of cyan.

EDIT: Third time's the charm, apparently. Everything seems to be working now! I think I was forgetting to flash system.img. The third time took a bit longer to do than the first two.
[Nexus 4 General] spicediablo:
Does rooting work for the latest 4.4.3?
[Nexus 4 General] efrant:
Yes, but you need SuperSU v1.99v3 or higher.
[Nexus 4 General] spicediablo:
I normally root using custom recovery

Sent from mako⁴
[Nexus 4 General] efrant:
That's fine, but you will need to update SuperSU afterwards to make sure you have stable root (if your recovery contains an older version of SuperSU).
[Nexus 4 General] kingofcomedy:
Do I?! I have installed SuperSU 1.97 and it's working so far. Should I install Chainfire's latest v1.99r3.zip?
[Nexus 4 General] spicediablo:
1.86 is not working for me, Reflashed 1.99v3 and working

Sent from mako⁴
[Nexus 4 General] efrant:
I would, yes.
[Nexus 4 General] hamedunix:
Hello everyone, I am currently on 4.4.2 with Root access (using the method mentioned above) and I got OTA update notification last night. Is it safe for me (rooted) to proceed with the OTA to 4.4.3?

P.s. I read somewhere that 4.4.3 OTA won't go through on rooted devices.
[Nexus 4 General] cadarn07:
In my experience, those updates usually fail until you flash stock recovery, then apply the update. Then you have to flash custom recovery again and re root. You'll probably want to update your root app as well.
[Nexus 4 General] spicediablo:
You can try. Might go through but you will lose root upon upgrade

Sent from mako⁴
[Nexus 4 General] hamedunix:
Well, right now I am on stock recovery (I rooted using the genius method in this thread). I was wondering if someone had been in same place as me? ( stock recover, rooted on 4.4.2 and updating over the air) :D

---------- Post added at 06:22 AM ---------- Previous post was at 05:47 AM ----------

Flashing boot and system partitions would remove root as I understand?

---------- Post added at 06:52 AM ---------- Previous post was at 06:22 AM ----------

Strange thing is that "fastboot devices" only recognizes my phone when it is in fastboot menu but not when it's on and OS is loaded up. Any ideas?
[Nexus 4 General] efrant:
Root shouldn't make a difference.

If you have a custom recovery, you probably will not be able to update using the notification that appears in Android. You need to reboot into your custom recovery and flash the update. That's the only difference.

Yes, you can accept the update and, assuming you didn't modify or delete any system files and/or have a custom kernel/radio, the update will work.

And no, root does not modify or delete system files.

Yes. So? With an unlocked bootloader, getting root on a device is trivial: just flash a custom recovery and use that to flash SuperSU.

That's because the "fastboot" command only communicates with the bootloader -- it can't communicate with Android.
[Nexus 4 General] hamedunix:
Thanks a million [MENTION=1566190]efrant[/MENTION] . I updated to 4.4.3 using the method you provided here. I'll root it later today. Good job man with the nice thread and good support.
[Nexus 4 General] benkya:
i am failing updating ota 4.4.3 with error status 7 about google camera.odex, can i just flash only system images with cwm to make flashing ota work ? where i can find flashable zip system image for 4.4.2 ?
[Nexus 4 General] arffrhn:
All the .img files must be flash with adb. If you want a recovery flashable, you need to flash the whole rom (with the kernel). Either way is it better that way. Look in android develepment section for stock flashable 4.4.2. (Or the title may have changed to 4.4.3 as it is latest). Or better yet, just flash the stock 4.4.3.
[Nexus 4 General] chrone:
Shouldn't it flash with fastboot instead of adb?

Sent from my Nexus 5
[Nexus 4 General] donniemceduns:
Yes am having the same problem too.Did you ever get it solved?
[Nexus 4 General] arffrhn:
Yeah well. My mistake. :P
[Nexus 4 General] Leosukita:
I loved your guide it was my light in the end of tunnel!

but i think you could do some changes on this quoted part:

on E.5 if you use 'fastboot boot customrecovery.img' it will only boot from recovery, for you to change to custom recovery the command should be

'fastboot flash recovery customrecovery.img'

and the E.7 should be a little more specific: 'Find the Superuser zip that you downloaded, and apply it.'

Hope it help

thanks again!
[Nexus 4 General] sordna:
fastboot boot rec.img means to boot into the provided recovery without flashing it, (nothing wrong with that) however there is no "fastboot recovery" command,

to flash it you would do "fastboot flash recovery rec.img"
[Nexus 4 General] Leosukita:
Exactly , my bad forgot the flash.
[Nexus 4 General] :
There is 174 pages on this thread, not including mine, so there is no way I am about to go through all of that.

I do not own this device, but in the thread it talks about a specified bootloader which requires you to use a specific kernel command-line in order to boot the image (i.e. boot.img and/or recovery.img).

My current device was recently updated to 4.2.2 (we are behind times, I know), and the Bootloader was bumped up. Fastboot boot recovery.img no longer works now unless you downgrade the Bootloader.

My question here is how was the needed kernel command-line discovered and can someone explain the steps for it so I may adapt this to my K2_CL and provide a solution to the rest of the K2_** community.
[Nexus 4 General] _Kyros_:
I'm a little confused as to what command line is correct in order to erase cache partition after flashing recovery.img, there's 2 options in the OP with the 1st being crossed out, but the 2nd option causes problems where it stays forever at the 4 colored circles, so I had to reboot into stock recovery and choose the option to delete cache from there in order for it to boot correctly.
[Nexus 4 General] Fatty1212:
Thank you for this guide! It makes it so much easier to go back to stock!
[Nexus 4 General] chrone:
Quick questions, how to untampered this device when doing this factory reset?

Should I unlocked bootloader from nexus bootunlocker app, unrooted, flash all the images excep userdata, fastbooted boot twrp and flashed nexus bootunlocker script by [MENTION=4544860]osm0sis[/MENTION] to lock and untamper back the bootloader?

Sent from my Nexus 5
[Nexus 4 General] 3rdstring:
I believe fastboot oem lock after you flash he other images. There are tamper flags on some devices, IDK if the N4 has one or not.
[Nexus 4 General] paolontra:
I am receiving exactly the same error:

sending 'bootloader' (2203 KB)...

OKAY [ 0.074s]

writing 'bootloader'...

FAILED (remote: flash write failure)

finished. total time: 0.077s

rebooting into bootloader...

OKAY [ 0.001s]

finished. total time: 0.001s

< waiting for device >

sending 'radio' (45537 KB)...

OKAY [ 1.436s]

writing 'radio'...

FAILED (remote: flash write failure)

finished. total time: 1.439s

rebooting into bootloader...

OKAY [ 0.001s]

finished. total time: 0.001s

< waiting for device >

archive does not contain 'boot.sig'

archive does not contain 'recovery.sig'

archive does not contain 'system.sig'

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

Bootloader Version...: MAKOZ30d

Baseband Version.....: M9615A-CEFWMAZM-2.0.1700.98

Serial Number........: 0036623b8d58d56e

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

checking product...

OKAY [ 0.002s]

checking version-bootloader...

OKAY [ 0.001s]

checking version-baseband...

FAILED

Device version-baseband is 'M9615A-CEFWMAZM-2.0.1700.98'.

Update requires 'M9615A-CEFWMAZM-2.0.1701.03'.

finished. total time: 0.014s

Press any key to exit...

-----

I have tried also the Android 4.4.2 version. But even if the baseband matches, I still cannot update for the flash write failure reason.

Do you guys have any idea how to solve this?

Many thanks in advance.
[Nexus 4 General] kerpert:
Try reinstalling Android Development Kit and ensure driver are correctly installed.

Sent from my GNex
[Nexus 4 General] hityo:
Im getting the same error, every-time I try to unlock the bootloader it just keeps locking it self so I cant do a return to stock. and still getting the cache errors!

Please help....
[Nexus 4 General] pincher65:
after fastboot oem unlock you confirm this operation on phone?
[Nexus 4 General] hityo:
Yes, after flash oem boot unlock, once it restarts it relocks the bootloader. It boots up in the phone but coems up with so many errors liek camera has crashed, gallery has crashed and so on...

I have tried to flash just the cache.img file, adbside load, cf-auto root and still vant get the bootloader unlocked to perform a new flash

?????? sooo confused ??????
[Nexus 4 General] gogYCH:
can anyone help

I have the same problem?
[Nexus 4 General] pincher65:
make wipe data in recovery and then flash again. such happens after cm installer use
[Nexus 4 General] gogYCH:
I do not know what's helpful, but I managed to flash without errors

I changed the USB cable

disassembled phone and disconnected the battery for a few minutes

compiled and made phone flash

After a reboot, the phone started but we show only 5.7 GB of internal memory and is the nexus of the 16 gb,

Now I do factory reset and have a couple of minutes is not done, I hope it will,not yet finished
[Nexus 4 General] pincher65:
the wire and USB port should at once try to be changed. wipe data should be done of settings of phone. wipe from recovery won't help
[Nexus 4 General] gogYCH:
Yes,I wipe data from phone,but now he's stuck in wipe

more than half an hour in order to wipe and nothing happens
[Nexus 4 General] pincher65:
Lock - unlock bootloader
[Nexus 4 General] gogYCH:
can not enable usb debugging,my nexus still wipe and restart repeatedly...
[Nexus 4 General] pincher65:
it is not necessary for flashing through fastboot. flash the full image again
[Nexus 4 General] gogYCH:
that, again flesh full image

and I succeeded, returned to factory settings

for half an hour its ok but so it restarted again and got stuck in the sign of Google

I do not know where I'm wrong...

Now I understood something,

After the restart, and after whom caught google logo, disconnect and conect battery and power on nexus 4, then works normally and so half an hour, and repeated ...

what would it be?
[Nexus 4 General] toanau:
I am curious what is the difference between this and the wug tool kit.
[Nexus 4 General] arffrhn:
This is where you do everything manually while the toolkit does everything for you automatically. But basically, the commands are the same.
[Nexus 4 General] yasink:
fastboot reboot-bootloader not working

Hello,

I've tried the instructions a few times for a friends phone. I have the stock rom on here except there is one little problem.

On the phone if I try: Settings -> Backup & Reset -> Factory Data Reset.

The phone turns off, and does not turn back on again (unless I do power + vol down, then power again when start is selected)

When following the instructions I noticed the same thing with fastboot reboot-bootloader.

In fact if the phone is powered off in anyway, it can only be booted by going into the bootloader first (power + vol down)

I've tried going into the stock recovery and doing both wipe options also.

Any help or point in the right direction would be appreciated.
[Nexus 4 General] gogYCH:
Very strange is that my Nexus 4 does not want to work at the factory ROM.

I tried all the factory ROMs versions 4.2.2 and 4.3 and 4.4.4,

any of them install and or get stuck in the boot, or the system rebooted, and after some time restart a couple of times and then it will no longer put up a system rather than stuck in the boot.

After re-flash rom and while the system boots up every time I have half the internal memory ... I found here in the forum instructions on how to solve a throw-in dd file and other files because it does not turn your phone to factory settings from the menu of nexus 4.

I tried to install and use fastboot commands, and NRT and Nexus 4 toolkit, there was no difference. Certainly I do step by step instructions, but unsuccessful .After when stuck in boot mode have two ways to flesh again,NRt dont work (FAILED <remote: bogus Chunk size for Chunk type Raw>),sem eror with nexus toolkit or with fastboot,but after the battery is removed and then put those mistakes no more...

1. First disconnect the battery for 1 minute and conect battery and then install the factory rom using NRT or Nexus toolkit ( After that methods rom will bi flash and will successfully boot but after a few minutes or even hours following restart a couple of times and will get stuck in the boot in an attempt to boot)

2. LGNPST method-every time successful,but I managed to find only 4.2 rom i tot format (bin) (that bin rom the older test version on my NEXUS good work,but it can not update to the newer Android and shows only 5.7 GB of internal memory)

After a lot of unsuccessful attempts flesh factory rom,and successful and those who are work well short period of time, until you get stuck, in boot I decided to flash rom caynongen 10.2.

And here two days back my nexus works without any error.

I wonder what the problem is, why factory rom not working on my NEXUS?

Is it possible to stay somewhere an old file that procedure flesh is not deleted, and working problems in new installations?

Nexus 4 has 25 partitions

that all partitions can be formatted fastboot command fastboot format partition,

I would like all the partitions manually reformat and re-flash the stock rom but I do not know what I format the -system, data, Cash, recovery, boot, radio, bootloader,

What about the other partitions?can also reformat other partition and whose ?

Sorry for my bad english, and thanks for answer on my questions!
[Nexus 4 General] arffrhn:
Install fastboot driver.

Go into bootloader.

Unlock bootloader.

Flash factory images.

All the things you need are in the OP.

Good luck. :)
[Nexus 4 General] Pichananas:
Dear all,

I am stuck with my Nexus 4, trying to flash a factory image.

I followed all the steps, tried with a mac and a windows computer, 3 different cables (including one stock cable).

I tried using a flash-all script, also flashed manually all partitions.

I also tried to first erase all partitions first, then start from the beginning.

I successfully passed all flash steps, and I also got the robot screen showing the install is processing on first reboot.

But after that, I keep being stuck on the Google loading screen.

I also of course tried the cache wipe and factory reset from the safe boot mode, but still stuck.

I am not highly skilled, and I start to feel desperate :)

Any suggestion?

Cheers,

Pichananas
[Nexus 4 General] CamoGeko:
How long did you wait for it to boot?
[Nexus 4 General] Pichananas:
I wait minimum 10 minutes, and up to 30 minutes.
[Nexus 4 General] puncha1580:
[MENTION=1631407]pichan[/MENTION]as: try installing the factory update for 4.2. Some nexus have an issue with factory updates from 4.3. I had the issue on 2 nexus 4s.... once you factory update to 4.2, update sequentially using OTA and report
[Nexus 4 General] Remember Your Name:
Thank you this guide was very helpful!

Sent from my Nexus 4
[Nexus 4 General] Pichananas:
Awesome, after trying with all version from 4.3 to 4.4.2, you finally gave the solution!

With the factory image 4.2.2 my phone has boot at first flash.

Thanks a lot, hope it might help other peoples too.
[Nexus 4 General] Pichananas:
Hi all,

The problem keeps on happening after one or two days I use the phone, either I update to 4.3 or not.

The phone stops to receive mobile data (the reception bars are empty, then totally disappear).

After that, I always enter a boot loop if I reboot.

Any suggestion?
[Nexus 4 General] Pichananas:
My issue looks actually very similar to the one described in the thread quoted here (sorry for the long post quoted, but it shares lots of information I didn't, lack of technical knowledge for now... :)

Thank you for your support!
[Nexus 4 General] RASTAVIPER:
Just a suggestion, but maybe you could flash a different radio and see if there is any change?

From here

http://xdaforums.com/showthread.php?t=2087227

Unleashed from Onda v957m on TDT
[Nexus 4 General] Pichananas:
Thanks, I will try.

Quick n00b question: to do so, can I just flash the new radio then reboot-bootloader?

Or do I have to flash all partitions manually?

Many thanks
[Nexus 4 General] CamoGeko:
Just flash and reboot.

You can do fastboot erase cache if you really want.
[Nexus 4 General] puncha1580:
[MENTION=1631407]pichan[/MENTION]as if in case the radio update causes similar issues, which I'm kinda sure, will... please follow this guide.

Be very careful, while following this guide. One miss and you risk getting bricked. As I said earlier, this issue affects some nexus 4s, not all. Cuz I've seen 2 that have faced this and about 5 that don't. All rooted, and currently on 4.4.4. But whenever there's an update, this recurs sometimes on those 2.
[Nexus 4 General] Pichananas:
[MENTION=4207667]puncha1580[/MENTION], sorry, what guide are you talking about? :)

The radio flash indeed doesn't solved the issue, and for some made it worst (lost a wifi connectivity).
[Nexus 4 General] puncha1580:
Hey really sorry, this is the link http://xdaforums.com/showthread.php?t=2347060
[Nexus 4 General] Pichananas:
Thanks, I will try this as last chance and keep you posted of the result.

In the mean time, I bought a Nexus 5, and used the stock cable to flash the stock ROM 4.4 on my broken Nexus 4, I finally could boot after a looooong time (I left it booting over night), but Base-band is still unknown.

The wifi works, only the mobile network is not recognised, and no reaction from the phone when I plug/unplug the SIM card (I tried 2 different ones to be sure).
[Nexus 4 General] Lownita:
Hi

Does the phone to be plugged into the pc when installing the fastroot/adb drivers? And what is the difference between fastboot and adb mode? I know that vol up+down + power boots into fastboot mode. But how do I boot into adb?

Thanks!!!
[Nexus 4 General] efrant:
Yes, to install the fastboot part of the driver, you need to have the phone booted in fastboot mode and plugged in to the PC. To install the ADB part of the driver, your device needs to be either a) booted in a custom recovery like CWM or TWRP; or b) booted normally with USB Debugging enabled.
[Nexus 4 General] 8-bit_Infidel:
Hey all,

My fist post (a bit daunting).

I got my Nexus 4 the other day after a getting root I restarted it and it has since not got back into android.

It's stuck on a boot loop either the Nexus logo or the Google screen,

Do I need to get the stock 4.2 ROM?

If so how do i get it?

It's no longer on the google.dev page

I really want to get this thing going again any help would be much appreciated.
[Nexus 4 General] Lownita:
Hi

I got a question regarding file extension of the factory image.

http://goo.im/devs/mskip/stock/occam this is .tar

http://www.randomphantasmagoria.com/firmware/nexus-4/occam/ this is .tgz (which contains the .tar)

Does it matter which one to flash?

Thanks!!
[Nexus 4 General] efrant:
Not sure why you are getting a bootloop. Maybe try a factory reset from recovery before you do anything else. That may sold your issue.

As for the stock images, there are two links in the first post for the images: Google's dev page and oldblue910's blog...

I have never used a toolkit, so I can't tell you what is in mskip's images. If you have any questions related to that, please post in his toolkit thread, not here. I have provide two links in the first post to the factory image: Google's dev page or oldblue910's blog. Why would you look elsewhere?
[Nexus 4 General] 8-bit_Infidel:
uomfwe jan.

Thank you so much, I have no idea why I didn't see that, I was on the net for hours, lol

Again can't thank you enough!
[Nexus 4 General] Doggonit:
I can't flash the bootloader? I am on a Mac, and I downloaded the attached files and the stock files from the archive that someone runs (from your link). I extracted all the files into the same folder as instructed using Keka (similar to 7zip but for Mac). I also unzipped the archive inside the stock ROM folder.

So all my files were in one place, I went to the directory in the terminal that all the files are located in. I entered bootloader mode, and successfully unlocked the bootloader. Then I rebooted the bootloader. So now I am up to step 4. of part D. I want to complete step 5, but I cannot. I tried to flash the bootloader but I get this error message:

What gives?

EDITED: Fixed!

Never mind, I'm an idiot. I need to type (correctly): ./fastboot flash bootloader bootloader-mako-makoz10l.img

I forgot the extra bootloader in red! :eek:
[Nexus 4 General] Doggonit:
In part E 3 you tell us to download SuperSU (version 0.98?) to /sdcard. Where is /sdcard? There is no SD Card in the Nexus 4 so do I make this directory somehow somewhere? I don't follow this part of the instructions at all.

Are your rooting instructions correct if I just got the phone and completed part D? Other posts talk about turning on USB Debugging by hitting something 7 times in a menu?
[Nexus 4 General] 3rdstring:
/sdcard is a symlink (to /data/media/0) if your using MTP this is the root folder you see when you connect your phone to your PC. You have to go to Settings >> About phone & tap "Build number" 7 times to activate the Devloper Options menu in settings, this is where you would turn on USB debugging. You need that option on if you want use adb
[Nexus 4 General] efrant:
Do you not have a folder called /sdcard? I do. It should be a symlink to /data/media/0. Put it in there if you can't find /sdcard

In any case, it doesn't matter where you put the SuperSU zip file, as long as you now where it is, and the custom recovery can access it.

EDIT: Ninja'd by 3rdstring!

Yes.

You do not need to turn on USB Debugging to follow any of the steps in this how-to.

EDIT: Actually, it depends on how you get the SuperSU file on your device. If you want to do it while booted in Android and use ADB, then yes, you would need USB Debugging enabled. If you use MTP, then no. If you use ADB via recovery, then no (which is what I assumed in this guide).
[Nexus 4 General] Doggonit:
Ah, I think I am starting to understand this. I am using a Mac, so I don't use ADB. So when I plug in the phone, the folder that automatically appears via the Android File Transfer (MTP) program is /sdcard? I see this when I plug in the phone:

So I just drop the SuperSU zip file right there in the root of that folder?

Edited to add:

Okay, I dropped the file in the folder that come up, booted back into the bootloader, followed all the instructions in part E, and successfully found the file in TWRP, and then I used joeykrim's Root Checker app to confirm that the device is rooted. I think that did the trick. It wasn't quite as easy as I thought it would be, but it also wasn't that difficult. I guess if I had done it on a PC it would've been obvious that the main folder that appears when you connect via MTP is /sdcard but on a Mac that distinction isn't really clear.