yashsingh1/xdaforums huggingface dataset:
[Nexus 5 General] MrBradPD:
Hey I pretty much just created my account right now to say Thank you. And also to see if I can figure out what happened with my Nexus 5.

Here is my story. I had unlocked my bootloader and was running Cataclysm Rom (great ROM by the way) for about a week. Then my issue happened while I was at work not even using my phone, it was just in my pocket. I feel it do its little vibrate and it reboots. I think ok, not a huge deal. But then it was as it would not boot up, so I forced it to shut off till I got home and could figure something out.

So, I get home and mess with it. Try to start it and it would either freeze at the boot logo, or the screen would go black but still be on. At this point I figured it just need a good reset, so I thought I would try another ROM. So I downloaded Purity Rom, doing full wipe and everything. But same problem occurred. It could not process past the boot logo, black screen, sometimes the boot logo would have a flashing white light go through it.

So I figured this thing must have somehow broke, either by my doing or a hardware failure. Then I found this. Tried Option 1 and it didn't work correct for whatever reason. Then I moved to option 2 and it worked without any issues (the commands anyway). I didn't relock my bootloader or anything at this point, just wanted to see if stock would work. It did not, same issues as above. But sometimes I could get to language selection and wifi and then almost every google service would crash until the phone locked up or shut off then back to square one! So I used option 2 a bunch more times with same results. Thought it was done for.

Still able to go into recovery I adb pushed the tamper flag reset/bootloader lock script. And then with booting TWRP with fastboot boot I was able to use it without issue. And it worked.

So then I go to the google contact us screen because I think my phone is ruined and I obviously want to send it back. Then I figure what the hell I'm going to push the power button 1 more time and see what happens. It worked! I booted up and updated everything. Even did a few restarts. I have no idea how it just started working after relocking. I pushed some random buttons in TWRP like fix permissions, but from my understanding it just failed to function from what it output on the screen.

Anyone know why running the relock/tamper reset would make my phone work?

Now I'm scared to do anything so it's going to remain stock for a bit (will miss the cataclysm options for a bit I guess). But hopefully I wont have to be without my phone for 2 days again (you realize how addicted you are to having it with you).

Anyway thanks to abaaaabbbb63 and osm0sis and also the Google Search engine for eliminating any annoying questions I would have asked through the process.

Ps. I am in no way putting down either Cataclysm or Purity ROM. Something obviously occurred on my end as Cataclysm functioned flawlessly for about a week or more.
[Nexus 5 General] samersh72:
system files interfered with each others which caused instability and crashed some system apps.

i guess resetting tamper and locking the bootloader did nothing.

i bet that you didnt wipe data and cache after flashing stock images at first, that caused stopping some system apps and if you checked your baseband info at that moment you will notice that it is "unknown".

pretty sure that wiping data with stock recovery once you flashed stock images had fix all the issues

always do a clean install for custom rom, including wiping system before flashing.

erasing system with fastboot (fastboot erase system) before flashing stock image is also important.
[Nexus 5 General] mysticfrog:
thanks for this thread.. had some issues with the bootloader last night... this really helped me out alot.. thanks again... coming from a note 3 (t mobile) i put to much into the process of rooting the device... anyhow your awesome brother...:good::good:
[Nexus 5 General] DefTaker:
I've already hit the 'Thanks' button but wanted to also reply via post and say thank you to abaaaabbbb63 for putting this up here.

I've been running stock (bootloader unlocked, TWRP, and rooted) and had flashed the mod for advanced power menu (APM). This worked great until I discovered that the 'Hot Boot' option didn't work. It was suggested that I install 'Busybox' so I did...and then allowed it to do its thing and voila! 'Hot Boot' worked. <--Except now the 'Boot into Recovery' and 'Boot into Bootloader' options didn't. :(

So I ended up finding Xposed framework & Gravitybox which would get me the APM that I was looking for. While flashing these two items worked great, I came to realize that whatever I had allowed Busybox to change had remained and was still borking up my system here and there.

So I went back and performed an earlier system restore from a nandroid backup I had made thinking that everything would be cleared out - even performed a data wipe, dalvik-cache wipe, cache-wipe and factory reset to be sure.

Nope...still had issues. :(

Until I found this thread! I restored the factory image using Option #1 (no issues whatsoever using Windows 8.1 -- ok, I take that back...I stupidly tried to run the extracted files without moving them to "platform-tools" folder first so my Android device wasn't recognized but after realizing what my mistake was and moving the files to the correct location, NO issues!).

Now everything is working perfectly! (Of course, I may just end up installing a different custom ROM later but I really want to stick with stock for now.)

Thank you again abaaaabbbb63! :good:
[Nexus 5 General] vandoor:
Thanks for this!
[Nexus 5 General] gidgiddonihah:
Tried searching for this but I don't see anything that covered this.

C:\Users\Tyson\Desktop\android-sdk-windows\platform-tools>fastboot oem device-in

fo

...

(bootloader) Device tampered: false

(bootloader) Device unlocked: false

(bootloader) off-mode-charge: true

OKAY [ 0.004s]

finished. total time: 0.004s

C:\Users\Tyson\Desktop\android-sdk-windows\platform-tools>

What does the off-mode-charge do? From what I read compared to my results I can assume Google will think I never touched it but I haven't found anything that mentions what off-mode-charge is. Anyone know?
[Nexus 5 General] abaaaabbbb63:
It's charging while your phone is off.
[Nexus 5 General] gidgiddonihah:
Much appreciated. I thought it was something along those lines but wasn't sure.
[Nexus 5 General] radar155:
i followed this guide but i have a problem: my nexus 5 (32gb) , after the procedure, shows only 26.76gb of total memory !!

i don't know if is important, but before this procedure it was installed the original cyanogenmod rom (using the cyanogen tool).

can anyone help me? i think 27,76 is not a normal total memory value.

p.s (avaialbe memory is 26,48)
[Nexus 5 General] remixkilla:
When I downloaded the file all I got was was just the factory image I don see those other files like in the op
[Nexus 5 General] EddyOS:
You have to extract it out until you get the individual files (Google went a bit overboard with the compression!!)
[Nexus 5 General] samersh72:
your total memory is right sir.
[Nexus 5 General] remixkilla:
Ok thank you
[Nexus 5 General] deserthi:
I tried flashing this twice. It worked both times but two things.

One is I get no stock recovery. I just get the little green android with a red triangle.

and Two I get no data. Using straight talk, put in two different apn's and no data.
[Nexus 5 General] samersh72:
Press volume up when you see the little green android to get into your stock recovery.

Flash cache image.

and then wipe data within recovery.
[Nexus 5 General] HunnyBearLewis:
Thanks for the guide, everything worked perfectly for me. :good:

If anyone out there uses Comodo Firewall, I'd suggest disabling Auto-Sandbox for 15 minutes as it sandboxed the .bat. I don't know if that matters at all since I had to restart the process (didn't have fastboot and adb setup to be used from anywhere in CMD) and it was marked safe for the second go.
[Nexus 5 General] ISDP:
I see a lot of users with a lot of problems, is this due to no experience with adb, fastboot and/or custom roms or is it because this is kind of a tricky method?

Also, I am from the Netherlands, does it matter what I flash onto my phone?
[Nexus 5 General] abaaaabbbb63:
It's due to driver and adb problems/ users not following the guide correctly or.. Hardware problems.

Doesn't matter where you are from. Factory images are not location dependent.
[Nexus 5 General] ISDP:
Are you sure about that? Because this phone is probably different from the USA version.

---------- Post added at 01:36 PM ---------- Previous post was at 01:34 PM ----------
[Nexus 5 General] jd1639:
Yes, he's sure about it
[Nexus 5 General] ISDP:
Okidokie, and this will return it to factory state right?
[Nexus 5 General] jd1639:
Yes it will
[Nexus 5 General] Flanarr:
Hello,

Thanks for this post. I just wished to know whether this process will also return to stock recovery from TWRP recovery image?
[Nexus 5 General] samersh72:
yes.
[Nexus 5 General] Flanarr:
Thank you
[Nexus 5 General] aavvaallooss:
2 advices:

1. Follow tutorials step bay step

2. Have Factory Images near in case anything goes bad
[Nexus 5 General] weiyin5210:
Very useful，thank you very much！

Sometimes just wiping the cache & data then the 32G can come back to 16G .
[Nexus 5 General] abaaaabbbb63:
Well.. Better be sure. And the second post makes sure that it fixes the problem.
[Nexus 5 General] Flanarr:
I still have SuperSU installed after unrooting. Is there a way to get rid of it?
[Nexus 5 General] jd1639:
How did you unroot? Did you flash back to stock?
[Nexus 5 General] Flanarr:
I followed the steps given under "Method 1" of this thread's 1st post
[Nexus 5 General] Vercion3:
Try method 2
[Nexus 5 General] jd1639:
Did you do the factory reset in the stock recovery?
[Nexus 5 General] Flanarr:
Yes I did
[Nexus 5 General] jd1639:
That's weird, do you still have the supersu app? I'd delete it in settings, apps
[Nexus 5 General] Flanarr:
I originally had SuperSU installer which kept asking me to download it through a notification. (There was no way to uninstall it)

Then I just updated it to get rid of the notification, and it was still the same. I will try to do another factory wipe.
[Nexus 5 General] jd1639:
You're doing the wipe in the stock recovery, right? Not a custom recovery? Did you install a custom recovery?
[Nexus 5 General] Flanarr:
When I rooted my phone, I installed TWRP. But after that I did exactly as Method 1 told me to.

The recovery mode shows a small android logo now
[Nexus 5 General] jd1639:
Ok, that's the stock recovery. A factory reset in there should wipe your entire device and get rid of all apps
[Nexus 5 General] Flanarr:
I just did one. Unfortunately it didnt.

I should mention that I also tried to set my tamper flag to false, which required me to boot from TWRP
[Nexus 5 General] jd1639:
Do you have twrp installed now?
[Nexus 5 General] Flanarr:
I dont think so. The Recovery mode takes me to the small Android thing.
[Nexus 5 General] jd1639:
All right, I'm not sure why supersu would still be on your phone, it shouldn't be. I'm assuming you're trying to get your phone back into a like new condition. I'd try to flash the flash-all.bat file again in method #1 of the op. As an alternate you could also try to flash just the userdata.img on method #2. But the flash-all is easier
[Nexus 5 General] Flanarr:
Ah, I wanted to have that as my last option. But I will do that :good:

Thank you :)
[Nexus 5 General] jd1639:
It will delete everything on your phone so proceed with caution
[Nexus 5 General] coolek33:
This is stock recovery. When U will see small Android press up+power for recovery options.
[Nexus 5 General] madhur_ahuja:
revert to stock kernel ?

Is there a way I can just revert to stock kernel ? I am running Franco Kernel.

I want to keep my phone rooted and don't want to wipe.
[Nexus 5 General] Vercion3:
It's in the OP in this forum

http://xdaforums.com/showthread.php?t=2518816
[Nexus 5 General] jejemc:
Hello and thank you for your tutorial abaaaabbbb63 this market very well and my nexus like new : Victoire:: Victoire:
[Nexus 5 General] fugn:
I followed this guide to the teeth and was able to lock the bootloader. I hope Google will honor the limited warranty on the phone, but as to the problem with my phone.

The screen stopped responding and the next day it started fading out and I could see vertical line streaks. I guess it's a problem with the touch screen digitizer
[Nexus 5 General] alamarco:
I have a question with regards to locking the bootloader in the final step.

The custom recovery, such as TWRP, is removed in the first steps following either method 1 or method 2. However, when locking the bootloader it is required to re-install TWRP. Does TWRP get removed when flashing Bootunlocker zip? I'm assuming it does, but I don't like making assumptions without verifying.

The reason I'm asking is I'm going to root my Nexus 5 this weekend and I'd like to understand the entire process. While I understand the rooting process, I want to make sure I understand the unrooting process. I like to be prepared and know everything I can before heading in. :)
[Nexus 5 General] jd1639:
When you flash the factory image it will remove twrp. You don't want to reinstall it, but only lock the boot loader
[Nexus 5 General] alamarco:
Okay, I think I get it now. If I'm understanding correctly, the following command will just boot the TWRP recovery and not actually install it on the device?

fastboot boot path/to/TWRP.img

Essentially it would be like booting your PC from a Linux Live CD. We are just booting into TWRP from the PC to install the boot unlocker, not actually installing TWRP again. I was under the wrong impression that the command above was installing TWRP again.
[Nexus 5 General] jd1639:
You are correct. It only boots into twrp, it does not install it.
[Nexus 5 General] alamarco:
Thank you! This has cleared up everything and it was exactly what I needed to know. Now I just wait for the weekend to begin. :)
[Nexus 5 General] hairy.areola:
Great tutorial, I am back on factory ROM.

However, I wish to root again. Upon booting into recovery mode I receive the Android robot logo with a triangular red box containing an exclamation mark. How do I proceed from here?

I apologize if this has been asked/answered before. I have searched but to no avail.

Thanks.
[Nexus 5 General] abaaaabbbb63:
In the General section, there's a rooting guide stuck at the top. Use it.
[Nexus 5 General] hairy.areola:
Yeah, there is, and I still have this problem that is not addressed by the rooting thread. I walked through the tutorial, but it does not account for phones with this error, only phones that are functioning in recovery mode.
[Nexus 5 General] abaaaabbbb63:
That's not an error. That's the stock recovery.

Unlock the bootloader (if not unlocked) , and use fastboot to flash a custom recovery image through fastboot using this command:

fastboot flash recovery recovery.img
[Nexus 5 General] iammodo:
Thank you for this, liked the flag changing tip.
[Nexus 5 General] leoncheong:
I think for method 2, after

fastboot erase cache

you need

fastboot flash cache cache.img

Is there a way to do factory reset without wipping SDcard?
[Nexus 5 General] Vercion3:
Nope

Factory reset wipes everything
[Nexus 5 General] Vercion3:
Factor reset wipes everything
[Nexus 5 General] Seadra:
Ok followed your guide and everything went soo smoothly. Thanks soooo much dude.

2 Things I am not able to understand. But it's kinda a long story (not so long)

Started with chainfire's root/unlock boodloader. Then I flashed CM 11. Then I flashed Franko's Kernal. And main purpose for that was to change the screen's colors and I did. I loved it all. I installed the aviate launcher as well and kept a wallpaper. Have fun. Now I thought, let's see if I can manage to get everything back to where it was. Followed your guide very carefully and with no problems at all, everything went smoothly. Now when I started using the phone , I noticed 2 things like I mentioned above , 1st aviate was installed (I didn't install anything) and 2nd My wallpaper was set up the same which I had when I installed the franko's kernal. How is that possible? I did flash the stock images you provided(the google's links). Am I missing anything? I did recheck to see if tamper flag thing was right or not and it was flase, so I guess I did everything right. How come I had the same wallpaper and avaite installed already?

sorry, if I am kinda being confused here.

edit: one more app found which was already installed: whatsapp. wow.
[Nexus 5 General] coolek33:
And the factory reset from stock recovery? Done?
[Nexus 5 General] jd1639:
You probably had your phone backed up to Google and when you set up your Google account it restored those.
[Nexus 5 General] Seadra:
Yes, but Google never did that last time, or last to last time. And google back up apps? since when :/ and even wallpaper? lol
[Nexus 5 General] jd1639:
Yes, out backups settings and wallpaper too
[Nexus 5 General] Oneireus:
Whenever I run flash-all.bat, it hangs on erasing Userdata. Like a good 5 to 10 minutes and nothing happens. Any idea how to proceed?
[Nexus 5 General] samersh72:
use second method.
[Nexus 5 General] Oneireus:
I did it, and Writing System began to hang.
[Nexus 5 General] samersh72:
erase system, recovery, cache, userdata, boot before flashing

fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
fastboot reboot-bootloader

then re-flash all stock images (method 2)

i suggest also to change usb port, cable
[Nexus 5 General] Oneireus:
erasing hangs on system. Everything else flashed and erased fine. This is a newer cable that detects the device. My other didn't. I am not sure how else to make that better.

EDIT - I changed the port. System erased, and now userdata hangs. This is frustrating.

EDIT 2 - Got the parts to erase. Still hangs on writing.

EDIT 3 - Changing ports got it to work. Thanks for the tip. Back to stock.

EDIT 4 - New issue: On reboot, it goes to the "Welcome" screen. When if I press the next arrow, it changes screens, then freezes and reboots. If I press nothing, it just freezes and reboots. Any ideas? I did a data and cache wipe, and that didn't help the problem.
[Nexus 5 General] samersh72:
device is fine

im pretty sure that the problem is with usb cable or pc
[Nexus 5 General] Oneireus:
Added in two more edits. Here they are:

EDIT 3 - Changing ports got it to work. Thanks for the tip. Back to stock.

EDIT 4 - New issue: On reboot, it goes to the "Welcome" screen. When if I press the next arrow, it changes screens, then freezes and reboots. If I press nothing, it just freezes and reboots. Any ideas? I did a data and cache wipe, and that didn't help the problem.

I am stuck on Edit 4. Phone is off for now, but I get to the "Just wait a sec" loading screen, then reboot.
[Nexus 5 General] samersh72:
hmmmm... try to reflash stock.

flash all stock images including "fastboot flash cache cache.img"

after finishing, boot directly from fastboot to recovery and wipe data and cache, reboot.

if not, i guess it is a hardware failure
[Nexus 5 General] Oneireus:
This did it. Thanks. Fully back to working stock. Unfortunately, that didn't fix my SIM card issue as T-Mobile suggested. Oh well.
[Nexus 5 General] tiestoycc:
Thanks for the tutorial!
[Nexus 5 General] detdett:
Since always ...
[Nexus 5 General] Seadra:
That's app settings only no? I have done this earlier and never had the wallpaper coming back to me. Anyways, if this is indeed the case, then awesome :)
[Nexus 5 General] maans88:
Ok so I put everything back to stock and unrooted the phone

but I can't change the tamper flag back to false

here's what I get...

maans-mbp:android me$ ./fastboot boot /Users/me/Desktop/TWRP.img

< waiting for device >

downloading 'boot.img'...

OKAY [ 0.472s]

booting...

FAILED (remote: not supported in locked device)

finished. total time: 0.572s

maans-mbp:android maanjoseph$

can someone help me please, I need to send the phone back to Google

---------- Post added at 07:57 PM ---------- Previous post was at 07:07 PM ----------

Disregard this message.

It was my mistake. Didn't unlock the bootloader. followed the steps, unlocked it and it worked.

honestly, you guys rock

gonna go have a beer now
[Nexus 5 General] mdpatterson:
unroot nexus 5 with a stock rom

are there any threads or posts on here that detail how to unroot a nexus 5 that has never flashed any custom rom? All I did for my nexus 5 was unlock the bootloader and gain root. I imagine unrooting will be pretty easy but all the guids Ive seen on here have instructions that incorporate getting rid of a custom rom. I just want to unroot and get my phone back to the way it was when I got it. Thanks
[Nexus 5 General] BirchBarlow:
"Unrooting" will not restore the phone to its factory condition. To restore it to factory condition, you need to do a factory flash...
[Nexus 5 General] mdpatterson:
So with that said then, I would need to follow the instructions at the beginning of this forum verbatim? Regardless of the fact that I never flashed a custom ROM and all I ever did was root my phone and unlock the boot loader?
[Nexus 5 General] abaaaabbbb63:
The system might be damaged from you playing with it.

So, use method 2, but only flash /system and /boot, and skip the factory reset part.
[Nexus 5 General] mdpatterson:
OK sweet so let me make sure I get this straight before I do it. I've only rooted my phone and unlocked the boot loader and have never replaced the stock ROM. So thus, what you are saying it's that I should simply utilize method 2 at the beginning of this post in its entirety with the exception of these steps:

⭐after everything finished, select "recovery" using the volume buttons

⭐when a small android appears, press power button+volume up

⭐select wipe data/factory data reset.

And after skipping those steps of method two I should just reboot? For some reason I feel like I've got that all wrong. Thanks for your help.
[Nexus 5 General] jd1639:
No, abaaaabbbb63 is saying to only flash the system.img and boot.img. you'll use

fastboot flash system system.img. and

fastboot flash boot boot.img.

Then reboot
[Nexus 5 General] mdpatterson:
Im sure it's painfully obvious, but I'm still learning all about routing and flashing. And s sorry to be a pain about it but the last thing I Wanda do is mess up my nexus I've pined over since the first rumors stayed coming out last year. So I need to download the windows package and then get to the fastboot menu on my nexus. At that point I need to Connect my nexus to USB. I then need to open a command prompt in windows. Now this is where I get shaker on the instructions. One I open the command prompt, I need to enter the command "fastboot flash system system.img" then hit enter, then enter the command prompt "fastboot flash boot boot.img" and once that's done I can reboot and I should then at that point be back to normal? All of this I recognize is after I've ensure my drivers are correct. But since I just rooted with the "auto root" technique that's in the nexus 5 forums a few days ago, I shouldn't need to install any new drivers. Again thanks a bunch for the help.
[Nexus 5 General] jd1639:
You'll need to download the factory image. Then use 7-zip to extract it. In there is another zip file, extract that too. In there you'll find the system and boot images. Those are the ones you want to use. And then, you are correct of booting into fastboot and connecting your device via usb and running the fastboot commands.
[Nexus 5 General] Techimplant:
Hey people..I am currently running Stock Rom but I am rooted..I am also running Franco kernel(r32)..

I just want to return to my stock kernel and dont want to lose my root either..is there any way to do this? ..Thanks
[Nexus 5 General] JNMM:
Find the stock ROM in the forum and flash that
[Nexus 5 General] mdpatterson:
Just got it all finished up. Worked flawlessly. As I'm sure the devs are aware of when done properly. Also was able to lock the bootlegger again seamlessly as well. Thanks again very much
[Nexus 5 General] jd1639:
Good for you! And you learned the correct way to fix your device. Well worth the effort. :)