Some findings about android device encryption:
- A
Factory data reset (via Settings --> Backup & reset)
does not remove device encryption. - A clean way to remove device encryption:
TWRP -> Wipe -> Format Data
- When you have a TWRP-backup of an encrypted userdata partition, it is not possible to restore to an unencrypted userdata partition (boot loop). Workaround: 1. Factory data reset 2. Encrypt phone via (Settings -> Security) 3. Restore your TWRP-backup of userdata via TWRP.
Tested with twrp-3.1.1-1-fp2.img and LineageOS.