3

I need to restore from a backup. However TWRP stopped asking me for the password to decrypt. In the terminal emulator I tried twrp decrypt 1234 but got the error "Failed to decrypt data". Whenever I try to use any other feature in TWRP, such as restore, it says "Failed to decrypt data". and "extracTarFork() process ended with ERROR: 255"

How can I restore from a backup?

8
  • @beeshyams no it isn't a multi user backup. It's TWRP 3-3-10, is there a new version for Xperia XZ1 Compact? – JonDon Dec 2 '20 at 11:19
  • @beeshyams as far as I could determine, no there isn't a newer version for XZ1 Compact. By trying things out I got it to work (see answer bellow). I'm curious, is this a known bug? Why is it sometimes TWRP just doesn't ask for password? – JonDon Dec 2 '20 at 12:04
  • 1
    TWRP needs a working firmware for decryption. if system vendor or modem is wiped, the workaround is to format userdata in order to remove encryption completely, so TWRP can mount it unencrypted – alecxs Dec 2 '20 at 15:08
  • @alecxs all I did was flash Lineage 17 so how could that corrupt the firmware? – JonDon Dec 2 '20 at 21:42
  • just a guess as you stated you wiped everything. encryption also depends on android version - switching between ROMs can also cause this – alecxs Dec 2 '20 at 22:02
2

Copied from comments:

TWRP needs a working firmware for decryption. If system vendor or modem is wiped, the workaround is to format userdata in order to remove encryption completely, so TWRP can mount it unencrypted.

Through experimenting I was able to get it to work by doing the following. First, try reflashing just TWRP in fastboot mode: fastboot flash recovery twrp.img. This may be enough, but if not se bellow . My phone is an Xperia so replace steps 1. and 2. with however you normally would install firmware.

Steps:

  1. download phone's Firmware as ftf
  2. Use flashtool to flash firmware
  3. Use fastboot to flash TWRP
  4. Use TWRP to wipe all data, but make sure not to wipe the backup you're trying to restore!
  5. Use TWRP to install a new ROM.
  6. Setup new ROM e.g. sign into WiFi
  7. Reboot to TWRP again
  8. Now TWRP should ask for password and you will be able to decrypt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.