• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

TWRP for Samsung Galaxy Z Fold2 5G (F916B)

Search This thread

ianmacd

Senior Member
Jan 5, 2016
2,352
3,799
Amsterdam
localhost
twrp-fold.jpg

Introduction

Welcome to TWRP for the Samsung Galaxy Z Fold2 5G. Samsung were kind enough to release the kernel source code ahead of the device itself, which enabled me to have TWRP ready and waiting when the courier rang my doorbell with my new phone. It's not often that a device sees a day 0 TWRP release.

The image of TWRP available here will work on all F916B, F916N and F9160 devices.

Installation

Only proceed if you are comfortable with low-level device management and are capable of recovering an unbootable device, should an unforeseen mishap occur.

Unlock your device's bootloader and then install the recovery image below. If you use Odin to flash it, remember to rename the image recovery.img and tar it before flashing. You will also need to flash a neutralised vbmeta.img image if you have not already disarmed verified boot.

Post-installation

The Z Fold2 5G utilises proprietary file-based encryption (FBE) in its factory state for the user data partition. TWRP cannot decrypt this, however, so it must be removed. Otherwise, you will not be able to perform back-ups and restores.

To remove encryption from your device, please use TWRP to flash the Samsung multi-disabler and then format /data again. You must use at least v2.5 of the multi-disabler.

Latest releases

These builds are stable and known to perform well on many users' devices.

Android 11 (CTLL firmware)

twrp-f2q-3.5.0_10-A11_3_ianmacd.img

Android 10 (BTJ1 firmware)

twrp-f2q-3.5.0_10-2_ianmacd.img

Known issues

  • TWRP is displayed only on the device's main (inner) screen.
  • Haptic feedback does not work.

Source


Support

For support or just to talk about the device amongst friends, please join our small Telegram group dedicated to the full range of Galaxy foldable devices.

Support may also be found in the more general Samsung TWRP/root group.


XDA:DevDB Information
TWRP for the Samsung Galaxy Z Fold2 5G, Tool/Utility for the Samsung Galaxy Z Fold2

Contributors
ianmacd

Version Information
Status:
Production
Current Production Version: 3.5.0-1_ianmacd
Production Release Date: 2020-12-29

Created 2020-09-16
Last Updated 2021-01-25
 
Last edited:

ianmacd

Senior Member
Jan 5, 2016
2,352
3,799
Amsterdam
localhost
Changelog

2021-01-25 3.5.0_A11-3

  • Fix spurious attempt to perform digest authentication when flashing .apk file.

2021-01-25 3.5.0_A11-2

  • TWRP will now include files named Magisk.apk, app-release.apk or app-debug.apk in the list of flashable .zip files. This is to accommodate the new packaging of Magisk as a payload within the manager app.

2021-01-19 3.5.0_A11-1

  • First release for Android 11.
  • With kernel built for CTLL firmware.

2021-01-19 3.5.0-2

  • Merge post-3.5.0 release bug fixes.

2020-12-29 3.5.0-1

  • Update to TWRP 3.5.0.

2020-12-23 3.4.0-3

  • Fixed bug that causes unmounting of System when Advanced menu is entered.

2020-12-20 3.4.0-1

  • First production release.
  • Working MTP implementation.

2020-11-06 3.4.0-1a20

  • Fixed image back-up of Optics partition.
  • logcat is now enabled in recovery.
  • With kernel built for BTJ1 firmware.

2020-10-07 3.4.0-1a17

  • With kernel built for BTIA firmware.

2020-09-29 3.4.0-1a15

  • Ignore touch sensor input from front screen.
  • Align camera recess within status bar.

2020-09-15 3.4.0-1a12

  • Day 0 TWRP release.
 
Last edited:
  • Like
Reactions: c1-p8 and Catpoule

vincentsli

New member
@ianmacd My Fold 2 5G is model number F916U1. Your topic and posts say this TWRP is for F916B version - is F916B the only supported Fold 2 5G model?

similar topic discussed in TG group, FYI :)

ME(Vincent Li):Hi Ian! @ianmacd I have a silly question wanna ask: is it compatible to flash your twrp image into my F9160(Chinese variant) model after rooting?

鱿鱼:[In reply to Vincent Li]
I think you’ll need to check the partition structure before flashing if I remember correctly

ME:[In reply to 鱿鱼]
I'm not sure whether I understand correctly or not that the partition structure would be the same across different variants (aka F916B/916U/F9160 etc.) as long as they share the same model name like Z Fold2 5G, although those variants might have different firmwares or kernels with which may affect this twrp image working properly?

Ian Macdonald:[In reply to Vincent Li]
I don't know how the F9160 differs from the F916B. The firmware would certainly be different, but the recovery environments need not be.

You don't have much to lose by trying it. If it doesn't work, just flash the stock recovery back.

You could also request kernel source code for your model from Samsung; then we can compare them. As of now, only the F916B has source code available, because I requested it before release.
 

Apo11on

Senior Member
Sep 5, 2008
1,659
332
San Diego, CA
@ianmacd My Fold 2 5G is model number F916U1. Your topic and posts say this TWRP is for F916B version - is F916B the only supported Fold 2 5G model?

@ianmacd Houston, do you readme? Can you please confirm the list of devices, supported by your build? Over.

Here is a full list of mounted partitions on my F916U1 - hope it helps.
Code:
$ cat /proc/mounts
/dev/block/dm-4 / ext4 ro,seclabel,relatime,i_version 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,size=5378544k,nr_inodes=1344636,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600,ptmxmode=000 0 0
none /dev/memcg cgroup rw,relatime,memory 0 0
none /dev/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
none /dev/cg2_bpf cgroup2 rw,nosuid,nodev,noexec,relatime 0 0
none /dev/cpuctl cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
none /dev/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0
none /dev/stune cgroup rw,nosuid,nodev,noexec,relatime,schedtune 0 0
none /dev/freezer cgroup rw,relatime,freezer 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
proc /proc proc rw,relatime,gid=3009,hidepid=2 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,seclabel,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime 0 0
pstore /sys/fs/pstore pstore rw,seclabel,nosuid,nodev,noexec,relatime 0 0
tmpfs /mnt tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=5378544k,nr_inodes=1344636,mode=755,gid=1000 0 0
tmpfs /mnt/secure/asec tmpfs rw,seclabel,relatime,size=5378544k,nr_inodes=1344636,mode=700 0 0
tmpfs /mnt/sde tmpfs rw,seclabel,relatime,size=5378544k,nr_inodes=1344636,mode=700 0 0
/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/efs /mnt/vendor/efs ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/data/knox/secure_fs/enc_media /mnt/shell/enc_emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1000,fsgid=1000,gid=9997,multiuser,derive_gid,default_normal,reserved=20MB 0 0
/data/media /mnt/runtime/default/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,reserved=20MB,unshared_obb 0 0
/data/media /mnt/runtime/read/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid,default_normal,reserved=20MB,unshared_obb 0 0
/data/media /mnt/runtime/write/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal,reserved=20MB,unshared_obb 0 0
/data/media /mnt/runtime/full/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal,reserved=20MB,unshared_obb 0 0
tmpfs /apex tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=5378544k,nr_inodes=1344636,mode=755 0 0
/dev/block/loop2 /apex/[email protected] ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop2 /apex/com.android.conscrypt ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop3 /apex/[email protected] ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop3 /apex/com.android.apex.cts.shim ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop4 /apex/[email protected] ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop4 /apex/com.android.runtime ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop5 /apex/[email protected] ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop5 /apex/com.android.media ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop6 /apex/[email protected] ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop6 /apex/com.android.media.swcodec ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop7 /apex/[email protected] ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop7 /apex/com.android.resolv ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop8 /apex/[email protected] ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/loop8 /apex/com.android.tzdata ext4 ro,dirsync,seclabel,nodev,noatime,i_version 0 0
/dev/block/platform/soc/1d84000.ufshc/by-name/metadata /metadata ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/dm-5 /product ext4 ro,seclabel,relatime,i_version 0 0
/dev/block/dm-6 /vendor ext4 ro,seclabel,relatime,i_version 0 0
/dev/block/bootdevice/by-name/apnhlos /vendor/firmware_mnt vfat ro,context=u:object_r:firmware_file:s0,relatime,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/block/bootdevice/by-name/modem /vendor/firmware-modem vfat ro,context=u:object_r:firmware_file:s0,relatime,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,seclabel,nosuid,nodev,relatime,i_version 0 0
/dev/block/dm-7 /odm ext4 ro,seclabel,relatime,i_version 0 0
/dev/block/dm-8 /prism ext4 ro,seclabel,relatime,i_version 0 0
/dev/block/dm-9 /optics ext4 ro,seclabel,relatime,i_version 0 0
none /acct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
none /config configfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/block/bootdevice/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/sec_efs /efs ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/carrier /carrier ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/dqmdbg /dqmdbg ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/spu /spu ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/keydata /keydata ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/keyrefuge /keyrefuge ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/omr /omr ext4 rw,seclabel,nosuid,nodev,noatime,journal_checksum,noauto_da_alloc,i_version 0 0
/dev/block/bootdevice/by-name/userdata /data f2fs rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,reserve_core=1280,resuid=0,resgid=5678,usrquota,grpquota,alloc_mode=default,fsync_mode=nobarrier 0 0
tmpfs /storage tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=5378544k,nr_inodes=1344636,mode=755,gid=1000 0 0
/data/media /storage/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,reserved=20MB,unshared_obb 0 0
tmpfs /storage/self tmpfs rw,seclabel,nosuid,nodev,noexec,relatime,size=5378544k,nr_inodes=1344636,mode=755,gid=1000 0 0
$
 

ianmacd

Senior Member
Jan 5, 2016
2,352
3,799
Amsterdam
localhost
@ianmacd Houston, do you readme? Can you please confirm the list of devices, supported by your build? Over.

It will work on the F916B. It may also work on the F9160 and the F916N.

As far as US versions are concerned, the U and U1 models have locked bootloaders that can only be unlocked using a paid service. Once that has been done, this version of TWRP may work on them.

I can't say with any more certainty than that, because my own device is the international model, the F916B.

Even if this version doesn't work on the 9160, the N, the U and the U1, it wouldn't be a huge amount of work to make those work, too; probably just a question of replacing the kernel with one specific to those devices.
 

WyldOne91

Senior Member
Dec 21, 2010
281
27
It will work on the F916B. It may also work on the F9160 and the F916N.



As far as US versions are concerned, the U and U1 models have locked bootloaders that can only be unlocked using a paid service. Once that has been done, this version of TWRP may work on them.

Do you happen to know of this paid service or where it's available? Depending on the price, I would be willing to consider paying to have the phone unlocked if that's what needs to be done.
 

TheUndertaker21

Senior Member
Jul 11, 2011
3,311
548
Brooklyn
Xposed Modules
Hi @ianmacd
how would we go about flashing gsi roms with the new twrp since system slot is now gone

---------- Post added at 06:04 PM ---------- Previous post was at 06:03 PM ----------

Hi @ianmacd
how would we go about flashing gsi roms with the new twrp since system slot is now gone
 

Chickenbone20

Member
Dec 17, 2017
42
17
It will work on the F916B. It may also work on the F9160 and the F916N.

As far as US versions are concerned, the U and U1 models have locked bootloaders that can only be unlocked using a paid service. Once that has been done, this version of TWRP may work on them.

I can't say with any more certainty than that, because my own device is the international model, the F916B.

Even if this version doesn't work on the 9160, the N, the U and the U1, it wouldn't be a huge amount of work to make those work, too; probably just a question of replacing the kernel with one specific to those devices.

Can confirm for the F916U that it does not work. At least in Odin it gets stuck on "File Analysis" and nothing happens.

EDIT: Nevermind it works fine on F916U
 
Last edited:

ianmacd

Senior Member
Jan 5, 2016
2,352
3,799
Amsterdam
localhost
3.4.0-1a15 released.

I have just released a new alpha build of TWRP.

This one fixes the issue of touch sensor input from the front screen not being ignored. If you experienced any ghost touch input issues when using TWRP while holding the device in your hand, this is the reason.
 

mric034

Senior Member
Aug 19, 2009
60
45
I can't access to files on storage or sdcard so i can't flash anything... how can i resolve this?
 

joecasa

New member
Jul 21, 2010
2
0
Just curious what the chances are that this work will develop into granting us mortals the ability to root and install custom roms?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    twrp-fold.jpg

    Introduction

    Welcome to TWRP for the Samsung Galaxy Z Fold2 5G. Samsung were kind enough to release the kernel source code ahead of the device itself, which enabled me to have TWRP ready and waiting when the courier rang my doorbell with my new phone. It's not often that a device sees a day 0 TWRP release.

    The image of TWRP available here will work on all F916B, F916N and F9160 devices.

    Installation

    Only proceed if you are comfortable with low-level device management and are capable of recovering an unbootable device, should an unforeseen mishap occur.

    Unlock your device's bootloader and then install the recovery image below. If you use Odin to flash it, remember to rename the image recovery.img and tar it before flashing. You will also need to flash a neutralised vbmeta.img image if you have not already disarmed verified boot.

    Post-installation

    The Z Fold2 5G utilises proprietary file-based encryption (FBE) in its factory state for the user data partition. TWRP cannot decrypt this, however, so it must be removed. Otherwise, you will not be able to perform back-ups and restores.

    To remove encryption from your device, please use TWRP to flash the Samsung multi-disabler and then format /data again. You must use at least v2.5 of the multi-disabler.

    Latest releases

    These builds are stable and known to perform well on many users' devices.

    Android 11 (CTLL firmware)

    twrp-f2q-3.5.0_10-A11_3_ianmacd.img

    Android 10 (BTJ1 firmware)

    twrp-f2q-3.5.0_10-2_ianmacd.img

    Known issues

    • TWRP is displayed only on the device's main (inner) screen.
    • Haptic feedback does not work.

    Source


    Support

    For support or just to talk about the device amongst friends, please join our small Telegram group dedicated to the full range of Galaxy foldable devices.

    Support may also be found in the more general Samsung TWRP/root group.


    XDA:DevDB Information
    TWRP for the Samsung Galaxy Z Fold2 5G, Tool/Utility for the Samsung Galaxy Z Fold2

    Contributors
    ianmacd

    Version Information
    Status:
    Production
    Current Production Version: 3.5.0-1_ianmacd
    Production Release Date: 2020-12-29

    Created 2020-09-16
    Last Updated 2021-01-25
    3
    It gives me great pleasure to finally be able to issue a production release of TWRP 3.4.0 for the Z Fold2 5G.

    Over the course of 27 alpha versions and 2 beta releases, the kinks have been worked out and this initial production release now features a fully functional implementation of MTP.

    It's also no longer necessary to disable MTP in order to use adb.

    Changelog

    2020-12-20 3.4.0-1

    • First production release.
    • Working MTP implementation.
    2
    Changelog

    2021-01-25 3.5.0_A11-3

    • Fix spurious attempt to perform digest authentication when flashing .apk file.

    2021-01-25 3.5.0_A11-2

    • TWRP will now include files named Magisk.apk, app-release.apk or app-debug.apk in the list of flashable .zip files. This is to accommodate the new packaging of Magisk as a payload within the manager app.

    2021-01-19 3.5.0_A11-1

    • First release for Android 11.
    • With kernel built for CTLL firmware.

    2021-01-19 3.5.0-2

    • Merge post-3.5.0 release bug fixes.

    2020-12-29 3.5.0-1

    • Update to TWRP 3.5.0.

    2020-12-23 3.4.0-3

    • Fixed bug that causes unmounting of System when Advanced menu is entered.

    2020-12-20 3.4.0-1

    • First production release.
    • Working MTP implementation.

    2020-11-06 3.4.0-1a20

    • Fixed image back-up of Optics partition.
    • logcat is now enabled in recovery.
    • With kernel built for BTJ1 firmware.

    2020-10-07 3.4.0-1a17

    • With kernel built for BTIA firmware.

    2020-09-29 3.4.0-1a15

    • Ignore touch sensor input from front screen.
    • Align camera recess within status bar.

    2020-09-15 3.4.0-1a12

    • Day 0 TWRP release.
    2
    noob here. will it work for latest firmware DUB5 for DBT?

    Yes.
    2
    Hey folks. I've got my 916U1 bootloader unlocked (big thanks @elliwigy) and I am having trouble getting Twrp to work. I cannot find a vbmeta image I am confident enough to use, and I also cannot find instructions on how to create this file. Clearly some folks in here have passed this stage. Please share what I am to do. =]

    I've pored through at least 5 different root instructions for Fold 2, and some were clearly cut and paste from other devices as they had the wrong buttons and/or screenshots. I've also searched Google and XDA without success in finding any vbmeta file specific to the Fold 2. I did find images for other devices, but I also read this file is device specific.

    FWIW, I plan to keep using the default OS, just trying to get root.

    On my non-US Note 9, it was relatively easy to unlock bootloader and flash Twrp, then Magisk.

    Thanks in advance for your help!