TWRP for Fairphone 3

Start here:

Add this to .repo/local_manifests/fp3.xml

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="chaosmaster/android_device_fairphone_fp3" path="device/fairphone/FP3" remote="github" revision="android-9.0" />
<project name="chaosmaster/android_kernel_fairphone_sdm632" path="kernel/fairphone/sdm632" remote="github" revision="twrp-9.0" />
</manifest>

run repo sync

run repopick -g https://gerrit.twrp.me 1807

11 Likes

Excellent work by all the people involved, doing my first proper fp3 backup right now :heart:

4 Likes

Hm I’m having trouble to backup the data partition:

Backing up Data (excl. storage)…
Backups of Data do not include any files in internal storage such as pictures and downloads.
createTarFork() process ended with ERROR: 255
Backup failed. Cleaning Backup Folder.

The recovery.log file contains the following at the end:

I:addFile ‘/data/misc_ce’ including root: 1
==> set selinux context: u:object_r:system_data_file:s0
I:addFile ‘/data/misc_ce/10’ including root: 1
==> set selinux context: u:object_r:system_data_file:s0
failed to lookup tar policy for ‘/data/misc_ce/10’ - ‘ced9be5f13b1f6aa’
I:Error adding file ‘/data/misc_ce/10’ to ‘/external_sd/TWRP/BACKUPS/A209G7PH0202/2020-01-25–04-25-27_89012A010520191217/data.ext4.win000’
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving ‘/external_sd/TWRP/BACKUPS/A209G7PH0202/2020-01-25–04-25-27_89012A010520191217/data.info’
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.

Did you decrypt data, when you started TWRP?

yes and I can see the internal storage properly. My guess it’s because of my work profile -> https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1373

A huge Thank you! to everybody having made this available.
It’s so good to have this on the phone. And it even can decrypt Android 9 encryption :partying_face: (which is not a given and not required to work).

3 Likes

Looks like that is the issue.
Found this patch: https://gerrit.twrp.me/c/android_bootable_recovery/+/1724
I have built a test-version with this patch included, give that a try:
https://github.com/chaosmaster/android_device_fairphone_fp3/releases/tag/20200124-02-MU

4 Likes

Also please, if anyone has tried the installer, please give some feedback AFAIK it is yet untested.

How to backup/restore the original recovery, if needed, as there’s no complete installing from scratch method available from Fairphone yet?

Does unlocking the bootloader format userdata?

I don’t know whether it formats, technically speaking, but you will lose your data.

4 Likes

Thanks I’ve given it a shot. Still the same problem. My guess from looking into the /data/misc_ce folder is that it’s not properly decrypting the second user:

fp3:/ # ls -R /data/misc_ce*                                                                                                                                                                                      
/data/misc_ce:
0 10 

/data/misc_ce/0:
storaged vold wifi 

/data/misc_ce/0/storaged:
storaged.proto

/data/misc_ce/0/vold:

/data/misc_ce/0/wifi:
WifiConfigStore.xml

/data/misc_ce/10:
dCWPZOjFa6F,kxCfb0uTrC j,0e4+6LXBDhdhqV7hZNbA 

/data/misc_ce/10/dCWPZOjFa6F,kxCfb0uTrC:

/data/misc_ce/10/j,0e4+6LXBDhdhqV7hZNbA:
1 Like

I’ve noticed the “decrypt user” option in the advanced tab. It fails to decrypt with my PIN though.

After deleting the work profile, backup up the data partition works fine.

4 Likes

Wow! Managed to root using magisk, instead of using the installer cant we just do:
fastboot flash recovery twrp.img

2 Likes

I don’t see recovery on offer in TWRP at least.
(Was thinking about installing the TWRP IMG file with the fastboot booted TWRP, but where to?)

From the description of the patch:

  • Add CLI support using the command “twrp decrypt [USER ID]”
  • Add GUI support using the menu Advanced → Decrypt User

I would assume, the secondary user requires a different password.

Since this is an A/B device, there is no separate recovery partition.
Recovery is part of the boot.img.
I have linked to a full stock dump above. (Which could be used with fastboot to get back to stock state)
You can also backup your boot.img using TWRP.

That’s what the installer is for, it would replace the recovery in the boot.img.
I don’t think anyone has tested that yet.

4 Likes

I just installed the TWRP using the zip installer, then I installed Magisk and rebooted the system. Everything is fine so far. Thanks !

11 Likes

Well you need to enter a PIN/password for the work profile when you setup one. I’ve used the same as for the screen unlock for convenience reasons. TWRP does not seem to be able to decrypt with the correct PIN/password though.