These are the steps I took in order to unlock the bootloader of my Moto G5 Plus. Ultimately I would like to install custom recovery software on it à la TWRP and root it with chainfire’s SuperSu. I’ve also included some extra notes in places that that gave me problems or I thought were tricky. The normal caveat applies: these steps worked for me, but your mileage may vary.
Prerequisites for Bootloader Unlocking
- A Moto G5 Plus phone
This should work for either the 32GB/2GB or 64GB/4GB variants but will definitely not work for, and could possibly brick, any Amazon “Special Offers” Moto G5 Plus.
- A PC running Windows, OS X, or Linux
I am using an Apple PowerBook Pro running Ubuntu 16.10 Yakkety Yak.
- The latest Motorola drivers
Windows (and possible OS X) users will need these, but Linux users will not.
Follow Motorola’s instructions to make sure your drivers are installed correctly.
- A Motorola Account
Sign in or create an account here:
- A USB B to Micro USB cable
- The Android Debug Bridge (ADB) and Fastboot programs
Originally you had to download the entire Android SDK if you wanted just these two programs. Fortunately Google recently made available for download the Android Platform-Tools package containing these programs. The most recent software is available for download at:
Download the appropriate version for your OS and install adb and fastboot according to Google’s instructions.
Moto G5 Plus Bootloader Unlocking
- Back up anything on your phone that you want to save: apps, user data, pictures, etc. You WILL lose it all if you follow these steps.
- Make sure that the Developer Options settings are activated on your phone. If they are not, and you don’t know how to turn them on, check out my post “How to Enable Developer Options in Android 7 Nougat“.
- With Developer Options activated, make sure that USB debugging is enabled. Go to Settings →Developer Options and scroll down until you find USB debugging. Turn it on if it is not already.
- Power off your phone.
- Boot your phone into fastboot mode by pressing the volume down and power buttons at the same time.
- Plug your phone into your PC.
- In the terminal run fastboot oem get_unlock_data
tpodlaski@Alabama:~$ fastboot oem get_unlock_data (bootloader) slot-count: not found (bootloader) slot-suffixes: not found (bootloader) slot-suffixes: not found ... (bootloader) Unlock data: (bootloader) 3A16580618696538# (bootloader) 5A5932323433504E4D46004D6F746F2047200000# (bootloader) A07864BA861114F6BE7B11C89E8F06FF742FC916# (bootloader) 839889FA000000000000000000000000 OKAY [ 0.099s] finished. total time: 0.099s
You may find some extraneous output when you run the command, but as long as you have lines similar to the (bootloader) lines above, and the return status was OKAY, then you can move on the next step.
- The data on the (bootloader) lines below the initial (bootloader) Unlock data: line needs to be assembled into a single string with no line breaks or carriage return. The easiest way to do this is in a text editor so open your favorite text editor and paste the date strings one immediately after the other making sure not to include (bootloader) or any leading spaces.
- Go to the Motorola unlock page. If you haven’t already, log in with you Motorola ID or create one if you do not have one.
- Read through and understand all of the risks associated with unlocking your bootloader. If you wish to continue, click the Next button at the bottom of the page.
- On the next page, scroll down to step #6 and in the text box paste the string you concatenated in step 7 into the textbox and then press the Can my device be unlocked? button.
- If your phone can be unlocked, a Request Unlock Key button will appear at the bottom of the page. Click to agree to the legal agreement and click the Request Unlock Key button. The unlock key will be e-mailed to address associated with your Motorola account.
- Check your mail for a message from Motorola containing the code you will need to unlock your device.
- With your phone in fastboot mode and connected to your computer, run fastboot oem unlock UNIQUE_KEY where UNIQUE_KEY is the key sent to you by Motorola.
tpodlaski@Alabama:~$ fastboot oem unlock 2CQRKLBXBGF545ZIN3ORP (bootloader) slot-count: not found (bootloader) slot-suffixes: not found (bootloader) slot-suffixes: not found ... (bootloader) Bootloader is unlocked! Rebooting phone OKAY [ 2.695s] finished. total time: 2.695s
Congratulations! Your bootloader is unlocked (and your warranty is void). Motorola won’t ever let you forget that you’ve unlocked your bootloader as every time you boot your phone you will be greeted with a screen like:
If you haven’t installed twrp yet, your warning screen might display “bad key” instead of “N/A” for the ID. Don’t worry about it. Nothing is wrong. I wasted a lot of time thinking this was a problem, but after doing some research I learned this was normal.
It is possible to get rid of this warning screen if it bothers you. It is my plan to write about it in a future post.
Unlocking your bootloader is just the first step toward totally taking control of your phone. Next comes installing a custom recovery like twrp which will allow you to root your phone and do tons of other cool things with it. I’ve already done both and will cover in detail how I did it in my next post. Until then …