A couple of days ago I received my Fairphone 4, but unfortunately for the moment, there aren’t any alternative operating systems available that provides you root access. Fortunately, the community already found a method to root the phone and to install Magisk. However, the instructions were not always that clear and I have written my own instructions guide.
⚠⚠⚠ WARNING ⚠⚠⚠
This guide is provided as is and comes with ABSOLUTELY NO WARRANTY; during the process the phone will be wiped and you will lose data. There is also a reasonable chance the phone gets bricked. Perform these steps is at your own risk and the writer, the community or Fairphone are not liable for any damages caused by following this procedure. Continue on your own risk.
The above warning can be summarized in the simple question: “Do you trust a geek from Belgium”, if the answer is No, close this page and wait until there are beter alternatives. Fun Fact… initially I ended up with corrupted phone, so again, on your own risk.
Also, while this was a fun little project, I’m not planning to keep this procedure up to date. So, for support, it is best you reach out to the community on the FairPhone website.
Download adb & fastboot
The adb and fastboot tools can be found on the official developer website from android: https://developer.android.com/studio/releases/platform-tools
Download the tools and extract them somewhere on your computer.
Unlock the bootloader
Again, another warning, when you unlock the bootloader, the device will be wiped and you lose all data. Please note: I have performed this on Windows 10 machine. For Linux and macOS, some steps could be different.
- Get the bootloader unlock code from the FairPhone website by following the next procedure, and while it says FairPhone 3 it also works for the 4: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
- Once you have entered the code on the phone; Go to Settings > System > Advanced > Developer options
- Enable USB Debugging and connect the phone to the computer using a USB cable
- On the computer, open a PowerShell window or Windows Terminal and go to the location where you have downloaded the platform tools (adb & fastboot)
- Reboot into the bootloader by running the command
.\adb.exe reboot bootloader
- On the phone; You should see Device State – Locked and need to unlock it by running the following command on the computer:
.\fastboot.exe flashing unlock
- Note: if you receive the message
< waiting for any device >, you are probably missing the correct driver. Run ‘PART 2 On your computer‘ of the following article. (This was a mistake I initially made)
- After successfully running the command, you will see a big warning on the phone. Confirm by selecting UNLOCK THE BOOTLOADER and push the power button
- After this step, the phone will reboot a couple of times and eventually will be wiped
Once done, you will need to run the initial configuration process and enable the USB debugging again.
Install Magisk App
The latest version of the Magisk App can be found on the Github Page of the developer: https://github.com/topjohnwu/Magisk/releases
Download the APK and install this on the phone.
Download and patch the stock boot image
The original boot image can be found on the FairPhone website: https://code.fairphone.com/projects/fairphone-4-kernel.html
Make sure you download the correct build. To find the correct build; On the phone, go to Settings > About Phone > Build number.
In this example the build number is FP4.FP3Q.A.094.20211213 so the corresponding boot.ing-file is build A.094.
Once you have downloaded the image to your phone, you need to patch the file using the Magisk App:
- Open the Magisk app on the phone.
- Click on Magisk Install.
- Select Select and Patch a file
- Selected te downloaded image (in my case A.094-boot.img)
- Click on LETS’s GO
- (optional) Write down the output location
⚠ Obviously, make sure that the patching was successful.
Install the patched boot image
- On the computer, open a terminal and go to the location where you have downloaded the platform tools (adb & fastboot)
- Download the patched boot image to the computer using the command
adb pull <patched boot image location>
- Reboot the phone to the bootloader using the command:
.\adb.exe reboot bootloader
- Perform a fastboot with the patched image using the command:
.\fastboot.exe boot <path to boot image on pc>
- After successful booting using fastboot, on the phone: Open Magisk
- Click on Magisk Install
- Select Direct Install (Recommended)
- Click on LETS’s GO
- Once successful, reboot the Phone
And that’s it, normally this will provide you root access with Magisk installed.
Final warning: Don’t lock the bootloader again, like I did. 😅
- Original post: https://forum.fairphone.com/t/fp4-root-access-is-possible-maybe-a-bit-risky/76839/43
- adb & Fastboot: https://developer.android.com/studio/releases/platform-tools
- Unlock the bootloader 1: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
- Unlock the bootloader 2: https://support.fairphone.com/hc/en-us/articles/360048646311-FP3-Manage-the-bootloader
- Fairphone 4 kernel: https://code.fairphone.com/projects/fairphone-4-kernel.html
- Magisk repository: https://github.com/topjohnwu/Magisk