A lot of Samsung Galaxy M40 owners have been looking for information on how to root their phones. The process is not as straightforward as it was with previous models, which required the use of TWRP for all rooting procedures.
This new model has a newer version of Android and does not work with TWRP. With this guide, we’ll be showing you how to root Samsung Galaxy M40 running Android 11 without TWRP.
One of the many advantages of rooting is that you can install custom firmware, which will allow you to update your device and get back any data that has been lost.
Steps to Root Samsung Galaxy M40
Below I have shown step by step procedure to Root Samsung Galaxy M40. You have to follow every step carefully, or else you may face trouble booting up your device again.
Please read the complete guide before applying the steps. This will avoid confusion.
Things to remember
- Make sure to disable all security Locks on your Samsung Galaxy M40.
- Take Full Backup of your Android device.
- You need a PC to perform the Commands.
- Fully charge your phone.
- Samsung Galaxy M40 Original USB Cable.
Note: Rooting is a complex process, so if you miss any of the below steps will end up bricking your device. So, make sure to follow all the steps carefully as shown.
We are not responsible for any loss and damage to your device. Apply the below steps with your own risk.
Step 1: Unlock Bootloader on Samsung Galaxy M40
- First, we need to enable Developer Options on Samsung Galaxy M40.
- Go to “Settings” on your Samsung Galaxy M40.
- Scroll down to the very bottom of the screen and select “About phone.”
- Next, select “Software information.”
- Tap on the “Build number” 5-6 times.
- Enter your phone’s lock screen PIN/Password/Pattern if prompted.
- You will now see the
"Developer mode has been enabled!"
toast message on the screen.
- The next thing we need to enable is the OEM unlocking option on Samsung Galaxy M40.
- Now we are ready to Unlock Bootloader on your Samsung Galaxy M40.
- First, power off your Samsung Galaxy M40 smartphone.
- Connect your phone to the PC while holding the Volume Down + Power keys together until you see the bootloader screen.
- Now press Volume Up key to enter “Device unlock mode.”
- Again press Volume Up key to confirm Bootloader Unlocking on Samsung Galaxy M40.
- Your device Bootloader is unlocked, and it should reboot automatically.
Downloads
In any steps, if the particular file is asked you to download, then you can come here and download it. We will update the links according to the latest build by developers.
- Download Magisk App (Latest Version) [Phone]
- Samsung USB Drivers (Optional) – Download [PC]
- SDK Platform Tools – Download [PC]
- Odin Flash Tool (Latest) – Download [PC]
Step 2: Download Stock Firmware for Samsung Galaxy M40
- Download Latest Frija Tool.
- Extract the zip file to your windows desktop.
- Open the extracted folder and double-click on the
frija.exe
file to launch the tool. - We need two things, first your phone’s model number and second, and CSC/regional code.
- You can get your phone model number by going to Settings → About phone.
- To view the CSC code, you can download “Phone Info SAM“ app.
- Once you have the above information, enter the required data in the Frija tool.
- Finally, click on the Download button.
Step 3: Extract AP Firmware file from Samsung Galaxy M40 Stock Firmware
- Once you have downloaded the firmware package, extract it.
- Now open the extracted folder, you will see firmware files in
.tar.md5
format. - Connect Samsung Galaxy M40 device to your PC/Laptop.
- Next, copy only the “AP firmware” file from your PC and paste it into your phone’s internal storage.
Step 4: Install Magisk App on Samsung Galaxy M40
- Download and install Magisk App on your phone.
- Open the Magisk app from the app drawer.
- Tap on the “INSTALL” button.
- Now here tap on the “Select and Patch a File.”
- Navigate to the internal storage and select the AP firmware file that you previously copied to the phone.
- Once the file is selected, tap on “LET’S GO.”
- Wait until Magisk patches the file.
- The patched image file can be found in the “Downloads folder.”
- Now connect your phone to the PC and copy the
magisk_patched.tar
file to the “firmware folder” on your PC.
Step 5: Boot your Samsung Galaxy M40 into Download Mode
- First, power off your Samsung Galaxy M40 device.
- Connect your smartphone to your PC while holding the Volume Down + Power keys together.
- You will now see the Bootloader screen.
- Now press Volume Up key to enter Download Mode.
Step 6: Flash Patched Boot.tar using Odin flash tool
- First, extract the Odin zip file to your desktop.
- Open the extracted folder and run Odin3 xxx.exe file.
- Connect your Galaxy device to PC/Laptop.
- You will see
ID:COM
section light up blue. It means the PC successfully recognizes your phone. - Click on the following slot buttons and select the corresponding firmware files:
- BL: Select the firmware file starting “BL”
- AP: Select the Patched AP firmware file (magisk_patched.tar)
- CP: Select the firmware file starting “CP”
- CSC: Select the firmware file starting “HOME_CSC”
- Once all firmware files are loaded to the Odin tool.
- Make sure to untick the Auto Reboot option under the “Options” tab.
- Once done finally, click “Start” to begin the flashing process.
- If the flashing is successful, you should see the PASS message on the Odin screen.
- Once the process completes, press the Volume Down + Power keys to exit Download mode.
- As soon as the screen goes black press the Volume Up + Power keys to boot into Recovery mode.
- Now once the Galaxy A51 boots into stock recovery mode follow the below steps.
- The first boot will take some time.
- That’s it! You have successfully rooted Samsung Galaxy M40 using Magisk.
You can also verify if your rooted Samsung Galaxy M40 passes SafetyNet by pressing the “Check SafetyNet” button in Magisk App.
After your device boots up, you will see Magisk App installed on your phone. This app will help you to manage Root permissions, install Magisk Modules, Magisk Hide, and other features
If you can’t see the app, simply download it from here.
Wrapping Up –
We hope you found this guide helpful in rooting your Samsung Galaxy M40 using Magisk on Android 11. If you have any questions about the process, please leave a comment and we will get back to you as soon as possible. Thank for reading!