TeamWin / android_bootable_recovery

1.33k stars 415 forks source link

FBE keys gets wiped on factory reset. New rom cannot decrypt data (after wipe data / not format) #131

Open arun54321 opened 3 years ago

arun54321 commented 3 years ago

Device codename: Phoenixin TWRP version: 3.5

WHAT STEPS WILL REPRODUCE THE PROBLEM?

wipe data / factory reset

WHAT IS THE EXPECTED RESULT?

New rom should able to decrypt the fbe encrypted data and access internal data.

WHAT HAPPENS INSTEAD?

These new builds wipes fbe keys in /data and device can't boot new rom and can't decrypt data. I had to format data to make the partition usable again.

ADDITIONAL INFORMATION

It worked fine and fbe keys are preserved on unofficial twrp 3.4 builds and on Pitch black recovery beta

fbe keys preserved & present in old unofficial twrp-3.4.0_10-0-phoenix twrp builds fbe keys wiped on twrp builds

Terminator-J commented 3 years ago

I'm having the same behavior, sadly. Trying to compile my own build of TWRP 3.5.2_11-0 for enchilada & fajita (OnePlus 6 & 6T). Was able to get fajita working by adapting Nebrassy's work on enchilada, and they're both able to reliably decrypt FBE. (see https://github.com/Terminator-J/recovery_device_oneplus_fajita/tree/11.0-twrp-crdroid/ for example). However, doing the "slide to factory reset" wipe action using 3.5.2_11-0 causes it to lose the FBE keys, and after restarting to recovery it's no longer possible to decrypt userdata. The only way to get it usable again is, like arun54321 said above, to format data (and lose all the contents of internal storage, when a simple reset is what I wanted). In the last official release based on mauronofrio's trees, 3.5.2_9-0, factory resetting works fine and will trigger a "first boot" with setup wizard when starting system, but keeps the FBE keys and contents of internal storage in /data/media/0/ intact.