I'm using File Based Encryption on data partition and I want to backup it with TWRP. In this kind of encryption, there are two possibilities to backup files. First, one does not decrypt files in TWRP and take backup files as they are, backup of encrypted files. The second solution is to backup decrypted files, so I need to decrypt files with PIN code in TWRP and then take backup.

Which solution is better and has fewer cons while restoring a backup?

  • 2
    Always better to go for backup without encryption, in my experience. Reasons 1. TWRP version may not be updated with latest OS version as I saw on One Plus 7 2. Changing ROMs 3. If you need to factory reset or wipe your device, encrypted backup not possible to be restored (even if you use same PIN) 4. cases like this
    – beeshyams
    Commented Feb 25, 2021 at 11:28
  • 2
    encrypted backup is useless when keystore in TEE is wiped
    – alecxs
    Commented Feb 25, 2021 at 11:37
  • @beeshyams thx for reply. When changing ROM it's better to start with new /data filesystem, it's obvious. To deal with cannot unlock device after restoring TWRP backup is easy, just delete unlock screen config file/sqlite db.
    – QkiZ
    Commented Feb 25, 2021 at 12:05
  • @alecxs Does TEE still flush keys if /data partition is wiped from TWRP instead of factory reset?
    – defalt
    Commented Feb 25, 2021 at 16:54
  • @defalt from what we both discovered recently that's the point i still don't know. guess not because that requires deleteKey command send to TEE
    – alecxs
    Commented Feb 25, 2021 at 17:20


You must log in to answer this question.

Browse other questions tagged .