Many owners of the OnePlus 5T may be wondering “how to root the OnePlus 5T”, and this guide will walk you through all of the necessary steps, from unlocking the bootloader to rooting the OnePlus 5T using TWRP Recovery. This guide will also show you how to create and restore Nandroid backups for the OnePlus 5T, incase something goes wrong and you need to restore your phone to a previous state. Warning: Unlocking the bootloader will wipe all of your user-data and factory reset your device – make sure you backup all important personal data before proceeding!

Pre-Requisites / Before You Begin

Make sure you have ADB installed on your computer – see the Appual’s guide How to Install ADB on WindowsEnable OEM Unlock, USB Debugging, and Advanced Reboot on your OnePlus 5T’s Developer Options. To enable Developer Options, go to Settings > About Phone > tap on Build Number 7 times until Developer Mode is confirmed as being activated. Then go into Developer Options and enable those above mentioned settings.

Requirements

MagiskCodeworkx TWRP OR Blu_Spark TWRP

How to Unlock the OnePlus 5T Bootloader

Flashing TWRP Recovery on the OnePlus 5T

Rooting the OnePlus 5T

From now on, do not flash partial OTA updates – if you want to flash a partial OTA, you must first flash a complete OTA that it applies to, and then flash the partial OTA from stock recovery. You will most definitely brick your device if you flash a partial OTA from TWRP, but if this happens, you can recover your device by flashing a full OTA .zip from stock recovery.

How to Create a Nandroid Backup for the OnePlus 5T

A Nandroid backup is an extremely useful thing to have before installing any kind of custom ROM on your device (or tinkering with /system stuff). Basically, it’s a full backup of your stock /system partition that will save your device in the event of a /system screwup, or you need to reinstall your original stock firmware. Warning: Before creating a Nandroid backup with TWRP, you must remove all lockscreen security. If you fail to do this, you will be unable to unlock your device after restoring a backup, and you will need to perform a factory reset to get into the Android system. This is because if you create a backup with lockscreen security enabled, the pin will become scrambled during the backup process, so you will have an incorrect pin error when you restore the device from a backup with lockscreen security enabled.

How to Restore a Nandroid Backup from TWRP

If you created a Nandroid backup while lockscreen security was enabled (which I expressly said don’t do), you may still be able to get into the Android system by deleting the files that contain your (scrambled) lockscreen security. You will need to boot into TWRP and go to File Manager. Navigate to /data/system/ and delete the following files:

Locksettings.dbLocksettings.db-shmLocksettings.db-walGatekeeper.password.keyGatekeeper.pattern.key

Now reboot your OnePlus 5T and enter your PIN to decrypt the storage – now you can simply unlock the phone via swiping. Go into Settings > Security and set a new lockscreen method / PIN. How to Create an EFS Backup for the OnePlus 5T It’s not uncommon for people tinkering with their /system or flashing things to corrupt the EFS Partition, which typically results in the IMEI being lost, and no cellular activity on the OnePlus 5T. This is extremely difficult to fix without an EFS Backup, so you can protect yourself from this happening by following this guide as a precaution.

Note: This must be performed on a rooted device!

Su

(this will grant root access to the Terminal Emulator app) Now enter:

dd if=/dev/block/sdf1 of=/sdcard/modemst1.bin bs=512dd if=/dev/block/sdf2 of=/sdcard/modemst2.bin bs=512

OnePlus Set To Have An Exciting July Planned: OnePlus Z, OnePlus TV and TWS…How to Unlock and Root the OnePlus 8 ProHow to Unlock and Root the OnePlus 3THow to Unlock the Bootloader and Root the OnePlus 6T How to Unlock and Root OnePlus 5T - 22How to Unlock and Root OnePlus 5T - 84