• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

How To Guide Method to upgrade every month, without wiping data and retaining root

Search This thread

roirraW "edor" ehT

Recognized Contributor
If I didn't disable verity or verification on my initail root, can i skip it here?
Yes, you can skip it as long as you use Magisk Canary 23016, and you're definitely not going to use a custom kernel (some custom kernels still need those disabled, or some developers aren't sure if they still need disabled to use their custom kernels).

If you've never disabled them before, the first time you disable them you'll definitely have to factory reset your phone.
 
1642200431111.png


this is how it should be in the flash-all.bat?
 

stroke55

Senior Member
Nov 29, 2013
58
36
Google Nexus 5
Moto Z
this is how it should be in the flash-all.bat?
The line with the update is missing (fastboot --skip-reboot update image-raven-sq1d.220105.007.zip):
PATH=%PATH%;"%SYSTEMROOT%\System32" fastboot flash bootloader bootloader-raven-slider-1.0-8013568.img fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot flash radio radio-raven-g5123b-93368-211225-b-8029609.img fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot --skip-reboot update image-raven-sq1d.220105.007.zip fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot flash boot magisk_patched.img fastboot reboot
 
The line with the update is missing (fastboot --skip-reboot update image-raven-sq1d.220105.007.zip):
PATH=%PATH%;"%SYSTEMROOT%\System32" fastboot flash bootloader bootloader-raven-slider-1.0-8013568.img fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot flash radio radio-raven-g5123b-93368-211225-b-8029609.img fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot --skip-reboot update image-raven-sq1d.220105.007.zip fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot flash boot magisk_patched.img fastboot reboot
1642200771656.png


like this? Also thank you. Getting back into the groove of Android after a few years with Apple.
 

banshee28

Senior Member
Aug 31, 2010
186
23
I had the same thing happen to me, I used the online flash tool. I jotted down what I did to get it fixed for future reference

Power and volume down to put in recovery mode

Download factory image and extract boot.img and patch with magisk on phone and copy to pc platform tools folder

Use online factory flash image tool
https://developers.google.com/android/images#raven

Under advanced tick disable verity and disable verification
After complete- adb reboot bootloader and reflashed patched magisk boot.img

./adb reboot bootloader
./fastboot flash boot magisk_patched_xxxxxx.img
./fastboot reboot
So similarly I used the online flash tool to get the Jan image loaded. Then used adb to flash the magisk boot img. All good, thanks!
 

Cares

Senior Member
Dec 2, 2010
1,523
277
Google Pixel 4 XL
Google Pixel 4a
Could someone explain to me why you don't need to disable verity and verification anymore while using the latest Magisk Canary? Doesn't flashing the factory image "wipe out" all of Magisk? How does it persist so that you don't have to do it?
 
  • Like
Reactions: basily

Lughnasadh

Senior Member
Mar 23, 2015
2,706
2,342
Google Nexus 5
Huawei Nexus 6P
Could someone explain to me why you don't need to disable verity and verification anymore while using the latest Magisk Canary? Doesn't flashing the factory image "wipe out" all of Magisk? How does it persist so that you don't have to do it?
You are confusing 2 different things. The reason why we previously needed to disable verity and verification was because the phone wouldn't boot if you modified your boot image without preserving the boot image header integrity (e.g. patching it with Magisk). With Canary Magisk 23016 you don't have to disable those 2 flags for a Magisk-patched boot image to boot your phone anymore. Also, with custom kernels which require you to flash 3 images rather than a zip, you will likely have to patch the boot image provided by the kernel developer with Magisk 23016 for it to boot.

Flashing a factory image, depending on how you do it, can "wipe out" Magisk, but you can just re-root instead. You can also modify the flash-all.bat file to flash a Magisk-patched boot image while updating so it doesn't "wipe out" Magisk (see Post #s 267 & 268).

Personally, I just remove the -w from the flash-all.bat file (to keep data) and flash it that way, and then patch my boot image with Magsik and flash the patched boot image in fastboot.
 
Last edited:

5upon

Senior Member
Jan 31, 2011
81
60
OnePlus 7 Pro
Note to Mac owners working with the shell scripts included in the factory image - flash-all.sh will NOT execute fully on an M1 MacBook Pro with Apple silicon. Midway through the fastboot update command, the phone will reboot into fastbootd and halt. Apparently this is an issue with USB-C to -C connections on the new MacBooks. I pulled my previous Intel MacBook off the shelf, connected my P6P with a USB-A to -C cable, the fastboot update command executed fully, and my phone is happily running the Jan firmware.
 
  • Wow
Reactions: roirraW "edor" ehT

roirraW "edor" ehT

Recognized Contributor
Note to Mac owners working with the shell scripts included in the factory image - flash-all.sh will NOT execute fully on an M1 MacBook Pro with Apple silicon. Midway through the fastboot update command, the phone will reboot into fastbootd and halt. Apparently this is an issue with USB-C to -C connections on the new MacBooks. I pulled my previous Intel MacBook off the shelf, connected my P6P with a USB-A to -C cable, the fastboot update command executed fully, and my phone is happily running the Jan firmware.
Wow, interesting. Good to know. Hopefully, Google or Apple or both fix the problem sooner than later.
 

5upon

Senior Member
Jan 31, 2011
81
60
OnePlus 7 Pro
  • Like
Reactions: roirraW "edor" ehT

Top Liked Posts

  • 2
    Is it still necessary to remove magisk modules and uninstall magisk before flashing this way?
    Uninstalling magisk isn't needed but I would recommend to deactivate the modules because you could run into bootloops.

    But even that is easy to fix. If you get a bootloop, just reboot into safemode and reboot the phone again. This will automatically deactivate all modules.
    2
    Surprisingly easy !!
    Maybe too easy... [looks back, paranoid, expecting the zombies to attack at any minute...]
    1
    Is it still necessary to remove magisk modules and uninstall magisk before flashing this way?
    Definitely disable modules. Some of the modules I had installed caused a bootloop on the Jan release.
  • 4
    So not sure about other people on here getting errors and such, but I just updated to the December update using the method in the OP (which I gave him the idea to add the lines in the flash-all file :D the more of us help the easier it is to make updates faster and painless).
    I always like to wait a few days or a week before updating to make sure there are no real issues with the update, if there are I'll just skip the update and wait for the next.
    One thing that i always do which isn't mentioned in the OP is to add these files
    files needed.png
    (in the picture attached)
    to the platform-tools folder when you go to run the commands in CMD from within the platforms-tools folder.
    One person on here, or maybe more, had the super_empty.img error, mine passed just fine with these steps, I included the screenshot of it just because...

    To summarize:
    1. Download factory image from google
    2. Extract boot.img and copy to pixel
    3. Patch with updated magisk
    4. Copy back to pc and just rename to "magisk_patched"
    5. Copy the highlighted files like in the picture to the platform-tools folder
    6. Open flash-all.bat file and edit the lines like in the second attached picture
    7. Save the flash-all.bat file
    8. Open CMD within platform-tools folder (where you copied all those files to)
    9. Run these commands:
    adb reboot bootloader
    flash-all.bat


    done, your phone should now be updated

    After update, check everything is working and then remove those files from the platform-tools folder so it's ready for the next update, or just to keep that folder clean, or just because you have some sort of OCD
    3
    Surprisingly easy !!
    3
    Just used this method to update to the January build. No issues.
    3
    this is how it should be in the flash-all.bat?
    The line with the update is missing (fastboot --skip-reboot update image-raven-sq1d.220105.007.zip):
    PATH=%PATH%;"%SYSTEMROOT%\System32" fastboot flash bootloader bootloader-raven-slider-1.0-8013568.img fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot flash radio radio-raven-g5123b-93368-211225-b-8029609.img fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot --skip-reboot update image-raven-sq1d.220105.007.zip fastboot reboot-bootloader ping -n 5 127.0.0.1 >nul fastboot flash boot magisk_patched.img fastboot reboot
    3
    So not sure about other people on here getting errors and such, but I just updated to the December update using the method in the OP (which I gave him the idea to add the lines in the flash-all file :D the more of us help the easier it is to make updates faster and painless).
    I always like to wait a few days or a week before updating to make sure there are no real issues with the update, if there are I'll just skip the update and wait for the next.
    One thing that i always do which isn't mentioned in the OP is to add these files View attachment 5487463(in the picture attached)
    to the platform-tools folder when you go to run the commands in CMD from within the platforms-tools folder.
    One person on here, or maybe more, had the super_empty.img error, mine passed just fine with these steps, I included the screenshot of it just because...

    To summarize:
    1. Download factory image from google
    2. Extract boot.img and copy to pixel
    3. Patch with updated magisk
    4. Copy back to pc and just rename to "magisk_patched"
    5. Copy the highlighted files like in the picture to the platform-tools folder
    6. Open flash-all.bat file and edit the lines like in the second attached picture
    7. Save the flash-all.bat file
    8. Open CMD within platform-tools folder (where you copied all those files to)
    9. Run these commands:
    adb reboot bootloader
    flash-all.bat


    done, your phone should now be updated

    After update, check everything is working and then remove those files from the platform-tools folder so it's ready for the next update, or just to keep that folder clean, or just because you have some sort of OCD
    Just FYI, with the release of Canary Magisk 23016, you don't need to disable verity and verification any longer 👍
  • 58
    Caution: This guide is only for already rooted users, who have at least once disabled verity and verification and in the process wiped data. If you follow this guide on a non-rooted phone with verity and verification enabled, you will have to wipe the phone.

    Following is a guide to update Pixel 6 Pro (perhaps all devices after Pixel 4a) every month, without wiping and retaining root. I tested it on my Pixel 6 Pro from 12.0.0 (SD1A.210817.015.A4, Oct 2021) to 12.0.0 (SD1A.210817.036, Nov 2021). There is no reason that it should not work on subsequent monthly patches, but just take the backups to be sure.

    1) Download the latest factory image for your device and platform-tools from the official Google sites and extract them in one folder.

    2) Extract the boot.img and patch it in magisk manager on your phone and copy it back to the folder where you extracted the factory image and platform-tools. Rename the copied file to magisk_patched.img

    Note: The version of Magisk that works on December 2021 patch is attached below or app-release.apk can be extracted from the zip file downloaded from https://github.com/topjohnwu/Magisk/actions/runs/1576410350 (thanks to @mclarence)

    3) Open flash-all.bat in notepad and remove -w and add --disable-verity, --disable-verification and --skip-reboot to the fastboot update line. Also add the following lines after the fastboot update line to flash the Magisk patched boot.img automatically:

    fastboot reboot-bootloader
    ping -n 5 127.0.0.1 >nul
    fastboot flash boot magisk_patched.img
    fastboot reboot

    After editing, the edited part of your flash-all.bat should look something like this:

    Code:
    fastboot --disable-verity --disable-verification --skip-reboot update [****image_name****]
    fastboot reboot-bootloader
    ping -n 5 127.0.0.1 >nul
    fastboot flash boot magisk_patched.img
    fastboot reboot
    
    echo Press any key to exit...

    Note: [****image_name****] is just a placeholder and needs to be the name of zip file which was originally there in flash-all.bat, do not change that. Be careful to rename the Magisk patched boot.img to magisk_patched.img or in the alternative make appropriate modifications in the flash-all.bat

    4) Open command prompt and go the folder where you extracted factory image and platform-tools. Type the following commands:

    adb reboot bootloader
    flash-all.bat

    Your device should be upgraded to the latest factory image, while retaining root, without wiping data.

    Update 1: I updated from 12.0.0 (SD1A.210817.036, Nov 2021) to 12.0.0 (SD1A.210817.037, Nov 2021) successfully using my method, without loosing data and root.

    Update 2: I updated from 12.0.0 (SD1A.210817.037, Nov 2021) to 12.0.0 (SQ1D.211205.016.A1, Dec 2021) successfully using my method, without loosing data and root.[/code]
    8
    Just tried this on my P6Pro. Managed to update from .015 to .036 and retained root.
    Also still passing SafetyNet with USNF 2.2 beta
    7
    So I notice there are some people, like me, that are a bit confused on how to exactly do this process. I like to be nice every once in a while, so this is my time. I will try to do a step by step process with exactly how I did after reading, and re-reading all the comments on how to do it (with pictures cuz I need pictures to learn haha).

    These are the exact steps I took when I updated from .36 to .37

    I downloaded the .37 zip, the one for your phone, mine is an unlocked version.
    LaL2hSk_0qyLp5oaPEuURPDf5vItZ4YnlNFR2UPtQMRGIvceVoBc8nGvxpmu90RonBslivQblX8-YrygqYIrtbz1B7AvAPk8lKQ4z5jctSVh97hWwkzuO2kK2Os7doqxiUK-HJrx


    Slapped the .37 zip file into a folder by itself so I can extract it inside that same folder. It should look like this once its extracted inside the same folder.

    1637794601085.png


    Then I opened another folder/window with the Platform-tools so I can easily navigate between the 2 folders.

    Then I opened the flash-all.bat from the zipped folder, to see what it contains, noticed that it flashes 3 files/images.
    “bootloader-raven-slider”
    “radio-raven”
    “Image-raven-sd1a”
    b-Lrwcu7O5sU1Yges_LPc33ynTBNbVMki5KPtndnhgTLKp05njPQO_uoik6Tw11_tDyM7jCAlm0SjBbzK6b7MOkoKSOku9uhclnTclBZPDDfHumwjqLNrtHKRJ2yUoRf1B_y8EPW

    Then close the file as we dont need it right now.

    So with this I know that I will need to add those 3 files to the platform-tools folder when I go to actually run the command.

    I actually took the .37 boot.img and copied it into my pixel with version .36 still running.
    The boot.img is inside the zipped folder and when you extracted it, it will now be viewable along with other files and the zipped folder still there.
    1637794847696.png


    copy this boot into the main folder of the pixel
    1637795054884.png


    On your Pixel, open Magisk and click install then select patch file, navigate to the boot.img file in your internal storage.
    Patch it with Magisk and then take the patched boot.img (which that file will actually be in your downloads folder in your Pixel) and copied it back to my computer.

    So as of now, it seems we are able to patch boot.img with current build without having to update then patch then flash. We can just patch on the current build then copy the patch to the computer and run the rest of the steps.

    Now that I have the patched boot.img on my computer, I will take all the highlighted files in the picture, plus the patched boot.img over to the Platforms-tools folder and just copy them in that folder.
    Here, I’m not sure how everyone else has their folder since I rarely use those tools, so I just add the files and then delete them after I’m done flashing. See picture of all copied in files. (dont forget your patched boot.img)

    -Q2fqEHQmA5DPStoBV4ht9FVinUy7MD2GF4bi38EhGlItokhERTlrJAknwjGtSGXeMTVPnQn-6FZwXFqLJljCjYmrh3rYl4XPrDdLoyBO4QSOaaact8E2FvXwxjCZRfudWUgt_3m


    Now I will open the flash-all.bat that's inside the Platform-tools using Notepad ++ (personal preference).
    Edit this file exactly like in the picture. Add the lines exactly how it shows in the picture.
    **NOTE** that you need to type the exact patched boot file in there. So, like in this picture, but with YOUR patched "magisk_patched" file as this will have your own ID after 23014.
    1637734768289.png

    once you made the edits on this file, dont forget to save it before you run the commands!

    Now plug in your phone to the computer.
    Make sure you have USB debugging turned on.
    Press shift and right click inside the Platform-tools folder and open Command Prompt.
    run these 2 commands:
    adb reboot bootloader
    flash-all.bat

    When it's all done, your phone will boot up and you will be on the new .37
    Nothing else to add here as it will literally run through everything for you and boot up and you're done.

    Hope this helps someone, as I am a visual learner myself.
    7
    couldnt we just add step 5 into the flash-all file? for example:
    fastboot reboot-bootloader
    fastboot flash boot magisk_patched-xxxxx.img
    fastboot reboot

    like in the picture? or would it not actually run that way?
    View attachment 5465521
    holy poop that worked!! i was scared to try it myself but since i have a backup phone with all my data on it, it wouldnt be so bad to wipe the pixel if i messed it up doing it this way! But hey, it actually worked!!
    here is the modified flash-all and yes you will need the "ping" line after the update line.
    1637619349812.png


    so with this, no need to type extra stuff, just add it all in the flash-all file and run the first 2 commands:
    adb reboot bootloader
    flash-all.bat

    and thats it, the only time consuming part is patching the boot, putting it in the folder with the platform-tools.
    6
    Disabling verity/verification is no longer required with Magisk 23016 :)

    And no, you don't need to enable it if you did disable it. Just don't worry about it next upate.