UNLOCKING THE BOOTLOADER
WARNING:- UNLOCKING YOUR BOOTLOADER VOIDS YOUR WARRANTY.PROCEED AT YOUR OWN RISK.
NOTE: Unlocking the bootloader will Wipe/ factory reset your device, and will delete
all personal data from your device such as apps, photos, messages, and settings.
- Make sure to take a backup of your entire device data.
- Go to Settings>About Phone>Tap build number continuously until you enable developers option,under developers option enable oem unlocking.
- Download the Minimal ADB and Fastboot.
- Install the latest Motorola USB Drivers.
- Put your device in fastboot mode (power off, then press the power and volume down buttons simultaneously).
- In Search Menu, search for Minimal ADB and Fastboot and open it.
- Connect your Phone to PC.
- Type this in the CMD prompt window:- fastboot oem get_unlock_data
- You will get a return string.The returned string will be used to retrieve your unlock key. Copy it. [Right Click-Mark- Mark the text by pressing the shift key-Now press Ctrl+C]
- Paste all the lines together in a notepad. Remove the empty spaces.
On a Windows Desktop, the returned string format would be
$ fastboot oem get_unlock_data (bootloader) 0A40040192024205#4C4D3556313230 (bootloader) 30373731363031303332323239#BD00 (bootloader) 8A672BA4746C2CE02328A2AC0C39F95 (bootloader) 1A3E5#1F53280002000000000000000 (bootloader) 0000000
Paste together the 5 lines of output into one continuous string without (bootloader) or ‘INFO’ or white spaces. Your string needs to look like this:
- Now go to the Motorola Site. Sign in using your Google account or Motorola ID. Scroll down the page and paste the copied string in the field at step #6. Then click on ‘Can my device be unlocked?’, after which a "REQUEST UNLOCK KEY" button will appear at the bottom of page.
- To get your unlock key, select the ‘I Agree’ option. Note: You will receive an email with your Unlock Key at the email address you used to log in there.
- Important – Copy the 20-character key that Motorola sent you via email. Make sure your device is connected.
- Then in CMD type: fastboot devices (To check your device is connected)
- Then type: fastboot oem unlock UNIQUE_KEY
NOTE:- In above command, replace the word ‘UNIQUE_KEY’ with the unlock code that you got via email. Then hit enter and the unlocking process should begin.Once done your device will reboot.
RELOCKING THE BOOTLOADER
- Boot into fastboot mode.
- Open cmd and type:- fastboot oem lock
FLASHING CUSTOM RECOVERY
Currently we don't have a separate recovery partition to flash recovery directly,so we have to temporarily boot twrp by the following process.
- Download the lastest TWRP Recovery from here.
- Rename the downloaded recovery to twrp.
- Boot device into fatboot mode.
- Connect device to PC.
- Open CMD in the downloaded folder and type:- fastboot boot twrp.img
Thanks to @lalitjoshi06 for the permanent twrp installer.
Follow the instructions from his thread TWRP INSTALLER
ROOTING THE DEVICE
- Download the latest Magisk Stable/Beta Zip from here.
- Boot into custom recovery
- Flash the downloaded zip
Last Updated 2019-01-15