Now that your phone has an unlocked bootloader and a custom recovery installed, you have two options to gain root (Pick one or the other. You don't need to do both. ).
Option A) Flash SuperSU binaries which will give you root with the stock ROM
Option B) Flash a custom rom which will come pre-rooted
- Confirm that you have downloaded the SuperSU zip from the downloads section above. Connect OP3 to PC and send SuperSU to your phone.
- Turn the phone off. Then boot into recovery mode by holding volume down + power. Leave the phone at the main screen of the custom recovery for now.
- Install > browse to SuperSU zip and select it
- Swipe to confirm the installation. Then reboot.
- Note that not all custom roms will be pre rooted, however the majority of them are. Read the OP of the ROM thread to see what the verdict is.
- Copy a custom rom (you can find these in the OnePlus 3 ROMs, Kernels, Recoveries, & Other Development section of XDA or Custom OP3 Software section on OnePlus Forums) onto the phone (remember the location of where you copy it to)
- Turn the phone off then boot into recovery mode by holding volume down + power. To install a custom ROM the general procedure to follow is: wipe Dalvik + System + Data + Cache, flash ROM, flash GApps.
- Wipe > Advanced Wipe > Select Dalvik + System + Data + Cache > Swipe to Wipe
- Install > browse to the location where you previously copied the ROM zip and select it > Swipe to confirm the installation
- Install GApps using same process as ROM, then reboot.
Keep in mind that the first boot after installing a custom ROM & wiping the phone may take longer than usual, as the phone will need to rebuild the dalvik cache and initialize other first boot stuff.
Congrats! That is all! Your phone now has an unlocked bootloader, a custom recovery installed and is rooted. Enjoy !
The very first thing we highly recommend you to do now is to take EFS Backup and save it at your cloud and PC. It is very very important.
5. Making an EFS Backup
All too often, we've seen folks who have a corrupted or missing EFS Partition. This results in your IMEI being lost and no cellular activity on the device at all. This can be a royal PITA to fix, and some folks haven't been able to fix it at all. You can take a precautionary measure to safeguard yourself against this by taking a couple of minutes to back up your modemst files.
- Open up Terminal Emulator on your phone (if you don't have it you can download it here).
- Once it's open you'll be greeted with a command line prompt, in which you can enter text commands, the first thing you need to do is enable root access by entering this line (press the enter key on your on-screen keyboard after each command to issue it):If this is the first time you've used Terminal Emulator a Superuser or SuperSU popup will appear, make sure you grant root access.
- Now enter these two commands:
dd if=/dev/block/sdf1 of=/sdcard/modemst1.bin bs=512
dd if=/dev/block/sdf2 of=/sdcard/modemst2.bin bs=512
This will place two files (modemst1.bin & modemst2.bin) on your internal storage. Make sure you copy them to your PC and other Clouds immediately so that you have a backup there to use if you need to restore it in future.
That's it !! Incase you ever need to restore Nanroid or EFS Backups, continue.
6. Restoring a Nandroid Backup
Note: If you happened to forget to remove lockscreen security (PIN/Pattern/Fingerprint) before creating your backup, and you cannot get into your OS after restoring, you can do the following to fix the issue. Boot into TWRP and use the built in file manager to delete /data/sytem/locksettings.db. This should be enough to get you into your OS again. If it isn't you can also try deleting /data/system/locksettings.db-shm and /data/system/locksettings.db-wal. If this still doesn't fix your issue you can delete /data/system/gatekeeper.password.key and /data/system/gatekeeper.pattern.key.
7. Restoring an EFS Backup
- Boot into TWRP Recovery .
- [Only and Only if you want to restore /system and /data too from the Backup] Wipe > Advanced Wipe > Select Dalvik + System + Data + Cache > Swipe to Wipe. Go back to TWRP Home.
- Go to Restore Menu and select the backup you want to restore.
- Select the partitions you want to restore.
- Swipe to Restore. The process will take some time.
If by chance you end up with a corrupt EFS partition all you need to do is flash the files back to your device using fastboot.
- Boot into fastboot mode (power + volume up) and connect your phone to your PC via usb cable.
- Keep modemst1.bin and modemst2.bin (backed up earlier) on your desktop and open command window there.
- These fastboot commands will restore the files:
fastboot flash modemst1 modemst1.bin
fastboot flash modemst2 modemst2.bin
- Reboot your device.
Now disconnect phone from PC. Hope your IMEI etc is back.
That's it for the guide. Enjoy !