15

I've unlocked my Nexus 5 by using CF-Auto-Root. I want to undo my actions and return the device to its original state: unrooted and locked.

How can I do this?

16

You'll need to use fastboot, which is provided in the CF-Auto-Root zip file, and also available standalone and packaged with lots of other software. It's part of the Android SDK Tools / Platform Tools, which can be installed on Windows, OSX, or Linux.

Note: If you've installed a custom ROM or kernel on top of rooting, you'll want to flash the necessary stock versions from the Nexus 5 stock image with fastboot or possibly through TWRP/ClockWorkMod Recovery.

In order to re-lock the bootloader:

  1. Reboot your phone to Bootloader Mode
  2. Connect the USB Cable to your computer.
  3. Open a Command Prompt (Terminal on Linux or OSX)
  4. Navigate to the platform-tools directory inside the unzipped CF-Auto-Root directory.
  5. Use the following command, depending on your OS.

    • Linux: ./fastboot-linux oem lock
    • OSX: ./fastboot-mac oem lock
    • Windows: fastboot-windows.exe oem lock
  • Would this process work for other phones or just the Nexus 5 due to it being 'unlockable'? (in my case SGS2). – Scotty.NET Jan 9 '14 at 10:23
  • 1
    @Scotty.NET It works for many phones, but I doubt it would work on the SGS2. One of Samsung's many modifications has been removing Fastboot and replacing it with Odin. Although some Samsung phones to have minimal Fastboot compatibility. – dotVezz Jan 9 '14 at 12:27
  • 5
    Quick update: for the newer versions of platform-tools, fastboot oem lock does not work. They have changed the command to fastboot flashing lock. – Guillermo Orellana Ruiz Oct 27 '16 at 18:55
  • 1
    showing <waiting for any device> and nothing happens. However I connected my device(moto g) via datacable. – brijesh kumar Nov 8 '16 at 8:48
  • @brijeshkumar you may need to run the fastboot command as root. – dotVezz Nov 8 '16 at 17:14
2

On a rooted device, you can use BootUnlocker to re-lock the bootloader without using fastboot. You can also use it to unlock the bootloader again without wiping data. I use it to keep my bootloader locked most of the time, but unlock it prior to installing a system update or doing anything else that might require re-rooting via fastboot flash.

  • Currently unavailable for my Nexus 5X (running N from the latest OTA). – philo Mar 9 '17 at 17:36
-6

First of all there is no need to relock bootloader on a Nexus device as their specialty is that they have a unlocked bootloader by default. So maybe u can talk about unrooting.

Refer here : http://en.m.wikipedia.org/wiki/Google_Nexus

  • 8
    The bootloader isn't unlocked by default. It's unlockable, but not unlocked. Beyond that, this doesn't seem particularly helpful. Relocking has its merits in terms if helping to keep your device secure, and the link to Wikipedia doesn't seem to address the question in any way at all. – eldarerathis Dec 24 '13 at 23:47
  • 4
    From the Wikipedia page you linked, emphasis mine: "Devices in the Nexus series do not have manufacturer or wireless carrier modifications to Android (such as customs graphical user interfaces), and have an unlockable bootloader". Also, your assertion that all devices have unlockable bootloaders is just flat out incorrect. That's why it's one of the major specs listed (and a very attractive one for many) of the Nexus line, which is probably why the Wikipedia page points it out specifically. Did you read it? How does it answer the question about relocking the bootloader? – eldarerathis Dec 25 '13 at 14:14
  • 1
    @coolhz - Many devices have an unlockable bootloader, but not all devices. In the case of Nexus phones, they do not come unlocked. I'm pretty sure eldarerathis has done his research - he's both a highly respected member of the community and a moderator. – dotVezz Dec 26 '13 at 15:29
  • 1
    Here is a brief sampling of devices with no official bootloader unlock: Droid Ultra, Droid Mini and Droid Maxx (unless you get the "Dev edition" Maxx). The HTC One on Verizon. The Galaxy S4 on AT&T and Verizon (an exploit was found, but there is no out of the box official method; you must rely on a bug in the lock). – eldarerathis Dec 26 '13 at 17:15
  • 1
    And at this point, I think I've said all I really can, so I'm going to leave this be. You can continue to argue your points, but I'd suggest at least finding some sources that support you, aside from the single Wikipedia entry you seem to have either misread or misquoted. I tried to explain what was wrong in the answer as clearly as I could, and the voting seems to support me (as do the references I'm linking to), so I don't think there is anything more I can add. – eldarerathis Dec 26 '13 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.