TWRP for Fairphone 4

Do you have a clear idea of where/which decryption library is failing?

Looking up for “decrypt” in dmesg/logcat I see nothing, and in recovery.log there is this part:

part of recovery.log when TW_INCLUDE_CRYPTO := true
I:Unable to mount '/data'
I:Actual block device: '/dev/block/sda11', current file system: 'f2fs'
I:Backup folder set to '/data/media/TWRP/BACKUPS/ef69ff96'
I:Settings storage is '/data/media'
DEBUG:prepdecrypt::Running prepdecrypt script for TWRP...
I:prepdecrypt::File Based Encryption (FBE) is present.
DEBUG:prepdecrypt::SDK version: 30
DEBUG:prepdecrypt::DEFAULTPROP variable set to prop.default.
DEBUG:prepdecrypt::A/B device detected! Finding current boot slot...
DEBUG:prepdecrypt::Current boot slot: _b
DEBUG:prepdecrypt::SETPATCH Override flag found.
DEBUG:prepdecrypt::Device has recovery partition!
DEBUG:prepdecrypt::Resetprop binary not found. Falling back to setprop.
DEBUG:prepdecrypt::Recovery/Fastbootd mode boot detected.
DEBUG:prepdecrypt::SETPATCH Override flag found.
I:prepdecrypt::SETPATCH=true
DEBUG:prepdecrypt::Build tree is Oreo or above. Proceed with setting props...
DEBUG:prepdecrypt::Temporary vendor folder created at /v.
DEBUG:prepdecrypt::vendor mounted at /v.
DEBUG:prepdecrypt::prepdecrypt.vendor_mounted=1
DEBUG:prepdecrypt::Vendor Build.prop exists! Reading vendor properties from build.prop...
DEBUG:prepdecrypt::Current vendor Android SDK version: 30
DEBUG:prepdecrypt::Current vendor is Oreo or above. Proceed with setting vendor security patch level...
DEBUG:prepdecrypt::Current Vendor Security Patch Level: 2127-12-31
E:prepdecrypt::setprop failed. Vendor Security Patch Level unchanged.
DEBUG:prepdecrypt::prop.default update successful! ro.vendor.build.security_patch=2021-12-05
DEBUG:prepdecrypt::System-as-Root device detected! Updating build.prop path variable...
DEBUG:prepdecrypt::Build.prop location set to system/build.prop.
DEBUG:prepdecrypt::Temporary system folder created at /s.
DEBUG:prepdecrypt::system mounted at /s.
DEBUG:prepdecrypt::prepdecrypt.system_mounted=1
DEBUG:prepdecrypt::Build.prop exists! Reading system properties from build.prop...
DEBUG:prepdecrypt::Current system Android SDK version: 30
DEBUG:prepdecrypt::Current system is Oreo or above. Proceed with setting OS Version & Security Patch Level...
DEBUG:prepdecrypt::Current OS Version: 11
DEBUG:prepdecrypt::setprop successful! New OS Version: 11
DEBUG:prepdecrypt::prop.default update successful! ro.build.version.release=11
DEBUG:prepdecrypt::Current Security Patch Level: 2127-12-31
E:prepdecrypt::setprop failed. Security Patch Level unchanged.
DEBUG:prepdecrypt::prop.default update successful! ro.build.version.security_patch=2021-12-05
I:prepdecrypt::crypto.ready=1
I:prepdecrypt::Script complete. Device ready for decryption.
Starting TWRP 3.6.0_11-0-bee26852 on Sat Feb 19 19:58:49 2022
 (pid 638)
I:Lun file '/sys/class/android_usb/android0/f_mass_storage/lun0/file' does not exist, USB storage mode disabled
PRODUCT_USE_DYNAMIC_PARTITIONS := true
TW_INCLUDE_CRYPTO := true

The only error I see here is linked to the patch level (I guess?)

DEBUG:prepdecrypt::Resetprop binary not found. Falling back to setprop.
E:prepdecrypt::setprop failed. Vendor Security Patch Level unchanged.
E:prepdecrypt::setprop failed. Security Patch Level unchanged.

Then the prepdecrypt says it succeeded, but just after the device automatically reboot - and continue rebooting every 10 seconds. So strange :wink:

I:prepdecrypt::crypto.ready=1
I:prepdecrypt::Script complete. Device ready for decryption.
Starting TWRP 3.6.0_11-0-bee26852 on Sat Feb 19 19:58:49 2022
 (pid 638)

Booting the twrp image in the description causes me the phone stuck at the logo in boot up. FP4 Iode os. Any idea? Thanks

Strange, for me it works correctly (on stock OS)

Are you doing fastboot boot twrp.img or fastboot flash recovery twrp.img ? (I do the first one)

The first one too. fastboot boot twrp.img

Kurze Frage mal meinerseits

Um ein Backup der system PArtiotion zu machen, nützt mir TWRP nun nichts, da diese mit in der super PArtion abliegt und diese super verschlüsselt ist. Richtig?

Heißt für Backups auf dem FP4 ist TWRP ungeeignet.
Da muss ich anders ran.

Hallo @FairphoneHulk !
Ich antworte deine Frage in Englisch :slight_smile: Ich hoffe das is OK fur dich.

Indeed, in its current state of development TWRP is useless for doing backups, as system and userdata partitions are not successfully decrypted.

TWRP without decryption ability has few use, for example:

But in my opinion the full potential of TWRP could only be with decryption, that’s why I made some trials to include it :slight_smile: (unfortunately without success)

6 Likes

Have somebody tried to decrypt the FP4 successfully ? With dynDFE.zip?

@Aaanze , @hirnsushi for example…

What is it? Could you explain a little? :slight_smile: I searched it up and only found some direct download links (on androidfilehost or sourceforge). Is it an opensource tool or closed-source?

Nope, this stuff is out of my league :smiley:

I had to google it as well and couldn’t find sources either, not that uncommon with tools like that, but still… :roll_eyes:
I’ve seen it’s used in LeOS, does @harvey186 know where it’s from? :thinking:

It’s 32°C at my desk right now so I’m not gonna test something that might make me stay here longer getting my phone back to a working state, sorry :smirk:

2 Likes

it’s a script for removing force encryption setup from device fstab. Nothing more. You can do it also by hand if your vendor image is writeable. The zip is for using with TWRP

It is from a developer in PHH treble telegram group / xda member. there are 2 versions. DisableForceEncryption.zip for devices without super partition and dynDFE.zip for devices with super partition.

And on my desk where I’m just building GSIs are around 40 degrees. In normal room 28 and outside 34 degrees. Welcome summer :))

2 Likes

So this tool is not really about decrypting anything right ?

You basically flash that to disable force encryption, wiping everything in the process, thus allowing full TWRP features to work.
Assuming the said zip works :smiley:

I remember back in the days - I’m talking Samsung Galaxy S2/3 days - it was common to disable forced encryption as it would notably speed up the device. I’m not sure what would be the point of disabling encryption nowadays (well except when you need to use a TWRP that cannot decrypt your device ofc :smiley: )

1 Like

yes, format data, reboot to twrp, flash right version of dfe.zip, reboot and be happy :))

2 Likes

So if I understand well, this process will wipe all data and disable encryption, then you’ll be able to fresh install StockOS/CustomOS on it without encryption, thus being able of doing TWRP backups??

Yes, as it is written several times above

1 Like

Yep that’s the idea.

However I have no idea how this thing works nor if it’s bulletproof for every devices… Unless it has been tested on FP4 before by someone who’d care to report ?

Similar here on FP4 /e/OS. fastboot boot twrp.img causes phone to be stuck at the logo in boot up. Issuing the same command again creates a bootloop. It’s only possible to leave the bootloop (and successfully start the system) by going into bootloader/fastboot again and issuing fastboot set_active a command and start system then.

TWRP site says not to do it, but the only thing that worked was to flash the image first and then i could go into TWRP recovery. I did not installed it from the zip file because to do so I had to chose which partition to install on, and i did not find anything with google. But after reboot i can boot into TWRP again without problems.

1 Like

So you used fastboot flash recovery twrp.img to flash it?