yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] spicediablo:
I think should be this sequence, unlock bootloader(d1-d3), flash custom recovery(e1-e8), then flash your kernel.

To root yr device, you can follow instructions on section e. Replace fastboot boot customrecovery.img command with fastboot flash recovery customrecovery.img to flash custom recovery

Kernel flash method depends on what type of kernel file you have. If it is img file, you need to flash it using fastboot. If it is zip file, you can flash it using your custom recovery.

Sent from Mako⁴
[Nexus 4 General] TecQuality:
sorry if already asked: but after donwloaded the occam file from google i got 7 files, what should do now?
[Nexus 4 General] thephantom:
Follow letter C from the first post
[Nexus 4 General] TecQuality:
i forgot that the other files are unnecessary ... :) yes i've 6 .img files :p
[Nexus 4 General] NamNamNom:
I think you misunderstanded me. I want to unlock my bootloader, reflash the stock system recovery etc. Then flash custom recovery and supersu and lastly the kernel. But can i do this when i have a locked bootloader, stock rom and a custom recovery that doesnt work(cuz i have no root)??
[Nexus 4 General] spicediablo:
You already have stock rom, just reflash the custom recovery as your previous one doesn't work. Before you reflash, unlock your bootloader first

I don't think it is necessary to flash stock recovery. You can root once you have custom recovery

Sent from Mako⁴
[Nexus 4 General] spaceman860:
You have to unlock your bootloader which will wipe your device including the sdcard then flash custom recovery using fast boot then flash the su.zip in recovery

Sent from my Nexus 4
[Nexus 4 General] NamNamNom:
Thanks guys!
[Nexus 4 General] mubby93:
This is my second nexus. I used to have the nexus one and I remember that after unlocking the bootloader there was a lock on the bootscreen even after returning to stock. Does this have the lock on the bootscreen after returning to stock? I just want to make sure in case I need to RMA.
[Nexus 4 General] spaceman860:
Unlike the nexus one you can relock the bootloader after returning to stock for warranty

Sent from my Nexus 4
[Nexus 4 General] mubby93:
Thank You.

Also, I have been reading allover but no one has a definitive procedure but I just want to confirm. As of now there is no possible way to just obtain root on the stock rom without wiping everything? I just want root for adaway, I don't want roms or anything.
[Nexus 4 General] spicediablo:
Rooting requires you to unlock the bootloader. Unlocking bootloader will wipe everything. No alternative for that AFAIK

Sent from Mako⁴
[Nexus 4 General] mubby93:
Thank you

Final Question: When Key Lime Pie comes out, do I unroot, upgrade, root again or can I upgrade ota and still keep root?
[Nexus 4 General] spaceman860:
If you use the stock recovery you will lose root but if you use twrp recovery it will protect root

Sent from my Nexus 7
[Nexus 4 General] spicediablo:
If you are only rooted, then you qualify for

OTA upgrade. After upgrade to Klp, you will have to root again.

If you change your kernel or rom, you are not qualified for OTA upgrade.

Sent from Mako⁴
[Nexus 4 General] mubby93:
To straighten things out, if I restore to stock after changing my kernel, I would qualify again for OTA, right?
[Nexus 4 General] spaceman860:
Yes

Sent from my Nexus 4
[Nexus 4 General] spicediablo:
Yes but rather than restoring, it would be easier to flash the new stock ROM . My 2 cents

Sent from Mako⁴
[Nexus 4 General] mubby93:
Great! I'll root tomorrow then! Thanks guys

And ur idea is good...I'll just flash klp in twrp after release.
[Nexus 4 General] spicediablo:
Good luck!

Sent from Mako⁴
[Nexus 4 General] spaceman860:
You can't flash klp update in twrp unless your on stock

Sent from my Nexus 4
[Nexus 4 General] spicediablo:
He is on stock, no?

Sent from Mako⁴
[Nexus 4 General] spaceman860:
Yea but he said that if he was to switch kernels would he have to return to stock

Sent from my Nexus 4
[Nexus 4 General] spicediablo:
Only if he wants OTA. Else he could just flash klp using fastboot?

Sent from Mako⁴
[Nexus 4 General] spaceman860:
With fastboot yes with twrp no

Sent from my Nexus 4
[Nexus 4 General] mubby93:
I want to install franco's kernel and keep stock rom. I also wanna update to klp.

So I would install via fastboot? Would this delete any data? (I have never done this step, EVER)
[Nexus 4 General] El Daddy:
As long as you flash the stock kernel back and replace the system files franco modifies the OTA will flash fine.

Look at this thread to see what needs to be done to accept an OTA. http://xdaforums.com/showthread.php?t=2145848
[Nexus 4 General] eefo:
okay so first of all thanks alot for your brief tutorial.

i have managed to flash my devices back to stock as i was getting bluish colored screen on custom roms i dont know why :/

but anyways, the reason why i am commenting is that i didn't get it why play.google.com giving me incompatibility issue :/

and it says with my T-mobile nexus 4, but it's not T-mobile one.

even though i can install apps without any issue but still its kinda annoying :$
[Nexus 4 General] El Daddy:
Is your SIM T-Mobile? Because that's what its displaying, your carrier.
[Nexus 4 General] eefo:
nope its virgin mobile :/

play store isn't showing this statement, only when i install any app via laptop.
[Nexus 4 General] anshumandash:
I wanted to unlock boot loader and flash CWM. So I followed the steps and did not flash the factory images. I followed the steps as mentioned. But after flashing CWM, when I reboot, it is stuck to to boot animation "X". It's not getting in to the Stock ROM. What can I do now?
[Nexus 4 General] spicediablo:
If you follow the instructions, it should work. Anyway, I think factory reset is the only way now

Sent from Mako⁴
[Nexus 4 General] anshumandash:
So factory reset from recovery should work, Right? I am trying that.

Ohh great, it booted. Thanks.

One more question, is there a way to mount storage from recovery so that files can be copied? It works on my Nexus S. But when I select mount /sdcard on N4, it doesn't work. I am on latest CWM 6.0.3.1. I tried both touch and non touch.
[Nexus 4 General] spicediablo:
I think it doesn't work for nexus 4 due to no external sd card. I have tried mounting sd card and it doesn't work too. No idea what is wrong...

Sent from Mako⁴
[Nexus 4 General] anshumandash:
Even Nexus S doesn't have sd card support. But in Nexus S CWM, the option says mount /USB Storage. And it works perfectly. But in N4, the USB storage mount option isn't present and there isn't any sd card support on the phone. I think this could be the reason.
[Nexus 4 General] spicediablo:
Perhaps need to wait for new version from CWM to fix the issue

Sent from Mako⁴
[Nexus 4 General] efrant:
There is no way to mount storage from recovery in the way that you guys are suggesting on the N4. It works on the NS, but that is because the NS's internal storage is separate and the device supported UMS mode. On the N4, the "/sdcard" is part of the data partition (it is actually /data/media/0), and the device does not support UMS mode.

That being said, you can still use "adb push" and "adb pull" to copy files back and forth while in recovery.
[Nexus 4 General] spicediablo:
The expert has spoken, though I can only understand half. Haha

Sent from Mako⁴
[Nexus 4 General] anshumandash:
I see. I actually saw the /media/0 partition. Next time I will use ADB to push files while in recovery. Thank you so much.
[Nexus 4 General] ermacwins:
My phone seems buggered and need to flash the factory image. Will this delete my storage?
[Nexus 4 General] spaceman860:
If you flash the userdata.IMG it will reread the op

Sent from my Nexus 4
[Nexus 4 General] ermacwins:
Ok, this is my situation. I was on cm-10.1-20130501-NIGHTLY-mako and decided to try AOKP. Flashed it stuck on google logo. Tried restoring nandroid but it fails. Any other rom I flash it fails, twrp says unable to mount system and cwm says bad even with the same cm zip and newest cm. Funnily aokp flashes but gets stuck on logo.

Now what can I do, was thinking flashing factory image but cant afford to lose storage files

Is there anyway I can access my sdcard, if so then I can flash factory image
[Nexus 4 General] spaceman860:
Fastboot flash system system.IMG

Fastboot flash boot boot.IMG

Then go into twrp recovery factory reset it should boot if not your going to have to flash all the imgs

Edit are you doing a factory reset before trying to flash a rom

Sent from my Nexus 4
[Nexus 4 General] ermacwins:
Ok trying this.

Yes I am doing factory reset before flashing roms
[Nexus 4 General] kstano83:
I want to return to stock and I thought I would flash the 4.2 JOP40C MAKOZ10L 2.0.1700.33 from here and then get an update to 4.2.2 oficially. I'm still on .33 baseband and MAKOZ10L bootloader and I want my phone to be updated through OTA to make sure everything is done correctly . Do you think it is pointless and I should flash the latest image straight away?
[Nexus 4 General] Thibaultvw:
Flash the 4.2.2 version. It is the same as in the OTA.
[Nexus 4 General] DRatJr:
Whenever I try to install the drivers, it comes up that a hash file is invalid or something. I've downloaded multiple times and confirmed MD5 sums. Everything lines up. Just wont install. Anyone know why?
[Nexus 4 General] Danny.ns:
Hi!

Just wanted to say that I used this guide to try and get an understanding on how things work and I indeed feel like I now have a better idea on what is going. I simply flashed the stock 4.2.2 image, while rooting, but keeping stock recovery (happy with stock 4.2.2 for now, but wanted to try franco's kernel).

Everything went smoothly apart from one thing, when using commands in the commandpromt, i noticed i was getting "FAILED - xxxx too many links" or something similair (very sorry for not taking note of the exact error). Found the "fix" on google which was simply to use another USB-port on the computer. The rest went supersmooth and according to the guide. :good:

Thanks for taking the time!
[Nexus 4 General] beenja:
I'm having a problem after installing franco kernel r134

my device dont turn on without being plug in some energy source, and if it is on some charge it dont boot the android, start the google logo, but turn off. Loose a partition? anything?

I press power button and volume - and plug into my computer it start in bootloader

What should i do to back to normal?
[Nexus 4 General] chrone:
post #1 will set you back to normal. :)

or you could only flash the system and boot images and leave your apps and data intact. need to root again afterward, though.
[Nexus 4 General] theprodigy85:
My Nexus 4 is currently rooted on the stock rom with the stock recovery. I am planning to RMA the device, but before I do, is there a simpler way of returning it to stock/unroot rather than going through all the steps in the OP?

---------- Post added at 05:34 PM ---------- Previous post was at 05:24 PM ----------

Actually, is it enough to use the "Full unroot" feature in SuperSU to unroot my device for sending back to google?
[Nexus 4 General] spaceman860:
That should work but you will have to relock the bootloader after

Sent from my Nexus 4
[Nexus 4 General] velozolano:
Nexus 4 noob question.

Hey guys, i am new on nexus world and i came from Galaxy S3 and i love my nexus better than S3 which is good phone too, my question is;

i am root with stock rom and custom recovery twrp also busy box, i will get OTA or i have to flash stock rom :( i know this a question that everyone keep repeating but i read the hold thread and i did not see anybody with same situation..

Thanks and advance.
[Nexus 4 General] spaceman860:
If you installed bust box in xbin then yes ota will install

Sent from my Nexus 4
[Nexus 4 General] azrash:
you will get OTA, however it won't be able to automatically install it for you if I am not mistaken. You have to download the zip file, and flash it in TWRP.

You may refer to the dedicated thread for OTA here

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

[INFO] Nexus OTA Help-Desk

Flowed from my Nexus⁴
[Nexus 4 General] anshumandash:
OTA update will fail. Busy box modifies system files and you may not be able to update with a custom recovery. The best way would be to flash factory images just before the update starts rolling.

Sent from my Nexus 4
[Nexus 4 General] velozolano:
Yes i have busy box Xbin installed, great you made my day.. Thanks a lot

---------- Post added at 01:40 PM ---------- Previous post was at 01:37 PM ----------

Thanks, this help a lot
[Nexus 4 General] spaceman860:
If you install busy box in xbin it won't mess with system files.

You can be on stock with no mods unlocked rooted with a custom recovery and you will get the ota update and it will install fine.

The ota update link will be posted here before you get on your device so it's good to have a custom recovery so you can just flash it and it will also protect you from losing root and custom recovery

Sent from my Nexus 4
[Nexus 4 General] velozolano:
the flash factory images is the actually the zip rom right?

---------- Post added at 01:48 PM ---------- Previous post was at 01:44 PM ----------

You guys are amazing with your support by the way also i am unlock too.
[Nexus 4 General] spaceman860:
I said if your unlocked your fine. If you add mods or remove system apps or delete system files then you will have to flash the system.IMG using fastboot so the ota will install.

Sent from my Nexus 4
[Nexus 4 General] velozolano:
The only things that i removed in the system app are apks that came with the phone like magazine, book & other, the only mod that i did is the battery theme which is actually the system ui but i did a backup the original just in case i want put original theme back.

I think i am good to go in OTA without flashing :laugh:

Thanks Guys :good:...
[Nexus 4 General] spaceman860:
You'll have to put the apks back in system and undo the mod

Sent from my Nexus 4
[Nexus 4 General] velozolano:
that really matters to install magazine, books and I don't remember the useless apk I removed to have or get the OTA, I know that system ui need to be stock but useless apk make that the differents. Thanks

Wow
[Nexus 4 General] spaceman860:
[MENTION=1566190]efrant[/MENTION] have you seen this

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

[Security breach?] Your data is NOT SAFE! Simple bypass of data wipe when unlocking

Sent from my Nexus 4
[Nexus 4 General] efrant:
Thanks. I hadn't seen that thread before, but i have heard of people mentioning that their data didn't wipe when unlocking the bootloader on the N4. (Same thing happened on some GNex devices.)

If people are worried about sensitive data on their devices falling into the wrong hands, there's no other way to secure it other than encryption.
[Nexus 4 General] spaceman860:
Never did find out why some GN didn't get wiped when unlocked. At least we now have a way to unlock without it wiping data

Sent from my Nexus 4
[Nexus 4 General] bobo1337:
so i have one problem when i type in command prompt "fastboot devices" it says 'fastboot devices' is not recognizes as an internal or external command.... (i am noob,please help me)
[Nexus 4 General] 3rdstring:
You have to have the fastboot.exe file in the same directory you are in with the command prompt.

:edit: check Letter C step 8 in the OP
[Nexus 4 General] bobo1337:
but there is no fastboot.exe in folder :confused: (i need to open command propt in direcory i extract facorty image right?) thanks
[Nexus 4 General] spaceman860:
In the first post of this thread there is a platform tools zip download it and extract it and place it In the folder with the imgs

Sent from my Nexus 4
[Nexus 4 General] spicediablo:
Fast boot is in attachment at the end of op

Sent from Mako⁴
[Nexus 4 General] spaceman860:
That's what I said :rolleyes:

Sent from my Nexus 4
[Nexus 4 General] bobo1337:
Thank you a LOT i didn't even see that...-.- but you helpt me and everything works perfect! thanks again :D
[Nexus 4 General] spicediablo:
Oops, didn't meant to double post..

Sent from Mako⁴
[Nexus 4 General] bozint:
I'm sorry if this has already been posted.

I just bought the N4, coming from a GNex. Fastboot on the GNex was Vol Up + Vol Down + Power, the N4's combination is Vol Down + Power? The thing is I want to unlock the bootloader, but can't get into fastboot. Each time the phone boots normally. Just tried on the GNex, all is well.

I have the Universal Naked Driver installed, and the phone is recognized as ADB device.

---------- Post added at 06:05 PM ---------- Previous post was at 05:55 PM ----------

NVM, I'm in. Thanks for the thread again efrant. It's been very useful for the GNex, and I'm sure it will now when dealing with my N4.
[Nexus 4 General] Thibaultvw:
Had trouble with getting in fastboot as well the first time, so this is what I didnt know: you have to hold vol down + power button untill you come on the bootloader screen.

Happy flashing ;)
[Nexus 4 General] bozint:
Did it like 5-6 times and was bummed that it didn't go into fastboot. Checked out a YouTube video and noticed I had to hold it even after the vibration. Thanks for the reply nonetheless.
[Nexus 4 General] androidfoshizzle:
Downloaded the android factory image and tried using 7-zip to extract but says.."The system cannot find the file specified"
[Nexus 4 General] androidfoshizzle:
Im only getting this menu when doing the 7 zip extract

Edit: are these the 6 .img files i need in the folder?

Should i remove the .tar from the folder so its just the six .img's?
[Nexus 4 General] El Daddy:
Yes they are.
[Nexus 4 General] eluspo:
Question. Can i flash supersu without unlocking bootloader and just by going into stock recovery and flash the supersu zip file?
[Nexus 4 General] spaceman860:
No

Sent from my Nexus 4
[Nexus 4 General] eluspo:
Thanks for the response. Seems like i will have to unlock bootloader. Is there a way to unlock it via an app?
[Nexus 4 General] spaceman860:
No follow this guide or this one http://xdaforums.com/showthread.php?t=2266654

Nexus 4 Guide-Unlock Bootloader, Root, Install Custom Recoveries & Custom ROMs/Kernel

Sent from my Nexus 4
[Nexus 4 General] eluspo:
Can i enter stock recovery without unlocking bootloader. I tried but it seems i cant, just wanna confirm this.
[Nexus 4 General] efrant:
Yes you can. But you can't flash anything (unsigned) in the stock recovery.
[Nexus 4 General] eluspo:
Can you tell me how? Coz it seems when i select recovery mode it gives me an android with a "!" sign. Is there a key combination?
[Nexus 4 General] efrant:
That is the splash screen for the stock recovery.

To access the menu, hold the power button and press volume up (as per the first post).
[Nexus 4 General] eluspo:
How long do i have to press it? Thanks a lot for the help :)

The recovery splash screen says "no command".
[Nexus 4 General] spaceman860:
Press power then vol up then release both buttons menu will show up

Sent from my Nexus 4
[Nexus 4 General] locsplitter:
Thank you very much for this post.

I was unable to properly use the microphone in 4.2.2 (the microphone would not pick up during calls, voice search, voice texting, etc) and the only way someone could hear me was through the use of the speakerphone.

I flashed everything back to 4.2.1 with your guide, and everything works normally again! :victory:
[Nexus 4 General] heyplaynow:
:D

Flashed, unlocked and rooted!!! fantastic!!! :) your work is great! :laugh:
[Nexus 4 General] siravarice:
When I type in:

./fastboot-mac devices

My mac won't recognise that the phone is connected. What should I do?
[Nexus 4 General] sambolero:
Hi, I have 2 questions

1. If I'm using PA rom and want to return to stock rom, is it OK to repeat the steps from Part C to E in thread #1 ?

2. if I'm using stock rom and have rooted, and want to return to unroot stock, is it OK to repeat the steps of Part C to E in case I don't want to follow the steps in thread #2?
[Nexus 4 General] sambolero:
can anyone help?
[Nexus 4 General] efrant:
Parts C & D only. Part E is for root.

If you are already stock and just want to remove root, all you have to do is just flash the system.img file as per the instructions in part D.
[Nexus 4 General] anwedr:
[MENTION=633892]ef[/MENTION]rant If I want to flash to a different rom, is it preferred to format data? Factory reset / wipe data is preferred, but what about formatting the entire device? Is it necessary?
[Nexus 4 General] Agnes.m:
No. Doing a factory reset is ok.

Remember to wipe cache and dalvik cache after flashing:)

Sent from my Nexus 4
[Nexus 4 General] El Daddy:
No need to format everything, Just a data and cache wipe is fine.
[Nexus 4 General] pGuerrerox:
just did this for the love of art! i have been using the toolkit... but this was nice!!

great guide.. i didnt had the bootloop issue.

I did get only 8GB,, fix by factory reset from within the settings.
[Nexus 4 General] Holcomb227:
Doesn't google give you a flash-all.bat file with the stock image? Why can't we just click that and have it do its thing?
[Nexus 4 General] BillXia:
Thank you for sharing!

谢谢分享！
[Nexus 4 General] aanonymoushuman:
Can someone give me a link to just the stock recovery? I deleted it by accident and now don't want to download the whole file again, Thank you!
[Nexus 4 General] spaceman860:
It was in the 2nd post

http://d-h.st/jSl

Sent from my Nexus 4
[Nexus 4 General] vipergt11:
for mac devices

I had same issue on my mac. What I did is I put the 6 img files into the RootNexus4 file found in the tutorial on how to root on a mac found here http://www.androidrootz.com/2012/11/how-to-root-nexus-4-on-mac.html

Then everything work like a charm. I did have to facory reset with stock recovery to stop the bootloop.

I think for some mac it needs adb and fastboot file from sdk in order to write to the nexus and I think that is what the RootNexus4 file has. Please correct if I am wrong. I am not hard core programer. Thank you for your tutorial it help a lot.
[Nexus 4 General] gencka:
I wanted to flash a rom, but accidentally I formatted everything system, sd card, etc. Now I cant even boot. But problem is also I didn't have usb debugging enabled. Can someone help me? What can I don now?
[Nexus 4 General] chrone:
If you can enter the bootloader, you don't need to enable usb debugging enabled. Use fastboot to flash factory image as posted on post #1. Good luck! :)

Sent from my Nexus 4
[Nexus 4 General] spaceman860:
Go to into recovery and push a ROM to the phone and flash it

adb push rom.zip /sdcard/

If that doesn't work use fastboot and flash the system and boot imgs from Google

fastboot flash system system.img

fastboot flash boot boot.img

Then reboot

Sent from my Nexus 4
[Nexus 4 General] Pipusz:
I've used this guide before, but now, my phone is acting weirdo. The cache erasing command isn't working, so I tried to enter to the stock recovery. But it doesn't enter. Instead of giving the menu, it reboots and of course hangs at the X logo, because I wasn't able to wipe things. Any ideas on what to try next?

Edit: Apparently solved, platform tools must have been messed up.
[Nexus 4 General] J. Clarkson:
Could you explain to me what the 'radio' is please? Never heard of this, I suppose the 'flash' is the image that I download from here https://developers.google.com/android/nexus/images, then what is 'radio?

5) Flash the bootloader: fastboot flash bootloader bootloader-mako-makoz10o.img (or whatever the name of the bootloader image that you downloaded).

7) Flash the radio: fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.48.img (or whatever the name is of the radio image that you downloaded).
[Nexus 4 General] J. Clarkson:
^ Silly question, I've solved that now..

After I have unrooted my Nexus 4, what else will I need to do to make as if it came out of the new box in terms of software ect..?
[Nexus 4 General] chrone:
Factory reset will do you just fine. :)

Sent from my Nexus 4