How to root Samsung Galaxy M40 SM-M405F Android 9 Pie using ODIN software. It may be works for other variants SM-M405F, SM-M405FN, SM-M405G. This Root method use Latest Magisk Manager and patched AP tar file. Read notes / Warning on the bottom of this post before perform root your Samsung Galaxy M40 SM-M405F. Take it your own risk! Follow the instruction carefully and Make sure to backup all your important data!
Step by step Rooting Samsung Galaxy M40 SM-M405F Android 9 Pie
- Enable Developer Options: go to Settings -> About device. Tap 7 times on Build number to enable Developer options.
- Enable OEM unlock and USB debugging options ( Settings -> Developer options )
- Unlock bootloader, If not, Read How to unlock bootloader Galaxy M40
- Download and Extract ODIN v3.13.1 from https://odindownload.com/SamsungOdin/
- Download and Install Samsung Mobile Phone Drivers: http://developer.samsung.com/technical-doc/view.do?v=T000000117
- Download Latest Magisk Manager ( MagiskManager-v7.3.2.apk )
Patched AP .tar and Rooting Galaxy M40 SM-M405F Android 9 Pie with Magisk Manager :
- Download the firmware Galaxy M40 SM-M405F.
- Unzip the firmware and copy the AP tar file to your device. It is normally named as AP_[device_model_sw_ver].tar.md5. Copy AP tar file and MagiskManager-v7.3.2.apk to your phone.
- Install Magisk Manager ( MagiskManager-v7.3.2.apk ) on your phone.
- In Magisk Manager: Install → Install → Select and Patch a File
- Select the AP tar file. Magisk Manager will patch the whole firmware file and store the output to [Internal Storage]/Download/magisk_patched.tar. Copy magisk_patched.tar the tar file to your PC
- Enter Download Mode : Turn Power Off. Press and hold Volume Up key + Power Key, When Samsung Logo appears release Power Key only, keep pressing Volume Up key until Android Recovery Mode Appears. Select Wipe data / Factory reset, Select Reboot to bootloader. Connect your Samsung Galaxy to PC using USB Cable.
- Flash magisk_patched.tar as AP in ODIN, together with the BL, CP and HOME_CSC files. Never flash only an AP file, as Odin can shrink your /data file-system if you do.
Important: Uncheck “Auto Reboot” in Options!
- Magisk is now successfully flashed to your device! Several steps before you can properly use the device.
- Full data wipe is mandatory! Do not skip this step.
Press and hold Volume Down + Power Key, when the screen blank quickly press and hold Volume Up + Power key, when Samsung Logo appears release Power key only, keep pressing Volume Up key in the Android Logo screen with text “Erasing”, when screen blank again Press and Hold Volume Up + Power key. When Samsung Logo appears release Power Key only, keep pressing Volume Up key until Android Recovery Mode Appears. Select Wipe data / Factory reset. Select Reboot system now.
- After the device is booted up, do the usual initial setup. It need more time and patient. After finished, You will see Magisk Manager app in app drawer. If not, Install it manually.
- Connect the phone to Internet, open Magisk Manager. Magisk Manager will ask to do additional setups. Let it do its job and the app will automatically reboot your device.
- Done! You can use Root Checker to check it, Enjoy!
- To prevent loosing magisk root after reboot. NEVER REBOOT NORMALLY but Reboot it via Magisk or Fully Power Off then Turn Power On.
If something goes wrong and you want to unroot it, just flash the ROM to make it works again. Read How to flash Galaxy M40 SM-M405F.
Notes / Warning!
- Use at your own risk, I’m not responsible for bricking your device.
- Using the incorrect file may brick your device.
- If your target device has a custom firmware flash counter, Rooting will trigger it. If you’re lucky, Triangle Away has support for your device and can be used to reset the counter.
- If you have a KNOX-enabled device, Rooting will trip the KNOX WARRANTY VOID status !
- If your device storage is encrypted, Rooting will wipe your data !
- If you have locked bootloaders, flashing one of these will probably brick your device – with the exception of Nexus devices, which will usually automatically “OEM unlock” and wipe your data !
- Make sure to backup your important data before root it.