-
-
Save ivoruetsche/b8a8bf9a73faed1dd9f9ede3c0eac1a8 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 | |
# Latest | |
# https://magisk.me/zip/ | |
FASTBOOT=fastboot | |
ADB=adb | |
MAGISK=v25-2 | |
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