[OnePlus 6 Guides, News, & Discussion] b1czu:
OP6 rooting without TWRP

Checklist before preceed:

Working Fastboot

Be on software OOS 5.1.5 | 5.1.6 | 5.1.7 | 5.1.8

Unlocked bootloader

(Instruction here, but remember to enable OEM Unlocking first)

WARNING:

Please double check that you have unlocked bootloader!

A few users has reported that instaling magisk with locked bootloader or wiping phone (using stock recovery) with patched boot.img can soft brick your phone! Please avoid doing this for now. If you've already done this and you are stuck with only fastboot working please follow this post https://xdaforums.com/showpost.php?p=76608874&postcount=31 to restore your device to working state. Thank's to [MENTION=1751454]SaiBork[/MENTION] for more detailed instructions available here https://xdaforums.com/showpost.php?p=76632484&postcount=82

Rooting process:

Make sure that you have

UNLOCKED BOOTLOADER.

DO NOT attempt to patch boot.img using Magisk Manager without unlocked bootloader because it

WILL CAUSE SOFT BRICK

!!!

Boot device using patched boot.img.

For OOS 5.1.5 it can be downloaded [here]

For OOS 5.1.6 it can be downloaded [here]

For OOS 5.1.7 it can be downloaded [here]

For OOS 5.1.8 it can be downloaded [here]

It can be also patched manually (see bottom of this post).

To do this you need working fastboot. Fire up your cmd/terminal and cd to directory where you've downloaded/placed patched boot image. When you are in correct directory just type in cmd/terminal:

fastboot boot patched_boot_magisk1642_518.img

(check if img filename in command is exactly same as name of downloaded boot img) The phone should boot to Android.

Once the phone has booted install Magisk Manager app and open it. It can be downloaded here or here.

Magisk Manager App should show that your phone is rooted - but at this stage it's just temporary, until next reboot (nothing flashed yet).

Go to settings and Tap on "Update channel" and change it to Beta.

Go back to Magisk main screen and make sure that "Preserve force encryption" and "Preserve AVB 2.0/dm-verity" are

checked

!

Tap on "Install" and select "Direct Install (Recommended)".

Wait until boot.img is patched and flashed and reboot your device when prompted to do so.

After boot there aren't any error messages shown before (or after) entering PIN code, unlike when rooting using other methods.

To check SafetyNet status just open Magisk Manager once again and tap on "Tap to start SafetyNet check". It should be all green. :D

wOOt wOOt you just got rOOt! ;)

Video showing rooting process:

XDA user [MENTION=3294422]GizmoFreak[/MENTION] has made a video showing the whole procedure for 5.1.5! Thank you very much.

[YOUTUBE]V5zJvcXGmrk[/YOUTUBE]

How to do an OTA update preserving root

Install OTA. It will be installed on the inactive slot. Do not restart your OP6 when installation finishes.

Start Magisk Manager app.

Tap on Install.

Tap on Install to Second Slot (After OTA).

Reboot your device.

Check if you got root and if safety net checks are passed.

How to extract from OTA and manually patch stock OOS boot.img using Magisk Manager:

Install python3 and PIP manager on your system .

Use pip to install "protobuf" module:

pip3 install protobuf

Download payload_dumper.py and update_metadata_pb2.py from this gist https://gist.github.com/ius/42bd02a5df2226633a342ab7a9c60f15 and save them in one directory.

Download full update zip with OOS (containing payload.bin). It can be downloaded from this great thread by [MENTION=5301049]Titokhan[/MENTION]

Extract payload.bin from update zip to same directory where payload_dumper.py is located.

Use payload_dumper.py to extract original boot.img

python payload_dumper.py payload.bin

After a while you should have all img's included in payload.bin dumped in your working directory.

Install Magisk Manager app on your OP6.

Place that dumped boot.img on your phone storage.

In Magisk Manager app tap install, and select "Patching boot image file". Select boot.img that you've just uploaded to your phone.

Magisk Manager will patch boot.img and save it on Phone's internal storage in "MagiskManager" directory (file called "patched_boot.img").

Download this patched file to your computer and just use it to boot using fastboot