TeamWin / Team-Win-Recovery-Project

Core recovery files for the Team Win Recovery Project (T.W.R.P) - this is not up to date, please see https://github.com/TeamWin/android_bootable_recovery/
http://twrp.me
1.96k stars 740 forks source link

twrp-3.x.x-x-violet cannot decrypt f2fs /data #1508

Open ghost opened 5 years ago

ghost commented 5 years ago

Device codename: violet TWRP version: 3.3.1-0

WHAT STEPS WILL REPRODUCE THE PROBLEM?

Boot into recovery.

WHAT IS THE EXPECTED RESULT?

To be asked by FDE password or all files are decrypted.

WHAT HAPPENS INSTEAD?

No password is asked. /data is mounted, but files are encrypted. (filename is encoded)

/tmp/recovery.log : recovery.log dmesg: kmsg.txt

ghost commented 5 years ago

I:Done processing fstab files I:Setting up '/data' as data/media emulated storage. I:mount -o bind '/data/media' '/sdcard' process ended with RC=0 I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0 I:File Based Encryption is present e4crypt_initialize_global_de calling retrieveAndInstallKey Key exists, using: /data/unencrypted/key

Magendanz commented 5 years ago

I'm seeing the same issue on the Samsung Galaxy Tab A 10.1 (2019) [SM-T510], but TWRP hangs on the splash screen after the "Key exists, using: /data/unencrypted/key" message. Wiping the data partition in stock recovery prior to installing TWRP works around the problem, but that seems to be the only way to avoid the hang.

danielrocher commented 3 years ago

Same with Pixel 4 (flame), impossible to mount encrypted filesystem f2fs :

09-02 07:55:54.121   567   567 I /system/bin/recovery: [libfs_mgr]Created logical partition system_b on device /dev/block/dm-0
09-02 07:55:54.123   567   567 I /system/bin/recovery: [libfs_mgr]Created logical partition vendor_b on device /dev/block/dm-1
09-02 07:55:54.126   567   567 I /system/bin/recovery: [libfs_mgr]Created logical partition product_b on device /dev/block/dm-2
09-02 07:55:54.128   567   567 I /system/bin/recovery: [libfs_mgr]Created logical partition system_a on device /dev/block/dm-3
09-02 07:55:54.130   567   567 I /system/bin/recovery: [libfs_mgr]Created logical partition vendor_a on device /dev/block/dm-4
09-02 07:55:54.130   567   567 I /system/bin/recovery: [libfs_mgr]Created logical partition product_a on device /dev/block/dm-5
09-02 07:55:54.130   567   567 I /system/bin/recovery: [libfs_mgr]Created logical partition system_ext_a on device /dev/block/dm-6
09-02 07:55:54.179   567   567 W libc    : Unable to set property "ro.crypto.state" to "encrypted": error code: 0xb
09-02 07:55:54.183   567   567 W libc    : Unable to set property "ro.crypto.type" to "file": error code: 0xb
09-02 07:55:54.183   567   567 E /system/bin/recovery: fscrypt_mount_metadata_encrypted: /dev/block/sda15 /data 0
09-02 07:55:54.185   567   567 E cutils-trace: Error opening trace file: No such file or directory (2)

recovery.log :

...
I:Done processing fstab files
I:Trying to prepare system from super partition
I:Trying to prepare vendor from super partition
I:Trying to prepare product from super partition
I:Can't probe device /dev/block/sda15
I:Unable to mount '/data'
I:Actual block device: '/dev/block/sda15', current file system: 'f2fs'
I:Bind mounting flattened apex directory
I:Using automatic handling for /data/media emulated storage device.
I:Setting up '/data' as data/media emulated storage.
I:Can't probe device /dev/block/sda15
I:Unable to mount '/data'
I:Actual block device: '/dev/block/sda15', current file system: 'f2fs'
I:Backup folder set to '/data/media/TWRP/BACKUPS/99081FFAZ001HW'