[RECOVERY][UNOFFICIAL] TWRP for Galaxy A40

Search This thread

fahadali2315

Senior Member
Sep 18, 2013
3,159
6,313
Nottingham
Team Win Recovery Project 3.3.1

https%3A%2F%2Fwww.maketecheasier.com%2Fassets%2Fuploads%2F2019%2F01%2Ftwrp-featured.jpg

Exynos ONLY.
In NO way it is compatible with Snapdragon variants including but not limited to American(U/A/T/P/V), Chinese(0/8/6), Hong Kong(0), Japanese(SC-*), Canadian(W) variants.


Special Notes:
1. DON'T FORGET TO ENABLE "OEM UNLOCK" (located in Developers options).
2. KNOX will be tripped once you flashed 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 flashed 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 more work


Download: A40(Exynos variant - A405F)

TWRP

A40 MultiDisabler

DM-VerityDisabler&ForceEncrypt

GSI_MTP_Enabler

Sources:

TWRP


Guide:

  1. Go to developer settings and enable OEM unlocking
  2. Reboot the device into download mode
  3. Follow instructions in download mode to UNLOCK your bootloader
  4. This will wipe your data partition so beware , boot phone to system and let it connect to internet after bootloader unlock.
  5. Reboot into download mode and FLASH included TWRP tar file
  6. Boot into twrp
  7. Format Internal storage in TWRP
  8. Flash the multidisabler zip *Copy this to your SDCARD before wiping internal etc* this is for disabling all checks ( HUGE thanks to @geiti94)
  9. Make sure you are rooted with latest Magisk otherwise you will lose twrp
Bugs:

- USB OTG mount for the moment

[/YOUTUBE]​

NOTE: I don't own the device myself , but i do have A305F which is pretty similar to this device so building should be fairly similar

Thanks to @DerGraf1997 for testing blindly for me
 
Last edited:

fahadali2315

Senior Member
Sep 18, 2013
3,159
6,313
Nottingham
Telegram:

https://t.me/GalaxyA2019


Changelog:

22.09.2019

- Fixed MTP for GSI roms
included also GSI_MTP_PATCH.zip to get it working on Gsi properly
- For data backup to work , flash whole samsung firmware with odin , flash twrp and flash DM-Verity , force encryption fix linked in OP .Dont flash Multidisabler if you want data backup to work

17.09.2019

- Based on latest kernel sources available ASE4
- Initial Release



More instructions & differences between disablers

1. If you intend to flash twrp only & keep OneUi intact
Flash A40 multidisabler after flashing twrp, this will disable all samsung checks
Note : You will have to wipe your internal storage to get encryption fixed

2. If you plan on flashing some rom that has security checks disabled like GSI or custom roms. Then just flash twrp & flash Dmverity fix after rom. (data backup will only work with this)
Note: If you flash multidisabler and later on wish to flash gsi & dm verity . Your data partition wont backup in twrp.
 
Last edited:

chiri137

Member
Sep 19, 2019
6
6
Hey thanks alot for all the hard work. I've unlocked my bootloader and tried to write this image to my phone.
In Odin I only select your file, in the AP Tab.

However I get:

DOWNLOAD SPEED: FAST
Product name: SM-A405FN
Current Binary: Samsung Official
KG State: Prenormal
FAP Lock: Off
OEM Lock: Off(U)
Secure Download: Enabled
CCIC: S2MU106
CARRIER_ID: PHN
Warranty Void: 1 (0x0E03)
RP SWAEV B:2 K:2 S:2

ONLY OFFICIAL RELEASED BINARIES ARE ALLOWED TO BE FLASHED (RECOVERY) <--

Any idea how to remove the check for "official binaries" ? Here's the log from odin:

<ID:0/006> Added!!
<ID:0/006> Odin engine v(ID:3.1301)..
<ID:0/006> File analysis..
<ID:0/006> Total Binary size: 41 M
<ID:0/006> SetupConnection..
<ID:0/006> Initialzation..
<ID:0/006> Get PIT for mapping..
<ID:0/006> Firmware update start..
<ID:0/006> NAND Write Start!!
<ID:0/006> SingleDownload.
<ID:0/006> recovery.img
<ID:0/006> vbmeta.img
<ID:0/006> RQT_CLOSE !!
<ID:0/006>
<ID:0/006> Complete(Write) operation failed.
<OSM> All threads completed. (succeed 0 / failed 1)
 

tys0n

Senior Member
Hey thanks alot for all the hard work. I've unlocked my bootloader and tried to write this image to my phone.
In Odin I only select your file, in the AP Tab.

However I get:

DOWNLOAD SPEED: FAST
Product name: SM-A405FN
Current Binary: Samsung Official
KG State: Prenormal
FAP Lock: Off
OEM Lock: Off(U)
Secure Download: Enabled
CCIC: S2MU106
CARRIER_ID: PHN
Warranty Void: 1 (0x0E03)
RP SWAEV B:2 K:2 S:2

ONLY OFFICIAL RELEASED BINARIES ARE ALLOWED TO BE FLASHED (RECOVERY) <--

Any idea how to remove the check for "official binaries" ? Here's the log from odin:
You could try this: How to Fix Missing OEM Unlock KG State / RMM Prenormal on Galaxy A50
The step I think you missed is to boot phone to system and let it connect to internet after bootloader unlock. (Before flashing anything)
Unlock Boot Loader Galaxy A40 without Trigger KG State \ RMM state Prenormal
Hello!

I have two questions.
Can i install gsi roms with this twrp?
And can i install this twrp on my SM-405FM?
Yes, you can flash GSI's. It probably works for A404FM as well but I guess you'll have to try it to be sure.
 
  • Like
Reactions: LittleCherryFox

zavajon

Member
May 21, 2019
9
3

fahadali2315

Senior Member
Sep 18, 2013
3,159
6,313
Nottingham
Are You sure?
At https://topjohnwu.github.io/Magisk/install.html is written:
"Your device is non-A/B and uses system-as-root, so Magisk will be installed to the recovery partition of your device."
and
"Due to the fact that some devices no longer uses ramdisk in boot images, Magisk has no choice but to be installed in the recovery partition."

Yes. I am sure . This is not related to A30&A40 entirely.
You can try patching the boot.img with magisk manager and flashing in odin. You will have root.
Ps. Thats why one version of twrp will work on all security patches updates.
Otherwise you would need kernel updates with each twrp. Like A50 A70 etc. That boot from recovery.
 
Last edited:
  • Like
Reactions: AK2H

fahadali2315

Senior Member
Sep 18, 2013
3,159
6,313
Nottingham
Twrp updated 3.3.1-2
- Fixed MTP for GSI roms included GSI_MTP_PATCH.zip to get it working on Gsi properly
- For data backup to work , flash whole samsung firmware with odin , flash twrp and flash DM-Verity , force encryption fix linked in OP
Dont flash Multidisabler if you want data backup to work.
 

S Q 3 O P H

Member
Sep 15, 2014
6
0
Poznan
Twrp updated 3.3.1-2
- Fixed MTP for GSI roms included GSI_MTP_PATCH.zip to get it working on Gsi properly
- For data backup to work , flash whole samsung firmware with odin , flash twrp and flash DM-Verity , force encryption fix linked in OP
Dont flash Multidisabler if you want data backup to work.

The phone is in a boot loop. It doesn't work :(
 

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,080
9,927
The phone is in a boot loop. It doesn't work :(
It probably does, but your KG status is likely PRENORMAL.
OEM UNLOCK needs to be enabled and then you need to boot directly into TWRP after the first time you flashed it and flash the RMM V3 bypass otherwise you will get KG locked again at next boot.

I'm not sure if any of this is included in any of the patches in the OP.
 

fahadali2315

Senior Member
Sep 18, 2013
3,159
6,313
Nottingham
It probably does, but your KG status is likely PRENORMAL.
OEM UNLOCK needs to be enabled and then you need to boot directly into TWRP after the first time you flashed it and flash the RMM V3 bypass otherwise you will get KG locked again at next boot.

I'm not sure if any of this is included in any of the patches in the OP.
Multidisabler includes all of it.
I need to write instructions in a better way lol i suppose.
 
  • Like
Reactions: AK2H

fahadali2315

Senior Member
Sep 18, 2013
3,159
6,313
Nottingham
Second post updated with further instructions , hoping this helps everyone understand the differences.
Reverted to old twrp build, more testing needed.
 
Last edited:
  • Like
Reactions: AK2H

Sparko612

Senior Member
Sep 6, 2016
151
44
Do I need to flash multi disabler and magisk to be able to flash gsi rom as i ended up with bootloop to download mode after flashing no verity then gsi without root I even flashed the gsi mtp zip too
 

Sparko612

Senior Member
Sep 6, 2016
151
44
i had the same problem except i hsve tried to root via odin mehtod but all i get is bootloop , i floowed the guide properly too, so sorry havent flashed phones in a long time so a bit rusty
 
Last edited:

chiri137

Member
Sep 19, 2019
6
6
PERFECT ! WORKS excellent now. I'm writing this small noob-friendly tutorial so people can follow, I hope it's fool proof.

Step 0: Prereq
Download all the zip files from the main page on your phone and put them in the external SD card.

How to enable developer
Goto settings -> About Phone -> Software Information -> Tap "build number" 5 times

Enable OEM unlocking
Go back to Settings -> Developer options -> Enable "Oem unlocking" (if you do not see this option OR its grayed out try to connect your phone to internet, or follow this https://forum.xda-developers.com/ga...-to-skip-oem-lock-waiting-7-days-100-t3823361)

Note: Enabling OEM unlock here does not mean your OEM is unlocked! This switch only allows you to unlock it..Also enable USB debugging.

Turn off your phone.

Next: hold UP + Power until you will see a green screen. It must say "Hold long up to OEM/bootloader unlock." Follow those steps, to unlock it.
Congrats, now your OEM is unlocked. Turn off your phone.

Install TWRP
Hold UP + Power again. In the screen select "wipe data (factory reset). Then select Turn off Phone (should be one of the lower options)

While phone is off, hold UP + DOWN volume and attach USB cable to your phone. It should go into download mode.

In Odin, put the TWRP_A40 image in AP
Un-tick Auto reboot in the options tab.

Remove usb cable.

Tricky part: hold 7 seconds down+power. As soon as screen goes black hold UP + power!
Now you should be in TWRP!!

Once inside TWRP
Flash all the zip files you downloaded to your SD card
Go back to main menu, select reboot -> Recovery. Then reboot normally.

Enjoy =) Android must now boot up normally.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Team Win Recovery Project 3.3.1

    https%3A%2F%2Fwww.maketecheasier.com%2Fassets%2Fuploads%2F2019%2F01%2Ftwrp-featured.jpg

    Exynos ONLY.
    In NO way it is compatible with Snapdragon variants including but not limited to American(U/A/T/P/V), Chinese(0/8/6), Hong Kong(0), Japanese(SC-*), Canadian(W) variants.


    Special Notes:
    1. DON'T FORGET TO ENABLE "OEM UNLOCK" (located in Developers options).
    2. KNOX will be tripped once you flashed 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 flashed 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 more work


    Download: A40(Exynos variant - A405F)

    TWRP

    A40 MultiDisabler

    DM-VerityDisabler&ForceEncrypt

    GSI_MTP_Enabler

    Sources:

    TWRP


    Guide:

    1. Go to developer settings and enable OEM unlocking
    2. Reboot the device into download mode
    3. Follow instructions in download mode to UNLOCK your bootloader
    4. This will wipe your data partition so beware , boot phone to system and let it connect to internet after bootloader unlock.
    5. Reboot into download mode and FLASH included TWRP tar file
    6. Boot into twrp
    7. Format Internal storage in TWRP
    8. Flash the multidisabler zip *Copy this to your SDCARD before wiping internal etc* this is for disabling all checks ( HUGE thanks to @geiti94)
    9. Make sure you are rooted with latest Magisk otherwise you will lose twrp
    Bugs:

    - USB OTG mount for the moment

    [/YOUTUBE]​

    NOTE: I don't own the device myself , but i do have A305F which is pretty similar to this device so building should be fairly similar

    Thanks to @DerGraf1997 for testing blindly for me
    6
    PERFECT ! WORKS excellent now. I'm writing this small noob-friendly tutorial so people can follow, I hope it's fool proof.

    Step 0: Prereq
    Download all the zip files from the main page on your phone and put them in the external SD card.

    How to enable developer
    Goto settings -> About Phone -> Software Information -> Tap "build number" 5 times

    Enable OEM unlocking
    Go back to Settings -> Developer options -> Enable "Oem unlocking" (if you do not see this option OR its grayed out try to connect your phone to internet, or follow this https://forum.xda-developers.com/ga...-to-skip-oem-lock-waiting-7-days-100-t3823361)

    Note: Enabling OEM unlock here does not mean your OEM is unlocked! This switch only allows you to unlock it..Also enable USB debugging.

    Turn off your phone.

    Next: hold UP + Power until you will see a green screen. It must say "Hold long up to OEM/bootloader unlock." Follow those steps, to unlock it.
    Congrats, now your OEM is unlocked. Turn off your phone.

    Install TWRP
    Hold UP + Power again. In the screen select "wipe data (factory reset). Then select Turn off Phone (should be one of the lower options)

    While phone is off, hold UP + DOWN volume and attach USB cable to your phone. It should go into download mode.

    In Odin, put the TWRP_A40 image in AP
    Un-tick Auto reboot in the options tab.

    Remove usb cable.

    Tricky part: hold 7 seconds down+power. As soon as screen goes black hold UP + power!
    Now you should be in TWRP!!

    Once inside TWRP
    Flash all the zip files you downloaded to your SD card
    Go back to main menu, select reboot -> Recovery. Then reboot normally.

    Enjoy =) Android must now boot up normally.
    5
    Twrp updated 3.3.1-2
    - Fixed MTP for GSI roms included GSI_MTP_PATCH.zip to get it working on Gsi properly
    - For data backup to work , flash whole samsung firmware with odin , flash twrp and flash DM-Verity , force encryption fix linked in OP
    Dont flash Multidisabler if you want data backup to work.
    4
    Telegram:

    https://t.me/GalaxyA2019


    Changelog:

    22.09.2019

    - Fixed MTP for GSI roms
    included also GSI_MTP_PATCH.zip to get it working on Gsi properly
    - For data backup to work , flash whole samsung firmware with odin , flash twrp and flash DM-Verity , force encryption fix linked in OP .Dont flash Multidisabler if you want data backup to work

    17.09.2019

    - Based on latest kernel sources available ASE4
    - Initial Release



    More instructions & differences between disablers

    1. If you intend to flash twrp only & keep OneUi intact
    Flash A40 multidisabler after flashing twrp, this will disable all samsung checks
    Note : You will have to wipe your internal storage to get encryption fixed

    2. If you plan on flashing some rom that has security checks disabled like GSI or custom roms. Then just flash twrp & flash Dmverity fix after rom. (data backup will only work with this)
    Note: If you flash multidisabler and later on wish to flash gsi & dm verity . Your data partition wont backup in twrp.
    3
    As from screenshot our partition is a only hope that's helps
    Use A/B .

    Follow the link for more information
    Link to Phh

    PS. Working GSIs on A30/A40 right now are

    Lineage OS 16.0 build by AndyVan
    Havoc OS GSI
    Phh Aosp 9/10

    More maybe. But these are the most stable ones.