yashsingh1/xdaforums huggingface dataset:
[XDA Assist] Heisenberg:
Hi :)

Thanks for writing to us at XDA Assist. I can't find anything relating to your question, please ask in the Note 3 q&a section here:

Samsung Galaxy Note 3 Help and Troubleshooting
[Nexus 6  General] GuestK0087:
*How to prepare your Nexus 6 for resale*

Since the onset of Android 5.1, there are some specific steps needed to ensure you can sell your device and not have the seller need your Google password when they receive your device. Please read this guide provided by [MENTION=4617969]PatimusXPrime[/MENTION]

http://xdaforums.com/showpost.php?p=60455167&postcount=43

TWRP RECOVERY INSTALLED ONLY

The following info is for users who have TWRP installed and are stuck in bootloop (soft brick) after wiping OS with a locked bootloader.

Credit to this thread:

Thanks [MENTION=5365486]ixa20[/MENTION]

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

STEP 1

Boot into bootloader.

STEP 2

Use fastboot and issue the commands:

fastboot format userdata

fastboot format cache

This should allow you to boot back into TWRP.

Flash a ROM and get up and running.

Unlock your bootloader and leave it that way.

Thanks also to [MENTION=2872010]rootSU[/MENTION] for posting this solution many, MANY times.
[Nexus 6  General] productofusa:
I hear a lot about locking the boot loader, but what exactly am I missing out on in terms of security with an unlocked boot loader, and rooted
[Nexus 6  General] GuestK0087:
I think, primarily, if you are unencrypted you run the risk of your data being compromised if your phone is lost or stolen. Plus, the new security features are not proven to work 100% when bootloader is unlocked. Simply by rooting, you've opened your device to be more vulnerable to malicious attacks. I'm sure you already know that.
[Nexus 6  General] productofusa:
I see, nothing I wasn't already aware of! It seems that a significant amount of people that are used to an unlocked rooted handset are quick to jump on the relock the bootloader omg security bandwagon regardless of the consequences. Having said that thanks to folks such as yourself most of the kinks seem to be worked out at this point.

Thanks
[Nexus 6  General] Cannibal Oxen:
Okay, so I'm new to the whole unlocking/flashing thing.... I bought a nexus 6 from Verizon which obviously came with 5.1 out of the box. I was using stock with my google account attached and a pin lock. I successfully unlocked by bootloader and rooted with twrp and the nexus toolkit. I have also since flashed chroma. Am I to understand that I can not ever go back to unrooted stock and locked booloader, now?

I'm really sorry for what is probably a stupid noob question, but I'm really paranoid now. TIA!!
[Nexus 6  General] danarama:
The first post explains how to lock the bootloader safely. If you're going g back to stock, simply follow the steps
[Nexus 6  General] GuestK0087:
No, not at all. You can flash a factory image and return to stock at anytime. However, if you plan on flashing ROMs again, there's no need to relock the bootloader. For instance, if you wanted to return to stock to say, get an OTA, the bootloader being unlocked wouldn't affect that negatively.

If you did desire to relock, following this guide, as far as disabling the security and Google account, you should be able to relock. The important thing is making sure that pesky "allow OEM unlock" option remains checked after a reboot.
[Nexus 6  General] cam30era:
You can go back to stock. And then, subsequently relock the bootloader.

And the question is not "stupid". Noob questions are encouraged here. That's how you learn.
[Nexus 6  General] Cannibal Oxen:
Fair enough. The part that confused me was the first five steps appear to address steps required to unlock the bootloader. I was afraid since I already unlocked mine without first disabling security and removing my account that it would somehow preclude me from ever being able to relock the bootloader should that need ever arise in the future.

I really appreciate the help!
[Nexus 6  General] gorei23:
Yeah, I learned my lesson, DON'T PLAY WITH LOCKED BOOTLOADERS ON THIS DEVICE, EVER!

I had a locked bootloader, and no System (I had wiped it accidentally).

Luckily though I had the sense to keep TWRP installed, but I couldn't boot to it, it was just bootlooping to the TWRP splash screen.

I thought I had just lost a $650 investment, but here's what I did:

Boot to bootloader, then

fastboot erase cache
fastboot erase userdata

Then I could boot to TWRP! So I

adb push (ChromaOS zip here) /sdcard/

But when I tried to flash the Data and Cache partitions kept giving me errors, I couldn't flash anything!

I went to sleep (or tried to sleep, but couldn't) I was panicking!

When I woke up I tried one more thing:

From bootloader I did

fastboot format cache
fastboot format userdata

(Notice FORMAT instead of erase!)

I booted into TWRP and was able to flash ChromaOS, I was able to enable OEM Unlock, and flashed the full Factory Image, completely back to stock.

I booted once with unlocked bootloader to verify it was working, then locked it.

If I had the stock recovery, I would've had a $650 paperweight.

DO NOT MESS AROUND WITH LOCKED BOOTLOADERS!

DON'T RISK IT!
[Nexus 6  General] GuestK0087:
With the method I've outlined and personally tried, it can be safely done. The security settings are the issue and a safe way around that has been found.
[Nexus 6  General] gorei23:
I know, I'm just saying don't play around with it, if you're going to relock make sure that you KNOW it will work.
[Nexus 6  General] SerotoninStorm:
Can confirm that the outlined info here works flawlessly
[Nexus 6  General] ooofest:
I used this process to re-lock my phone after unlocking in the fastboot-enabled upgrade from OTA 5.1 "D" to stock 5.1 "E" an hour ago.

The easy part was unlocking/locking/rebooting in the correct order - the harrowing part was when my fastboot update of the radio failed, after which I figured out it was a transient USB issue with my system, so rebooted Windows and then everything went reasonably close to plan.

So, now I'm on "E" and with a locked bootloader (i.e., stock for Verizon). I'll be experimenting with custom ROMs after settling in with this for a bit, but wanted to test out VoLTE and other things before going the custom route.

Thanks again for this guide.

- ooofest
[Nexus 6  General] danarama:
Word of caution, don't flash stuff with a locked bootloader. If you get a bad flash and you can't boot, you'll be screwed.
[Nexus 6  General] pwned3:
Doesn't the setting in developer optionsto allow OEM unlock of the bootloader reset every boot on the new firmware? I know mine does on meanpop and chroma both 5.1 roms

Sent from my Nexus 6 using Xparent Skyblue Tapatalk 2
[Nexus 6  General] danarama:
Yes
[Nexus 6  General] efrant:
It does if you have "Device protection" enabled. If you do a factory reset and, while you are running through the set up wizard, do not enable "Device protection", then the " Allow OEM unlock" setting should stick.
[Nexus 6  General] ooofest:
Before attempting to upgrade the stock level or going custom, I was planning to run through at least steps 1-4 again to enable me to safely unlock.

Or, do I only need to tick OEM Unlock, adb into stock recovery and then fastboot oem unlock without going through the suggested factory data reset step?

- ooofest
[Nexus 6  General] danarama:
You would need to adb into bootloader to unlock after ticking. Unlock will wipe the device, but you'll want to wipe when flashing a custom ROM anyway. Just backup sdcard first.
[Nexus 6  General] ooofest:
Whoops, I'm up early with a headache and honestly meant to say bootloader instead of stock recovery :) .

Yes, the gist of my question was simply to learn if I could safely bypass the suggested step of first factory resetting before unlocking (which leads to a wipe anyway, as you note). On a 64GB device, the factory reset takes a bit of time, so would be convenient to avoid if not really needed.

- ooofest
[Nexus 6  General] danarama:
Should be fine as long as you're doing step 1 and 2
[Nexus 6  General] gorei23:
If you have an unlocked bootloader it would be extremely hard to brick this device, the only way AFAIK with an unlocked bootloader would be to "fastboot format boot" and not replace it.
[Nexus 6  General] :
Post #2 updated with instructions for users with TWRP installed who are stuck in bootloop after wiping OS and having a locked bootloader.
[Nexus 6  General] necroside007:
This sounds like: if you don't own a car, extremley hard to crash it
[Nexus 6  General] pyed:
ok I have a nexus 6 that I wiped and re-locked for no good reason without making sure that my new os is working, now it's bricked, and I can't OEM unlock because of this new security feature 5.1 has, and I don't have TWRP installed, so what to do now ? still no solution ? :(
[Nexus 6  General] :
Sorry but most likely not. You can RMA. No one has found a way around this as of yet.
[Nexus 6  General] V3TTOO:
So, if I have TWRP, is there any real issue with relocking the bootloader?

So, let's look at our theft deterrent options.

Bootloader, Device Protection, Encryption, Password

Bootloader locked will prevent anyone from editing your system. Unless Device Protection is on, they can restore the device and use it like new. With it on, they will need a password or Google creds to use the phone after restore.

Bootloader unlocked with TWRP/CustomROM, they can load into fastboot and flash a custom system, but if Device Protection is on, they can't load into TWRP or your system.

Now, can I have TWRP/CustomROM installed, then relock bootloader to prevent anyone from replacing my system and still having recovery locked by Device Manager, with an overall more secure system? They can't unlock bootloader without getting into the system, I can still flash ROMs through recovery, and flash recovery using something like ROM Manager or GooManager.

Locked bootloader only stops flashing partitions from fastboot. I can still do everything else, no? Besides a bad flash on both recovery AND system, I should be ok?
[Nexus 6  General] :
First, no you can't flash a recovery with a locked bootloader.

Personally, if you're going to unlock and flash ROMs, I wouldn't recommend a bootloader re-lock. You are correct that device protection is the real security here and as long as you have a password, pin lock set, you are most likely safe. At best, if your device fell into the wrong hands, they wouldn't have access to your personal data. IMHO, encryption should be left on as there is no substantial benefit that the typical user would notice by decrypting.
[Nexus 6  General] cam30era:
[MENTION=4891650]V3TTOO[/MENTION]

You can only safely relock bootloader if you are 100% stock.
[Nexus 6  General] V3TTOO:
I already have TWRP and unlocked on Chroma ROM. Encryption and device protection is on. No one can boot or get into recovery, but they can still use fastboot.

Are you sure you can't relock without being stock? I read users that did and were still able to flash using custom recovery and do recovery updates using an app in the system.
[Nexus 6  General] cam30era:
You can not relock your bootloader, unless 100%/stock. You will brick your device if you try. Read the OP.
[Nexus 6  General] V3TTOO:
I see that it states not to do it because there is no safe way. But I am assuming people are relocking to get back to stock, post update or whatnot.

I am curious on keeping custom recovery and ROM. Like I said before, users have relocked bootloader and had no issues using custom items. So if your statement is true, which I am questioning due to possible misinformation on my end, then something post 5.1 prevents relocking bootloader due to bootloop?

My understanding was relocking prevented flashing in fastboot, but the boot to ROM should still happen, and access to recovery as well. Someone out there must have relocked the bootloader AND attempted to keep custom software. I want confirmation of this. Everything I find is people trying to return to stock recovery and ROM.
[Nexus 6  General] cam30era:
You'll have to try it and report back with your results.
[Nexus 6  General] :
While I can't 100% confirm this as true, it is my strong recommendation that if you are installing custom recovery, you should leave bootloader unlocked. I can confirm that the users I've come across that have tried to re-lock while TWRP is installed have found themselves stuck in a bootloop but then, and only then, it is recoverable through TWRP.

The moral of the story is, and I can't stress this enough, if you are returning to stock, only after you have flashed the factory image, including recovery, that is when a re-lock should be executed. This for the purpose of RMA or resale of the device. If you are returning to stock to fix issues, with the intent to mod or ROM again, then there is ABSOLUTELY no need to lock the bootloader.
[Nexus 6  General] miketucky350:
I want to say thank you Evolution_Freak for your time on writing this up as it will help save many bricks. Sticky? I will also confirm this works 100%. I have done this on 2 devices now (insurance & warranty). Stressing that the oem lock stays ticked & most importantly that they have a fully booting untouched stock image is key.
[Nexus 6  General] :
It basically is a sticky as it is listed in the sticky roll up thread, that is a sticky.

Thank you for your kind words and I'm glad you have taken the time to provide confirmation. Unfortunately, not everyone takes the time to search and read all information before attempting to lock and we are still seeing bricks caused from not following the proper steps. :(
[Nexus 6  General] miketucky350:
Its too bad that some people don't follow the golden rule of slow down and read read and read again. It hasn't steered me in the wrong direction yet. Ya its a nexus but the lollipop security is no joke. I did this and rebooted device multiple times to verify its OK to continue. Instead of re locking asap.

Sent from my Nexus 6
[Nexus 6  General] cam30era:
No kidding! Between the bootloader relock brick, the "72 hour password change" rule, and the requirement to log back in after wiping your device (prior to a sale), there are a lot of changes that are catching users off guard. IMHO, Google has gone a little too far with the security measures and not giving users an easier way to opt out.
[Nexus 6  General] miketucky350:
I agree. Way too far especially for a device like ours known for modding. They should allow us to opt out completely. Either way I'm thankful for the openness and ease of this device. We could be locked up like the new Samsung's.

Sent from my Nexus 6
[Nexus 6  General] :
OP updated to discourage users who want to keep custom recovery from locking bootloader.
[Nexus 6  General] itzjonjon69:
beautiful i was one of those unfortunate individuals who used Nexus Root Toolkit and did everything before discovering this thread... FML! So basically my device is bootlooping, can anyone point me in the right direction as to what i need to do? Is there even a fix?

***EDIT***

HOLY CRAP guys! I don't know what i did but i had the phone in bootloader mode and just tried a bunch of different things (tried running the script to flash it back to stock) (and also tried flashing TWRP) in Nexus Root Toolkit and when i thought i was screwed i left my computer and phone on while the green android guy was just spinning his wheels and when i got home everything was booted up and working!!!!
[Nexus 6  General] :
Do you have TWRP recovery installed?
[Nexus 6  General] :
If you do have TWRP, look at post #2 in the OP and try that.
[Nexus 6  General] itzjonjon69:
HOLY CRAP guys! I don't know what i did but i had the phone in bootloader mode and just tried a bunch of different things (tried running the script to flash it back to stock) (and also tried flashing TWRP) in Nexus Root Toolkit and when i thought i was screwed i left my computer and phone on while the green android guy was just spinning his wheels and when i got home everything was booted up and working!!!!
[Nexus 6  General] :
The soft brick has been recoverable when TWRP is installed. It's when you have stock recovery that there's no hope at this time.
[Nexus 6  General] itzjonjon69:
I had flashed it back to stock recovery. TWRP was wiped when I ran the nexus root tool script (correct me if I'm wrong). That's why I thought I was royally screwed.
[Nexus 6  General] :
If this is true, and can be confirmed, then we may have a major breakthrough. It would be most helpful if you could confirm the steps you took both before, and after.

Lol, it might improve my opinion of toolkits too.
[Nexus 6  General] itzjonjon69:
Ok so this is how it went down. I'm gonna try the best that i can to retrace my steps.

1. After plugging my phone in and running Nexus Root Toolkit (NRT) it was updated to version 2.0.5

2. After the phone was loaded up i hit the "Flash Stock + Unroot" button and where it asks for the current status i chose "Device is on/Normal" it asks me what factory image to download. I chose Build: LMY47I and then i hit "Recommended Settings"

3. NRT did it's thing and after about 5-10 minutes the phone loaded up and forced me to input my gmail account info

4. I enabled developer mode and turned on USB debugging and eyed OEM unlock for a good minute (stupid dumb ass should of enabled it!) but didn't turn it on

5. Went back into NRT and selected "OEM Lock"

6. NRT did it's thing then the next thing i know the device rebooted and then the green android appeared and just kept spinning his wheels over and over

7. I stumble upon this thread and panic/freak the f*ck out!

8. I leave the phone in bootloader mode and have it plugged into the computer and relaunch NRT

9. I tried pressing the "Flash Stock + Unroot" and choosing "Soft-Bricked/Bootloop" for current status however it kept trying to flash the the different files but it kept failing over and over (due to locked bootloader) so i exited out of the command prompt

10. I press the "Unlock" button in NRT a couple of times and it opens up command prompt but nothing happens (if i remember correctly)

11. At this point i say, f*ck it if it's bricked i might as well try other things

12. I hit "Launch" advanced utilities button in NRT

13. Under Fastboot Boot i select "Custom Recovery" it opens command prompt again and nothing happens (if i remember correctly)

14. After this step if my memory serves me right the phone rebooted and the green android guy shows up again spinning his wheels

14. While the phone is trying to start up i went back to NRT and under Fastboot Flash i select "Recovery" and choose "download latest TWRP" which then NRT tries to detect my phone via adb/fastboot but keeps failing but i keep hitting retry

15. While doing all this the phone is still stuck on the green android guy, but after a good 5-10 minutes i noticed the screen had changed and i noticed the Nexus colors showed up (boot up animation) then low and behold the phone started up and i nearly fainted.

I really hope someone can retrace my steps and come up with a solution!
[Nexus 6  General] Intub8:
It sounds to me that #7 is where you messed up. Everything that you did after that was just silly. Sounds like if you had just waited a few minutes before doing anything after #6 ( I think the nexus tool even tells you this many take a while ) it would have booted up just fine. I have locked the bootloader at least 30 times trying to brick with stock recovery. The key is to make sure the system boots up before you lock. I am guessing ticking allow OEM unlock is a good safety step so if it does fail to boot you can still go back and fastboot OEM unlock and get it fixed. The last thing you ever want to do is panic , that is when silly mistakes are made.
[Nexus 6  General] efrant:
I finally caught up with reading this thread.

Here's my view on this: the issue with re-locking the bootloader on a Nexus 6 is that, unlike previous Nexus devices, it forces a wipe on re-lock. Moreover, the wipe is done by the stock recovery. So, if you have TWRP flashed, and you lock, you will end up in a bootloop (because it seems like TWRP doesn't deal with the force wipe the same way as the stock recovery does.

Now, that being said, I believe there is a way to have a locked bootloader and TWRP. You would have to unlock your bootloader, flash TWRP, root, then flash back the stock recovery. Now you should be able to re-lock. Then, once you boot back into Android, use a terminal emulator or Flashify (or something similar) from the Play Store to flash TWRP. You should end up with a locked bootloader with TWRP installed. Keep in mind that if you plan to unlock again, you would need to flash the stock recovery (using what I mentioned before) before unlocking.

I personally don't recommend a locked bootloader if you like to mess around with your phone, but hey, the choice is yours.
[Nexus 6  General] cam30era:
I tried this, and "enable oem unlock" did not stick through a reboot. So I stopped there.
[Nexus 6  General] efrant:
The "Allow OEM unlock" check is not related to what I mentioned. That is related to having a Google account on the device and/or having a lockscreen password/PIN/etc.
[Nexus 6  General] :
Thank you very much for clarifying many things. I, personally, don't see why anyone who wanted the benefits of a custom recovery, would want a locked bootloader at the same time. This is the reason for my edit of the OP, to try to discourage such an action.
[Nexus 6  General] :
[MENTION=1566190]efrant[/MENTION] I've added the link to your above post to the OP as well. Just below my recommendation to not lock if you're going to customize. Thanks again. :)
[Nexus 6  General] V3TTOO:
Thank you so much. I was not concerned with the ability to customize or WHY you would relock the bootloader, just if it was possible and functional. More just to clarify the ability and the concerns around it, but not just told I can't do it cause no one would want to do it. It might be valuable information for someone concerned with customizing and security.

So if I had a rooted ROM with stock recovery I should be able to relock. Then reflash recovery in the rooted ROM. Hmm, might have to play with all this further. Once again, thank you for the information.
[Nexus 6  General] efrant:
I don't have encryption on my phone, so maybe I've missed something: how can no one boot into recovery if you have TWRP flashed?
[Nexus 6  General] cam30era:
Thanks for clarifying that. There were a number of articles on several Android website that indicated this had to be checked to unlock bootloader. Shows that just because you read it on the internet, it ain't necessarily so.

Here's one example > http://www.droid-life.com/2014/11/0...nable-oem-unlock-option-in-developer-options/
[Nexus 6  General] efrant:
I think we must have gotten our wires crossed somehow lol. Yes, "Allow OEM unlock" does have to be checked to unlock the bootloader. What I was trying to say is that it stays checked if you don't have a Google account on the phone and no lockscreen password.
[Nexus 6  General] :
I was just going to say the same thing! :)
[Nexus 6  General] cam30era:
OK. Thanks for clarifying.

---------- Post added at 02:05 PM ---------- Previous post was at 01:18 PM ----------

:o
[Nexus 6  General] V3TTOO:
With Android Device Protection, TWRP and regular boot need a passcode to load. Fastboot is still accessable since the bootloader is unlocked, but the others are protected. This is what happens on reboot, to protect the device. It is extra from encryption. When you add a pin to your phone, it will ask if you want to enable device protection. It also protects TWRP. Guess they integrated with the 5.1 protection system.
[Nexus 6  General] efrant:
I have a lockscreen PIN and I do have device protection on, but when I boot into TWRP, it does not ask for any PIN...

In any case, when you boot your device to TWRP, but before you enter a PIN, does it still give ADB root access? In other words, if you are on the screen where TWRP is asking for a PIN, plug your device into a PC, and open an ADB shell to see if you have root access. If so, it's kind of pointless to have a PIN on TWRP...