Last active
December 11, 2022 13:31
-
-
Save basxto/8b2476479eee05c3d68d67e6a7750bde to your computer and use it in GitHub Desktop.
Root Fairphone 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FASTBOOT=fastboot | |
ADB=adb | |
MAGISK=v20.3 | |
TWRP_RELEASE=20200202-02 | |
TWRP=3.3.1-0_k4y0z-${TWRP_RELEASE}-fp3 | |
mkdir -p /tmp/flash_fp3_${TWRP_RELEASE} | |
cd /tmp/flash_fp3_${TWRP_RELEASE}/ | |
wget -nc https://github.com/chaosmaster/android_device_fairphone_fp3/releases/download/${TWRP_RELEASE}/twrp-${TWRP}.img | |
wget -nc https://github.com/chaosmaster/android_device_fairphone_fp3/releases/download/${TWRP_RELEASE}/twrp-installer-${TWRP}.zip | |
wget -nc https://github.com/topjohnwu/Magisk/releases/download/${MAGISK}/Magisk-${MAGISK}.zip | |
${ADB} reboot bootloader | |
product=$(${FASTBOOT} getvar product 2>&1 | grep -oE 'product:\s+FP3') | |
if [ $? -ne 0 ]; then | |
echo "This device is not a Fairphone 3!" | |
${FASTBOOT} continue | |
exit 1 | |
fi | |
${FASTBOOT} boot ./twrp-${TWRP}.img | |
${ADB} wait-for-recovery && ${ADB} shell twrp sideload && ${ADB} wait-for-sideload && ${ADB} sideload twrp-installer-${TWRP}.zip | |
${ADB} wait-for-recovery && ${ADB} shell twrp sideload && ${ADB} wait-for-sideload && ${ADB} sideload Magisk-${MAGISK}.zip | |
echo "Flashed TWRP and Magisk" | |
echo "Rebooting to device..." | |
${ADB} wait-for-recovery && ${ADB} reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great Script !!!
I just changed to line
MAGISK=v20.3
to
MAGISK=v21.2
Works like a charm.