• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[RECOVERY][EXYNOS] TWRP 3.5.2_9 for S10e|S10|S10+ (UPDATE: 2021-06-07)

Search This thread

sappounet

Member
Jan 30, 2011
36
6
My twrp doesnt seem to recognize that i have PIN so the internal storage is encrypted and has folders with strange name

I also have the same problem of TWRP not recognizing that I have a PIN, and the internal storage remains encrypted (i can see folders with strange names).

I've been posting some messages about this problem on modpunk's LOS 17.1 post, and I've tried pretty much everything, but so far I've not been able to find the solution to allow TWRP to decrypt the internal storage :(

@nugeganteng Have you found any solution since last time you posted your message, in October ?
 

sappounet

Member
Jan 30, 2011
36
6
Can we manualy mount /data encrypted with fstab "encryptable=footer" ? (without rebuilding TWRP with new fstab)

using something like :

Code:
mount -t ext4 -o noatime,nosuid,nodev,noauto_da_alloc,discard,journal_checksum,data=ordered,errors=panic\ wait,check,encryptable=footer,quota,reservedsize=128M,length=-20480 /dev/block/platform/13d60000.ufs/by-name/userdata /data

I can't understand how we can pass the password to decrypt files

I guess your message is related to the same issue I'm experiencing. Have you found a way to pass the password to TWRP to decrypt the files ?
 

doeternietoe

Senior Member
Dec 31, 2010
63
25
Can we manualy mount /data encrypted with fstab "encryptable=footer" ? (without rebuilding TWRP with new fstab)

using something like :

Code:
mount -t ext4 -o noatime,nosuid,nodev,noauto_da_alloc,discard,journal_checksum,data=ordered,errors=panic\ wait,check,encryptable=footer,quota,reservedsize=128M,length=-20480 /dev/block/platform/13d60000.ufs/by-name/userdata /data

I can't understand how we can pass the password to decrypt files
Hello,
My twrp doesnt seem to recognize that i have PIN so the internal storage is encrypted and has folders with strange name

I've been posting in the LineageOS 17.1 thread, along with
sappounet on a problem I have with twrp and which possibly relates to this.

In short: I have the latest version (3.4.0-0-android-10.0-beyond0lte-3) installed since august. I've used it regularly to update my ROM and backup my data. When I ran it earlier this week it didn't ask for my pin and will not decrypt my data. It can read /system just fine. I cannot for the life of me understand what's going on... :confused:

I've booted to recovery and from adb ran:

Code:
twrp decrypt ***password***

Result:
Code:
Attempting to decrypt data partition or user data via command line.
Failed to decrypt data.

Anybody any idea?
 

iceyou

New member
Jan 1, 2021
2
0
I can't seem to be able to boot into this recovery, the device gets stuck on samsung boot screen, while i could do that with the official 3.3.1 one. Samsung Galaxy s10 exynos
 
Dec 19, 2012
24
17
San Jose
Below is some info on TWRP decryption issue. Relevant log:

I:Done processing fstab files I:Setting up '/data' as data/media emulated storage. I:mount -o bind '/data/media' '/sdcard' process ended with RC=0 I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0 I:File Based Encryption is present e4crypt_initialize_global_de Determining wrapped-key support for /data fbe.data.wrappedkey = false <- notice this? calling retrieveAndInstallKey Key exists, using: /data/unencrypted/key Using SKeymaster(Keymaster MDFPP) from SKeymaster team for encryption. Security level: TRUSTED_ENVIRONMENT, HAL: [email protected]::IKeymasterDevice/default begin failed, code -62 Upgrading key in memory only: /data/unencrypted/key upgrade_key failed, code -38 e4crypt_initialize_global_de returned fail ... <repeating log message chunks, perhaps retries> ... I:Trying wrapped key. I:File Based Encryption is present e4crypt_initialize_global_de Determining wrapped-key support for /data fbe.data.wrappedkey = true <- property seem to change Wrapped key supported on /data calling retrieveAndInstallKey

The problem seems to be from Keymaster

This issues puts all of us in a tough spot; we can't take full backup and can't restore existing ones. Complete /data backups had saved me more number of times than I can count since the early beta stages.
 
Last edited:

flortsch

Member
Sep 10, 2014
34
30
Linz
florian-latifi.at
I was able to build the recovery image from the source that modpunk has linked in the first post and decrypting works for v1.4 LOS 17.1 ROM. I used SM-G970F_TCE_G970FXXS9DTK9 firmware proprietary blobs. I haven't deep dived to see whats causing the problem, yet.
Nice! So you simply built the recovery and used that firmware in the "Extract vendor blobs" steps? Would be nice if you could share a flashable image :)
 

fishnetfancy

Member
Jun 25, 2020
35
11
I was able to build the recovery image from the source that modpunk has linked in the first post and decrypting works for v1.4 LOS 17.1 ROM. I used SM-G970F_TCE_G970FXXS9DTK9 firmware proprietary blobs. I haven't deep dived to see whats causing the problem, yet.
thank you, @lakkimsetty.baba I looked at the Github page but it specifies Samsung S10e. Will this also work for S10+ if I build from source?
I have never done it and am wondering how to extract the proprietary blobs.
 

fishnetfancy

Member
Jun 25, 2020
35
11
Hi @fishnetfancy, here is the source for beyond2lte. Sorry, I don't know for sure if it will work and I am unable to test it since I don't have an S10+, but I have faith it will work.

Here(1, 2) is some info, apart from S10e's readme file, on how to extract the blobs and build the image.
Thank you, @lakkimsetty.baba Whilst you answer is brilliantly helpful I am too unskilled to be attempting compiling the TWRP image at this point. There are too many hurdles for me right now - starting with my inability to mount the system.img and vendor.img files on Linux (I am a n00b, lol).
Seeing how much time I have wasted invested learning new things it is time to cut my losses and attempt a re-install of 1.0 with the option of later moving to 1.4
 

fishnetfancy

Member
Jun 25, 2020
35
11
Thank you, @lakkimsetty.baba Whilst you answer is brilliantly helpful I am too unskilled to be attempting compiling the TWRP image at this point. There are too many hurdles for me right now - starting with my inability to mount the system.img and vendor.img files on Linux (I am a n00b, lol).
Seeing how much time I have wasted invested learning new things it is time to cut my losses and attempt a re-install of 1.0 with the option of later moving to 1.4
As I am writing this @lakkimsetty.baba do you think it will be possible to install the 1.4 ROM and coresponding TWRP and later replace TWRP with one I have compiled myself in order to be able to decrypt /storage (enabling TWRP backups)?
 

flortsch

Member
Sep 10, 2014
34
30
Linz
florian-latifi.at
Hi @fishnetfancy, here is the source for beyond2lte. Sorry, I don't know for sure if it will work and I am unable to test it since I don't have an S10+, but I have faith it will work.

Here(1, 2) is some info, apart from S10e's readme file, on how to extract the blobs and build the image.
Thank you for the links! I managed to build a recovery myself. Extracting the files from a firmware was not that easy. Also, the readme in the TWRP GitHub repository lacks an entry in the manifest file:

Code:
<project name="whatawurst/android_device_samsung_exynos9820-common" path="device/samsung/exynos9820-common" remote="github" revision="twrp-9.0" />

Nevertheless, thank you for the info :)
 
  • Like
Reactions: lakkimsetty.baba
Dec 19, 2012
24
17
San Jose
For S10+, the repo's recovery partition size that was set is smaller than the image that is being generated.

FAILED: /home/saitejal/twrp/repo/out/target/product/beyond2lte/recovery.img /bin/bash -c "(/home/saitejal/twrp/repo/out/host/linux-x86/bin/mkbootimg --kernel /home/saitejal/twrp/repo/out/target/product/beyond2lte/kernel --ramdisk /home/saitejal/twrp/repo/out/target/product/beyond2lte/ramdisk-recovery.img --cmdline \"androidboot.selinux=permissive buildvariant=userdebug\" --base 0x10000000 --pagesize 2048 --recovery_dtbo device/samsung/beyond2lte/prebuilts/recovery_dtbo --os_version 10.0 --os_patch_level 2025-12-31 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --header_version 1 --board SRPRI28A004RU --output /home/saitejal/twrp/repo/out/target/product/beyond2lte/recovery.img --id > /home/saitejal/twrp/repo/out/target/product/beyond2lte/recovery.id ) && (size=\$(for i in /home/saitejal/twrp/repo/out/target/product/beyond2lte/recovery.img; do stat --format \"%s\" \"\$i\" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \" /home/saitejal/twrp/repo/out/target/product/beyond2lte/recovery.img\" | tr \" \" +); maxsize=\$(( 67633152 -69632)); if [ \"\$total\" -gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > \$maxsize)\"; false; elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)\"; fi ) && (/home/saitejal/twrp/repo/out/host/linux-x86/bin/avbtool add_hash_footer --image /home/saitejal/twrp/repo/out/target/product/beyond2lte/recovery.img --partition_size 67633152 --partition_name recovery )" error: +/home/saitejal/twrp/repo/out/target/product/beyond2lte/recovery.img too large (67653632 > 67563520)

If the size is increased in BoardConfig to finish the build, then flasing may fail since the image size is larger than the partition size on the phone, I think.
 
  • Like
Reactions: fishnetfancy

LordHornyPanda

New member
May 23, 2021
1
0
Hello, thank you for your great work!

I'm trying to check the files integrity, but I'm getting invalid signature...
> gpg --keyring .\gpgkey-8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D.gpg --verify .\recovery.img.xz.asc gpg: assuming signed data in '.\recovery.img.xz' gpg: Signature made 4/6/2020 9:00:24 AM Pacific SA Standard Time gpg: using RSA key 8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D gpg: BAD signature from "Andreas Schneider <[email protected]>" [unknown]

I also tried Cleopatra (see attached screenshots).
What am I doing wrong?
 

Attachments

  • Screenshot (5).png
    Screenshot (5).png
    13.3 KB · Views: 27
  • Screenshot (6).png
    Screenshot (6).png
    18.6 KB · Views: 30

Veraster

Member
Apr 28, 2013
42
1
Houston TX
I'm having a lot of trouble getting this working. If I flash this after patching the stock firmware with magisk, it will boot to TWRP and not android. After flashing LineageOS, I cannot get into TWRP using the buttons. The only way to get in to TWRP is to do something that makes android not boot such as flash something to the AP.

Any ideas? I've already retried the process of installing stock firmware in odin, patching with magisk, flashing that with odin, seeing it boot, flashing TWRP then flashing LineageOS about 4 times. Note that while LineageOS actually boots, I can't get magisk working. While I can flash magisk via Odin's AP button by renaming it boot.img and putting it in the same tar as recovery.img and vbmeta.img, and while magisk manager claims magisk is installed, I can't install any modules. I get an error message of
Code:
! is not installed
! Please install Riru from Magisk Manager
***********************************
! Installation failed

I'm using vbmeta-disabled as instructed, extracting twrp-3.5.2_9-beyond2lte-v1.img.xz and renaming it to recovery, renaming vbmeta-disabled.img to vbmeta.img, using 7zip to put that into a .tar file and then flashing the resulting tar file to AP with Odin.

what am I doing wrong?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    [RECOVERY][EXYNOS] TWRP 3.5.2_9 for S10e|S10|S10+ (UPDATE: 2021-06-07)

    This project provides the TWRP recovery for the Samsung Galaxy S10e (SM-G970F, beyond0lte), S10 (SM-G973F, beyond1lte) and S10+ (SM-G975F, beyond2lte).

    teamwin-recovery-project-twrp-logo.jpg


    This recovery supports FBE decryption of AOSP based ROMs like LineageOS, OmniROM etc. There is no support for Samsung ODE in TWRP yet. If you're interested, help to provide it is welcome.

    FEATURES

    • File-Based Encryption (FBE) support
    • MTP and ADB support
    • EXT4 support
    • F2FS support
    • EXFAT support
    • Provides unzip
    • Additional languages

    KNOWN ISSUES

    • If you decrypt /data with TWRP, the trustzone thinks this is a failed unlock attempt and will lock the storage for 1d
    • 'adb sideload' doesn't work

    DOWNLOAD

    Make sure you download the .img.xz and corresponding .asc.txt file (see INTEGRITY)! You can decompress the the recovery image using p7zip or xz.

    You can always find the latest version of the recovery under the follwing links:

    S10e
    S10
    S10+

    INTEGRETY

    The recovery images also come with an GPG armor file (.asc). With that file you verify that the image I created hasn't been altered.

    How do you do that?

    1. Download my gpg keyring here: https://cryptomilk.org/gpgkey-8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D.gpg.
    2. Download the recovery.img.xz and recovery.img.xz.asc.txt file
    3. Rename the recovery.img.xz.asc.txt file to recovery.img.xz.asc
    4. Verfiy the signature using the following command:
      Code:
      gpg --keyring ./gpgkey-8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D.gpg --verify recovery.img.xz.asc

    A good tutorial is: How to verify signatures for packages from the Tor Project.

    SECURITY ADVICE


    Don't flash ROMs or Magisk modules which set SELinux to permissive or you open your device for malware!

    What a Wurst!

    Contributors

    modpunk, derf elot
    Source Code: https://github.com/whatawurst/android_device_samsung_beyond0lte/tree/twrp-9.0


    Version Information
    Status:
    Stable
    Current Stable Version: 3.4.0-0
    Stable Release Date: 2020-06-12

    Created 2020-03-16
    Last Updated 2020-06-12
    12
    Hello!
    Could you edit your post and detail how you flashed twrp and vbmeta?
    Thanks a lot.
    I still find it confusing

    Disclaimer by @Ivan_Meler:

    Code:
     /*
     * Your warranty is now void.
     *
     * 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 before flashing!
     * 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.
     *


    The instuctions below asume you have an unlocked bootloader, which is mandatory, and if your bootloader isn't unlocked, please look here how to unlock it, and if the OEM unlock button is missing, also look here.


    To flash modpunk's TWRP and vbmeta on S10e SM-970F Exynos international version, you need to:
    1) Download the latest TWRP here.
    2) Download vbmeta disabled image here.
    3) Extract twrp-3.3.1-0-android-10.0-beyond0lte-5.img from the twrp-3.3.1-0-android-10.0-beyond0lte-5.img.xz with 7zip to fx. Desktop. 7zip can be found here.
    4) Rename twrp-3.3.1-0-android-10.0-beyond0lte-5.img to recovery.img.
    5) Rename vbmeta-disabled.img to vbmeta.img.
    6) Place vbmeta.img in same place as recovery.img.
    7) Open 7zip, and navigate to where vbmeta.img and recovery.img is placed.
    8) Archieve vbmeta.img and recovery.img in one arhieve of .tar format (fx. TWRP.tar), and use "Compression level": Store.
    9) Turn of your device
    10) Press and hold the volume down and bixby (Not power!), and keep holding it, while connecting the USB cable between phone and PC.
    11) When the download mode warning screen appear, release all buttons, and follow the instructions on the download mode warning screen.
    12) Open up Odin3 v3.13.1 as admin, and you should se a message saying "Added" in the log, and a blue flag above ID:COM, together with a port number. Odin can be found here, or direct link here.
    13) Press on AP in Odin, and navigate to where TWRP.tar is placed, and select it, so AP becomes checked, and the path to TWRP.tar is viewable in the AP slot.
    14) Navigate to options in Odin, and make sure that "Auto Reboot" is NOT selected, and navigate back to the Log tab.
    15) Press start to flash TWRP.tar.
    16) When a success message is stated in the log, then exit download mode by pressing volume down and power.
    17) When the screen turns of, you need to immediately press the recovery combo (VolumeUp, Bixby and Power), and keep holding it, until the secondary warning appears (The one with warning about unlocked bootloader), then release Bixby and Power, but keep holding volume up, until the TWRP logo is seen.
    18) If you have entered TWRP, then go to bulletpoint 20.
    19) If the phone fails to turn on after 10 seconds, then push power first and immediately after press bixby and volume up as well, until the secondary warning appears (The one with warning about unlocked bootloader), then release Bixby and Power, but keep holding volume up, until the TWRP logo is seen.
    20) In TWRP, swipe slider to allow modification.

    Since @modpunk's TWRP support FBE, you wont be able to see your files through TWRP, until you format data, so:
    1) Go to "Wipe" > "Format Data" in TWRP.
    2) Enter "Yes" in the field to format the data partition/factory reset the device.
    3) Go to the "Reboot" menu in TWRP and select "Recovery" to reboot your Samsung Galaxy S10e.
    4) If the phone boots to TWRP again, then go to "Reboot" menu in TWRP and select "System".

    If you also want to instal LineageOS as well, then:
    1) Make sure the LineageOS flashable .zip file is placed on an external SD card.
    and flash it while you are in TWRP, otherwise it will be wiped when formating the data partition/factory resetting the device.
    2) Go to "Install" > "Select Storage" > "Micro SD card".
    3) Navigate to where LineageOS flashable .zip file is placed, and press to flash.
    4) Confim by sliding the slider.
    5) After successful flash, then =>
    a) If comming from stock or uncompatible ROM, do a full wipe (ART, Cache, Data).
    b) If comming from same developper LineageOS, wipe (ART, Cache).

    Just to have everything in one place, and to gain Magisk root by modpunk's Magisk boot image, then:
    1) Download Magisk boot image for S10e to PC from (magisk_boot_ctc9_beta1.img.xz) here
    2) Extract magisk_boot_ctc9_beta1.img from magisk_boot_ctc9_beta1.img.xz with 7zip, and place the magisk_boot_ctc9_beta1.img in root of your SD card on the phone.
    3) Download Magisk Manager 7.5.1 from here, or direct link here.
    4) Install Magisk Manager 7.5.1 on S10e, and don't wory about it not being instaled, when Magisk is fired up.
    5) Turn of the phone.
    6) When the screen turns of, you need to turn on the phone by pressing the recovery combo (VolumeUp, Bixby and Power), and keep holding it, until the secondary warning appears (The one with warning about unlocked bootloader), then release Bixby and Power, but keep holding volume up, until the TWRP logo is seen.
    7) If you have entered TWRP, then go to bulletpoint 9.
    8) If the phone fails to turn on after 10 seconds, then push power first and immediately after press bixby and volume up as well, until the secondary warning appears (The one with warning about unlocked bootloader), then release Bixby and Power, but keep holding volume up, until the TWRP logo is seen.
    9) Navigate by pressing "Instal" > "Select Storage" > "SD card".
    10) Press "Install Image" to be able to flash an .img file.
    11) Navigate to where the magisk_boot_ctc9_beta1.img is placed, and select it.
    12) Flash magisk_boot_ctc9_beta1.img by swiping the slider.
    13) When flashing is complete, DO NOT do any other modification, navigate back to main screen, and select "Reboot" > "System".
    14) Phone phone is started, enter Magisk Manager.
    15) Magisk Manager will ask to do additional setup, and select yes to to confirm.

    After auto reboot, there is no need for recovery combo to enter rooted system, that is now no longer needed.

    Hope it helps :)
    These are windows instruction, but I still hope someone can share knowledge about Heimdal.
    11
    FAQ

    How do boot into the bootloader/download mode?

    Here are the steps:

    1. Turn off your phone
    2. Press and hold the volume down and bixby keys
    3. Connect a USB cable attached to your computer

    The 'Bixby' button is the button below the volume keys.

    How do boot into recovery mode?

    1. Turn off you phone
    2. Press and hold the volume up and bixby and power key

    You can also do the above when you reboot the phone, once the screen turn black press the buttons.

    How do I reboot my phone?

    Press and hold the volume down and power key for at least 7 seconds.

    How do I unlock my device?

    Not that if you unlock your device, your phone will be factory reset! Make sure to make backups.

    To unlock your device:

    1. Go to Settings -> About Phone and find the "Build Number"
    2. Tab the build number several times till it tells you that you unlocked the Deverloper Settings
    3. Go to Settings -> System -> Advanded -> Developer Settings
    4. Enable "OEM Unlock"
    5. Reboot to bootloader mode (see above)
    6. Follow the instruction displayed on screen and unlock your device

    How do I flash the recovery?

    After you unlocked the bootloader:

    1. Boot into download mode (see above)
    2. Flash recovery.img and vbmeta-disabled.img using Odin or Heimdall.

    What is VBMETA?

    Your phone has a partition for storing cryptographic hashes to verify the validity of the flashed software to all the partitions on your system. This is called Android Verified Boot.

    In order to flash a recovery.img you need to replace the VBMETA image with a custom image to disable the checks. You can find a vbmeta-disabled.img here.
    7
    I've released a new TWRP. Update to 3.4.0 of TWRP and to the latest Linux Kernel we use in LineageOS. I also fixed a small adb bug.
    5
    CHANGELOG

    2020-07-24
    • Update to Linux Kernel 4.14.189
    • Updated to CTF3 blobs
    • Removed TWRP app

    2020-06-09
    • Update to TWRP 3.4 (Fixes for SAR and multi user decryption)
    • Update to Linux Kernel 4.14.183
    • Fixed ADB only mode