[RECOVERY][OFFICIAL] TWRP for Galaxy A40 [A405FN]

Search This thread

Charlie Cooper

Senior Member
Jun 29, 2015
62
17
Samsung Galaxy A40
That worked. Thanks so much! I still get a messages like 'this bootloader is unlocked press power button to continue booting' but seems fine otherwise.

Well done to everyone who was able to follow this guide and fill in the blanks!
 

TeoFriendly

Member
Jan 13, 2014
9
1
Hi, friends
sorry if this question is already asked before.
Does this tutorial works for rooting A40 with Android 11 ?
Or do i need to find some another tutorial. o only need to root. nothing more.
Please let me know if there is any less complicated method :)
Thanks

EDIT: I rooted the phone successfully with magisk. :)
 
Last edited:
  • Like
Reactions: Charlie Cooper

sjiamnocna

Member
Feb 19, 2017
19
2
Brno
Samsung Galaxy A40
Hi,
I'm using JOdin with Linux Mint 20 (5.8.0-28-generic)

After editing UDEV rules and installing libusb-devel it detects the device, it downloaded the PIT, but when flashing it says
Code:
custom binary (recovery) blocked by OEM lock

I've tried that settings->devtools->OEM unlock switch in both positions multiple times and never got the chance to see the "press volume up to OEM unlock" screen nor to flash the recovery.

I tried to flash with JOdin3 in PDA slot

What shall I do? I desperately don't wont the original system there... please help :)
 
Last edited:

Solamiii

New member
Nov 16, 2020
3
0
Hi, friends
sorry if this question is already asked before.
Does this tutorial works for rooting A40 with Android 11 ?
Or do i need to find some another tutorial. o only need to root. nothing more.
Please let me know if there is any less complicated method :)
Thanks

EDIT: I rooted the phone successfully with magisk. :)
Hi,
I would like to know how you went about having rooted in it on android 11

See ya!

PS : i'm French and i can read English but i have trouble putting it into practice when i use Google translate.
 

chillout23

Senior Member
Feb 21, 2011
378
22
Somewhere around
I made a file with TWRP + boot.img + vbmeta for the step 7, so if someone is interested, you can download it here .
Just flash it with Odin in AP slot.
Please make sure you are on the latest firmware (CUD3)
Work perfect. Thank you so much :)

EDIT 1:
Unfortunately when install your file, all files from mobile phone is gone.
Before factory reset/clear data from TWRP I checked storage...completely empty and when boot to system all empty and camera problem...
Tried 2 times followed every step from 1st post, and every time same.
Internal storage completely empty - without any folder or file?!
Camera cannot save pictures...not working at all my friend :)

Will try now step by step from 1st post and will see...

EDIT 2:
Step 7 - when flash recovery phone bootet again to download mode but not to system...and when was like that I flashed and vbmeta too...boot to TWRP and same thing again?!
What is going wrong?

Flashed every file with "AP"

Anybody help please :)
 
Last edited:

Lenny Bard

Senior Member
Jun 24, 2016
271
1,047
Here is the TWRP file for UF2 firmware : DOWNLOAD

Work perfect. Thank you so much :)

EDIT 1:
Unfortunately when install your file, all files from mobile phone is gone.
Before factory reset/clear data from TWRP I checked storage...completely empty and when boot to system all empty and camera problem...
Tried 2 times followed every step from 1st post, and every time same.
Internal storage completely empty - without any folder or file?!
Camera cannot save pictures...not working at all my friend :)

Will try now step by step from 1st post and will see...

EDIT 2:
Step 7 - when flash recovery phone bootet again to download mode but not to system...and when was like that I flashed and vbmeta too...boot to TWRP and same thing again?!
What is going wrong?

Flashed every file with "AP"

Anybody help please :)

I didn't really understand what you did but here is how I do it :

1- I assume you have already unlock the bootloader (step 1 to 6 in the first post)
2- Reboot to bootloader (power off, press vol up + down and connect the phone to your computer)
3- Put TWRP .tar I provide (twrp-a40-xxx) in AP slot. Important : Flash the version that corresponds to your firmware.
4- Your device will reboot to TWRP. Format data and flash the Multidisabler (link in 1st post). These files need to be on a SD card.
5- Now you can reboot or flash Magisk if you want to root your phone.

The files I provide is only if you "start from scratch".
 
  • Like
Reactions: chickenscanfly

hyunury

New member
Jul 4, 2021
1
0
I am using A405S (South Korea SK Telecom) with Android10, SW A405SKSU3BTJ2. I followed the step and succeed to install the TWRP, Vmeta, Mutlidisabler. Mask rooting is also completed. But I have the issue that LTE is continuously disconnected and connected. So I can not use the LTE data at all. Wifi is working well. It seems TWRP/Vmeta installation to this SW causes some problem. Is there any way to resolve this issue? I want to use both Wifi and LTE.

+ Adding
I found air plane mode is intermittently on and then off. It cause LTE disable and enable again once air plane mode is off. Is there a way to permernently disable the air plane mode?
 
Last edited:

sabotage154

Senior Member
Apr 24, 2011
133
10
I am using A405S (South Korea SK Telecom) with Android10, SW A405SKSU3BTJ2. I followed the step and succeed to install the TWRP, Vmeta, Mutlidisabler. Mask rooting is also completed. But I have the issue that LTE is continuously disconnected and connected. So I can not use the LTE data at all. Wifi is working well. It seems TWRP/Vmeta installation to this SW causes some problem. Is there any way to resolve this issue? I want to use both Wifi and LTE.

+ Adding
I found air plane mode is intermittently on and then off. It cause LTE disable and enable again once air plane mode is off. Is there a way to permernently disable the air plane mode?
did you find out what was going on here and fix? i have the same problem on the a405s
latest twrp and vbmeta from this post
magisk

anyone know if i can flash a405fd, a405fm or a405fn to this phone via odin?
 

Mikeligno

Senior Member
May 3, 2016
62
19
29
Napoli
Here is the TWRP file for UF2 firmware : DOWNLOAD



I didn't really understand what you did but here is how I do it :

1- I assume you have already unlock the bootloader (step 1 to 6 in the first post)
2- Reboot to bootloader (power off, press vol up + down and connect the phone to your computer)
3- Put TWRP .tar I provide (twrp-a40-xxx) in AP slot. Important : Flash the version that corresponds to your firmware.
4- Your device will reboot to TWRP. Format data and flash the Multidisabler (link in 1st post). These files need to be on a SD card.
5- Now you can reboot or flash Magisk if you want to root your phone.

The files I provide is only if you "start from scratch".
Any way to get the TWRP files for UH2 rooting? please help me i cant root android 11 a40 UH2
 

Philandroid

Member
May 21, 2021
26
1
Samsung Galaxy A40
Many thanks @Lenny Bard for the UH2 version!

As a Linux user I don't have a working Odin ready. I understand I can flash TWRP via adb or fastboot. Should I use adb push, adb sideload or what's the fastboot command for it?

Could anybody please point me?

TIA,
Phil
 
Last edited:

sjiamnocna

Member
Feb 19, 2017
19
2
Brno
Samsung Galaxy A40
Many thanks @Lenny Bard for the UH2 version!

As a Linux user I don't have a working Odin ready. I understand I can flash TWRP via adb or fastboot. Should I use adb push, adb sideload or what's the fastboot command for it?

Could anybody please point me?

TIA,
Phil
Hi there another lost with Linux person :)

I couldn't do it from Linux (heimdal-flash) it got stuck each time.
After some time I downloaded the PIT file via command line, but the GUI always stucked me with "info" screen and theres no docs on "command line" flashing so I'm not sure if I should do it.

But it didn't work neither from Windows dualboot nor from another computer (Odin) so I guess something is wrong with the phone.

I've got Arduino to work pretty simply. But not Samsung A40 :/

Anyone have idea that could help?
 

ThunderSquirrel

New member
Aug 18, 2021
2
2
Many thanks @Lenny Bard for the UH2 version!

As a Linux user I don't have a working Odin ready. I understand I can flash TWRP via adb or fastboot. Should I use adb push, adb sideload or what's the fastboot command for it?

Could anybody please point me?

TIA,
Phil
I successfully flashed TWRP with heimdall. To do so,

1 Boot into download mode and check that heimdall is working:
Bash:
heimdall print-pit
The device will reboot if heimdall is working properly.

2 Boot into download mode and flash vbmeta.img:
Bash:
heimdall flash --VBMETA vbmeta.img --no-reboot

3 When done, reboot into download mode and flash TWRP:
Bash:
heimdall flash --RECOVERY recovery.img --no-reboot

4 Now reboot into recovery.

It is possible to flash both the vbmeta and the recovery in just one command, but I haven't tried it:
Bash:
heimdall flash --VBMETA vbmeta.img --RECOVERY recovery.img --no-reboot
 

Philandroid

Member
May 21, 2021
26
1
Samsung Galaxy A40
Thanks for this little Heimdall tutorial! Meahwhile I managed to revive my old Windows PC to flash TWRP using Odin.

I've got some more flashing jobs on my desk, surely another chance for Heimdall :)
 

ThunderSquirrel

New member
Aug 18, 2021
2
2
Thanks for this little Heimdall tutorial! Meahwhile I managed to revive my old Windows PC to flash TWRP using Odin.

I've got some more flashing jobs on my desk, surely another chance for Heimdall :)
There's another option for a Linux user (not as convenient as using heimdall though): run odin on Windows under QEMU and pass-through the usb port connected to the device.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    Team Win Recovery Project 3.6.1
    TWRP-Feature-Image-810x298_c.png


    Special Notes:
    1. DON'T FORGET TO ENABLE "OEM UNLOCK" (located in Developers options)
    2. KNOX will be tripped once you flash custom binaries to your phone. Your warranty may be voided. However this may not affect you if your country forces Samsung to provide hardware warranty regardless of software status
    3. Samsung Firmware OTA (aka System Updates) will no longer work once you flash custom binaries. You can flash custom ROMs if you want to keep the OS up-to-date
    4. All apps that use KNOX like Samsung Pay, Secure Folder and maybe more will no longer work
    Download:
    Changelog:
    • 21.10.2021
      • Rebased kernel source to CUH4
    • 16.06.2021
      • Rebased kernel source to CUC2
    • 03.05.2020
      • Rebased kernel source to BTB8
    • 25.04.2020
      • Rebased kernel source to ATA4
    • 07.12.2019
      • Initial Release
    Guide:
    • If you already have a custom recovery installed:
      1. Boot to your custom recovery
      2. Flash the recovery image
    • If you are starting from scratch:
      1. Go to Developer Settings and enable "OEM Unlock" option
      2. Power off the device and boot in download mode
      3. In download mode, you will see the long press and volume up option to unlock the bootloader
      4. Unlock the bootloader. That will wipe your device so be sure you made a backup of your data
      5. After bootloader unlock, boot up the phone and make sure it is connected to the internet or it will trigger rmm prenormal
      6. Setup the phone without google account and others
      7. Reboot in download mode and flash the recovery and vbmeta images
      8. Boot to TWRP
      9. Format data in TWRP
      10. Flash the Multidisabler zip
      11. Now you can reboot

    Contributors
    ponces, geiti94, ianmacd
    Source Code: https://github.com/TeamWin/android_device_samsung_a40
    Kernel Source Code: https://github.com/ponces/android_kernel_samsung_universal7904
    6
    Good news everyone!
    I finally have a working build with a proper fix!

    I was so wrong and this all hapened because Samsung has decided to finally fix in their firmware files the name of the SoC that our devices has. So, due to this, exynos7885 is no longer mentioned but instead it is exynos7904. This name change affected some filenames in the kernel, boot and recovery. One of the examples is the fstab as @tys0n correctly mentioned. The file that exports the ANDROID_ROOT variable was also affected and this was the main problem.

    Go grab the new builds in the OP! The Multidisabler zip is also fixed as now we will be using ianmacd's version.
    4
    I made a file with TWRP + boot.img + vbmeta for the step 7, so if someone is interested, you can download it here .
    Just flash it with Odin in AP slot.
    Please make sure you are on the latest firmware (CUD3)
    4
    this is what i did ... create a tar file with twrp, boot and vbmeta inside.
    Go to Settings >> About phone >> Software version and then tap the build number for about 10 times to enable developer mode. Once enabled, you will see the message "You are now a developer" on the screen.
    Go back to the main Settings screen and look for Developer Options. Inside you will find OEM unlocking and USB debugging. Enable both options by tapping the switch.
    Now turn off your smartphone and start the download mode. You can do this by pressing the Volume Up and Volume Down buttons simultaneously for a couple of seconds.
    Note: While using the above combination, you need to connect your device to your computer via the USB cable.
    Another note: make sure all necessary drivers are already installed on your computer. If not, the desktop will not detect the smartphone.
    After step 3, you should now be able to see the download mode with a large warning text written at the top of the screen.
    Now, long press the Volume Up button to unlock the device bootloader. You will now be redirected to a confirmation screen. Press Volume Up to proceed with the unlock mode.
    Your smartphone will restart and a Bootloader unlock message will appear on the screen. Acknowledge it and continue further by pressing the power key.
    Note: All your data will now be deleted. Hopefully, you've followed our tip and created a full backup.
    You will now see the device setup screen. Complete it without linking any Google or Samsung account. You can also skip installing the app.
    Once you are on the home screen, enable Developer Options as mentioned in step 1 of the guide.
    Now open developer options and look for OEM unlock. The option should be disabled
    Make sure the USB Debugging option is enabled on your smartphone.
    Download the Odin software and extract it to your computer. You should now be able to see the Odin Exe file after extraction. Run it as an administrator.
    Note: You may receive a popup related to ADB drivers. Let the update process finish automatically.
    Now restart your phone in download mode and while doing this connect your smartphone to the desktop. You can follow step 3 of the Unlock Bootloader guide to do that.
    Once the phone is connected to the computer and is in Download mode, you will be able to see the blue mark on the Odin software. This means that the software has detected your smartphone.
    add the previously created .Tar file to the Odin software by pressing the AP button.
    Note: Make sure Re-Partition and Auto Reboot is unchecked. You can find it in the options menu.
    Now, hit the Start button to start the flashing process. This will take a couple of seconds so that you can sit back and relax.
    Once the whole flashing process is complete, you will see the Pass message on the screen somewhere.
    How to exit download mode and enter TWRP recovery?
    To exit download mode and access TWRP recovery, you can hold down the Volume Down and Power keys simultaneously. When the screen goes blank for a few seconds, ...you need to release the Volume Down key and then quickly switch to the Volume Up button. When TWRP recovery appears, you can release all keys at the same time.

    Once you are inside TWRP recovery, go to the Wipe option and then tap on the Format Data option. Type Yes to continue.
    Once the deletion is finished, go back to the main menu in TWRP recovery and tap the Restart button.
    Within the Restart option, tap on the Recovery option. This will reboot you into custom recovery.
    Now you need to install the multidisabler file using the Install option. Once the file has been updated, you can restart your smartphone.
    Note: You need to flash the Multidisabler file using TWRP recovery.
    3
    Just to let you all know that we now have official builds of TWRP !! :D