yashsingh1/xdaforums huggingface dataset:
[Nexus 5 General] appuserprime:
Ah. My mistake. I never deleted my bootloader. I simply flashed the wrong bootloader version. See if you can help me here...

I had the latest stock image(M4B30Z, Dec 2016) running before I did ANY of your wipe advice. Then I did the erasing and flashed the bootloader and restarted. Sadly I accidentally flashed the Lollipop bootloader (LRX21O). Now the phone is in a complete hard brick state. I somehow got it to fastboot and did a flash-all.bat of the Lollipop image but unfortunately now it is bricked even more and I have seen fastboot crash as well.

So it has a bootloader technically, but its corrupted or incompatible.

Thanks for your time
[Nexus 5 General] abaaaabbbb63:
In theory the flash-all.bat should work and reset the phone to a fully functional state. It didn't give any errors, did it? Can you access the stock recovery? Do a factory reset from the recovery, then try to boot again.

You can also try flashing older versions as well (of 6.0.1) or even older versions of Android if nothing else works.
[Nexus 5 General] appuserprime:
I realize that flashing the wrong bootloader is not common for an experienced user, but I assure you that I am unable to turn the device on. That means no button combos, no fastboot, no recovery, no google logo. The phone was originally hard bricked after I manually flashed and restarted the correct bootloader.

Then I started troubleshooting..

After I started troubleshooting, there were only 2 exceptions where I was able to get to Fastboot with button combos. The first time, I used the opportunity to flash-all on top of my erased boot, cache, system, etc.

That did not fix it so I got lucky a 2nd time and got to fastboot but this time it crashed out of fastboot never to turn on again!

And now that I am trying to use an ODIN like software to do factory flashes my device is not showing up in device manager at all.
[Nexus 5 General] AndroidNewDeveloper:
HELP ME

See..

i am having problem in installing Gapps

i tried every way it didn't worked out

plz guide me step by step so i can increase system space

I CANNOT DO IT
[Nexus 5 General] DiamondJohn:
The Nexus 5 is notorious for having a faulty power button. Normally it gets stuck in the ON position. But maybe yours fails to switch on.
[Nexus 5 General] Primokorn:
Wrong thread. There's a Q&A section for such a question.

In a nutshell, you need a custom recovery and download the smallest GApps package (Pico AFAIR).
[Nexus 5 General] audit13:
Gapps is not required when flashing a stock Google ROM.
[Nexus 5 General] sekiradrug:
Hello everyone

I've been having no sim card issue on my Nexus 5 6.0.1. After it spent 20 days at local phone service, the guy told me its software problem, hardware is fine.

After some googling and help of a friend, I ended up returning my n5 to 5.0.1 but it didnt solve my problem. After that I took it 4.4.4. but problem is still there.

Any thoughts?

thanks
[Nexus 5 General] ruabell:
how far "back to stock" do I need to go to restore the ability to use Android Pay without any issues?

can I remain rooted?

just the bootloader?

super hide is a super pain in the arse and rarely works

have a grateful weekend[emoji41]
[Nexus 5 General] Guatiao:
Many moons later this guide has proven really easy and helpful for my aging Nexus 5, which came out of retirement when my Galaxy S6 Edge Plus decided to kill my data connection. Waiting for a replacement at the moment, and enjoying my "new" nexus 5, thanks!!!!!
[Nexus 5 General] bigcelo75:
[/QUOTE]

Try holding the power button and tapping the volume up button when it says no command. That should take you to stock recovery. Hope that helps!
[Nexus 5 General] Karikalan:
works fine

Thanks a ton, i am no where related to tech world, yet able to root and save my kitten :):) beautiful clear tutorial
[Nexus 5 General] Mc.YomiCo:
Um on 7.1.2 AOSP Rom...if i can do this to get official android on my nexus 5...plz guide...best regards

---------- Post added at 08:10 AM ---------- Previous post was at 08:03 AM ----------

I have something similar on my Nexus 5 and i send my phone to service and they change my motherboard in phone because it whose broken.[/QUOTE]

Hay is this work for mee.... I'm on 7.1.2 AOSP Rom i need to get back on official android plz help
[Nexus 5 General] Krnanthak kumar:
How much time take to reboot ?
[Nexus 5 General] Stevica Smederevac:
Shouldn't take longer than 10 minutes
[Nexus 5 General] Trojanviru:
Hey can i flash the image file by using flashify app in my nexus 5
[Nexus 5 General] SSyar:
I am on M4B30Z, i tried kingroot for the root it did root my phone but end up in battery percentage issue of 3000%. Internet suggests me to flash factory image ., but i want data(pic/videos etc) intact., so what if i just extract and flash *system.img* from M4B30Z factory image will it work for me to fix that 3000% issue ?
[Nexus 5 General] BearOfXDA:
How would this be done with TWRP only?

I have no access to a PC, so how would flashing the stock image be done on TWRP? You can flash images by themselves, so would you just flash them in the same order? Or is there something I'm missing?
[Nexus 5 General] nitramus:
I might be mistaken but I think in the newer versions of twrp you can flash .img files
[Nexus 5 General] r0bis:
Why not use commands from flash-all.sh

Thanks very much for this guide. I have seen a few similar ones. They say to flash the images in sequence as above (more or less same sequence) with fastboot reboot-bootloader in between some.

My question - why not use

fastboot -w update ./image-bullhead-XXXX.zip

as the last command in flash-all.sh

That seems to do everything (after it verifies that correct bootloader and radio have been flashed beforehand used) and the only thing to do after this finishes is to fastboot flashing lock.

Then fastboot oem device-info gives:

[user@computer bullhead-n4f26i]$ fastboot oem device-info

...

(bootloader)	Device tampered: false

(bootloader)	Device unlocked: false

(bootloader)	off-mode-charge: true

(bootloader)	Display panel:

OKAY [ 0.060s]

finished. total time: 0.060s

The difference seems to be only in sequence. Using the flash-all.sh you get

* bootloader.img

* reboot to booloader

* radio.img

* reboot to booloader

* then flashed in sequence: boot - recovery - system - vendor - userdata - cache

* then all I do is to lock the bootloader

I your sequence after flashing bootloader and radio with corresponding reboots you do:

* flash in sequence system - userdata - boot - recovery - cache

with erasing cache prior to writing it

and also in my case vendor.img gets written (I acknowledge it parhaps is not present in all image zips)
[Nexus 5 General] nitramus:
For some reason for me the flash all never worked so I followed the manual part and never had any problems.
[Nexus 5 General] r0bis:
May not work for several reasons, but most commonly where path is not found, i'd think. I was just curious as to why there is `update` command to fastboot which apparently flashes images from the zip file (http://manpages.ubuntu.com/manpages/zesty/man1/fastboot.1.html) - so there is no need to unzip it into its component parts, but maybe there is something else to update? I was also thinking if it was necessary to reboot the device between flashing some partitions or not. Also it seems clear that flashing radio and bootloader first and then rebooting is important before flashing all other partitions; I was just curious why.it is so?
[Nexus 5 General] ALASTOR1111:
I got Nexus 5 with Ubuntu on it from my friend, how to go back to Android? Can i use this guide to flash android back from fastboot? I don't have Linux on my PC, its Win10. Please give me step by step guide. Thanks in advance.
[Nexus 5 General] Soren11112:
Randomly stopped and hard-bricked phone

As I said, it randomly stopped then hard bricked the phone
[Nexus 5 General] Spyhopping:
Thinking of installing a new motherboard in my N5

Will this work if I purchase a new motherboard for my nexus 5?
[Nexus 5 General] iiPostMaster:
I had a bootloop happening from what I believe was either TWRP's fault or accidentally installing SuperSU twice. I flashed all the stock stuff for my device except for cache.img, as the file repeatedly told me it was corrupted after 5 attempts. Upon booting into recovery, the device displayed an android on its back with a red triangle that had a black exclamation point inside. I held volume down and power, but no menu opened to wipe my device. It began booting automatically when I pressed the specified button combo and now it's bootlooping again. Is my phone done for?
[Nexus 5 General] Max_H:
I Hope I'm Not Too late 2 get Help on this 5 year old Ph that I Bought last week that I've Stuffed!

it's a Refurbished 32 GB Version, Supposedly w/ a New Battery... I got with the intention of Running Maru OS or Ubuntu Touch (ie. UbPorts ), so that I could Mitigate or Distance Myself from Android ( Google Really! )

So after Sucksessfully installing UbPorts on it ( & that was a Challenge Believe Me! ) & Migrating Most of My Files Over I was getting Notifications that I had Only 2% Storage space left & I hadn't even installed Any Apps Yet! :( I Calculated that the OS alone was Using an 8 GB Footprint! & then I was Horrified 2 Discover that the Battery was Down 2 about 30% after Only a few hOurs & having Begun w/ a Fully Charged Battery & I'd Hardly done anything on it, No Services Running etc, So that's rather Unsatisfactory! So I Tried Uninstalling UbPorts & Returning it 2 Stock...

Now it's Hung Stuck on Google Splash Screen w/ an Unlocked Padlock icon, I can However get it 2 the UbPorts Recovery Mode which has Reboot system now or Ubuntu actions or Android actions or Reboot 2 Bootloader or Power down or View Recovery logs. Of I've Tried Both Ubuntu & Android actions, But No Joy w/ either!

it'd be Great if I could get TWRP or CWM Recovery installed or otherwise even stock Android is better than Nuthing! ;)

I've got MacOS 10.13.4 & Linux Mint 18.3 & M$ Virus Bait 7

Please Help!

:confused:
[Nexus 5 General] mukul2108:
anyone has solution to this? I'm having the same problem...

thanks in advance
[Nexus 5 General] Ph4:
Still 16GB

Hello,

I tried everything that is written here, from OP and other users, many times, but my phone still 16GB while the seller says it is 32 GB,

What other can I do?
[Nexus 5 General] audit13:
Tried looking up the serial # or imei # to ensure that it is a 32 GB model?
[Nexus 5 General] Ph4:
Great idea!

Once I got the serial number how can I check the storage with that?

Thanks in advance
[Nexus 5 General] audit13:
This might help: https://imei24.com/warranty_info/Apple/
[Nexus 5 General] Ph4:
I've just done it but there is no information about storage, thanks anyway
[Nexus 5 General] audit13:
I tested it with my iPhone and it was accurate. Try googling for other potential sites.
[Nexus 5 General] mopide:
Hi, I have a question about temper flag reset method:

is this method safe if I have my bootloader locked already?
[Nexus 5 General] vhin09:
thank you!! it really works in my xiaomi mi a1! :)
[Nexus 5 General] undercover:
Can't we just set that flag manually?

Something like

Fastboot OEM flag 1 or whatever
[Nexus 5 General] aletto:
Tried it, same error.
[Nexus 5 General] abaaaabbbb63:
I don't think so. That would have too easy.

Ok, then there's only one right thing to do.

[MENTION=4544860]osm0sis[/MENTION] Halp!
[Nexus 5 General] aerozolic:
I don´t understand what the bootunlocker actually does and why i have to run it twice if i´m already unlocked and once if not. The purpose of this script seems to be different. At least that´s what I read from the creator´s thread about this. But i´m noob in this android hacking thing and probably miss the point here :P
[Nexus 5 General] abaaaabbbb63:
The script should lock your bootloader if it's unlocked, and unlock it if it's locked. After that, it resets the tamper flag to "false", in both cases.

If you run it twice at the beginning, the only thing it will do is resetting the tamper flag value.

I guess you can run it once at the end, and also lock your bootloader. I'll make the proper modification after we get rid of this 'Status 1" problem.
[Nexus 5 General] aerozolic:
How many times do i have to run it if the bootlocker is currently locked and I want to reset the tamper flag value and end up with locked bootloader? :P

Can i check the tamper flag value somehow?
[Nexus 5 General] abaaaabbbb63:
2 times. But you have to have a custom recovery installed. You can't boot a recovery if you're locked. If you're rooted, you can use the Bootunlocker app from the play store to unlock your bootloader, then lock it back with the script.
[Nexus 5 General] osm0sis:
Unknown device would only pop up if it couldn't get anything from the getprop commands. Make sure you're using the latest version of CWM or TWRP and try again.

(In TWRP the getprop command isn't supported so I worked around it by parsing /system/build.prop for the important device information, so either way it should work.)
[Nexus 5 General] aerozolic:
Already edited my post.

Isn´t your CWM trick going to work instead of installed custom recovery?
[Nexus 5 General] abaaaabbbb63:
not if your bootloader is locked.
[Nexus 5 General] aerozolic:
Already unlocked it again with the app because i´m still tooted.
[Nexus 5 General] abaaaabbbb63:
Hmm... weird. Maybe that CWM has some bugs then.

Can anyone try the non-touch official version of CWM?

http://www.clockworkmod.com/rommanager
[Nexus 5 General] osm0sis:
Well, I mean, it worked for you so that means it detects and works just fine. It's a pretty simple script, detecting the device info either from getprop command or build.prop directly if getprop fails.

CWM should be fine as long as you're using a recent version, though really it should work no matter what with my TWRP workaround, and is tested working on both recoveries for other devices.
[Nexus 5 General] aerozolic:
Did you change the link of cwm in the op? Cant check the cwm version at the moment, but afaik i downloaded it from your link to some cwm thread

Still, how can i check the tamper flag value?
[Nexus 5 General] osm0sis:
fastboot oem device-info
[Nexus 5 General] abaaaabbbb63:
Yes, I changed it, since there's now an official CWM.
[Nexus 5 General] osm0sis:
Does my zip still work for you? Try a couple things for me please: make sure system is unmounted and run it, then mount system and run it. Does it work both ways?

Then flash stock recovery while bootloader unlocked and try loading CWM with fastboot boot, then try the tests in the last paragraph again to see if the boot method makes a difference.
[Nexus 5 General] abaaaabbbb63:
All of them work as expected, regardless of /system being mounted or not.
[Nexus 5 General] osm0sis:
Does it work for you with TWRP hammerhead as well?

If so then there's definitely some kind of user error involved for those other guys..
[Nexus 5 General] aerozolic:
Getting same error with latest CWM
[Nexus 5 General] osm0sis:
See here: http://xdaforums.com/showthread.php?p=47560277#post47560277

There's something weird going on with your setup where the script can't read your device information. Explain your procedure. What's on your device currently? Is /system formatted or is there a ROM like the factory image there?

Do an adb shell while booted to CWM, and type:

getprop > /sdcard/getprop.txt;

busybox mount /system;

cat /system/build.prop > /sdcard/buildprop.txt

Then give me both of those files.:good:

Naturally if the script can't determine it's the correct device it shouldn't run. Safety first.
[Nexus 5 General] aerozolic:
Stock rooted rom.

I boot into fastboot. run fastboot boot cwm.img, choose to install from zip, find and run the zip and get the error.

I did that adb shell, entered the commands and didn't get any error output but I can't find them anywhere on my device with android file transfer.
[Nexus 5 General] techfanatic9:
[MENTION=4346614]abaaaabbbb63[/MENTION] I have created video guides for both Windows and Mac on how to unroot the Nexus 5 (similar to your steps), if you would like to you can add these videos on the main thread. :laugh::D

Windows:

[YOUTUBE]DRp5jJO34PE[/YOUTUBE]

Mac:

[YOUTUBE]PX4R6IhcoTM[/YOUTUBE]
[Nexus 5 General] osm0sis:
Pull them down while connected with adb:

adb pull /sdcard/getprop.txt

adb pull /sdcard/buildprop.txt

Thanks!
[Nexus 5 General] jtdc:
sorry for my noobness but i want to accomplish this:

coming from an old rooted phone i want to restore in this nexus 5 some titanium backupped apps with their data.

root nexus 5 as titanium backup requires it, so i can restore those data.

unroot the nexus 5 without any traces of it being rooted, all the restored data are intact for use.

is it possible to do this with...

1. cf-auto-root to root nexus 5

2. use its unroot feature to remove root

- i really need no traces of it being rooted because in time i will have to install Good for Enterprise application for office email use, and that detects and won't function if phone is rooted.

thanks in advance for the responses
[Nexus 5 General] abaaaabbbb63:
You can root it with CF root, then use the unroot option in the SuperSU app. I think it will work just fine.
[Nexus 5 General] jtdc:
i see thanks. so using cf-root-auto 1st time, my existing data on nexus 5 will be wiped right? actually i don't care if bootloader is unlocked (and so does the Good Enterprise app). as long as data is not wiped on future re-root/unroot. does that hold?
[Nexus 5 General] gee2012:
Only unlocking the bootloader will wipe data, rooting does not. So if you unlock it once and it will never be wiped again.
[Nexus 5 General] abaaaabbbb63:
Thanks a lot!!

I will add them as soon as I get home.
[Nexus 5 General] aerozolic:
If you didn't know yet then booting with twrp instead of cwm worked.
[Nexus 5 General] osm0sis:
That's so weird. What does the bootloader reported as when you flash it for TWRP?
[Nexus 5 General] aerozolic:
[TUTORIAL] How to flash a factory image | Return to stock | Unroot your Nexus 5

I don't remember exactly but I think it was "Done" or something. And if the system is unrooted then twrp asks if I also want to root before exiting recovery
[Nexus 5 General] osm0sis:
No no, what does the script report the bootloader as? Like the part that says:

Device: hammerhead

Bootloader:
[Nexus 5 General] aerozolic:
Ah sorry, didn't check that. Maybe some other fellow who also had problems can try again with twrp and report back

BTW does factory reset (from stock recovery) wipe all of the internal storage (emulated sdcard) too, yes?
[Nexus 5 General] aletto:
Bootloader: HHZ11d

Considering that TWRP works, maybe the OP would kindly change the OP? (Does that sentence even make sense? I'm too tired to care anymore...)
[Nexus 5 General] abaaaabbbb63:
I did change it. Now the tamper reset step is done using TWRP.
[Nexus 5 General] osm0sis:
It reports that or you're just telling me that? What the hell, did TWRP add proper getprop support while CWM somehow broke it for some hammerhead devices?
[Nexus 5 General] DUBYEAH-:
So ive been working on this all day pretty much. I followed method two, get to the end and boot into recovery. I receive a red triangle over the droid and when holding UP + Power eventually boots into setup. No big deal, not really necessary and i cant always reset and wipe in setting. Well when i boot up i get the "Unfortunately" messages, for Camera, Hangouts, and Gallery. Ive tried re-flashing every file individually only to end with the same results, and Factory Reset does not work. I hit the button and nothing happens. hit it a million times same thing. zilch, notta, zero.

I'm not really stressing over it, its whatever. But some ideas would be nice. MD5 is correct, before anyone says redownload.
[Nexus 5 General] marcusva79:
This is so weird I put the stock factory image on via fastboot using the Lazy instructions and everything worked good but I see my device with 12.1 gb free of 12.5 gb available instead of like 16gb. I got the black 16 gig. This normal?

Nevermind I just need to find stock recovery
[Nexus 5 General] abaaaabbbb63:
Yes, it is normal. From 16 GB of total storage, 12.5 are available to user storage. The rest are the system,cache, recovery etc partitions.
[Nexus 5 General] abaaaabbbb63:
What button are you pressing to select wipe data/factory reset? Power button, right? After you select it, you have to press the power button to actually start the factory reset.

Then try this :

Unlock your bootloader, then boot. It should do a factory reset by it's own. If it still doesn't work, then reflash the recovery.img, and system.img, and try doing a factory reset from recovery again.
[Nexus 5 General] marcusva79:
I just went ahead and tried the what if it went to 32 to 12 and see if it does anything haha
[Nexus 5 General] abaaaabbbb63:
Well.. Best case scenario: you would have ended up with a 32 GB phone out of nowhere :D (which is actually ~29 GB ).
[Nexus 5 General] aletto:
TWRP reported that. I would've made a picture if it was possible.
[Nexus 5 General] liperus:
Hi, I have a noob question :p

If I'm on a custom Rom and custom kernel and want to go back to stock but keep my kernel, which files should I flash with fastboot? Do I have to go back full stock and then re-flash my kernel, or is there a faster way not flashing all the images?
[Nexus 5 General] osm0sis:
Very nice! I just looked into it and TWRP did finally add getprop command support!

https://github.com/TeamWin/Team-Win-Recovery-Project/commit/8d66f8bda919435d36a1df1d8f3cea16a3c496fa

This is great news! I'll make a test version of the BootUnlocker without the workaround that was required for older TWRP and hopefully you can test it with CWM for me. :)

What version of CWM were you using anyway? Point me to the image please. :good:
[Nexus 5 General] abaaaabbbb63:
You could just flash all the images using the flash-all.bat, then flash the kernel again in fastboot:

fastboot flash boot boot.img

Or only flash system.img, and recovery.img, and do a factory reset from the stock recovery. That should do it.
[Nexus 5 General] quendil:
Thanks a lot for this guide but i have a little noob question (just to learn something new):

Inside the ROM image, there is a cache.img file.

What 's the use of this file, since we dont even flash it?
[Nexus 5 General] abaaaabbbb63:
Cache can, and will be generated on the first boot. Flashing the cache.img will probably shorten the first boot time.
[Nexus 5 General] Tobie69:
THANKS....
[Nexus 5 General] abaaaabbbb63:
you're welcome
[Nexus 5 General] iJimaniac:
[MENTION=4346614]abaaaabbbb63[/MENTION] Thanks for making a straight-foward tutorial. I'm curious about this tamper flag? I haven't seen anyone mention it besides you, although I admitedly haven't been in the n5 forums that much. I would think such an important issue (especially for those wanting to RMA/return) would make to the xda portal, since nexus users aren't used to having to deal with flash counters.
[Nexus 5 General] abaaaabbbb63:
Well, I'm not the only one to mention it. osm0sis and other guys worked on a script to reset it. It's a minor thing, easy to fix, and many, including warranty guys, don't know about it.
[Nexus 5 General] osm0sis:
Yet. We know it exists, but we don't know if/when they plan to start using it to deny warranty. Easiest way to know about it is already posted in the OP: fastboot oem device-info :good:

[MENTION=4173463]aletto[/MENTION]: check your PMs. ;)
[Nexus 5 General] faultytowersdude:
Hi would the resetting the tamper instructions work if your boot loader is already locked
[Nexus 5 General] abaaaabbbb63:
Do you have a custom recovery installed? If not, then you'll have to unlock the bootloader, and follow the instructions.
[Nexus 5 General] faultytowersdude:
No I have stock recovery
[Nexus 5 General] aerozolic:
[TUTORIAL] How to flash a factory image | Return to stock | Unroot your Nexus 5

You have to unlock your bootloader and then follow the instructions in the OP
[Nexus 5 General] faultytowersdude:
Ok when I follow these instructions to reset flag and relock bootloader I'm on the understanding when running twrp in fastboot to run script your not actually installing twrp but running from your internal memory.