How to Unlock Bootloader, Install TWRP and Root Moto G7 using Magisk

Unlock Bootloader, Install TWRP recovery and Root Moto G7

Rooting your phone isn’t too difficult. However, you will have to be careful when you try rooting your phone.

Having a guide with you can help you easily unlock your phone, and root it. 

Rooting can give added functionality to the users, and they may be able to do things they were not able to do, without rooting their device.

Users will be able to uninstall system apps, install custom ROMS, and do various other things. 

If you want to root your device, then you need to follow this guide.

In this article, we will be discussing how you can uninstall the bootloader of your device, install TWRP, and root your Moto G7 using Magisk. 

Related Article: How to Unlock bootloader, Install TWRP and Root Samsung Galaxy Note 9

Things To Know Before You Get Started

There are certain things that you need to know before you get started with the process. Take care of the tips that are mentioned below-

  • Have a backup of your device. Rooting will clear the data on your phone, so when you try to root your device, ensure you have the backup of your device.
  • Ensure your phone is charged up to 80% or more. Your device should not shut down in between the process, so you must ensure that it is charged to 80% or more.
  • Follow the instructions carefully. The very next thing that you should take care of is following the instructions carefully.

Also Read: How to Install TWRP and Root Samsung Galaxy Note 8

Downloads That You Will Need

There are certain files that you need to download before you get started with the process. Given below are all the files that you need to download to root your Moto G7.

You can either download the TWRP from the official repository of TWRP. Ensure you download the .img file of the TWRP recovery.

Unlocking Bootloader, Installing TWRP, And Rooting Moto G7

Moto G7
Moto G7

Now that you know what you will need to root your device, let’s get started with the process.

The process will be divided into three steps- unlocking the bootloader, installing TWRP, and then rooting using Magisk.

Also Read: Best Custom ROMs for Moto G7 [River](Android 10 & 11) in 2021

Unlocking The Bootloader Of Your Phone

  • Firstly download and extract the Android SDK and Fastboot tools file on your PC.
  • Now you will have to unlock the bootloader of your phone.
  • Head to the settings of your phone, and then head to the about phone section. In the about phone section, tap on build number a few times, until you see a notification ‘You are now a developer’ at the bottom of your screen.
  • Now head back to the settings menu, and search for developer options. In the developer options, you will find an OEM unlocking toggle. Turn it on to enable the OEM bootloader unlocker. Also, you will find a USB debugging toggle, ensure you turn it on as well.
  • Next, connect your phone to your computer using the USB cable. Ensure the drivers for your phone are installed.
  • Now head to the ADB fastboot folder, and right-click on the empty area, and then click on ‘Open command window here.’
  • Now in the command prompt type adb devices, to ensure whether the device is connected or not. You will see a USB Debugging popup on your phone. Allow it.
  • Next, you will have to boot your phone to bootloader mode. To do so, execute the command adb reboot bootloader in the command prompt terminal.
  • Your phone will show bootloader locked message if it is locked. If your bootloader is locked then type in the command fastboot devices and execute it to ensure the drivers are installed properly. This will show you your device’s serial number, and this will ensure that the phone is connected properly and all the drivers are installed.
  • Now you can tap the volume down button to boot to download mode. You will be prompted to select download mode option. Navigate to the option using volume keys and select it using the power option.
  • Type in the command fastboot oem get_unlock_data  to begin unlocking your device. This will return a string.
  • Copy the five lines of the string and copy them to the notepad. Now delete the space between the string to arrange it in a single line.
  • Ensure you only copy the string and not the bootloader or INFO prefix.
  • Now you will need the key to unlock the phone. For this visit the Motorola bootloader unlocking site and sign in with your account.
  • You can sign in with your Google account or with your existing Motorola account. You will be asked to paste the string that you copy in the field required, and then click on ‘Can my device be unlocked?’ and you will receive a mail with unlock key.
  • Now copy the unlock key that you receive, and execute the command: fastboot oem unlock UNLOCK_KEY in the command prompt terminal.
Note: Replace UNLOCK_KEY with the unlock key 
that you copied from your mail.
  • Once done, you will have successfully unlocked the bootloader of your phone.
  • Now boot the phone, and set it up.

Installing TWRP Recovery On Your Moto G7

  • Now that you have unlocked the bootloader of your phone, you must install the TWRP recovery image. To do this, ensure you have downloaded the recovery image.
  • Copy the recovery image to the platform-tools folder on your computer.
  • Now connect your phone and your PC using USB, and ensure file transfer is on.
  • Next, you will have to copy the TWRP recovery image to the internal storage of your phone. If you using Moto G7 regular version, then you need to ensure that you use a MicroSD card, and copy the file to it.
  • It is because the TWRP cannot decrypt the internal storage initially, and that’s why you will need the file on the external storage like a MicroSD card.
  • Now boot your phone to bootloader mode. To do so, power off the device. Now hold the power button + volume down combo for a few seconds to boot your phone into bootloader mode.
  • Ensure your device is still connected to your PC using the USB cable.
  • Next, enter the command in the command window fastboot boot twrp-image.img and execute it.
  • You will have to replace the twrp-img with the file name of the TWRP recovery that you download. Know that .img is the extension, so you need not change that.
  • Your phone will now reboot to TWRP recovery mode.
  • In the TWRP recovery mode, select the advance option, and then select Install Recovery Ramdisk.
  • Now head to the location where you copied TWRP image, and select the image.
  • Swipe the toggle to install the image, and TWRP will be installed on your device.

Rooting Your Device Using Magisk

  • Now that you have installed TWRP, you can finally root your device. Download the Magisk file on your computer.
  • In case, you are having the regular Moto G7, download the copy-partitions-AB.zip file as well.
  • Ensure your phone is connected to your PC using USB, and it is still in TWRP recovery mode.
  • If it is not in TWRP recovery mode, then first boot it into the TWRP recovery mode by switching off the device and pressing volume up + power button for a few seconds.
  • In the TWRP recovery mode, head to the mount menu, and then press the enable MTP button. If the MTP is already enabled, then it will show ‘Disable MTP’.
  • Now copy the Magisk zip file to the storage of your phone. If you are using the regular Moto G7, copy the ‘copy-partitions-AB.zip’ file along with the Magisk file.
  • After the files are copied to the storage of your phone, you can disconnect your phone from your PC.
  • Now head back to the TWRP main screen, and here select Install.
  • Now head to the location where you copied the files, and select the Magisk file. Now for regular Moto G7, tap on add more zips option, and then select the ‘copy-partitions-AB.zip’.
  • Both the files will be added to the flashing queue.
  • Now swipe the toggle to confirm flash. After the process is completed, you will have successfully rooted your Moto G7.

Conclusion

That’s the complete process of unlocking the bootloader, installing TWRP, and unlocking the Moto G7 using Magisk.

We divided the complete process into three parts so that it will be much easier for you to keep up with the process.

Make sure you follow the steps carefully. We hope you find the article helpful. If so, do let us know in the comments section.

Anurag Jain

A content writer, tech geek, and fitness enthusiast out there to explore the world.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts