[Xiaomi Poco F1 Guides, News, & Discussion] pfavayi:
Encryption has nothing to do with rooting ...

you need to understand what is encryption and what it is doing in order to understand what is happening.

encryption encrypts your personal data - photos videos documents files on your internal storage.

That has nothing to do with rooting.

===

For a very long while you'd have to decrypt your phone before rooting

===

Makes perfect sense....

If you are encrypted with ROM A and you flash ROM B , then it will not see your personal data in from ROM A

So decrypting in ROM A makes sense

Decrypted data can be seen by any rom or by anyone

===

or else you'd have issues like boot looping,

===

This is self-explanatory if you understood the above..

(You can't read the internal storage in the new rom and that causes the boot loops)

===

If you have other suggestions how to keep encryption during the rooting process, by all means.

===

Encryption has nothing to do with rooting...

Google demands that new powerful phones be encrypted.

So you buy your new phone encrypted.

If you have to change ROM then either you decrypt first and then flash the new rom

Or you factory reset /format your internal storage. That way you will not have any encrypted data on your internal storage and so you can install any new rom without problems.

If you try to flash a new ROM when your phone is encrypted you will have to format your phone.

You can be encrypted when you're not rooted

You can be NOT encrypted when you're not rooted

You can be encrypted when you're rooted

You can be NOT encrypted when you're rooted

Encryption is a Vender issue determined by settings in the file

/vendor/etc/fstab.qcom

This is the file FED & DFE alter.

You can even do it by hand through a text editor.

Whenever a new vendor+firmware is flushed you have to flash FED or DFE or manually edit the file so that you do not encrypt your phone on first boot after the flashing of the vender firmware.

Most FED and DFE also have an old version of magisk included. So after flashing FED, DFE flash the latest version of magisk as well.

(I have DFE that does not include magisk and it is only 128k)

Fortunately or unfortunately miui does not have the phone encrypted.

So flashing another rom from MIUI will not cause any encryption related problems and your phone will remain not encrypted.

But if you flash vendor plus firmware then the change in /vendor/etc/fstab.qcom will make your phone encrypt on the next boot unless you flush FED or DFE immediately after.

And unless you decrypt your phone, the next ROM you flash will wipe out your internal storage or course bootloops until you wipe out your internal storage - and that is because your internal storage will be encrypted.

===

Rooting without disabling verification is troublesome as it could lead to bootloop issues

===

Wrong again . I explained it above.

DFE has to do with your vender firmware not with the rooting.

Rooting is just the ability to write in /system

When you unlock the bootloader for the first time the phone will be formatted... And that means there will be no data on the internal storage...

Depending on the contents of /vendor/etc/fstab.qcom you will get encrypted or not on first boot.