TWRP Recovery for Samsung Galaxy A40. It’s only for Exynos variants SM-A405F, SM-A405FN, SM-A405FM. The TWRP Recovery worked with Magisk for rooting. Read notes / Warning on the bottom of this post before flashing TWRP recovery on your Samsung Galaxy A40. Take it your own risk! Follow the instruction carefully and Make sure to backup all your important data!
Step by step flashing TWRP Recovery on Samsung Galaxy A40 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 )
- Make the bootloader are unlocked if not read How to unlock Bootloader
- 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 TWRP, A40 MultiDisabler, DM-VerityDisabler&ForceEncrypt and GSI_MTP_Enabler
- Copy A40 MultiDisabler, DM-VerityDisabler&ForceEncrypt and GSI_MTP_Enabler to SD Card. MTP feature may be not work.
Flashing TWRP Recovery on Galaxy A40 Android 9 Pie :
- Make sure the bootloader are unlocked
- 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 Reboot to bootloader. Connect your Samsung Galaxy to PC using USB Cable.
- IMPORTANT!: Uncheck “Auto Reboot” in Options!
- Flashing TWRP as AP in ODIN, then click start.
- Magisk is now successfully flashed to your device! Several steps before you can properly use the device.
- 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 until TWRP Recovery Mode Appears.
- Select Wipe -> Format data.
- Install A40 MultiDisabler
- Select Reboot to Recovery
- Select Reboot to System
If something goes wrong and you want to unroot it, just flash the ROM to make it works again.
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, Flashing TWRP Recovery will trip the KNOX WARRANTY VOID status !
- If your device storage is encrypted, Flashing TWRP Recovery 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.
Source: XDA-Developer Forums