Skip to content

Instantly share code, notes, and snippets.

@mi4code
Created October 19, 2023 17:22
Show Gist options
  • Save mi4code/f09507a43f1c6b9bfa72c551c3121b5a to your computer and use it in GitHub Desktop.
Save mi4code/f09507a43f1c6b9bfa72c551c3121b5a to your computer and use it in GitHub Desktop.
How to root Motorola Edge 40

How to root Motorola Edge 40

Here is how I rooted my Motorola Edge 40 (can be applied on other Motorlola phones). Sharing because I had hard time finding good rooting guide. Hope you find this usefull.

Disclaimer

Do at your own risk and only if you know what are you doing.

Install drivers

NOTE: i got fastboot working after couple of tries, here is the process i expect to work

If you dont have already, download adb and fastboot. Put your phone into fastboot mode (turn it off, then hold volume down + power key so turns on or use adb reboot bootloader) and connect it to your PC. Using fastboot devices you should be able to see your phone. If not, install driver from here. If still not, open Device manager, find your phone in the list and using Update driver install driver automatically. Then it should work.

Unlock the bootloader

WARNING: This step will wipe all data on the device! NOTE: This probably wont void device warranty but Motorola will definetly know that you unlocked bootloader of your device. NOTE: You need to use the phone continuously for a week before the Settings->Developer options->OEM unlocking option becomes availible. (more info) SOURCE: here.

Follow this guide on Motorola's website (you will need Motorola account for that). For me it took about 10 mins to get the email with the code. You will by asked by fastboot to enable Settings->Developer options->OEM unlocking (if you havent already). Now you will have to set up the phone because it did factory reset.

Patch and install firmware image

NOTE: more firmware sources here NOTE: basic and partial tutorial here SOURCE: here

You will need to get firmware image for your phone in order to patch it. There are two ways how to get such image:

  1. Download it from somewhere on the internet: I dont recomend this one due to risks this leads to (anyway i checked coresponding file aganist the one i got using the second method and their checksums matched). But if you still want to go this way, download it from Lolinet Mirrors (then go to /lyriq/official/... - you will have to find the rest of the dirnames in Settings->Device info or CPU-Z may help you).
  2. Get it using Rescue and Smart Assistant: Download Rescue and Smart Assistant from here, install it and go trough the registration process. Go to the Rescue, choose the right model (using USB connection or by IMEI) and download the firmware image it offers to you. This will download and extract the firmware image to C:/ProgramData/RSA/Download/ (if you want the downloaded unexctracted formware image archive file, go to the Download folder, start downloading and kill the app process as soon as it starts with extraction of the archive). Now extract/open the downloaded firmware image archive. Locate boot.img and copy it to your phone. Install Magisk to your phone. Follow the patching process here (the phone has boot ramdisk, has vbmeta partition, file to patch is boot.img) Patch the file and copy the patched file to your computer. Boot into fastboot mode again and type fastboot flash boot_a <patched file> or fastboot flash boot_b <patched file> according to the slot currently used (here is how to find out). Skip the vbmeta part. Finally reboot using fastboot reboot.

Install Universal SafetyNet Fix

SOURCE: here

Now you should see Installed in the Magisk app. Unfortunately now your phone wont pass Play Integrity Check so Google Pay or banking apps will not work. To pass at least BASIC_INTEGRITY (app for checking here) open Magisk, set up DenyList for all involved apps (google play services, google wallet, google play, banking apps), install this module and reboot. And thats all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment