[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] shivalwolf:
I got encryption worked out, It's not great and it's very messy but it means I can keep encryption. You will lose all your data if you try an enable encryption so do this at your own risk. This was done on my Australian S10E running ASD5. I do not know if the /dev's and device sizes are the same on other models.

This method switches over to Full Disk Encryption instead of File Based Encryption. multidisabler already turns off FBE, these steps just make it so you can now use FDE instead. Using FDE unfortunately means you lose access to /data and the internal storage in twrp but at least there is still the other useful parts of twrp like backups and installs (as long as they don't write anything to /data).

While you can backup all the other partitions you can't use the built in TWRP function to backup /data. If you wish to backup /data you need to go to the terminal and use DD to make a .img file of the entire /dev/block/sda31 device. using dd results in a FULL image of the device (your /data and your internal_storage) I am still trying to work out a clean procedure for this as a raw backup results in a 110gb backup file and is very slow to backup and restore.

Due to the way rooted devices are booted using the recovery kernel you can not start the FDE process unless you are using the standard system booted kernel. I do not know why this is but encryption failed every time i tried to encrypt from Recovery instead of from System. This process has to be done from a clean freshly rooted state due to a weird issue where once you run magisk for the 1st time and it finishes its setup process trying to boot into unrooted system mode the UI crashes every time you enter the pin/password. This may be a temporary issue i am not sure i couldn't find a way around it so i did the encryption process before doing the magisk setup.

You will need to modify multidisabler and inside the disable_fbe function where it replaces fileencrypiton with encryptable you need to add "=footer" after "encryptable" so it looks like this.

"sed -i -e 's/^\([^#].*\)fileencryption=[^,]*\(.*\)$/# &\n\1encryptable=footer\2/g' /vendor/etc/fstab.exynos9820"

This will allow for FDE storing the encryption key data at the end of the /data block device (/dev/block/sda31). If you do not have =footer then FDE does not work as it does not know where to store the encryption key data. You will need to install this modified version during the regular procedure where you would install the unmodified multidisabler. You cant install the modified multidisabler after you have run the regular version. Alternatively to modifying multidisabler from TWRP you can mount /vendor and manually edit /vendor/etc/fstab.exynos9820 to add "=footer" to the appropriate line.

This should be the step by step process to get FDE.

Follow the regular procedure for twrp+magisk+multidisabler

After the step of installing multidisabler and wiping data (before rebooting out of twrp)

1. unmount /data using the mount menu

2. go into the terminal or use the adb shell

run> e2fsck -f /dev/block/sda31

This is to make sure the filesystem is clean and you also need the value for the total number of blocks for the device. The output will look something like below. You need the last value which is the full size of the block device in my case it is "29083648"

/dev/block/sda31: 12/7274496 files (0.0% non-contiguous), 602886/[B]29083648[/B] blocks

3. Now you need to resize the filesystem as FDE requires at least 16k at the end of the partition to write its key data. Assuming other devices are the same the block size is 4K per block you will need 4 blocks for 16K. So to get the new size subtract 4 from your total number of blocks in my case 29083648 - 4 = 29083644

run> resize2fs /dev/block/sda31 [B]29083644[/B](where the number is your number of blocks from above)

You will get an output like this

resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/block/sda31 to [B]29083644 [/B](4k) blocks.
The filesystem on /dev/block/sda31 is now [B]29083644 [/B](4k) blocks long.

4. Run e2fsck again to make sure the partition is clean.

run> e2fsck -f /dev/block/sda31

5. Reboot into regular system mode

6. go through regular setup for your device. This can be a real setup as you will not be wiping again.

7. in Settings you can now encrypt the device with full disk encryption. Make sure you set a pin/password 1st but then go to the encryption option and start encryption. I suggest just doing the fast encryption but you can do a full slow encryption if you want

8. Once encrypted boot into system mode again, you should be prompted for your pin/password on boot. If this worked then you have FDE enabled. You can now reboot into Recovery and boot with root enabled into the OS and finish your magisk root setup.