[RECOVERY][UNOFFICIAL][3.5.2] TWRP for Galaxy M31

Search This thread

zrekkab

Member
Aug 11, 2014
5
2
android 11 use to much battery
i am a developer and every developer know for every device the initial rom work perfectly but upgrade it descharge battery quickly then the initial rom please make twrp for android 10

it might be a mistake here(states android 10),but on telegram page it was mentioned android 11 only,try upgrading to 11 and flash,all modules perfectly worked for me.
 

mrao

Senior Member
Dec 21, 2005
435
59
www.oneclickroot.com
Can someone please provide a Odin flashable bootloago_patcher file for Android 10.0. This TWRP works only on 11.0 and while I can achieve root just fine on 11.0, the app I want to test needs 10.0 and I cant flash the bootlogo_patcher via TWRP on 10.0
 
Thanks. I successfully installed twrp and rooted my phone. I also successfully installed Encryption Disabler. But, unfortunately couldn't install TWRP_Bootlogo_patcher. Every time I try to flash it, it always ended with Error: 1, showing “device is not compatible.”
I am on latest one UI 3.1, which released just yesterday. Is this happening as my rom is too latest for ur supplied zip file? Hope, u will answer soon. Thanks again.

NB: I already formatted data by typing “yes”.
Thanks. I successfully installed twrp and rooted my phone. I also successfully installed Encryption Disabler. But, unfortunately couldn't install TWRP_Bootlogo_patcher. Every time I try to flash it, it always ended with Error: 1, showing “device is not compatible.”
I am on latest one UI 3.1, which released just yesterday. Is this happening as my rom is too latest for ur supplied zip file? Hope, u will answer soon. Thanks again.

NB: I already formatted data by typing “yes”.
Did you rooted your phone by Magisk after flashing TWRP? please reply
 
  • Like
Reactions: raphable
@soulr344 Dude you are a gem. Thank you so so much for the recovery however there is one issue. I cannot reboot to TWRP when phone is off. As a work around I I'm using Simple Reboot app to boot to TWRP recovery when phone is on. I really want to do it with hardware keys (Volume plus + Power key) with PHONE OFF because I have a habit of keeping TWRP backup as I'll be flashing many zips and if any zip can screws my phone, TWRP backup will save me. When phone off, tried many tricks key combinations, holding Volume up + Power button for 3 seconds, 5 seconds, 10 seconds and no success. Also flashed 'Disable_Dm-Verity_ForceEncrypt_03.04.2020-1.zip' still can't boot up to recovery when phone is off. Please advise.
 

amb1402

Senior Member
Sep 15, 2010
83
30
i did reach this step 9​
  1. Download TWRP.tar from download link below;
  2. Open odin and place the TWRP.tar file in AP slot and press start. Once you press start, keep holding power and volume up button and the device will reboot to recovery mode.
i managed to boot to twrp but when i go to wipe and do format data it say unable to mount storage
 
  • Like
Reactions: krome_3k

mohd.shakeel.khan

New member
May 2, 2015
3
0
Samsung Galaxy M31
Ae08b8N.png
Disclaimer:
I am not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed.
Please do some research if you have any concerns about features included in this recovery before flashing it!
YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you.
Kernel Features:
  • latest kernel source release
  • disabled security stuff/knox/proca/logging/audit/useless features
Recovery Features:
  • TWRP 3.5.1, Android 10
  • Built in 64-bit mode
  • Super partition support
  • Added custom super binary to help with managing super partitions ( more on that in post #3 )
  • Native rw mount dynamic partitions
  • Native GSI flashing
  • Native dynamic partitions resize/wipe/backup/restore
  • Working MTP and ADB only!
How to install?
Prerequisites: Samsung USB drivers, Odin v3.14.1
  1. Make sure OEM Unlock is ON in developer settings;
  2. Turn off the phone;
  3. Press the volume down + volume up button whilst the phone is connected to a pc to boot in download mode;;
  4. Long press vol up then confirm you want to unlock bootloader (this is needed one time only);
    * Please be aware all your data will be erased including internal storage and phone will reboot!!
  5. Let the phone boot normally, pass the setup and connect to internet (wireless or mobile data) in order to unlock RMM;
  6. Make sure OEM Unlock is ON in developer settings;
  7. Turn off the phone;
  8. Use vol down + bixby key + usb cable plugged to a pc to start the phone in download mode, short press vol up to confirm you want to go to download mode;
    * If by any chance you see RMM state=Prenormal or KG state=Prenormal, factory reset data and redo from step 5!
  9. Download TWRP.tar from download link below;
  10. Open odin and place the TWRP.tar file in AP slot and press start. Once you press start, keep holding power and volume up button and the device will reboot to recovery mode.
  11. * If you're coming from stock, go to "Wipe" > ""Format Data" > type "yes" to format data. If you skip this Internal storage won't work in TWRP
  12. Flash the encryption_disabler.zip from the link below to disable internal storage encryption and patch stock recovery restoration.
  13. Additionally, flash TWRP_Bootlogo_patcher to patch warning screens when booting the device.
  14. If you want to root, flash Magisk.
  • If you're coming from other TWRP versions, download TWRP.img, reboot to recovery, tap Install > Install Image > Navigate to downloads folder > select TWRP.img > Select Recovery and swipe to confirm flash. Go to reboot and reboot to recovery and the changes will have taken place.

Downloads:

Sources:
Device Tree: https://github.com/exynos-nigg/android_device_samsung_m31nsxx
Kernel Source: https://github.com/soulr344/android_kernel_samsung_m21nsxx/tree/prebuilt
TWRP Source: https://github.com/TeamWin/android_bootable_recovery/commits/android-10.0

Credits:
  • TeamWin, corsicanu, ananjaser1211, jesec, epicX67, exynos-nigg, testers and anyone else who made this possible.
My device (m31nnxx)
 

krome_3k

Member
Oct 3, 2011
34
4
Hi, i had flashed stock android 11 rom using odin. I tried flashing twrp using odin but i couldnt get the phone to boot into recovery and it was getting overwritten by the stock recovery. So, then i rooted my phone using this guide and flashed the twrp image using the official twrp app. I could reboot into recovery, but on connecting the phone to windows, the directory structure was all garbage. So i flashed the encryption disabler and rebooted without formatting data. Since then(yesterday) i am stuck at the samsung logo and i cannot boot into download mode or twrp or fastboot. None of the key combinations are working except volume down + power and that just restarts the phone. If try to go into download mode the screen shows the samsung logo but odin shows the blue connected sign only and there is nothing on the box above. I tried flashing stock rom again but odin fails as shown in screenshot. I think my only option is to drain the battery and then get into download mode and try flashing stock again. Should i flash android 10 or 11? Please help. Any and all suggestions are welcome. Thanks in advance guys.

EDIT : I posted this after a panic attack lol. Everything is working for me now.
 

Attachments

  • screen.jpg
    screen.jpg
    498.4 KB · Views: 51
Last edited:

whitewalkers10

New member
Jul 15, 2022
1
0
FAQ
Q: TWRP can't mount data partition, what to do?
A: Make sure you formatted data partition.

Q: Phone is not booting even after 20 minutes
A: Try to reboot. If still not booting, make sure you flashed encryption disabler zip / formatted data partition.

Q: How to format data partition?
A:

ymlnQUE.jpg




Q: Phone is showing only Samsung logo
A: Try to reboot. If still not booting, consider installing a more recent firmware. If you still don't succeed, post here some details about your device and previous firmware and we might be able to help.

Q: Why do i need to format data partition?
A: Because old firmware encrypted your data partition and new rom can't decrypt and use that content / root needs access to data partition to place misc files / phone not booting after flashing root until data partition gets formatted.

Q: I can't flash anything with TWRP. Internal Storage has some random folders with weird name.
A: Format Data and flash encryption disabler.
my phone is stuck at bootloop only and i can enter only in download mode so i try to flash new firmware using odin but again it stucks at bootloop..i am helpless please help..
 

Rajarshi Khatua

New member
Dec 3, 2020
2
0
Ae08b8N.png
Disclaimer:
I am not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed.
Please do some research if you have any concerns about features included in this recovery before flashing it!
YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you.
Kernel Features:
  • latest kernel source release
  • disabled security stuff/knox/proca/logging/audit/useless features
Recovery Features:
  • TWRP 3.5.2, Android 10
  • Built in 64-bit mode
  • Super partition support
  • Added custom super binary to help with managing super partitions ( more on that in post #3 )
  • Native rw mount dynamic partitions
  • Native GSI flashing
  • Native dynamic partitions resize/wipe/backup/restore
  • Working MTP and ADB only!
How to install?
Prerequisites: Samsung USB drivers, Odin v3.14.1
  1. Make sure OEM Unlock is ON in developer settings;
  2. Turn off the phone;
  3. Press the volume down + volume up button whilst the phone is connected to a pc to boot in download mode;;
  4. Long press vol up then confirm you want to unlock bootloader (this is needed one time only);
    * Please be aware all your data will be erased including internal storage and phone will reboot!!
  5. Let the phone boot normally, pass the setup and connect to internet (wireless or mobile data) in order to unlock RMM;
  6. Make sure OEM Unlock is ON in developer settings;
  7. Turn off the phone;
  8. Use vol down + bixby key + usb cable plugged to a pc to start the phone in download mode, short press vol up to confirm you want to go to download mode;
    * If by any chance you see RMM state=Prenormal or KG state=Prenormal, factory reset data and redo from step 5!
  9. Download TWRP.tar from download link below;
  10. Open odin and place the TWRP.tar file in AP slot and press start. Once you press start, keep holding power and volume up button and the device will reboot to recovery mode.
  11. * If you're coming from stock, go to "Wipe" > ""Format Data" > type "yes" to format data. If you skip this Internal storage won't work in TWRP
  12. Flash the encryption_disabler.zip from the link below to disable internal storage encryption and patch stock recovery restoration.
  13. Additionally, flash TWRP_Bootlogo_patcher to patch warning screens when booting the device.
  14. If you want to root, flash Magisk.
  • If you're coming from other TWRP versions, download TWRP.img, reboot to recovery, tap Install > Install Image > Navigate to downloads folder > select TWRP.img > Select Recovery and swipe to confirm flash. Go to reboot and reboot to recovery and the changes will have taken place.

Downloads:

Sources:
Device Tree: https://github.com/soulr344/android_device_samsung_m31
Kernel Source: https://github.com/soulr344/android_kernel_samsung_m21nsxx/tree/prebuilt
TWRP Source: https://github.com/soulr344/android_bootable_recovery/commits/android-10.0

Credits:
  • TeamWin, corsicanu, ananjaser1211, jesec, epicX67, exynos-nigg, testers and anyone else who made this possible.
please update for android 12
 

Top Liked Posts

  • There are no posts matching your filters.
  • 104
    Ae08b8N.png
    Disclaimer:
    I am not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed.
    Please do some research if you have any concerns about features included in this recovery before flashing it!
    YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you.
    Kernel Features:
    • latest kernel source release
    • disabled security stuff/knox/proca/logging/audit/useless features
    Recovery Features:
    • TWRP 3.5.2, Android 10
    • Built in 64-bit mode
    • Super partition support
    • Added custom super binary to help with managing super partitions ( more on that in post #3 )
    • Native rw mount dynamic partitions
    • Native GSI flashing
    • Native dynamic partitions resize/wipe/backup/restore
    • Working MTP and ADB only!
    How to install?
    Prerequisites: Samsung USB drivers, Odin v3.14.1
    1. Make sure OEM Unlock is ON in developer settings;
    2. Turn off the phone;
    3. Press the volume down + volume up button whilst the phone is connected to a pc to boot in download mode;;
    4. Long press vol up then confirm you want to unlock bootloader (this is needed one time only);
      * Please be aware all your data will be erased including internal storage and phone will reboot!!
    5. Let the phone boot normally, pass the setup and connect to internet (wireless or mobile data) in order to unlock RMM;
    6. Make sure OEM Unlock is ON in developer settings;
    7. Turn off the phone;
    8. Use vol down + bixby key + usb cable plugged to a pc to start the phone in download mode, short press vol up to confirm you want to go to download mode;
      * If by any chance you see RMM state=Prenormal or KG state=Prenormal, factory reset data and redo from step 5!
    9. Download TWRP.tar from download link below;
    10. Open odin and place the TWRP.tar file in AP slot and press start. Once you press start, keep holding power and volume up button and the device will reboot to recovery mode.
    11. * If you're coming from stock, go to "Wipe" > ""Format Data" > type "yes" to format data. If you skip this Internal storage won't work in TWRP
    12. Flash the encryption_disabler.zip from the link below to disable internal storage encryption and patch stock recovery restoration.
    13. Additionally, flash TWRP_Bootlogo_patcher to patch warning screens when booting the device.
    14. If you want to root, flash Magisk.
    • If you're coming from other TWRP versions, download TWRP.img, reboot to recovery, tap Install > Install Image > Navigate to downloads folder > select TWRP.img > Select Recovery and swipe to confirm flash. Go to reboot and reboot to recovery and the changes will have taken place.

    Downloads:

    Sources:
    Device Tree: https://github.com/soulr344/android_device_samsung_m31
    Kernel Source: https://github.com/soulr344/android_kernel_samsung_m21nsxx/tree/prebuilt
    TWRP Source: https://github.com/soulr344/android_bootable_recovery/commits/android-10.0

    Credits:
    • TeamWin, corsicanu, ananjaser1211, jesec, epicX67, exynos-nigg, testers and anyone else who made this possible.
    8
    Info about custom super partition helper binary. (Irrelevant because of native logical partitions but yeah, its present)

    It's meant to help with managing partitions inside the super partition itself. It has some functions built in like mount, unmount, flash and format. Here is a brief rundown on what each of them do.

    Partitions that are supported are:
    system, system_root, vendor, odm, product
    Please note that system_root is an alias of system and umount is an alias of unmount.
    All of these commands are runnable through TWRP Terminal ONLY!

    Code:
     super mount partition

    This will mount partition in rw mode in mountpoint in fstab.

    Code:
     super unmount[or umount] partition

    This command will unmount given partition and make it read only.

    Code:
     super format partition
    This command will format given partition as ext4 inside super partition.

    Code:
     super flash partition /path/to/image.img
    Flashes image.img to partition.
    You can also flash GSI (Generic System Image) using this command. Simply run:
    Code:
    super flash system /path/to/gsi.img


    For Custom ROM Developers:

    You can use this as an alternative to mount/format/unmount partitions that are inside super partition normally.
    Code:
    run_program("/sbin/super", "format", "system");  # formats system
    run_program("/sbin/super", "mount", "system");   # mounts system as rw
    run_program("/sbin/super", "unmount", "system"); # unmounts system and makes it ro
    7
    Changelog:
    v1.0
    • Initial Release
    More in github release page

    MISC LINKS
    Telegram Channel
    Telegram Group
    TeamWin Official Website
    7
    FAQ
    Q: TWRP can't mount data partition, what to do?
    A: Make sure you formatted data partition.

    Q: Phone is not booting even after 20 minutes
    A: Try to reboot. If still not booting, make sure you flashed encryption disabler zip / formatted data partition.

    Q: How to format data partition?
    A:

    ymlnQUE.jpg




    Q: Phone is showing only Samsung logo
    A: Try to reboot. If still not booting, consider installing a more recent firmware. If you still don't succeed, post here some details about your device and previous firmware and we might be able to help.

    Q: Why do i need to format data partition?
    A: Because old firmware encrypted your data partition and new rom can't decrypt and use that content / root needs access to data partition to place misc files / phone not booting after flashing root until data partition gets formatted.

    Q: I can't flash anything with TWRP. Internal Storage has some random folders with weird name.
    A: Format Data and flash encryption disabler.
    3
    Hello there,
    I followed all steps and in the end ended up having with the device only showing the Samsung logo after I flashed magisk (magisk version here: https://magisk.me/zip/). I had a 64gb version of the SM-M315 running the latest android 11 version provided by samsung (current date: 10.04.2021). I have not yet managed to escape the bootloop, veen when trying to restart the warnings appear and then the samsung logo displays. I have made a pre-root version backup, but have not yet managed to return to the recovery.

    Edit: I am aware that I have might bricked my device and just wanted to ask if there is anything that I could do just in the case that my assumption is wrong.

    nope, you havent bricked. start by flashing stock rom again, the flash twrp, AND BE SURE to flash encryption disabler and format data. thats all and it should boot. if you skip encryption dissabler, then the stock recovery will auto restore itself(which seems your case)