A better rooting guide:
We unlock bootloader and back up imp files first.
take backup of all your data, contacts, settings, sync everything.
ensure you have prequisites, (TWRP, Platform tools)
Install official drivers from Device > MTP
Obtain Platform tools from
https://developer.android.com/studio/releases/platform-tools
enable dev settings in phone,
enable oem unlock, usb debug and advance boot from dev settings
open cmd to where you have extracted platform tools(Shift+Right click in the directory > open powershell or cmd, from powershell, type cmd and color 4 or whatever your pref.)
type adb devices, your phone will ask for fingerprint, tick always trust and allow.
type adb devices again, you should see your device's serial number.
reboot to fastboot by volup+poweroff combo and select fastboot. (you can also do adb boot but I prefer this)
Connect cable, open device manager(Run > devmgmt.msc)
If you see android device, or if device is not identified, then right click on that unknown android device and update drivers, windows 10 update provides the same thing, just that the source is more trusted.
if that does not work, or if you have automatic driver update disabled, go to windows update > optional update > drivers > install the android adb interface driver.
no reboot is necessary.
type fastboot devices
you should see serial number.
type fastboot oem unlock
confirm in mobile, it will reset.
I prefer doing manual reset again here, it's just my pref, not necessary, so power off device, voldown+powerbutton hold, release power button when screen turns on, keep holding voldown until you see fastboot. and boot to recovery wipe everything, cache data system userdata.
reboot to device, skip in setup, enable dev settings, and enable usb debug + advanced boot
connect to pc, confirm fingerprint + always allow, reboot to fastboot
rename the twrp file that you downloaded and place in same platform tools folder to twrp.img
type fastboot boot twrp.img
then run following commands one by one. you can copy paste in powershell, note, one of the boot_a or boot_b command may fail, not to worry.
adb shell
dd if=/dev/block/bootdevice/by-name/boot_a of=/tmp/boot_a.img
dd if=/dev/block/bootdevice/by-name/boot_b of=/tmp/boot_b.img
dd if=/dev/block/bootdevice/by-name/persist of=/tmp/persist.img
dd if=/dev/block/sdf2 of=/tmp/modemst1.bin
dd if=/dev/block/sdf3 of=/tmp/modemst2.bin
exit
adb pull /tmp/boot_a.img boot_a.img
adb pull /tmp/boot_b.img boot_b.img
adb pull /tmp/persist.img persist.img
adb pull /tmp/modemst1.bin modemst1.bin
adb pull /tmp/modemst2.bin modemst2.bin
you will have all files in platform tools folder
you would have obtained either boot a or boot b, just rename to boot.img
back up all 4 files. DO IT, VERY IMP!
So now you have backed up everything without using any payload dumper, no unnecessary python installs.
reboot to device
Now, if you want to root:
obtain official magisk manager stable apk from:
https://github.com/topjohnwu/Magisk
copy the magisk apt and boot.img to your root of internal storage
Install magisk
run, tap on install next to magisk > tap on select and patch a file > select your boot.img, > let's go
it will show success, and save new boot file in downloads folder.
copy that file to your pc > platform tools folder( you must have already backed up the stock boot.img, so you can delete the existing one) and rename the new one to boot.img
reboot to fastboot.
fastboot flash boot boot.img
Press the power button on device, it will reboot.
Now, you have root on your stock rom.
Do not update OOS, without reverting to stock, because we may not know if tomorrow oneplus brings some security features to brick your devices.
You can update the magisk manager app, but Do not update magisk without following boot.img patch a file process with your stock boot.img, do not repatch the magisk_boot.img
You need to follow respected Rom's or Kernel's instruction for flashing of same.