[GUIDE] Root and keeping root options

Search This thread

BillGoss

Senior Member
Sep 2, 2010
5,155
4,523
Sydney
OnePlus 3T
Updated 220513: rewritten and includes OOS 12

A. First time rooting​

This process is common across all options

A.1 Flashing Magisk patched boot image​

Notes:
Follow the instructions detailed in DroidFreak32's https://forum.xda-developers.com/t/...national-kb2000-kb2001-kb2003-kb2005.4178675/ paying attention to:
  1. You can use the latest stable version of Magisk (my recommendation as of May 2022)
  2. Do NOT use the "To flash" option in step 11 because this causes issues when you get the next OTA update. Use the the "To Temporarily boot into a rooted system (RECOMMENDED!!)" option.
  3. Backup both the stock boot (the one extracted from using Payload Dumper) and Magisk patched boot images if you are going to use CLI
I also recommend that you install the Universal SafetyNet Fix Magisk module to pass SafetyNet with an unlocked bootloader. Use my modified version (attached) that fixes the fingerprint reader not working on rooted OOS 12 until kdrag0n's version is updated.

A.2 Using TWRP (OOS 11 only)​

  1. Boot bootloader
  2. fastboot boot <twrp.img>
  3. Backup current boot
  4. Install Magisk-*.apk
  5. Reboot system
  6. Uninstall Magisk stub
  7. Install Magisk-*.apk
  8. Install the Universal SafetyNet Fix Magisk module to pass SafetyNet with an unlocked bootloader. Use my modified version (attached) that fixes the fingerprint reader not working on rooted OOS 12 until kdrag0n updates his version.

B. Keeping root during an update​

B.1 System Update downloads and installs the update​

This is using the built-in System Update tool, which you'll find in:
  • OOS 11: Settings>System settings> System Update
  • OOS 12: Settings>About device>Software update
The process is complicated because you cannot use Magisk>Magisk Install>"Install to inactive slot" as this will fail on OOS 11 (for incremental updates) and OOS 12 (for all updates, including the initial update from OOS 11 to OOS 12). The following process is courtesy of @osm0sis in https://forum.xda-developers.com/t/...ices-platforms.2239421/page-149#post-84764713 and @rage302 in https://forum.xda-developers.com/t/...ing-root-options.4387977/page-4#post-86830285.
  1. Restore the current stock boot image using Magisk>Uninstall Magisk>"Restore images" and DO NOT reboot
  2. Download and Install the update (and DO NOT reboot) using:
    OOS 11: Settings>System Settings>System Update>Download and Install
    OOS 12: Settings>About device>Software update
  3. Copy the updated boot image as follows:
    • On PC: Find the inactive slot suffix:
      • adb shell getprop ro.boot.slot_suffix Note: on OOS 12 when you connect the phone to the PC you must enable "Transfer files" on the phone for ADB to see the device.
      • If the result is _a then the inactive slot suffix is _b otherwise it is _a
    • Take a copy of the boot image: adb shell su -c dd if=/dev/block/by-name/boot<inactive slot suffix> of=/sdcard/oos-ota-boot.img replacing <inactive slot suffix> with the value you previously determined (_a or _b). Note: Magisk may prompt you (on your phone) to grant root access to Shell - grant it.
  4. On phone: Patch the dumped oos-ota-boot.img using Magisk>Magisk Install>"Select and Patch a File"
  5. Copy /sdcard/Download/magisk_patched*.img to your PC
  6. Restore root to the current slot using Magisk>Magisk Install>"Direct Install (Recommended)". This is so you keep root in case the update somehow fails and you're returned to the current system.
  7. Turn on Airplane Mode to prevent Google Play Services detecting that the phone is bootloader unlocked and making your phone uncertified in Google Play.
  8. Reboot the phone from the System Update dialog; verify that you are now running the updated version
  9. On PC: Reboot to bootloader using adb reboot bootloader
  10. Boot (NOT flash) the patched boot image: fastboot boot <magisk-patched image> where <magisk-patched image> is the patched image you transferred to the PC
  11. On phone: Verify that Magisk shows you are rooted
  12. Make rooting permanent using Magisk>Magisk Install>"Direct Install (Recommended)" and reboot again
  13. Turn off Airplane Mode

B.2 Manual Install​

This involves manually downloading the update zip and then installing it using one of the following options.
It is up to you to download the update (from whichever source you use).

How I get a copy of the update zip
Note: I'm running the NA version of OOS. If the URL below for the OTA is different for other OOS versions, please let me know via a PM.
Once the phone tells me that there's an update available I do the following in Termux (https://f-droid.org/en/packages/com.termux/):
  1. su -c "logcat -d" | grep -Eo "https://android.googleapis.com/packages/ota-api/package/[a-z0-9]*.zip"
    This looks for the the Google OTA server file name in logcat and returns the source address. For example, the KB2005 C.11 full update was https://android.googleapis.com/packages/ota-api/package/435fc808f603bbc8a63ce30fd944676a65a61d6f.zip
    Note: You could also use adb shell to run the logcat -d | grep ... commands, though I've never done that because I prefer to do everything on my phone, where possible.
  2. wget -O /sdcard/oos-ota-update.zip <source address>
    This pulls a copy of the file to /sdcard.
    Note: You could also just paste the URL into a browser to download the file.

B.2.1 Local Install​

This is using:
  1. Move the update zip to /sdcard (NOT a subdirectory of /sdcard)
  2. Magisk>Uninstall Magisk>Restore images - this restores the stock boot image whilst keeping Magisk
  3. Install the update using the appropriate local installer for your version of OOS and DO NOT reboot
  4. Restore root to the current slot using Magisk>Magisk Install>"Direct Install (Recommended)". This is so you keep root in case the update somehow fails and you're returned to the current system.
  5. Root the updated boot image using Magisk>Magisk Install>"Install to inactive slot" and reboot

B.2.2 Using TWRP (OOS 11 updates only; NOT the OOS 11 to 12 update)​

There may be a way of using TWRP but I've never tried it. Given that we are now on OOS 12 and TWRP doesn't work on OOS 12, it's rather pointless to talk about using TWRP for incremental updates. Should we get a working TWRP 12 version, then I'll revisit this section.

B.2.3 Using CLI​

CLI (command line interface) tools, such as Terminal (I use Termux from https://f-droid.org/en/packages/com.termux/) or ADB shell, allows you to manually download delta updates avoiding the need to wait for full updates or for someone to post a copy of the delta update zip.
If you use Terminal then you can install updates without the need of a PC (my preferred option).
Using line commands, at one level, can simplify some processes by avoiding the need to switch out to recovery and back again. On the other hand, they complicate things by requiring knowledge of how to use them.
The commands you need to be familiar with are:
  • dd to read-from/write-to the partitions in /dev/block/by-name
  • grep to scan the output of a logcat
  • getprop to find out which are the active/inactive slots
  • logcat to read the Android logs
  • su to run commands as root
  1. Get a copy of the update zip
    Note: I'm running the NA version of OOS. If the URL below for the OTA is different for other OOS versions, please let me know via a PM.
    Once the phone tells me that there's an update available I do the following in Termux:
    1. su -c "logcat -d" | grep -Eo "https://android.googleapis.com/packages/ota-api/package/[a-z0-9]*.zip"
      This looks for the the Google OTA server file name in logcat and returns the source address. For example, the KB2005 C.11 incremental update was https://android.googleapis.com/packages/ota-api/package/435fc808f603bbc8a63ce30fd944676a65a61d6f.zip
    2. wget -O /sdcard/oos-ota-update.zip <source address>
      This pulls a copy of the file to /sdcard
      Note: You could also just paste the URL into a browser to download the file
  2. Find the active slot suffix: getprop ro.boot.slot_suffix
    If the result is _a then the inactive slot suffix is _b otherwise it is _a
  3. Restore stock boot/recovery (recovery: only on OOS 11 if TWRP is installed) using dd if=<copy of stock boot/recovery> of=/dev/block/by-name/<boot/recovery><active slot suffix>
  4. Install the update using:
  5. Backup the new stock boot/recovery (recovery: only on OOS 11 if TWRP is installed) using dd if=/dev/block/by-name/<boot/recovery><inactive slot suffix> of=<new boot/recovery img>
  6. Restore root to the current slot dd if=<copy of current Magisk patched stock boot/recovery> of=/dev/block/by-name/<boot/recovery><active slot suffix>. This is so you keep root in case the update somehow fails and you're returned to the current system.
    Note: You could also use Magisk>Magisk Install>"Direct Install (Recommended)"
  7. (ONLY if keeping TWRP on OOS 11) Magisk>Modules>Install from storage: Select twrp-installer.zip
  8. Magisk>Magisk Install>"Install to inactive slot" and DO NOT reboot
  9. Backup the new Magisk patched stock boot using dd if=/dev/block/by-name/<boot><inactive slot suffix> of=<new Magisk patched boot img>
  10. Reboot from Magisk (I'm not sure that you can use the normal system reboot process)

C. A note on Magisk backup folders in /data​

When Magisk patches the boot image using either Magisk>Magisk Install>"Direct Install (Recommended)" or Magisk>Magisk Install>"Install to inactive slot" it creates a backup of the original stock boot image in a directory named /data/magisk_backup_<SHA1 of stock image>.
When you use Magisk>Uninstall Magisk>Restore images the backup corresponding to the current patched boot image is used to restore the stock image to the current (active) slot.
Clearly, if you deleted these magisk_backup directories then Magisk will not be able to restore the stock boot image. You must, therefore, always keep the current backup.
If you don't delete these backups you can end up with a lot of obsolete backups. So, how to work out which one is the one you need to keep?
The simplest way is to:
  1. Restore the current stock boot image using Magisk>Uninstall Magisk>Restore images
  2. Delete all the /data/magisk_backup_* directories
  3. Restore the rooted boot image using Magisk>Magisk Install>"Direct Install (Recommended)" - this also creates a new magisk_backup directory (no need to reboot)
 

Attachments

  • safetynet-fix-v2.2.1-ob1.zip
    92.2 KB · Views: 3
Last edited:

The Apostle

Senior Member
Jan 27, 2012
1,101
353
Saint Louis
OnePlus 6
OnePlus 8T
Great write up. I know some people will appreciate the info when they have that "freak out moment" and something goes slightly wrong.

My question/suggestion would be in regards to your A.2 step. But please, if both options work, my post can be ignored. As you and I discussed in another thread, the update process via TWRP while keeping root has always been, on previous OnePlus Android OS versions.
  1. Download full ROM zip from OnePlus or other available location. I.E. 11.0.12.12
  2. Create Nandroid backup.
  3. Install full ROM zip.
  4. Install TWRP.
  5. Reboot to recovery.
  6. Install Magisk.
  7. Reboot to system.
Assuming it's a full update and not a delta. You outlined...

  1. Manually download the update (from whichever source you use)
  2. Boot recovery
  3. Restore the stock boot and recovery that you backed up previously
  4. Install the update
  5. Boot bootloader
  6. fastboot boot <twrp.img>
  7. Backup current boot and recovery
  8. Install Magisk-*.apk
  9. Install twrp-installer.zip
  10. Reboot system
As you stated, if full update, skip steps 3, 5, 6. Does changing the order and installing Magisk before TWRP allow you to not install TWRP 2x in order to keep the recovery and preserve root?

I used my outlined steps to update to 11.0.12.12 and it worked perfectly. Sorry if this post seems out of sorts, I'm doing it from my phone.
 
  • Like
Reactions: rage302

BillGoss

Senior Member
Sep 2, 2010
5,155
4,523
Sydney
OnePlus 3T
Great write up. I know some people will appreciate the info when they have that "freak out moment" and something goes slightly wrong.

My question/suggestion would be in regards to your A.2 step. But please, if both options work, my post can be ignored. As you and I discussed in another thread, the update process via TWRP while keeping root has always been, on previous OnePlus Android OS versions.
  1. Download full ROM zip from OnePlus or other available location. I.E. 11.0.12.12
  2. Create Nandroid backup.
  3. Install full ROM zip.
  4. Install TWRP.
  5. Reboot to recovery.
  6. Install Magisk.
  7. Reboot to system.
Assuming it's a full update and not a delta. You outlined...

  1. Manually download the update (from whichever source you use)
  2. Boot recovery
  3. Restore the stock boot and recovery that you backed up previously
  4. Install the update
  5. Boot bootloader
  6. fastboot boot <twrp.img>
  7. Backup current boot and recovery
  8. Install Magisk-*.apk
  9. Install twrp-installer.zip
  10. Reboot system
As you stated, if full update, skip steps 3, 5, 6. Does changing the order and installing Magisk before TWRP allow you to not install TWRP 2x in order to keep the recovery and preserve root?

I used my outlined steps to update to 11.0.12.12 and it worked perfectly. Sorry if this post seems out of sorts, I'm doing it from my phone.
The problem is that delta updates require you to restore both recovery and boot partitions to stock otherwise the installation fails.
The process I describe works for both full and delta updates. But, like I said, if you know that the update is a full OTA, then you can simplify the process and, <edit>if you know it's always going to be a full update, then<end-edit> you can use your "usual" process.

PS: this is a source of confusion because the BA ROMs are always full updates, while the AA ROMs are typically delta updates.

So what works for one user will not work for another even though they are both running OOS on an 8T.

And then there's the difference between letting System update download and install versus manual install, which creates another place for confusion is you just talk about "install update" instead of being specific as to the exact method.
 
Last edited:

The Apostle

Senior Member
Jan 27, 2012
1,101
353
Saint Louis
OnePlus 6
OnePlus 8T
The problem is that delta updates require you to restore both recovery and boot partitions to stock otherwise the installation fails.
The process I describe works for both full and delta updates. But, like I said, if you know that the update is a full OTA, then you can simplify the process as per your "usual" process.
I guess I don't know why people wouldn't simplify the process, download the full ROM, and eliminate steps. It's worked for years on OnePlus devices across android 9, 10, and now 11.
 

Feduz

Senior Member
Jun 1, 2014
81
7
Hi!

I'm using this method for the update:

Without TWRP
  1. Manually download the update (from whichever source you use) to /sdcard
  2. Magisk>Uninstall Magisk>Restore images - this restores the stock boot image whilst keeping Magisk
  3. Install the update in System Update>Gear icon (local install)
  4. Magisk>Magisk Install>Install to inactive slot
  5. Reboot system

2nd point, if I tap on uninstall magisk, It tells me that I don't have a backup original boot image, how can I proced?

Thanks
 

BillGoss

Senior Member
Sep 2, 2010
5,155
4,523
Sydney
OnePlus 3T
Hi!

I'm using this method for the update:

Without TWRP
  1. Manually download the update (from whichever source you use) to /sdcard
  2. Magisk>Uninstall Magisk>Restore images - this restores the stock boot image whilst keeping Magisk
  3. Install the update in System Update>Gear icon (local install)
  4. Magisk>Magisk Install>Install to inactive slot
  5. Reboot system

2nd point, if I tap on uninstall magisk, It tells me that I don't have a backup original boot image, how can I proced?

Thanks
You can't proceed if your update is an incremental update. Otherwise you can go ahead.
You'll need to find a copy of the stock boot image to restore it before installing the incremental update.
 

Feduz

Senior Member
Jun 1, 2014
81
7
You can't proceed if your update is an incremental update. Otherwise you can go ahead.
You'll need to find a copy of the stock boot image to restore it before installing the incremental update.
I'm on 11.0.11.11KB05BA, to 11.0.12.12. so I need to flash the original boot image via ADB/fastboot? Then proceed with point 3?
 

rmroot

Senior Member
Sep 20, 2018
63
3
What should I backup using TWRP before a custom rom update and before a jump from a custom rom to another?
 

BillGoss

Senior Member
Sep 2, 2010
5,155
4,523
Sydney
OnePlus 3T
What should I backup using TWRP before a custom rom update and before a jump from a custom rom to another?
Read the TWRP OP posts for the answer.
 

lvints

Senior Member
Jan 6, 2012
1,050
196
Timon
OnePlus 9R
@BillGoss

I will be a user of an OP 9R in a few days and I saw that it shares the same version of TWRP.

In the 9r forum I still haven't found a well explained tutorial and if it's possible.

The instructions you put here allow you to update OxygenOS on 8T and keep root/TWRP, right? Would they be applicable to the 9R as well?
 

BillGoss

Senior Member
Sep 2, 2010
5,155
4,523
Sydney
OnePlus 3T
@BillGoss

I will be a user of an OP 9R in a few days and I saw that it shares the same version of TWRP.

In the 9r forum I still haven't found a well explained tutorial and if it's possible.

The instructions you put here allow you to update OxygenOS on 8T and keep root/TWRP, right? Would they be applicable to the 9R as well?
I know that the 8T and 9R share similar architecture so the process I've described may work on the 9R, but I can't confirm this.

I do know that as one point we had a common TWRP version for both the 8T and 9R, but that's no longer the case and there's no official TWRP for the 9R.

So, from my perspective, you're on your own on this. If it works, great. You may want to post your process and results in the 9R forum, but not here (this is strictly an 8T forum and thread).
 

JimDandy68

Senior Member
Feb 6, 2012
125
12
T-Mobile Samsung Galaxy S5
Moto X4
Thanks very much for this thread, @BillGoss. Just easily upgraded 11.0.12.12.KB05AA to 11.0.13.13.KB05AA with your methods using fastboot boot trwp.xx.img from bootloader mode and simply reinstalling Magisk after letting the update run (airplane mode on, as you suggest). I had just upgraded Magisk before the update, so had the latest apk handy in my downloads.

To backup your boot in TWRP (first know your active slot), you can get to a terminal in the TWRP/Advanced menu. I use the same commands you list in your "Use a CLI" instructions.
 
  • Like
Reactions: BillGoss

Feduz

Senior Member
Jun 1, 2014
81
7
Hi, I've updated correctly to the latest OOS, should I need to update Magisk? or will be fine this version?


e835e564-2366-4ad7-a356-6d62c5ac6769.jpeg
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    @BillGoss Hello, I was in oos11 Root without twrp. In oos11 to make the upgrade, I made installation in local mode, then in magisk I reinstalled the one "after OTA" then reboot. To upgrade to OOS12 I did the same thing. But now, how to make an upgrade C15 -> C16 for example, without brick the phone since there is no more the option to install in local mode (Gear icon) ???
    Install this and you will have local upgrade

    3
    Okay I was courious and tried to root my KB2005 (GLO) with incremental Update .C16 (since there is no Full OTA yet).
    I used @BillGoss guide from OP (Update 20220427 WIP) in combination with @osm0sis method (also mentioned in OP and it worked! -> Kudos to both of them.
    These were my steps:

    1. UNROOT current slot in magisk app (=uninstall +restore images) WITHOUT REBOOTING
    2. Download and Install the C16 incremental update from built-in Software Update function WITHOUT REBOOTING
    3. Dump the fresh updated boot_img from the inactive slot (find your active slot with ->
      Code:
      adb shell getprop ro.boot.slot_suffix
      using the command BillGoss mentioned ->
      Code:
      adb shell su -c dd if=/dev/block/by-name/boot_b of=/sdcard/update-boot.img
      (in my case the inactive slot=b please change accordingly refering to your currently inactive slot -> boot_a or boot_b)
    4. patch the dumped update-boot.img with magisk -> "Select and Patch a File"
    5. copy the magisk_patched.img to your PC
    6. Re-root the current slot using the Magisk app direct Install, so in case the update somehow fails you'll be back where you started (rooted on the current slot) (THX to osm0sis for this step)
    7. turn on Airplane Mode
    8. reboot phone from update dialog, let it boot up and check if you are now on the updated slot
    9. reboot to fastboot e.g. using this command ->
      Code:
      adb reboot bootloader
    10. fastboot boot the magisk_patched.img ->
      Code:
      fastboot boot .\magisk_patched.img
    11. boot up and check in magisk app if you are now rooted
    12. in magisk app do a "Direct Install" and reboot again
    13. now you are on the updated slot with persistent magisk root
    14. turn off Airplane Mode and enjoy.
    greetings rage
    2
    First of all > THANK YOU and Kudos for that great Guide!

    Just a short question to Method B.2.1.
    Is this Method also capable to use it with incremental zip updates or just for Full OTA zips?
    Thanks for the nice comment 😊

    It works for both full and incremental updates. All the methods cater for both. The only process that doesn't is A.1 and I've pointed that out clearly.
    2
    Okay I was courious and tried to root my KB2005 (GLO) with incremental Update .C16 (since there is no Full OTA yet).
    I used @BillGoss guide from OP (Update 20220427 WIP) in combination with @osm0sis method (also mentioned in OP and it worked! -> Kudos to both of them.
    These were my steps:

    1. UNROOT current slot in magisk app (restore images) WITHOUT REBOOTING
    2. Download and Install the C16 incremental update from built-in Software Update function WITHOUT REBOOTING
    3. Dump the fresh updated boot_img from the inactive slot (find your active slot with ->
      Code:
      adb shell getprop ro.boot.slot_suffix
      using the command BillGross mentioned ->
      Code:
      adb shell su -c dd if=/dev/block/by-name/boot_b of=/sdcard/update-boot.img
      (in my case the inactive slot=b please change accordingly refering to your currently inactive slot -> boot_a or boot_b)
    4. patch the dumped update-boot.img with magisk -> "Select and Patch a File"
    5. copy the magisk_patched.img to your PC
    6. Re-root the current slot using the Magisk app direct Install, so in case the update somehow fails you'll be back where you started (rooted on the current slot) (THX to osm0sis for this step)
    7. turn on Airplane Mode
    8. reboot phone from update dialog, let it boot up and check if you are now on the updated slot
    9. reboot to fastboot e.g. using this command ->
      Code:
      adb reboot bootloader
    10. fastboot boot the magisk_patched.img ->
      Code:
      fastboot boot .\magisk_patched.img
    11. boot up and check in magisk app if you are now rooted
    12. in magisk app do a "Direct Install" and reboot again
    13. now you are on the updated slot with persistent magisk root
    14. turn off Airplane Mode and enjoy.
    Brilliant!
    Your steps 10-12 were what I've been missing. Because they enable the simpler method of just using Magisk for later updates.
    Thank you!
    1
    It has only what I wrote in previous message..
    I'm sending you a PM as this is off topic for this thread.
  • 11
    Updated 220513: rewritten and includes OOS 12

    A. First time rooting​

    This process is common across all options

    A.1 Flashing Magisk patched boot image​

    Notes:
    Follow the instructions detailed in DroidFreak32's https://forum.xda-developers.com/t/...national-kb2000-kb2001-kb2003-kb2005.4178675/ paying attention to:
    1. You can use the latest stable version of Magisk (my recommendation as of May 2022)
    2. Do NOT use the "To flash" option in step 11 because this causes issues when you get the next OTA update. Use the the "To Temporarily boot into a rooted system (RECOMMENDED!!)" option.
    3. Backup both the stock boot (the one extracted from using Payload Dumper) and Magisk patched boot images if you are going to use CLI
    I also recommend that you install the Universal SafetyNet Fix Magisk module to pass SafetyNet with an unlocked bootloader. Use my modified version (attached) that fixes the fingerprint reader not working on rooted OOS 12 until kdrag0n's version is updated.

    A.2 Using TWRP (OOS 11 only)​

    1. Boot bootloader
    2. fastboot boot <twrp.img>
    3. Backup current boot
    4. Install Magisk-*.apk
    5. Reboot system
    6. Uninstall Magisk stub
    7. Install Magisk-*.apk
    8. Install the Universal SafetyNet Fix Magisk module to pass SafetyNet with an unlocked bootloader. Use my modified version (attached) that fixes the fingerprint reader not working on rooted OOS 12 until kdrag0n updates his version.

    B. Keeping root during an update​

    B.1 System Update downloads and installs the update​

    This is using the built-in System Update tool, which you'll find in:
    • OOS 11: Settings>System settings> System Update
    • OOS 12: Settings>About device>Software update
    The process is complicated because you cannot use Magisk>Magisk Install>"Install to inactive slot" as this will fail on OOS 11 (for incremental updates) and OOS 12 (for all updates, including the initial update from OOS 11 to OOS 12). The following process is courtesy of @osm0sis in https://forum.xda-developers.com/t/...ices-platforms.2239421/page-149#post-84764713 and @rage302 in https://forum.xda-developers.com/t/...ing-root-options.4387977/page-4#post-86830285.
    1. Restore the current stock boot image using Magisk>Uninstall Magisk>"Restore images" and DO NOT reboot
    2. Download and Install the update (and DO NOT reboot) using:
      OOS 11: Settings>System Settings>System Update>Download and Install
      OOS 12: Settings>About device>Software update
    3. Copy the updated boot image as follows:
      • On PC: Find the inactive slot suffix:
        • adb shell getprop ro.boot.slot_suffix Note: on OOS 12 when you connect the phone to the PC you must enable "Transfer files" on the phone for ADB to see the device.
        • If the result is _a then the inactive slot suffix is _b otherwise it is _a
      • Take a copy of the boot image: adb shell su -c dd if=/dev/block/by-name/boot<inactive slot suffix> of=/sdcard/oos-ota-boot.img replacing <inactive slot suffix> with the value you previously determined (_a or _b). Note: Magisk may prompt you (on your phone) to grant root access to Shell - grant it.
    4. On phone: Patch the dumped oos-ota-boot.img using Magisk>Magisk Install>"Select and Patch a File"
    5. Copy /sdcard/Download/magisk_patched*.img to your PC
    6. Restore root to the current slot using Magisk>Magisk Install>"Direct Install (Recommended)". This is so you keep root in case the update somehow fails and you're returned to the current system.
    7. Turn on Airplane Mode to prevent Google Play Services detecting that the phone is bootloader unlocked and making your phone uncertified in Google Play.
    8. Reboot the phone from the System Update dialog; verify that you are now running the updated version
    9. On PC: Reboot to bootloader using adb reboot bootloader
    10. Boot (NOT flash) the patched boot image: fastboot boot <magisk-patched image> where <magisk-patched image> is the patched image you transferred to the PC
    11. On phone: Verify that Magisk shows you are rooted
    12. Make rooting permanent using Magisk>Magisk Install>"Direct Install (Recommended)" and reboot again
    13. Turn off Airplane Mode

    B.2 Manual Install​

    This involves manually downloading the update zip and then installing it using one of the following options.
    It is up to you to download the update (from whichever source you use).

    How I get a copy of the update zip
    Note: I'm running the NA version of OOS. If the URL below for the OTA is different for other OOS versions, please let me know via a PM.
    Once the phone tells me that there's an update available I do the following in Termux (https://f-droid.org/en/packages/com.termux/):
    1. su -c "logcat -d" | grep -Eo "https://android.googleapis.com/packages/ota-api/package/[a-z0-9]*.zip"
      This looks for the the Google OTA server file name in logcat and returns the source address. For example, the KB2005 C.11 full update was https://android.googleapis.com/packages/ota-api/package/435fc808f603bbc8a63ce30fd944676a65a61d6f.zip
      Note: You could also use adb shell to run the logcat -d | grep ... commands, though I've never done that because I prefer to do everything on my phone, where possible.
    2. wget -O /sdcard/oos-ota-update.zip <source address>
      This pulls a copy of the file to /sdcard.
      Note: You could also just paste the URL into a browser to download the file.

    B.2.1 Local Install​

    This is using:
    1. Move the update zip to /sdcard (NOT a subdirectory of /sdcard)
    2. Magisk>Uninstall Magisk>Restore images - this restores the stock boot image whilst keeping Magisk
    3. Install the update using the appropriate local installer for your version of OOS and DO NOT reboot
    4. Restore root to the current slot using Magisk>Magisk Install>"Direct Install (Recommended)". This is so you keep root in case the update somehow fails and you're returned to the current system.
    5. Root the updated boot image using Magisk>Magisk Install>"Install to inactive slot" and reboot

    B.2.2 Using TWRP (OOS 11 updates only; NOT the OOS 11 to 12 update)​

    There may be a way of using TWRP but I've never tried it. Given that we are now on OOS 12 and TWRP doesn't work on OOS 12, it's rather pointless to talk about using TWRP for incremental updates. Should we get a working TWRP 12 version, then I'll revisit this section.

    B.2.3 Using CLI​

    CLI (command line interface) tools, such as Terminal (I use Termux from https://f-droid.org/en/packages/com.termux/) or ADB shell, allows you to manually download delta updates avoiding the need to wait for full updates or for someone to post a copy of the delta update zip.
    If you use Terminal then you can install updates without the need of a PC (my preferred option).
    Using line commands, at one level, can simplify some processes by avoiding the need to switch out to recovery and back again. On the other hand, they complicate things by requiring knowledge of how to use them.
    The commands you need to be familiar with are:
    • dd to read-from/write-to the partitions in /dev/block/by-name
    • grep to scan the output of a logcat
    • getprop to find out which are the active/inactive slots
    • logcat to read the Android logs
    • su to run commands as root
    1. Get a copy of the update zip
      Note: I'm running the NA version of OOS. If the URL below for the OTA is different for other OOS versions, please let me know via a PM.
      Once the phone tells me that there's an update available I do the following in Termux:
      1. su -c "logcat -d" | grep -Eo "https://android.googleapis.com/packages/ota-api/package/[a-z0-9]*.zip"
        This looks for the the Google OTA server file name in logcat and returns the source address. For example, the KB2005 C.11 incremental update was https://android.googleapis.com/packages/ota-api/package/435fc808f603bbc8a63ce30fd944676a65a61d6f.zip
      2. wget -O /sdcard/oos-ota-update.zip <source address>
        This pulls a copy of the file to /sdcard
        Note: You could also just paste the URL into a browser to download the file
    2. Find the active slot suffix: getprop ro.boot.slot_suffix
      If the result is _a then the inactive slot suffix is _b otherwise it is _a
    3. Restore stock boot/recovery (recovery: only on OOS 11 if TWRP is installed) using dd if=<copy of stock boot/recovery> of=/dev/block/by-name/<boot/recovery><active slot suffix>
    4. Install the update using:
    5. Backup the new stock boot/recovery (recovery: only on OOS 11 if TWRP is installed) using dd if=/dev/block/by-name/<boot/recovery><inactive slot suffix> of=<new boot/recovery img>
    6. Restore root to the current slot dd if=<copy of current Magisk patched stock boot/recovery> of=/dev/block/by-name/<boot/recovery><active slot suffix>. This is so you keep root in case the update somehow fails and you're returned to the current system.
      Note: You could also use Magisk>Magisk Install>"Direct Install (Recommended)"
    7. (ONLY if keeping TWRP on OOS 11) Magisk>Modules>Install from storage: Select twrp-installer.zip
    8. Magisk>Magisk Install>"Install to inactive slot" and DO NOT reboot
    9. Backup the new Magisk patched stock boot using dd if=/dev/block/by-name/<boot><inactive slot suffix> of=<new Magisk patched boot img>
    10. Reboot from Magisk (I'm not sure that you can use the normal system reboot process)

    C. A note on Magisk backup folders in /data​

    When Magisk patches the boot image using either Magisk>Magisk Install>"Direct Install (Recommended)" or Magisk>Magisk Install>"Install to inactive slot" it creates a backup of the original stock boot image in a directory named /data/magisk_backup_<SHA1 of stock image>.
    When you use Magisk>Uninstall Magisk>Restore images the backup corresponding to the current patched boot image is used to restore the stock image to the current (active) slot.
    Clearly, if you deleted these magisk_backup directories then Magisk will not be able to restore the stock boot image. You must, therefore, always keep the current backup.
    If you don't delete these backups you can end up with a lot of obsolete backups. So, how to work out which one is the one you need to keep?
    The simplest way is to:
    1. Restore the current stock boot image using Magisk>Uninstall Magisk>Restore images
    2. Delete all the /data/magisk_backup_* directories
    3. Restore the rooted boot image using Magisk>Magisk Install>"Direct Install (Recommended)" - this also creates a new magisk_backup directory (no need to reboot)
    3
    Okay I was courious and tried to root my KB2005 (GLO) with incremental Update .C16 (since there is no Full OTA yet).
    I used @BillGoss guide from OP (Update 20220427 WIP) in combination with @osm0sis method (also mentioned in OP and it worked! -> Kudos to both of them.
    These were my steps:

    1. UNROOT current slot in magisk app (=uninstall +restore images) WITHOUT REBOOTING
    2. Download and Install the C16 incremental update from built-in Software Update function WITHOUT REBOOTING
    3. Dump the fresh updated boot_img from the inactive slot (find your active slot with ->
      Code:
      adb shell getprop ro.boot.slot_suffix
      using the command BillGoss mentioned ->
      Code:
      adb shell su -c dd if=/dev/block/by-name/boot_b of=/sdcard/update-boot.img
      (in my case the inactive slot=b please change accordingly refering to your currently inactive slot -> boot_a or boot_b)
    4. patch the dumped update-boot.img with magisk -> "Select and Patch a File"
    5. copy the magisk_patched.img to your PC
    6. Re-root the current slot using the Magisk app direct Install, so in case the update somehow fails you'll be back where you started (rooted on the current slot) (THX to osm0sis for this step)
    7. turn on Airplane Mode
    8. reboot phone from update dialog, let it boot up and check if you are now on the updated slot
    9. reboot to fastboot e.g. using this command ->
      Code:
      adb reboot bootloader
    10. fastboot boot the magisk_patched.img ->
      Code:
      fastboot boot .\magisk_patched.img
    11. boot up and check in magisk app if you are now rooted
    12. in magisk app do a "Direct Install" and reboot again
    13. now you are on the updated slot with persistent magisk root
    14. turn off Airplane Mode and enjoy.
    greetings rage
    3
    @BillGoss Hello, I was in oos11 Root without twrp. In oos11 to make the upgrade, I made installation in local mode, then in magisk I reinstalled the one "after OTA" then reboot. To upgrade to OOS12 I did the same thing. But now, how to make an upgrade C15 -> C16 for example, without brick the phone since there is no more the option to install in local mode (Gear icon) ???
    Install this and you will have local upgrade

    2
    First of all > THANK YOU and Kudos for that great Guide!

    Just a short question to Method B.2.1.
    Is this Method also capable to use it with incremental zip updates or just for Full OTA zips?
    Thanks for the nice comment 😊

    It works for both full and incremental updates. All the methods cater for both. The only process that doesn't is A.1 and I've pointed that out clearly.
    2
    Okay I was courious and tried to root my KB2005 (GLO) with incremental Update .C16 (since there is no Full OTA yet).
    I used @BillGoss guide from OP (Update 20220427 WIP) in combination with @osm0sis method (also mentioned in OP and it worked! -> Kudos to both of them.
    These were my steps:

    1. UNROOT current slot in magisk app (restore images) WITHOUT REBOOTING
    2. Download and Install the C16 incremental update from built-in Software Update function WITHOUT REBOOTING
    3. Dump the fresh updated boot_img from the inactive slot (find your active slot with ->
      Code:
      adb shell getprop ro.boot.slot_suffix
      using the command BillGross mentioned ->
      Code:
      adb shell su -c dd if=/dev/block/by-name/boot_b of=/sdcard/update-boot.img
      (in my case the inactive slot=b please change accordingly refering to your currently inactive slot -> boot_a or boot_b)
    4. patch the dumped update-boot.img with magisk -> "Select and Patch a File"
    5. copy the magisk_patched.img to your PC
    6. Re-root the current slot using the Magisk app direct Install, so in case the update somehow fails you'll be back where you started (rooted on the current slot) (THX to osm0sis for this step)
    7. turn on Airplane Mode
    8. reboot phone from update dialog, let it boot up and check if you are now on the updated slot
    9. reboot to fastboot e.g. using this command ->
      Code:
      adb reboot bootloader
    10. fastboot boot the magisk_patched.img ->
      Code:
      fastboot boot .\magisk_patched.img
    11. boot up and check in magisk app if you are now rooted
    12. in magisk app do a "Direct Install" and reboot again
    13. now you are on the updated slot with persistent magisk root
    14. turn off Airplane Mode and enjoy.
    Brilliant!
    Your steps 10-12 were what I've been missing. Because they enable the simpler method of just using Magisk for later updates.
    Thank you!