[GUIDE] Install Magisk with proper support for OTA updates - Xiaomi Mi A2 Lite Guides, News, & Discussion

Code:
* I'm not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed.
* Please do some research if you have any concerns about features included in the products you find here before flashing it!
* YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you.
* Your warranty could be void if you tamper with any part of your device / software.
* Same statement for XDA.
Here's an alternative method to install Magisk that support OTA updates (copied from the Mi A1 forum and expanded )
You need a PC with Android platform tools (they exist also for MacOS and Linux). When using Windows, you should also install MiFlash tool to get the required drivers to recognize the device.
BOOTLOADER UNLOCK
First thing to do: unlock the bootloader (if you didn't already do this, obviously). Smartphones with Android One are much easier to unlock compared to other Xiaomi phones with MIUI (where you have to ask for authorization and wait for weeks).
CAUTION: when you unlock the bootloader, the phone will reset, erasing all your saved data. Backup your data before unlocking.
1. Go to Settings > System > About phone > and tap many times on "Build number" until you unlock "Developer options" (on Andoird 9 "About phone" is right at the top of the Settings app).​2. Go back to the previous page (i.e. Settings > System), where you can find now "Developer options". Go there and enable the "OEM unlocking" option (and it's better to never disable this).​3. Now you can shutdown your phone, then turn it on while holding the "Volume down" button pressed. Release it when you see the Fastboot screen You can also use the command "adb reboot-bootloader" if you already connected the phone to the PC.​4. Now connect the phone with your PC via USB cable, open an administrative command prompt, move to the directory where the Android platform tools are placed and unlock the bootloader with the following command:
Code:
fastboot oem unlock
The phone will reboot, erasing all the data.​
Now you unlocked your phone's bootloader and can continue to the next section.
MAGISK INSTALLATION
5. Download and install on the smartphone the latest version of Magisk Manager's apk available.
You need the smartphone to be connected to the internet, because Magisk won't install and won't work properly without a connection.​
6. Now you can easily download an already patched boot.img from the following list and jump straight to point 10 of this guide, or you can continue to the next point and learn to patch yourself an original boot.img
If you choose the short way, be sure that you select the patched_boot.img with the same "Build number" currently installed on your phone (see point 1 of this guide), and don't flash the file directly on the phone memory, because Magisk will not work properly (do exactly what this guide says, and you will not find problems, hopefully).
For our convenience, extract the patched_boot.img file in the same directory where Android platform tools are located.
patched_boot 9.6.4.0 (2018 July update) - patched with Magisk 17.1
patched_boot 9.6.6.0 (2018 August update) - patched with Magisk 17.1
patched_boot 9.6.8.0 (2018 September update) - patched with Magisk 17.1
patched_boot 9.6.9.0 (2018 October update) - patched with Magisk 17.1
patched_boot 9.6.10.0 (2018 November 1st update) - patched with Magisk 17.1
patched_boot 9.6.11.0 (2018 November 2nd update) - patched with Magisk 17.1
patched_boot 10.0.2.0 (2018 December upgrade to Android 9.0 Pie) - patched with Magisk 18.0
patched_boot 10.0.3.0 (2019 January update) - patched with Magisk 18.0
In case you erroneously flash those patched files directly on the phone, flash back the original boot.img via fastboot and follow the guide:
original boot.img 9.6.4.0 (2018 July update) - taken from fastboot ROM
original boot.img 9.6.6.0 (2018 August update) - taken from OTA update
original boot.img 9.6.8.0 (2018 September update) - taken from OTA update
original boot.img 9.6.9.0 (2018 October update) - taken from OTA update
original boot.img 9.6.10.0 (2018 November 1st update) - taken from OTA update
original boot.img 9.6.11.0 (2018 November 2nd update) - taken from OTA update
original boot.img 10.0.2.0 (2018 December upgrade to Android 9.0 Pie) - taken from fastboot ROM
original boot.img 10.0.3.0 (2019 January update) - taken from fastboot ROM
7. You need the original boot.img to patch. You can find it inside the official fastboot ROM zip for daisy. Check that the downloaded ROM version is the same as the "Build number" currently installed on your phone (see point 1 of this guide). If the versions are different, update (or downgrade if possible) your phone to that version. You can also download original boot.img elsewhere (for example at the point 6 of this guide), but always pick the same "Build number" of your phone.
After you get the boot.img, copy it to the phone memory (via USB or microSD, or download directly from the phone browser, as you prefer).​
8. Open the Magisk Manager app installed previously, it will ask if you want to install Magisk. Accept by tapping on "Install" > "Patch Boot Image File" and select the boot.img file that you get on the point 7 of this guide.​
9. Wait until the process completes (about 1 minute), then tap on "Close". Now in the phone memory, inside the Download directory, you should have a patched_boot.img file. Copy that file to the PC, inside the same folder where the Android platform tools are located, for our convenience.​
10. Reboot the phone in fastboot mode (as already explained in point 3 of this guide), open an administrative command prompt, move to the Android platform tools directory and then write the following command:
Code:
fastboot boot patched_boot.img
If everything works the phone should boot normally. Open Magisk Manager and it should ask to install Magisk, if not you must tap on the "Install" button. Then choose "Install" > "Direct Install (Recommended)" to install Magisk on the phone, and reboot when finished.​
11. Last step to stay safe when a new OTA update arrives: go to "Settings" > "System" > "Developer options" > and disable "Automatic system updates". From now on, you should check manually if a new OTA update is available.​
Now the installation is finished, you can use Magisk Manager to install modules and manage root permissions.
HOW TO APPLY OTA UPDATES
UPDATE 9 February 2019 It seems that with the latest Magisk (v18.1) and Magisk Manager (v7.0.0) the following procedure is working fine again. I didn't test it personally, but some users gave positive feedback.
WARNING! January 2019 Since the arrival of Android 9 Pie, the OTA update with Magisk as described in the following section, doesn't seem to work anymore. It could work, but you could also get a bootloop with the risk of losing your data.
Before upgrading from Android 8 to 9, or doing an OTA update after Android 9 you should:
- backup your data;
- remove any lockscreen password or fingerprint;
- uninstall totally Magisk and reboot.
If after doing this you get a bootloop, you could try to manually flash the vanilla boot.img via fastboot on the current slot (the same version as the last installed OTA). If you managed to fix the bootloop you can then install Magisk anew, from step 5 of this guide.
If the phone wants your PIN or password to proceed after the OTA update or after fixing the bootloop, and your PINs or passwords doesn't work, then you could have to reset the phone (or erasing the data partition, that should be the same thing), losing all your data.
Last chance if everything fails, you can flash the latest fastboot ROM from the official Xiaomi site and the phone will be working again.
IMPORTANT: OTA updates will work only if all the partitions on the smartphone are untouched. Magisk Manager can restore the original boot.img following this section of the guide, but if you tampered directly with the system partition (e.g. manually editing build.prop) or other partitions, OTA will refuse to install.
You can try to fix OTA updates without the need to flash the whole original fastboot ROM, by flashing only the tampered partitions (usually only "system") with the corresponding img file found inside the fastboot ROM zip. Check the "Troubleshooting" section of this guide for details.
12. When you know that a new OTA update is available and you want to install it, open Magisk Manager, and tap on "Uninstall" > "Restore Images" but very important: absolutely don't reboot the phone now!
Important note: Magisk Manager will restore the boot.img that was found on the phone while installing Magisk. If the boot.img was already non-vanilla (for example you flashed the boot.img with TWRP before installing Magisk), Magisk Manager will backup that modified version of boot.img, and when restored the OTA will not work, as that's not a vanilla boot.img.​
13. Close Magisk Manager and go to "Settings" > "System" > "System update" and install the OTA update. After the update is downloaded, a two-stages update will begin.​
14. When both stages of the update process completed, it will ask to restart: DON'T DO IT!. Open Magisk Manager again and tap on "Install" > "Install" > "Install to Inactive Slot (After OTA)" and after that you can tap on "Reboot".​
After the reboot you will have the updated Android version with Magisk already working.
Thanks to user @jashancheema for the Mi A1 guide and a bigger thanks to @topjohnwu for the OTA part and above all for developing Magisk.

TROUBLESHOOTING
WARNING: before attempting any of the following operations, you must disable any screen lock, PIN or password, because you risk to not get back your data (encryption issues). It is recommended to take a backup, too (as every time a custom modding is involved).
You can get errors when installing OTA updates if you didn't follow meticulously the guide.
Check this list to try to find where the problem lies:
- when a new version is found, the updater will check if all the partitions on the device are untouched. If there is a partition that has been modified, the OTA updater will not proceed with the installation;​- typically, the two partitions commonly modified by user modding are the boot partition (that's where Magisk and TWRP are installed) and the system partition (when you change a config file, add or remove a system app, etc.);​- a system partition modified only by using Magisk modules is effectively untouched, because Magisk register all changes to /system in a file in the /data partition and then trick Android to believe those changes are really applied to /system;​- boot partition instead is really modified, but if you install Magisk following this guide, Magisk will save a copy of the untouched boot partition, and restoring it before applying OTA update will make the update work.​
Now, if you didn't follow this guide to install Magisk and you installed it in other ways, Magisk could alert you that he cannot restore the original boot.img (the boot partition) when you try to apply the OTA update.
To fix this, you can flash directly the vanilla (original, unmodified, untouched) boot.img taken from the point 6 of this guide, using those commands:
Code:
fastboot getvar current-slot
fastboot flash boot_? boot.img
the first command will tell you what is the current slot in use (a or b), the second command will flash the original boot into the phone, but you have to change the "?" in the command with a or b (i.e. the current slot that the first command provided).
Remember that the boot.img file version must correspond to the Android build version currently running in your phone.
If the OTA update will still refuse to apply, probably you changed something directly in the /system partition (for example you changed something in the build.prop without using a Magisk module to do this).
In this case you have to flash the original system.img in the phone with those commands:
Code:
fastboot getvar current-slot
fastboot flash system_? system.img
and as before, the first command will tell you the right slot to use instead of the "?" in the second command.
Here you can find the system.img extracted from the OTA updates zip (along with every other .img file inside that):
9.6.6.0 (August 2018) OTA update dump as .img files
9.6.8.0 (September 2018) OTA update dump as .img files
9.6.9.0 (October 2018) OTA update dump as .img files
9.6.10.0 (November 2018) full fastboot ROM
9.6.11.0 (November 2018) OTA update dump as .img files
If you want to obtain the system.img by yourself, you can find it inside the fastboot images but usually they are not updated monthly like OTA updates. But you can extract the system.img directly from the OTA update zips found in this thread (as I did above with my dumps), using the Python scripts found here.
To make the Python scripts work in Debian/Ubuntu and derivatives, you have to download both "extract_android_ota_payload.py" and "update_metadata_pb2.py", give them execution property and then install the package "python-protobuf". After this you can give this command to unpack the payload.bin file (that you must extract from the OTA update zip):
Code:
./extract_android_ota_payload.py /path/to/payload.bin
This will extract in the current directory all the .img files inside payload.bin, including the system.img
I don't know how to proceed in Windows, probably you only need to install the latest Python2 release and the script will work.​
As the last resort, you can flash directly with MiFlash the latest fastboot image available (even if older than your current version). Use the "flash_all.bat" script but before take a backup of your data, because the phone will be fully reset.
If you don't want to take the risk of not doing a backup, use the script "flash_all_except_storage.bat" when flashing, so you will keep all your data, but be warned that sometimes you will not be able to access the data anymore, because of encryption problems.
Right after the flash, you can start following the guide from point 5 or 6.
It should not be a problem downgrading the build version via fastboot, as long as the Android main version remain the same (Oreo 8.1 at the moment).

Thx, nice work :good:

Thanks to the OP. Great post! Totally noob friendly guide. Nice work.

It should also work on mi a2, thanks!

Lione2 said:
It should also work on mi a2, thanks!
Click to expand...
Click to collapse
Sure, but you can't use the posted patched_boot.img, because they're designed for Mi A2 Lite (daisy) and not for Mi A2 (jasmine).
EDIT: I posted the patched and original boot files for Mi A2 jasmine in the second post. I don't know if I can make a thread in the Mi A2 forum section with an adapted copy of my guide, there are already two guides there (even if not polished like this) and I don't want to create more confusion with a third guide about the same argument...

i've installed magisk from previous guide - what steps should I take to apply OTA update? - 12 to 14?
Now magisk informs me that there is 17.1 version - how to update it?

krzygaj said:
i've installed magisk from previous guide - what steps should I take to apply OTA update? - 12 to 14?
Now magisk informs me that there is 17.1 version - how to update it?
Click to expand...
Click to collapse
If you flashed directly the patched_boot.img via fastboot in both slots A and B as the other guide said previously, you must flash the original boot.img to both slots, then start the guide from point 10.

BubuXP said:
If you flashed directly the patched_boot.img via fastboot in both slots A and B as the other guide said previously, you must flash the original boot.img to both slots, then start the guide from point 10.
Click to expand...
Click to collapse
I did as you wrote but still can't install August update - is there any log?
- extracted boot.img from rom: http://en.miui.com/download-354.html
- did fastboot flash boot_a boot.img and fastboot flash boot_b boot.img and rebooted
- next rebooted and did fastboot boot patched_boot.img with patched_boot 9.6.4.0 (July update) - patched with Magisk 17.1
later did steps in guide - but when i do system update it stops on first stage
Any ideas?

krzygaj said:
I did as you wrote but still can't install August update - is there any log?
- extracted boot.img from rom: http://en.miui.com/download-354.html
- did fastboot flash boot_a boot.img and fastboot flash boot_b boot.img and rebooted
- next rebooted and did fastboot boot patched_boot.img with patched_boot 9.6.4.0 (July update) - patched with Magisk 17.1
later did steps in guide - but when i do system update it stops on first stage
Any ideas?
Click to expand...
Click to collapse
You tampered the system partition? Try flashing also the system.img in that case.
Another case could be that you made an OTA update from the June build to July: in this case the partitions on the other slot (probably only the boot partition) where lost when overwrited with fastboot (and cannot be restored, as we don't have any June build ROM or OTA).
If everything fails, do a full fastboot flash with MiFlash tool, but using the flash_all_except_storage.bat script, that should keep your data intact, restore all partitions (A and B) to stock versions and you can then apply OTA (before or after installing Magisk, but I suggest after installing Magisk so you can test if the guide works fine).

BubuXP said:
If everything fails, do a full fastboot flash with MiFlash tool, but using the flash_all_except_storage.bat script, that should keep your data intact, restore all partitions (A and B) to stock versions and you can then apply OTA (before or after installing Magisk).
Click to expand...
Click to collapse
Thanks above worked :good:
Hope the next update will go smoothly

September?

When booting comes a warning message because of the unlocked boot loader. How can I disable this message?

PC295 said:
When booting comes a warning message because of the unlocked boot loader. How can I disable this message?
Click to expand...
Click to collapse
you can't turn that off with open bootloader

Guys, after i have unlocked bootloader i cannot charge my phone when is off because he go on when I insert the plug, it's normal?

proton242 said:
Guys, after i have unlocked bootloader i cannot charge my phone when is off because he go on when I insert the plug, it's normal?
Click to expand...
Click to collapse
No

ConradB said:
No
Click to expand...
Click to collapse
ConradB you have some suggestion? Thank you

proton242 said:
ConradB you have some suggestion? Thank you
Click to expand...
Click to collapse
Same problem on mine, I don't know if it's a ROM bug or it's caused by unlocked bootloader or Magisk.
The only solution at the moment is charging while the phone is switched on.

BubuXP said:
Same problem on mine, I don't know if it's a ROM bug or it's caused by unlocked bootloader or Magisk.
The only solution at the moment is charging while the phone is switched on.
Click to expand...
Click to collapse
Ciao BubuXP, provando a rimuovere Magisk (lasciando il bootloader sbloccato) tutto torna alla normalità, cosa dici, crea casino quando patcha il boot.img?

Related

[Guide][Root Magisk Only][OTA Compatible] Moto G6 Play

* Warranty is void
* I'm not responsible for any damage to your phone in mistaking anything specified here
* This guide requires intermediate knowledge
I'm posting this guide because I haven't found any special thread about it, and had to search multiple threads and websites to get a conclusion in how to root Magisk only (without flashing TWRP or any other custom recovery). Focused in not decrypting the phone, or modify any system partition for a full OTA compatibility.
Requirements:
* ADB/Fastboot & Motorola USB drivers installed - (PC)
* Unlocked bootloader - (Phone)
* Stock rom - (Phone)
* Magisk Manager (latest stable version installed on your phone)
* TWRP (compatible to the Moto G6 Play model) - please refer to this thread for more details. ***(Of course, you won't flash it!)
*** PLEASE! REFER TO THE UPDATES BELOW!!! ***
Tutorial:
1. Reboot to bootloader
2. Boot into downloaded TWRP using Fastboot code:
Code:
fastboot boot twrp_downloaded.img
(on TWRP ignore any password by canceling)
3. Backup stock boot image using:
Code:
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot stockboot.img
4. Reboot system using ADB code:
Code:
adb reboot system
5. After rebooted, copy backed up stockboot.img to the phone internal memory
6. Install and open Magisk Manager, click [Instal] > [Install] > [Select and Patch a File] and select stockboot.img on internal memory.
7. After boot image patched, copy magisk_patched.img from phone Download folder to PC
8. Reboot to bootloader and flash magisk_patched.img to phone using Fastboot code:
Code:
fastboot flash boot magisk_patched.img
9. After done, reboot system using fastboot code:
Code:
fastboot reboot
10. All done! Open Magisk Manager and check root! For future OTA updates already rooted with Magisk, I recommend this post: https:// www. the custom droid .com/install-ota-update-rooted-android-device-guide/ - (remove spaces )
[UPDATE 1]
I've noticed that Moto G6 simply forces reboot system before update the device, if we go to restore images in Magisk to try it out tutorial post from 10., it'll simply be removed after that.
Even doing so and going ahead to update the device losing Magisk, and still have to back up once more the new updated boot image and patch it on Magisk following my guide above, I got a bootloop patching the newest OTA with Magisk 20.0 (latest).
After almost losing indefinitely root access, I got it done, downgrading Magisk to 19.3.
For doing so, download Magisk 19.3 zip file from GitHub repository and copy it to the SD Card, boot up into TWRP using fastboot (without flashing) then proceed as read-only, after that, install Magisk 19.3 zip file to patch the OTA updated boot image, then it's done. Root it's working properly without updating Magisk.
I don't know exactly why the latest Magisk it is breaking the OTA updated boot image... Whatever, it's a good approach to get root access back after the recent OTA!
I still need to check if this workaround will be working on new OTA's. That's it.
[UPDATE 2]
After recent update - January 2020, my rooting workaround supporting OTA is working properly as followed solution on UPDATE 1, above.
I didn't test using latest Magisk 20.3 apk due the bootloop when patching boot image in Magisk 20. Don't know if that bug has been fixed...
Updating Magisk after successfully rooted using solution above will not result in a bootloop, but I do recommend downgrade Magisk when new OTA is released.
Hello, thank you for this guide. I'm having trouble with the last step, as I also am having a bootloop with the boot image patched with the latest Magisk. Would you care to elaborate on how do I install Magisk 19.3? Since I boot TWRP, but cant find the Downloads folder from the phone, where I put the Magisk-v19.3.zip file. Cheers!
gabardal said:
Hello, thank you for this guide. I'm having trouble with the last step, as I also am having a bootloop with the boot image patched with the latest Magisk. Would you care to elaborate on how do I install Magisk 19.3? Since I boot TWRP, but cant find the Downloads folder from the phone, where I put the Magisk-v19.3.zip file. Cheers!
Click to expand...
Click to collapse
First, if you have the actual boot backup, you'll need to flash it to fix bootloop.
Remember to boot into TWRP (without flashing) to flash it.
* Follow the samples above for the codes if necessary.
After fixing bootloop all you'll need to do is download the Magisk-v19.3.zip from “Magisk GitHub releases” and place it on the external sd card.
Then boot into TWRP (always without flashing) and flash the zip file using TWRP. (Remember to flash to boot image).
It'll simply patch your boot, after that, reboot, if successfully booted go check Magisk.

[MAGISK][ROOT][BOOT.IMG] How to patch the Oneplus 8, 8T and 8 Pro stock Boot Image (boot.img) from the currently installed Stock ROM

Quick and concise how to for obtaining a Stock Boot Image from your Oneplus 8, 8T or 8 Pro device and patching with Magisk to create a fastboot flashable patched boot.img.
DISCLAIMER:
Code:
#include <std_disclaimer.h>
/*
*
* We are not responsible for bricked, broken or dead devices. This is a high-level
* how to for users with a basic knowledge of ADB and Fastboot. YOU alone are
* choosing to make these modifications, and you are solely responsible for your
* device's fit for use and wellbeing.
*
* Backup your data!
*
*/
PREREQUISITS:
An unpatched Stock Boot.img running on your device
General knowledge and understanding of ADB and Fastboot
Download latest op8, op8p, or op8t Horizon Kernel img from [e.g., op8p_7.img]:
https://dl.akr-developers.com/?dir=oneplus/horizon_kernel/R/images
Download latest Magisk Canary build from Github [e.g., app-debug.apk]:
https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/app-debug.apk
DEVICE/PC OPERATIONS:
→ ADB
Enumerate devices
Code:
adb devices
Boot into Fastboot
Code:
reboot bootloader
→ FASTBOOT
Enumerate devices
Code:
fastboot devices
Determine the current slot (A/B), whichever slot you're on should be the "good" img
Code:
fastboot getvar current-slot
Boot with the custom kernel downloaded from Horizon to use root [NOTE: Include the full path of the img if not in the same directory]
e.g., fastboot boot "C:\Users\User\Downloads\op8p_R7.img"​
Code:
fastboot boot xxxxxxx.img
→ ADB
Copy the boot.img from each slot to the root of the device
Code:
adb shell
su
dd if=/dev/block/sde11 of=/sdcard/boot_a.img
dd if=/dev/block/sde35 of=/sdcard/boot_b.img
→ Android Device [NOTE: Some Android 11 devices experience patching issues on the Beta Channel like bootloop] [NOTE: Some users experience issues on Canary like no SIM detected; if so switch to Beta]
Install Magisk app-debug.apk (Canary)
Go to Settings → Update Channel → Canary
Go to Home → Install → Install → Select and Patch A File
Navigate to internal storage and select the stock boot.img [choose the img from whichever slot you're on]
When it’s done patching copy the file, named magisk_patched.img, from the root → Downloads of your device to PC
→ ADB
Code:
reboot bootloader
→ FASTBOOT
Test to ensure it boots before flashing; if not you'll need to patch the other img
Code:
fastboot boot magisk_patched.img
→ Android Device
If the device boots and you have root in the Magisk Manager app, reboot the device into Fastboot then flash the active slot [NOTE: Both slots do not need to be flashed; just the current active slot]
→ FASTBOOT
Flash the patched image file [NOTE: Include the full path of the img if not in the same directory]
e.g., fastboot flash boot_b "C:\Users\User\Downloads\magisk_patched.img"
Code:
fastboot flash boot magisk_patched.img
fastboot reboot
- OR -​
Code:
fastboot flash boot_a magisk_patched.img
fastboot reboot
- OR -​
Code:
fastboot flash boot_b magisk_patched.img
fastboot reboot
ADDITIONAL RESOURSES:
→ FASTBOOT
If you need to set the other slot to be the active slot use:
Code:
fastboot --set-active=a
- OR -​
Code:
fastboot --set-active=b
→ ADB
ADB Magisk Bootloop Fix
Code:
adb shell
magisk --remove-modules
→ OTA Help
Magisk stock boot.img missing fix [NOTE: Android 11 onwards, the /sbin folder might not exist, so Magisk will randomly create a folder under /dev and use it as the base folder]
Rename to: stock_boot_0.img
Compress with gzip = stock_boot_0.img.gz
Copy stock_boot_0.img.gz file to the root of: /data
Edit the config file: /dev/xxxxxxx/.magisk/config → Change SHA1= to 0
Magisk Manager → Uninstall Magisk → Restore Images
→ ADB
Determine the random folder name generated by Magisk on Android 11+
Code:
ls -laR /dev | grep '.magisk/rootdir'
→ ADB
Determine the Boot Image partition location [NOTE: Will list all partitions; look for boot_a and boot_b]
Code:
ls /dev/block/bootdevice/by-name/ -all
Tried some other way on android 11 but failed, so back to android 10.
maybe i won't get android 11 until TWRP is work.
can't easily backup data without root is very annoying, thanks for the work!
I have followed every step, but root only last until I restart my Oneplus.
What am I doing wrong? Why want the device stay rooted?
mrram said:
I have followed every step, but root only last until I restart my Oneplus.
What am I doing wrong? Why want the device stay rooted?
Click to expand...
Click to collapse
Guessing here, but have a second look at these two commands:
Code:
fastboot boot magisk_patched.img
△ This will NOT flash the rooted image, it will only boot up once so you can test it or use it for temporary root
verses
Code:
fastboot flash boot magisk_patched.img
▲ This will flash the rooted image and is used after you've tested the patched image to be sure it doesn't bootloop and to have persistent root
If I use this Horizon kernel to boot with root on 11.0.4.4, could I use directly Magisk 22.0 to root the device permanently? Thanks in advance.
MagikGab said:
If I use this Horizon kernel to boot with root on 11.0.4.4, could I use directly Magisk 22.0 to root the device permanently? Thanks in advance.
Click to expand...
Click to collapse
I only use the Horizon to boot then grab my kernel to patch with Magisk. You could use the Horizon kernel, but you would have to flash it, not just boot it. So, root device, backup stock dtbo, flash Horizon & dtbo, re-root if lost during flash. I would recommend against that until there's a custom recovery available in case there were any issues. Additionally, you must backup your stock dtbo if you ever want to return to stock. You should visit the Horizon thread for more details, but again if you're not familiar with kennel mods you might not want to start learning on a device without a custom recovery.
CarvedArt said:
I only use the Horizon to boot then grab my kernel to patch with Magisk. You could use the Horizon kernel, but you would have to flash it, not just boot it. So, root device, backup stock dtbo, flash Horizon & dtbo, re-root if lost during flash. I would recommend against that until there's a custom recovery available in case there were any issues. Additionally, you must backup your stock dtbo if you ever want to return to stock. You should visit the Horizon thread for more details, but again if you're not familiar with kennel mods you might not want to start learning on a device without a custom recovery.
Click to expand...
Click to collapse
I'd like only to root my device, remaining as more stock as possible, for now. If I want to avoid using a custom kernel (also for the rooting process), should I extract the boot.img with Python, then patch it with Magisk 22? Thanks in advance for your reply, but I'm coming from a Xiaomi that was quite easier to root
MagikGab said:
I'd like only to root my device, remaining as more stock as possible, for now. If I want to avoid using a custom kernel (also for the rooting process), should I extract the boot.img with Python, then patch it with Magisk 22? Thanks in advance for your reply, but I'm coming from a Xiaomi that was quite easier to root
Click to expand...
Click to collapse
Just follow the steps above -- that'll get you a stock kernel (your current kernel) patched with Magisk and permanently rooted. The above process is only using the Horizon kernel to boot your device with root so that you can extract your kernel and patch it. The final result will be as stock as you can get with root.
Hey everyone. OP8 Pro user here. Just took OTA going from 11.0.9.9 running Magisk Canary 23 to the newest 11.0.10.10. I restored images before taking the OTA and reinstalled magisk to the other slot like I always do to retain root. Ive now lost root and am trying to boot the last two versions of the Horizon kernel. Ive tried the two latest ones (r9.2 and r9.2.1 from February 2021) and while they do boot my phone, I cant get SU access to extract the stock images.
Anything else that anyone things I should try? All i want from Christmas is root.
Isn't there a more easy way to obtain root?
That's strange. I use OnePlus smartphones with LineageOS for years now and cannot remember to execute such a complicated procedure. Just now I got a OnrPlus 8, installed LineageOS and Magisk and restored my apps with Titanium. So, it definitely worked.
Now, after a Lineage system update, root is gone.
Unfortunately I cannot tell exactly how I installed Magisk. I have a very poor memory. Think I just installed the app and said either just "install" or patched the zip with TRWP
But I definitely never downloaded or extracted any boot image manually.
Has anyone an explanation for this?
Even more strange: I just tried to flash magisk.zip again with TRWP. Now it tells me
"Magisk patched boot image detected"
and later:
"Failed to mount '/system_root' (Device or resource busy)"
After reboot the Magisk app now offers me three choices in the install tab:
- choose a file and patch (only this one existed before)
- direct installation (recommended)
- install into inactive slot (after OTA)
I don't understand the last one and tried the recommendet one.
Now, root is there again. Do I have to do this after each update? With my OnePlus5 I didn't.
Unfortunately I have another problem with my OnePlus8 and Lineage:
I'm using AdAway which replaces the hosts file, but on my OP8 it cannot.
"Unable to cppy the hosts file to /System partition. Please check if the Magisk Systemless module is active"
What does it mean? The Magisk app says: "ramdisk yes"
tosho1 said:
Unfortunately I have another problem with my OnePlus8 and Lineage:
I'm using AdAway which replaces the hosts file, but on my OP8 it cannot.
"Unable to cppy the hosts file to /System partition. Please check if the Magisk Systemless module is active"
What does it mean? The Magisk app says: "ramdisk yes"
Click to expand...
Click to collapse
Magisk → Settings (Gear icon) → Systemless hosts ← Click it
tosho1 said:
Isn't there a more easy way to obtain root?
That's strange. I use OnePlus smartphones with LineageOS for years now and cannot remember to execute such a complicated procedure. Just now I got a OnrPlus 8, installed LineageOS and Magisk and restored my apps with Titanium. So, it definitely worked.
Now, after a Lineage system update, root is gone.
Unfortunately I cannot tell exactly how I installed Magisk. I have a very poor memory. Think I just installed the app and said either just "install" or patched the zip with TRWP
But I definitely never downloaded or extracted any boot image manually.
Has anyone an explanation for this?
Even more strange: I just tried to flash magisk.zip again with TRWP. Now it tells me
"Magisk patched boot image detected"
and later:
"Failed to mount '/system_root' (Device or resource busy)"
After reboot the Magisk app now offers me three choices in the install tab:
- choose a file and patch (only this one existed before)
- direct installation (recommended)
- install into inactive slot (after OTA)
I don't understand the last one and tried the recommendet one.
Now, root is there again. Do I have to do this after each update? With my OnePlus5 I didn't.
Click to expand...
Click to collapse
LineageOS is not the stock ROM so it's slightly different and not covered in this thread.
Thank you, CarvedArt. I wasn't aware of this.
Does anyone have the latest stable Android 13 patched boot image for the IN2015 that they can share with me ?

UPDATING Pixel 5 Factory Image & Re-Rooting

Why This Thread?
I have seen several questions on the process for updating a rooted Pixel 5, since the existing guides only explain the unlock and initial rooting, I thought I'd throw together a quick HOW TO on UPDATING and Re-Rooting for anyone who might still be uncertain about "update" procedures, I've followed thie below method twice now with no issues at all,> None of my data was lost and I kept my EX kernel!.
If You Want To Unlock Your Bootloader and Root Your Pixel 5:
This guide takes you step by step through bootloader unlock, using magic to patch the boot image and get your device rooted.
If You're Already Unlocked & Rooted, and Want To Update The Factory Image And Re-Root:
If you're already rooted and want to update to the next factory image, just follow the standard update factory image routine for the Pixel series of devices, then following the below:
After extracting the primary factory zip, and the secondary zip that is created from the first extraction (all done within the platform tools folder with the fastboot app)
Edit the FLASH-ALL file.... keep the -w for a clean install that wipes everything, or remove the -w to keep your data.
This will install the latest factory image and remove root.
Now, follow these steps here, they're perfect. (these are the same instructions for unlocking bootloader, and initial install of Magisk listed above)
If you were previously rooted, and just updating the next factory image, you can skip the entire sections on installing and hiding Magisk manager in the above instructions, (these settings remained in Magisk Manager when I did this).
And you're done!
KNOWN ISSUE:
* * * MagiskHide Props Config IS NO LONGER WORKING * * *
Please follow THIS LINK for the Universal Safetynet Fix that replaces the MagiskHide Props Config process.
If you know an easier, shorter, more efficient, or UPDATED method, please share it and I'll make the necessary corrections/adjustments
My method is updating via the OTA packages. Similar to using the factory image but no editing of files.
Download the factory image for your current software version.
Factory Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Extract the boot.img from #1
Download the factory image of the version you're updating to.
Factory Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Download the OTA image for the version you're updating to.
Full OTA Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Turn off magisk modules
Apply the boot.img from step #2 (I save this from my previous update so I can skip steps 1 & 2 above.)
adb reboot bootloader
fastboot flash boot "path to boot.img"
fastboot reboot (this is a sanity check to make sure things are normal. The phone should be normal and without root. It can be skipped if you wish, simply use the fastboot menu on the phone and boot to recovery skipping steps 4 & 5.)
Sanity check phone
adb reboot recovery
Once in recovery hold the power button and click volume up
Use the volume keys to highlight "Apply update from ADB"
Click the power button.
On your computer run: adb sideload "path to #4" and wait for it to finish. You'll get status on the adb command and on the phone.
Once finished restart the phone and let it finish the update.
Your phone is now updated but without root.
Extract boot.img from #3 above.
Copy it to the phone
Open magisk manager and patch the boot.img you just copied
Copy the patched boot.img file created by magisk manager back to your computer
Apply this file using fastboot
adb reboot bootloader
fastboot flash boot "path to patched boot.img"
fastboot reboot
Turn on your magisk modules and test
You can now delete 1, 3, & 4. I save #12 for the next update. This eliminates the need for 1 & 2.
You should now have an updated rooted device.
l7777 said:
My method is updating via the OTA packages. Similar to using the factory image but no editing of files.
Download the factory image for your current software version.
Factory Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Extract the boot.img from #1
Download the factory image of the version you're updating to.
Factory Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Download the OTA image for the version you're updating to.
Full OTA Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Apply the boot.img from step #2 (I save this from my previous update so I can skip steps 1 & 2 above.)
adb reboot bootloader
fastboot flash boot "path to boot.img"
fastboot reboot (this is a sanity check to make sure things are normal. The phone should be normal and without root. It can be skipped if you wish, simply use the fastboot menu on the phone and boot to recovery skipping steps 4 & 5.)
Sanity check phone
adb reboot recovery
Once in recovery hold the power button and click volume up
Use the volume keys to highlight "Apply update from ADB"
Click the power button.
On your computer run: adb sideload "path to #3" and wait for it to finish. You'll get status on the adb command and on the phone.
Once finished restart the phone and let it finish the update.
Your phone is now updated but without root.
Extract boot.img from #2 above.
Copy it to the phone
Open magisk manager and patch the boot.img you just copied
Copy the patched boot.img file created by magisk manager back to your computer
Apply this file using fastboot
adb reboot bootloader
fastboot flash "path to patched boot.img"
fastboot reboot
You can now delete 1, 3, & 4. I save #12 for the next update. This eliminates the need for 1 & 2.
You should now have an updated rooted device.
Click to expand...
Click to collapse
Thank you. Well-written, just a few minor corrections.
Download the factory image for your current software version.
Factory Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Extract the boot.img from #1
Download the factory image of the version you're updating to.
Factory Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Download the OTA image for the version you're updating to.
Full OTA Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Apply the boot.img from step #2 (I save this from my previous update so I can skip steps 1 & 2 above.)
adb reboot bootloader
fastboot flash boot "path to boot.img"
fastboot reboot (this is a sanity check to make sure things are normal. The phone should be normal and without root. It can be skipped if you wish, simply use the fastboot menu on the phone and boot to recovery skipping steps 4 & 5.)
Sanity check phone
adb reboot recovery
Once in recovery hold the power button and click volume up
Use the volume keys to highlight "Apply update from ADB"
Click the power button.
On your computer run: adb sideload "path to #4" and wait for it to finish. You'll get status on the adb command and on the phone.
Once finished restart the phone and let it finish the update.
Your phone is now updated but without root.
Extract boot.img from #2 above.
Copy it to the phone
Open magisk manager and patch the boot.img you just copied
Copy the patched boot.img file created by magisk manager back to your computer
Apply this file using fastboot
adb reboot bootloader
fastboot flash boot "path to patched boot.img"
fastboot reboot
You can now delete 1, 3, & 4. I save #12 for the next update. This eliminates the need for 1 & 2.
You should now have an updated rooted device.
zeepzorp said:
Thank you. Well-written, just a few minor corrections.
Click to expand...
Click to collapse
Thanks, updated the original.
Thanks for the instructions. I was able to re-root the device, but I couldn't pass SafetyNet Attestation.
My P5 has updated to: 11.0.0 (RQ1A.210105.003, Jan 2021)
I used MagiskHide Props Config (updated) method. which is:
#su
#props
#1 (edit device fingerprint)
#f (Pick a certified finger print)
#7 (google)
#20 (pixel 3a)
#3 (Android version 11)
#y (restart)
The devices rebooted but still, no SafetyNet pass.
hamooz92 said:
Thanks for the instructions. I was able to re-root the device, but I couldn't pass SafetyNet Attestation.
My P5 has updated to: 11.0.0 (RQ1A.210105.003, Jan 2021)
I used MagiskHide Props Config (updated) method. which is:
#su
#props
#1 (edit device fingerprint)
#f (Pick a certified finger print)
#7 (google)
#20 (pixel 3a)
#3 (Android version 11)
#y (restart)
The devices rebooted but still, no SafetyNet pass.
Click to expand...
Click to collapse
Altering the model prop doesn't work for safety net any longer. There is a safetynet-fix magisk module you can use.
l7777 said:
Altering the model prop doesn't work for safety net any longer. There is a safetynet-fix magisk module you can use.
Click to expand...
Click to collapse
I have also flashed Universal SafetyNet Fix but no luck
hamooz92 said:
I have also flashed Universal SafetyNet Fix but no luck
Click to expand...
Click to collapse
I just flashed the safety net fix myself and it worked like a charm.
I also left the magisk config prop module installed (just because)
Are all your other Magisk settings in order (magisk hide, checking all the boxes under GooglePlay , etc.)?
l7777 said:
Download the factory image for your current software version.
Factory Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Click to expand...
Click to collapse
current build number is RD1A.200810.021.A1
zeepzorp said:
Download the OTA image for the version you're updating to.
Full OTA Images for Nexus and Pixel Devices | Google Play services | Google for Developers
developers.google.com
Click to expand...
Click to collapse
one the ota site there's only one "EU carrier" images different than the current one: RD1A.201105.003.B1 (NOV 2020). should i use this one or can i also use the this one f.e. RQ2A.210305.006 (nothing specified)
You may find my video helpfu too but it more pertains to installing the DP1 for Android 12, but the update process is practically the same.. For rooting Android 12, it seems we need to disable verity/verification of boot images, otherwise flashing a modified boot img will just boot immediately to fastboot again.
narf0815 said:
current build number is RD1A.200810.021.A1
one the ota site there's only one "EU carrier" images different than the current one: RD1A.201105.003.B1 (NOV 2020). should i use this one or can i also use the this one f.e. RQ2A.210305.006 (nothing specified)
Click to expand...
Click to collapse
In your case yes I'd probably use RQ2A.210305.006.
zeepzorp said:
Thank you. Well-written, just a few minor corrections.
Click to expand...
Click to collapse
l7777 said:
Thanks, updated the original.
Click to expand...
Click to collapse
Thank you, l7777 and zeepzorp. This is also the way I would have done it. Out of curiosity and to reduce manual steps in between, would it work to restore the original boot.img to unroot and then use the normal OTA updates inside Android? Without a spare phone or a TWRP backup I hesitate to try this.
Also, when following the manual update steps, is it safe to skip versions in between, e.g. update directly from January to March versions? In my past 10 years of manually updating ROMs I have never used any OTA update functionality from inside Android and I noticed that the OTA update process, which was performed in mid January 2021 when unpacking the phone, updated the ROM in the following order, each separated by reboots in between:
Shipped version: 11.0.0 (RD1A.200810.021.A1, Oct 2020, EU carriers)
1st OTA update: 11.0.0 (RQ1A.201205.011, Dec 2020, All carriers except AT&T and Verizon)
2nd OTA update and at that time current version: 11.0.0 (RQ1A.210105.003, Jan 2021)
Why did it not skip the version in between and directly update to the January version?
dhrv said:
Thank you, l7777 and zeepzorp. This is also the way I would have done it. Out of curiosity and to reduce manual steps in between, would it work to restore the original boot.img to unroot and then use the normal OTA updates inside Android? Without a spare phone or a TWRP backup I hesitate to try this.
Also, when following the manual update steps, is it safe to skip versions in between, e.g. update directly from January to March versions? In my past 10 years of manually updating ROMs I have never used any OTA update functionality from inside Android and I noticed that the OTA update process, which was performed in mid January 2021 when unpacking the phone, updated the ROM in the following order, each separated by reboots in between:
Shipped version: 11.0.0 (RD1A.200810.021.A1, Oct 2020, EU carriers)
1st OTA update: 11.0.0 (RQ1A.201205.011, Dec 2020, All carriers except AT&T and Verizon)
2nd OTA update and at that time current version: 11.0.0 (RQ1A.210105.003, Jan 2021)
Why did it not skip the version in between and directly update to the January version?
Click to expand...
Click to collapse
As far as skipping monthly updates, I only update every other month (unless there's a massive update for security) and I've had zero issues. Just updated to March from January, no problems.
I'm having a hard time understanding your instructions. I apologize in advance but, could I get a more detailed list of instructions?
philharmon said:
I'm having a hard time understanding your instructions. I apologize in advance but, could I get a more detailed list of instructions?
Click to expand...
Click to collapse
Follow these instructions, they're pretty much step for step.
https://android.gadgethacks.com/how...ide-for-beginners-intermediate-users-0348101/
They're included in my OP (hyperlinked) as well.
If you have a specific question, just ask!
Az Biker said:
Follow these instructions, they're pretty much step for step.
https://android.gadgethacks.com/how...ide-for-beginners-intermediate-users-0348101/
They're included in my OP (hyperlinked) as well.
If you have a specific question, just ask!
Click to expand...
Click to collapse
Be warned, nothing after step 20 in that guide is valid any longer. Passing safetynet requires a different magisk module.
GitHub - kdrag0n/safetynet-fix: Google SafetyNet attestation workarounds for Magisk
Google SafetyNet attestation workarounds for Magisk - GitHub - kdrag0n/safetynet-fix: Google SafetyNet attestation workarounds for Magisk
github.com
l7777 said:
Be warned, nothing after step 20 in that guide is valid any longer. Passing safetynet requires a different magisk module.
GitHub - kdrag0n/safetynet-fix: Google SafetyNet attestation workarounds for Magisk
Google SafetyNet attestation workarounds for Magisk - GitHub - kdrag0n/safetynet-fix: Google SafetyNet attestation workarounds for Magisk
github.com
Click to expand...
Click to collapse
Which is why the following warning has been written in the OP since Feb 2021:
KNOWN ISSUE:
* * * MagiskHide Props Config IS NO LONGER WORKING * * *
Please follow THIS LINK for the Universal Safetynet Fix that replaces the MagiskHide Props Config process.
Has anyone tried the Pixel update and software repair tool
Google Pixel - Update and Software Repair
to go from Android 10 to 11?
Then modify the boot image with Magisk and fastbooting that?
ƒ
Az Biker said:
Which is why the following warning has been written in the OP since Feb 2021:
KNOWN ISSUE:
* * * MagiskHide Props Config IS NO LONGER WORKING * * *
Please follow THIS LINK for the Universal Safetynet Fix that replaces the MagiskHide Props Config process.
Click to expand...
Click to collapse
That assumes that people read the OP.
biTToe said:
Has anyone tried the Pixel update and software repair tool
Google Pixel - Update and Software Repair
to go from Android 10 to 11?
Then modify the boot image with Magisk and fastbooting that?
ƒ
Click to expand...
Click to collapse
It will almost certainly perform a factory reset in the process.
Just sharing how I do it in case someone is interested in a shorter path:
1. Download the new full factory image
2. Extract the file. Then extract boot.img from the image zip file within.
3. Copy boot.img to your pixel 5
4. Patch it with magisk
5. Move back the patched file, rename it to boot.img
6. Update the original zip file titled image-redfin-r*.zip with the new boot.img file (override the older one)
7. Edit flash-all file by removing -w so it won't wipe your device clean
8. Flash with flash-all
No need to unroot and reroot.

[UPDATE / KEEP ROOT GUIDE] MAY 2021 (RQ2A.210505.002) - "CORAL" Magisk & Stock Boot / DTBO Images

(Sorry guys, this would have been up sooner, but Android File Host hasn't been letting me upload all day for some reason, so I just temporarily uploaded May 2021's files to my Google Drive for now instead. Enjoy! --- moved back to AFH )
IMPORTANT!! THESE FILES / THIS THREAD IS FOR PIXEL 4 XL "CORAL" ONLY, NOT PIXEL 4 "FLAME"!!
**IT IS HIGHLY RECOMMENDED TO PATCH THE STOCK BOOT IMAGE YOURSELF, FROM YOUR OWN DEVICE, USING MAGISK MANAGER. WHILE THERE'S A GOOD CHANCE THE FILE I PROVIDED BELOW WILL BE IDENTICAL (USE A FILE HASH CHECKSUM TOOL IF YOU'RE CURIOUS), THERE IS ALSO A CHANCE THEY MAY HAVE SMALL, BUT SIGNIFICANT, VARIANCES**
Thanks for the info and link, @wrongway213
Link to @topjohnwu's post: twitter dot com /topjohnwu/status/1272136975022084097?s=19 (until I figure out how to stop new XDA from forcing the URL to embed a giant twitter posting in the middle of the post...)
ALL FILES BELOW ARE FOR "RQ2A.210505.002, May 2021"!
Magisk v22.1 Patched Boot Image: https://www.androidfilehost.com/?fid=2188818919693794185
Factory Untouched Boot Image: https://www.androidfilehost.com/?fid=2188818919693794183
Factory Untouched DTBO Image: https://www.androidfilehost.com/?fid=2188818919693794180
----------------------------------------------
-------------UPDATE PROCESS BELOW-------------
----------------------------------------------​
EASY UPDATE / SEAMLESS KEEP-ROOT UPDATE PROCESS (using a PC - a very intuitive, effective, and relatively safe method).
** You can only follow this guide verbatim if coming EXACTLY from build "11.0.0 (RQ2A.210405.005, Apr 2021". But the general idea is the same for other builds, you just need the correct files for your device.
coral-rq2a.210405.005-factory-dtbo.img: https://www.androidfilehost.com/?fid=2188818919693776320
coral-rq2a.210405.005-factory-boot.img: https://www.androidfilehost.com/?fid=2188818919693776321
May 2021 sideload OTA zip: https://dl.google.com/dl/android/aosp/coral-ota-rq2a.210505.002-ca3e88b3.zip
DO NOT BOOT BACK INTO O/S UNTIL ALL STEPS ARE COMPLETED - THIS ENSURES EVERYTHING BOOTS BACK UP WITH MAGISK / EDXPOSED ALL RUNNING PROPERLY RIGHT AWAY
1. boot into bootloader
----------------
** I was on custom kernel, so I needed to flash BOTH the stock boot and dtbo images
2. fastboot flash boot coral-rq2a.210405.005-factory-boot.img
3. fastboot flash dtbo coral-rq2a.210405.005-factory-dtbo.img
......* these steps to restore stock recovery; dtbo.img also necessary for some kernel installations.
......* won't hurt to flash both anyway, so if you're unsure, go ahead and do both.
-----------------
4. use volume keys to change selection to boot to Recovery Mode
......- when you reach the android symbol with No Command, hold power button, tap volume up, in case you've forgotten
5. choose option "Apply update from ADB"
6. adb sideload coral-ota-rq2a.210505.002-ca3e88b3.zip
7. Once the OTA sideload is done, Reboot to bootloader (you'll also notice it's now on the other slot after OTA flashed)
8. fastboot flash boot coral-rq2a.210505.002-magisk_patched-22100.img
9. done, start the phone
(Optional - Flash custom kernel. If you had a custom kernel, you need to re-flash it)
This is a 100% seamless update that requires no additional / re-setup of any of my Magisk or EdX/LSposed setups. All of the factory files can be found here https://developers.google.com/android/images. boot.img and dtbo.img are in their corresponding full Factory Image zips, and the ota zip is under Full OTA Images.
-------------------------------------------------
-------------------TROUBLESHOOTING-------------------
-------------------------------------------------​
Issues after updating?
If you end up unable to boot or bootlooping afterwards, you most likely have an old Magisk module that isn't playing nice with the new build. There are 2 main things you can do:
1. Flash the new factory untouched boot image. You will of course lose root, and all modules will be disabled. However, it should at least get you able to boot back up quickly and have a working phone if you're in a bind.
2. I would recommend checking Tulsadiver's thread: https://forum.xda-developers.com/pixel-4-xl/how-to/magisk-modules-disabler-booting-magisk-t3990557
Instead of reverting to stock boot image, fastboot boot (NOT FLASH) Tulsadiver's boot image. This will boot your phone in Magisk Core-Only Mode, with all modules disabled but root retained. From here you can open Magisk Manager and disable suspect modules. Before rebooting, go to Magisk Manager's settings and disable Magisk Core-Only Mode. Once you disable the incompatible module, the phone should boot back up.
- See this post (or thread) for more tips / context / an example: https://forum.xda-developers.com/showpost.php?p=82509691&postcount=16
Since Magisk v21.x, Core Only mode has been replaced by using Android's built-in Safe Mode. Booting into Safe Mode should essentially boot you back into your system but with all modules disabled (as well as Magisk Hide). Keep in mind that even after you reboot, modules will remain disabled, unless you re-enable them first. Also remember to re-enable Magisk Hide if you had it enabled before.
Please see @Didgeridoohan's guide for more details: https://www.didgeridoohan.com/magisk/MagiskModuleIssues#hn_Core_Only_Mode
It's also worth mentioning, his guide is extremely well-made and contains a lot of useful information that could benefit all Magisk users and modders. I highly recommend looking through it anyway!
I am getting an error with unpacking the boot image with both the one provided as well as the one direct from Google. Any fix?
@AlphAndroid, I had no problem with Google's boot img. Maybe you should download the factory image again and check the SHA-256 checksum to make sure the download is not corrupt.
@i5lee8bit, thanks for the guide as always, worked fine! Just adding that the platform tools have been updated to r31.0.2 from r31.0.0: https://developer.android.com/studio/releases/platform-tools
AlphAndroid said:
I am getting an error with unpacking the boot image with both the one provided as well as the one direct from Google. Any fix?
Click to expand...
Click to collapse
What do you mean with unpacking the boot image? Are you trying to patch it yourself in Magisk Manager and talking about the step where it says unpacking the boot image? @Ghisy's advice is good, check the hash checksums. Here are various hash checksums of the untouched factory boot image for this month:
File: coral-rq2a.210505.002-factory-boot.img
CRC-32: cedb0fab
MD5: 987f7849b32f3a652c7d8378bbe0048a
SHA-1: f55f0e4a3fc7d4e321a4f8fea0cad157f371f564
SHA-256: d2a53c9527b21f51526a4343506b2617c8b78100c3e6fb90df517372493145ba
SHA-512: 9a3c027b5fdc9072c7955b01be5489060f66ff718ddf51dcd1350324f84d56219f20086cd8ce128721246d6b88c08fbb0de6642d3dec60c141f2496f42316364
SHA3-256: 74fe9d3d65f6e186dfc0c7708f12b7f308e2f014720fc8930549c7d2c349aaef
SHA3-512: 48d3890a8e014ff65d4e81fdaa9f13746aa4ab9632f6e600cebb1e697bff45ebbe22b16b205965d31e8056667361f217ad29db6f9a0b9d44927bfb065cf82f0c
Are you downloading from PC and then copying to the phone? If you're using MTP or FTP, sometimes they mess with the file in tiny, almost unnoticeable (annoying) ways. Try downloading directly from the phone (and check the hash while you're at it).
i5lee8bit said:
What do you mean with unpacking the boot image? Are you trying to patch it yourself in Magisk Manager and talking about the step where it says unpacking the boot image? @Ghisy's advice is good, check the hash checksums. Here are various hash checksums of the untouched factory boot image for this month:
File: coral-rq2a.210505.002-factory-boot.img
CRC-32: cedb0fab
MD5: 987f7849b32f3a652c7d8378bbe0048a
SHA-1: f55f0e4a3fc7d4e321a4f8fea0cad157f371f564
SHA-256: d2a53c9527b21f51526a4343506b2617c8b78100c3e6fb90df517372493145ba
SHA-512: 9a3c027b5fdc9072c7955b01be5489060f66ff718ddf51dcd1350324f84d56219f20086cd8ce128721246d6b88c08fbb0de6642d3dec60c141f2496f42316364
SHA3-256: 74fe9d3d65f6e186dfc0c7708f12b7f308e2f014720fc8930549c7d2c349aaef
SHA3-512: 48d3890a8e014ff65d4e81fdaa9f13746aa4ab9632f6e600cebb1e697bff45ebbe22b16b205965d31e8056667361f217ad29db6f9a0b9d44927bfb065cf82f0c
Are you downloading from PC and then copying to the phone? If you're using MTP or FTP, sometimes they mess with the file in tiny, almost unnoticeable (annoying) ways. Try downloading directly from the phone (and check the hash while you're at it).
Click to expand...
Click to collapse
i also used a hash checksum, checked out the same
I'm just a bit hesitant to use the provided patched boot image now that I'm getting the issue.
I also had an error at 96% sideloading the OTA (something like: sideloading failed, no error 0). I then did NOTHING, stayed in Bootloader and downloaded the latest adb platform tools (mine was 30.0.5 from nov 2020, rather old) - with the newest platform tools I sideloaded again and then it worked (even though it stayed on 90% for 3-4 minutes, idk why, after that it smoothly went to 100% and finished sideloading) - then after that just normally flash the magisk patched file and the phone booted up again and is working fine. It seems to be more important than I thought to have the most up to date adb tools - never had an issue with that before. Thankfully my phone didnt go into bootloop, lol.
So it seems that the newest Pixel 4 xl OTA file is uncompatible with (maybe specific) older adb platform tools, ergo people if you have a problem, check your platform tools version - the OTA file that is linked here in this thread is fine and is not the rootcause of any issues.
Best place a remark into the mainpost @i5lee8bit that it is very important to keep the adb platform tools up to date and always check it before trying to update. It might save some people from trouble.
Hello all.
I need a little help please.
I am coming from:
10 (QQ2A.200305.003)
Magisk 21201 / 8.0.4
It’s been a while since I have done this and I would like to update to the Android 11 May version and I would like to make sure that what I am about to do is procedurally correct.
And, I am hoping this is the correct place to post
Download 11.0.0 (RQ2A.210505.002, May 2021 (coral-rq2a.210505.002-factory-0ec4212f.zip)
Unhide/Uninstall Magisk - Restore Images
Is this necessary with a factory reset?
Factory reset
Boot phone into fastboot mode
Flash-all.bat –w
At this point, once the phone re-boots, I should have a “working” phone on Android 11?
Extract boot.img and copy to phone
Download Magisk-v23.0.apk to phone and install
Do I set the update channel to beta or canary?
Install/select & patch boot.img
Reboot
Copy patched boot.img to computer
reboot into fastboot
Should I / could I fastboot flash boot boot.img --slot all at this point just to be safe?
Fastboot flash boot patchedboot.img
Fastboot reboot
Safetynet fix
Set update channel
Enjoy.
Am i missing anything?
Thanks in advance
ƒ

[GUIDE] Pixel 5 "redfin": Unlock Bootloader, Update, Root, Pass SafetyNet

If you are looking for my guide on a different Pixel, find it here:
Pixel 3
Pixel 3XL
Pixel 3a
Pixel 3aXL
Pixel 4
Pixel 4XL
Pixel 4a
Pixel 4a (5G)
Pixel 5a
Pixel 6
Pixel 6 Pro
For best results, use the latest stable Magisk release.
Discussion thread for migration to 24.0+.
Note: Magisk prior to Canary 23016 does not incorporate the necessary fixes for Android 12+.
WARNING: YOU AND YOU ALONE ARE RESPONSIBLE FOR ANYTHING THAT HAPPENS TO YOUR DEVICE. THIS GUIDE IS WRITTEN WITH THE EXPRESS ASSUMPTION THAT YOU ARE FAMILIAR WITH ADB, MAGISK, ANDROID, AND ROOT. IT IS YOUR RESPONSIBILITY TO ENSURE YOU KNOW WHAT YOU ARE DOING.
Prerequisites:
Latest SDK Platform Tools - if Platform Tools is out of date, you WILL run into problems!
USB Debugging enabled
Google USB Driver installed
I recommend using Command Prompt for these instructions; some users have difficulty with PowerShell.
Make sure the Command Prompt is running from your Platform Tools directory!
Android Source - Setting up a device for development
Spoiler: Downloads
Pixel OTA Images
Pixel Factory Images
Magisk Stable, Magisk Canary - Magisk GitHub
Spoiler: Unlock Bootloader
Follow these instructions to enable Developer Options and USB Debugging.
Enable OEM Unlocking. If this option is grayed out, unlocking the bootloader is not possible.
Connect your device to your PC, and open a command window in your Platform Tools folder.
Ensure ADB sees your device:
Code:
adb devices
If you don't see a device, make sure USB Debugging is enabled, reconnect the USB cable, or try a different USB cable.
If you see "unauthorized", you need to authorize the connection on your device.
If you see the device without "unauthorized", you're good to go.
Reboot to bootloader:
Code:
adb reboot bootloader
Unlock bootloader: THIS WILL WIPE YOUR DEVICE!
Code:
fastboot flashing unlock
Select Continue on the device screen.
Spoiler: Initial Root / Create Master Root Image
Install Magisk on your device.
Download the factory zip for your build.
Inside the factory zip is the update zip: "device-image-buildnumber.zip". Open this, and extract boot.img
Copy boot.img to your device.
Patch boot.img with Magisk: "Install" > "Select and Patch a File"
Copy the patched image back to your PC. It will be named "magisk_patched-23xxx_xxxxx.img". Rename this to "master root.img" and retain it for future updates.
Reboot your device to bootloader.
Flash the patched image:
Code:
fastboot flash boot <drag and drop master root.img here>
Reboot to Android. Open Magisk to confirm root - under Magisk at the top, you should see "Installed: <Magisk build number>
Spoiler: Update and Root Automatic OTA
Before you download the OTA, open Magisk, tap Uninstall, then Restore Images. If you have any Magisk modules that modify system, uninstall them now.
Take the OTA update when prompted. To check for updates manually, go to Settings > System > System Update > Check for Update
Allow the update to download and install. DO NOT REBOOT WHEN PROMPTED. Open Magisk, tap Install at the top, then Install to inactive slot. Magisk will then reboot your device.
You should now be updated with root.
Spoiler: Update and Root OTA Sideload
Download the OTA.
Reboot to recovery and sideload the OTA:
Code:
adb reboot sideload
Once in recovery:
Code:
adb sideload ota.zip
When the OTA completes, you will be in recovery mode. Select "Reboot to system now".
Allow system to boot and wait for the update to complete. You must let the system do this before proceeding.
Reboot to bootloader.
Boot the master root image (See note 1):
Code:
fastboot boot <drag and drop master root.img here>
Note: If you prefer, you can download the factory zip and manually patch the new boot image, then flash it after the update. Do not flash an older boot image after updating.
Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
Reboot your device. You should now be updated with root.
Note: You can use Payload Dumper to extract the contents of the OTA if you want to manually patch the new boot image. However, I will not cover that in this guide.
Spoiler: Update and Root Factory Image
Please note that the factory update process expects an updated bootloader and radio. If these are not up to date, the update will fail.
Download the factory zip and extract the contents.
Reboot to bootloader.
Spoiler: Update bootloader if necessary
Compare bootloader versions between phone screen and bootloader.img build number
Code:
fastboot flash bootloader <drag and drop new bootloader.img here>
If bootloader is updated, reboot to bootloader.
Spoiler: Update radio if necessary
Compare baseband versions between phone screen and radio.img build number
Code:
fastboot flash radio <drag and drop radio.img here>
If radio is updated, reboot to bootloader.
Apply update:
Code:
fastboot update --skip-reboot image-codename-buildnumber.zip
When the update completes, the device will be in fastbootd. Reboot to bootloader.
Boot the master root image (See note 1):
Code:
fastboot boot <drag and drop master root.img here>
Note: If you prefer, you can manually patch the new boot image, then flash it after the update. Do not flash an older boot image after updating.
Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
Reboot your device. You should now be updated with root.
Note: If you prefer, you can update using the flash-all script included in the factory zip. You will have to copy the script, bootloader image, radio image, and update zip into the Platform Tools folder; you will then have to edit the script to remove the -w option so it doesn't wipe your device.
The scripted commands should look like this:
Code:
fastboot flash bootloader <bootloader image name>
fastboot reboot bootloader
ping -n 5 127.0.0.1 > nul
fastboot flash radio <radio image name>
fastboot reboot bootloader
ping -n 5 127.0.0.1 > nul
fastboot update --skip-reboot <image-device-buildnumber.zip>
Once this completes, you can reboot to bootloader and either boot your master patched image, or if you patched the new image, flash it at this time.
Spoiler: Update and Root using PixelFlasher <<RECOMMENDED FOR NOVICES>>
PixelFlasher by @badabing2003 is an excellent tool that streamlines the update process - it even patches the boot image for you.
The application essentially automates the ADB interface to make updating and rooting much easier. However, it is STRONGLY recommended that you still learn the "basics" of using ADB.
For instructions, downloads, and support, please refer to the PixelFlasher thread.
Spoiler: Update and Root using the Android Flash Tool
Follow the instructions on the Android Flash Tool to update your device. Make sure Lock Bootloader and Wipe Device are UNCHECKED.
When the update completes, the device will be in fastbootd. Reboot to bootloader.
Boot the master root image (See note 1):
Code:
fastboot boot <drag and drop master root.img here>
Note: If you prefer, you can download the factory zip and manually patch the new boot image, then flash it after the update. Do not flash an older boot image after updating.
Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
Reboot your device. You should now be updated with root.
Spoiler: Pass SafetyNet/Play Integrity
SafetyNet has been deprecated for the new Play Integrity API. More information here.
In a nutshell, Play Integrity uses the same mechanisms as SafetyNet for the BASIC and DEVICE verdicts, but uses the Trusted Execution Environment to validate those verdicts. TEE does not function on an unlocked bootloader, so legacy SafetyNet solutions will fail.
However, @Displax has modified the original Universal SafetyNet Fix by kdrag0n; his mod is able to force basic attestation instead of hardware, meaning that the device will pass BASIC and DEVICE integrity.
Mod available here. Do not use MagiskHide Props Config with this mod.
This is my configuration that is passing Safety Net. I will not provide instructions on how to accomplish this. Attempt at your own risk.
Zygisk + DenyList enabled
All subcomponents of these apps hidden under DenyList:
Google Play Store
GPay
Any banking/financial apps
Any DRM media apps
Modules:
Universal SafetyNet Fix 2.3.1 Mod - XDA post
To check SafetyNet status:
YASNAC - GitHub
To check Play Integrity status:
Play Integrity Checker - NOTE: MEETS_STRONG_INTEGRITY will ALWAYS fail on an unlocked bootloader.
I do not provide support for Magisk or modules. If you need help with Magisk, here is the Magisk General Support thread. For support specifically with Magisk v24+, see this thread.
Points of note:
The boot image is NOT the bootloader image. Do not confuse the two - YOU are expected to know the difference. Flashing the wrong image to bootloader could brick your device.
While the Magisk app is used for patching the boot image, the app and the patch are separate. This is what you should see in Magisk for functioning root:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
"Installed" shows the version of patch in the boot image. If this says N/A, you do not have root access - the boot image is not patched, or you have a problem with Magisk.
"App" simply shows the version of the app itself.
If you do not have a patched master boot image, you will need to download the factory zip if you haven't already, extract the system update inside it, then patch boot.img.
If you prefer updating with the factory image, you can also extract and manually patch the boot image if desired.
Some Magisk modules, especially those that modify read only partitions like /system, may cause a boot loop after updating. As a general rule, disable these modules before updating. You are responsible for knowing what you have installed, and what modules to disable.
Credits:
Thanks to @badabing2003 , @pndwal , @Displax , @Az Biker , @ipdev , @kdrag0n , @Didgeridoohan , and last but not least, @topjohnwu for all their hard work!
V0latyle said:
As many of you know by now, in order to run a patched boot image on Android 12 requires disabling Android Boot Verification.
On Android 12, disabling verity and verification will require a data wipe if it hasn't been done before. What seems to "lock" the state of boot verification is booting into system; so, if you perform an update, or flash vbmeta without the disable flags, then reboot into Android, you have essentially enabled boot verification and will require a wipe to disable it again. Confusing, I know.
Here is the appropriate update process. DO NOT take the automatic OTA if you are rooted. If you allow the phone to reboot after an update without disabling boot verification, you will have to wipe in order to disable it again, as you would need to for a patched boot image.
***Note***: The boot image doesn't have to be patched before you perform the update. Some have found it works better to update, THEN patch the boot image.
OTA Sideload:
1. Download both the OTA and the factory zip.
2. Extract vbmeta.img and boot.img from the factory zip.
3. Patch the boot image and copy it back to your computer.
4. Reboot to recovery and sideload the OTA: select Apply Update via ADB, then on your PC:
Code:
adb sideload ota.zip
5. When the OTA completes, you will be in recovery mode. DO NOT REBOOT TO SYSTEM. Select "Reboot to bootloader".
6. Reflash vbmeta to disable boot verification:
Code:
fastboot flash vbmeta --disable-verity --disable-verification --slot=all vbmeta.img
7. Flash patched boot image:
Code:
fastboot flash boot --slot=all magisk_patched-23xxx_xxxxx.img
8. Reboot to system.
Factory update:
1. Download the factory zip.
2. Extract boot.img
3. Patch the boot image and copy it back to your computer.
4. Reboot to bootloader.
5. Apply update:
Code:
fastboot update --disable-verity --disable-verification --skip-reboot image-codename-buildnumber.zip
6. Flash patched boot image:
Code:
fastboot flash boot --slot=all magisk_patched-23xxx_xxxxx.img
7. Reboot to system.
Android Flash Tool:
1. Download the factory zip.
2. Extract boot.img
3. Patch the boot image and copy it back to your computer.
4. Reboot to bootloader.
5. Follow the instructions on the Android Flash Tool to update your device. The ONLY boxes you should check are "Disable Verity" and "Disable Verification"
6. When the update completes, the phone will reboot to system without root.
7. Reboot to bootloader and flash patched boot image:
Code:
fastboot flash boot --slot=all magisk_patched-23xxx_xxxxx.img
8. Reboot to system.
REMEMBER: The most critical part of this is making sure verity and verification are disabled during the update process before the phone reboots. If you forget to patch the boot image, that's OK - you don't have to flash /boot right after update.
If you have trouble with the patched boot image, simply flash /boot back to stock and allow Android to boot, then re-patch and re-flash the boot image.
You can also, if you want, boot the patched image instead of flashing it:
Code:
fastboot boot magisk_patched-23xxx_xxxxx.img
This is considered "temporary boot" as it loads the image from your PC rather than from device storage. You can use this to confirm root works, and if you so desire, you can then perform Direct Install in Magisk.
Click to expand...
Click to collapse
You Sir are all over these forums spreading helpful advice, and knowledge. I would just like to say Thank You for all you do here. It's so greatly appreciated. You are one of the many people who make this place so special.
Also, Thank You for your service to our country.
@V0latyle can you link me to a web page that would list every adb and fastboot command that we as android modders would use. What I mean is I couldn't find a Google search that listed the fastboot command with --slot=all among other adb and fastboot commands
Krsmqn said:
You Sir are all over these forums spreading helpful advice, and knowledge. I would just like to say Thank You for all you do here. It's so greatly appreciated. You are one of the many people who make this place so special.
Also, Thank You for your service to our country.
Click to expand...
Click to collapse
I agree with @Krsmqn, @V0latyle THANK YOU FOR YOUR SERVICE !!!!! in the military and for your service in the xda community
I used the Android Flash Tool method to update to the November build, and followed the instructions precisely. It worked flawlessly. My deny list is exactly the same in Magisk, and all my modules are working perfectly. I didn't even have to disable them. I think I will use this method from now on.
Krsmqn said:
You Sir are all over these forums spreading helpful advice, and knowledge. I would just like to say Thank You for all you do here. It's so greatly appreciated. You are one of the many people who make this place so special.
Also, Thank You for your service to our country.
Click to expand...
Click to collapse
elong7681 said:
I agree with @Krsmqn, @V0latyle THANK YOU FOR YOUR SERVICE !!!!! in the military and for your service in the xda community
Click to expand...
Click to collapse
Thanks guys, I appreciate it.
elong7681 said:
@V0latyle can you link me to a web page that would list every adb and fastboot command that we as android modders would use. What I mean is I couldn't find a Google search that listed the fastboot command with --slot=all among other adb and fastboot commands
Click to expand...
Click to collapse
Boy, I wish I had that handy, because I could sure use it too! I don't have your answer but hopefully someone else does, because believe me I'll be bookmarking it!
Will this work on Android Pixel 5a?
Rafiul Bari Chowdhury said:
Will this work on Android Pixel 5a?
Click to expand...
Click to collapse
Yes. The root process is exactly the same for the 4a 5g, 5, and 5a. The update process is the same across all Pixel devices.
I patched the boot.img. Magisk 23 did not report errors. But size of the patched file is zero. This looks not promising...
nostromo12 said:
I patched the boot.img. Magisk 23 did not report errors. But size of the patched file is zero. This looks not promising...
Click to expand...
Click to collapse
What version of Magisk did you use?
The stabil one
Will this work on Android Pixel 5a?
V0latyle said:
Yes. The root process is exactly the same for the 4a 5g, 5, and 5a. The update process is the same across all Pixel devices.
Click to expand...
Click to collapse
Okay. But Should I Remove Magisk Fully before upgrading through ADB/Fastboot/AFT?
H,
I'm on Android 11 pixel 5, can I use this tutorial ?
I think it's safer to unroot/remove Magisk and modules when going from 11 to 12 right? Some modules might not be compatible with 12 causing bootloops.
thecompany said:
I think it's safer to unroot/remove Magisk and modules when going from 11 to 12 right? Some modules might not be compatible with 12 causing bootloops.
Click to expand...
Click to collapse
You're going to have to wipe /data anyway if you intend to root on Android 12. Unless you're willing to try an idea I have.
Thanks V0latyle !!
I follow the flash tool method for update from october to november on my pixel 5
Perfect update, no issues and all data ok
nico22320 said:
Thanks V0latyle !!
I follow the flash tool method for update from october to november on my pixel 5
Perfect update, no issues and all data ok
Click to expand...
Click to collapse
Did you use Magisk canary? It is not necessary to check wipe in the android flash tool?
I use standard Magisk and can not change the update path to canary
nostromo12 said:
Did you use Magisk canary? It is not necessary to check wipe in the android flash tool?
I use standard Magisk and can not change the update path to canary
Click to expand...
Click to collapse
No i use the beta version of magisk.
You need wipe only for update from Android 11 to Android 12.
Just follow the guide for update to november and enjoy
nico22320 said:
No i use the beta version of magisk.
You need wipe only for update from Android 11 to Android 12.
Just follow the guide for update to november and enjoy
Click to expand...
Click to collapse
I want to upgrade from 11 (oktober) to 12
In the first message from this thread concerning the flash tool there was no wipe mentioned.
I want to update keeping my data ! How to proceed?
The best way: save yours photos etc with your Google account and make a fresh install with Factory image on Android 12 ( with disable verity and vérification)
It's long for set up device but 100% of chance of work with no issues for futurs update
Sûre you Can try to update without wipe and disable verity and vérification but maybe bootloops or not

Categories

Resources