86
[GUIDE] OnePlus 3T: How to Unlock Bootloader | Flash TWRP | Root | Nandroid & EFS Backup and More !!

  1. Funk Wizard KitKat Moderator Nov 22, 2016

    Funk Wizard, Nov 22, 2016 :

    [​IMG]
    [​IMG]

    Introduction
    Rooting this device is actually quite a simple and easy process. Before you begin, it is recommended that you at least try to understand what each part of the process will do. Although this guide will elongate each step in order to show all of the details, the method used can be broken up into 3 main steps: Unlocking the Bootloader, Installing a Custom Recovery and finally Rooting. Each new step relies on the previous step to have been completed, and a basic summary of each part is:

    1. Unlocking Bootloader: Opens the door to the internal memory of the device to be written on to. This allows you to flash images onto the main partitions of the phone.
    2. Installing a Custom Recovery: A custom recovery is flashed onto the recovery partition of the device and overwrites the stock recovery that exists by default. Custom recoveries bring lots of functionality and give you the ability to perform wipes, install flashable zips, create full backups of your NAND (Nandroid backup), and various other features. An unlocked bootloader is needed to install a custom recovery.
    3. Rooting: You can gain root by either flashing via recovery a pre-rooted custom rom, or flashing a zip containing the SuperSU binaries. A custom recovery is necessary to do this.
    After completing these steps your phone will be rooted, the phone will have a custom recovery installed, and the phones bootloader will be unlocked. This, in our opinion, is the most practical and beneficial method for rooting your phone. It gives you some basic adb/fastboot knowledge, and should hopefully help you have a decent understanding of what is going on. Also this method will work regardless of what android version your phone has.

    If you are confused by anything in this guide, we would highly suggest getting it clarified being before moving on. Ask your question in this thread and we or someone else will likely answer. Also we would suggest that you read over the whole thread a few times before actually doing anything to the phone.

    Before you proceed please OTA up to 3.5.3 as TWRP has an issue with Decryption on 3.5.1

    DECRYPTION NOT WORKING?

    If your device isn't decrypting in TWRP, chances are you still have the old crypto key format from the 3.5.1 release firmware.

    You can solve this by updating to 3.5.3 and changing your boot up password in your device OS's settings.

    By changing your password after updating to 3.5.3 or newer, your OS will rewrite your crypto key to be compatible with TWRP.

    You are free to disable your password after this if you don't want one, and TWRP will decrypt with the default password.
     
    Last edited: Dec 2, 2016

    #1
  2. Funk Wizard KitKat Moderator Nov 22, 2016

    Funk Wizard, Nov 22, 2016 :
    Setup, Preparation and Prerequisites

    Basic tasks that may be referred to throughout this guide:


    • Open command prompt - Press Shift + Right Click anywhere on the screen and select Open Command Window here/
    • Enter fastboot mode- Turn the phone off. Hold volume up + power until the "fastboot" screen appears. [Alternatively, if Advanced Reboot is enabled, you can press Reboot -> Bootloader from the power menu.]
    • Enter recovery mode - Turn the phone off. Hold volume down + power until the "OnePlus Logo" screen appears. [Alternatively, if Advanced Reboot is enabled, you can press Reboot -> Recovery from the power menu.]

    ADB and Fastboot Installation
    1. Download the ADB For Windows from here :- https://drive.google.com/open?id=0B0MKgCbUM0itNVB1elljU2NPR0k

    Or You can find a universal ADB & Fastboot Tool here

    Or you can manually update Fastboot and ADB binaries here



    2. Run the .exe file downloaded from above as Administrator.
    3. Press 'Y' every time the installer asks for.
    4. Continue Driver Installation.

    Now,ADB and Fastboot have been installed on your PC. Great !


    Some Important Things

    • Show File Extensions - Open a command prompt window and run "Control folders" (without the quotes). Go to the View tab and uncheck the "Hide extensions for known file types" option. This will help avoid confusion when renaming files.
    • Battery - Ensure that your phone has at least 60% battery remaining, and that your PC is plugged in and wont shut down spontaneously during the process. The procedure doesn't take very long , but its best to have enough charge in case something goes wrong.
    • Backup (Optional) - Unlocking the bootloader will/should completely wipe all data from the device. This includes apps, settings and even the contents of the internal sdcard (pictures, music, etc.). Copy all important files off the phone onto a PC or upload them to a cloud.
    • USB Debugging - On your phone go to Settings > About phone > Tap on Build number 7 times. This will enable Developer options. Now go back to Settings > Developer options > Enable USB debugging
    • Enable OEM Unlocking - On your phone go to Settings > Developer options. Then enable the 'OEM Unlocking' option. Also,a free advice, make sure that from now on,OEM unlocking option is enabled before you reboot. Sometimes,it might get disabled itself.
    • Enable Advanced Reboot - On your phone go to Settings > Developer options. Then enable the 'Advanced Reboot' option.
     
    Last edited: Nov 29, 2016

    #2
  3. Funk Wizard KitKat Moderator Nov 22, 2016

    Funk Wizard, Nov 22, 2016 :
    • Unlocking Bootloader
    • Turn the phone off. Then boot it into fastboot mode by holding volume up + power. The phone will display "fastboot" text indicating that it has successfully entered fastboot mode.

    • Plug the phone into your PC, then open a command prompt window on the desktop (Shift + Right Click -> Open Command Window here) and type :-
    Code:
    fastboot devices
    • This command will list the connected devices. If your phones serial number shows up you are good to go and may continue. If the phone is NOT listed this indicates that your drivers are not installed correctly. In order for you to continue you must fix your drivers so that your phone is listed under fastboot devices.

    • If the phone has been recognized by the command above, proceed to unlocking the bootloader with the following command:
      Remember that this step will/should wipe EVERYTHING off the phone

    • Code:
      fastboot oem unlock
    • You would be greeted with a Unlock Bootloader Warning page, hit the vol button to select Yes and turn it blue and Hit the Power Button to execute the selection

    • You your device your reboot, show you a Secure boot warning, reboot into stock recovery and wipe all data. Once done, your phone will reboot into the OS Continue to the next step to install Custom Recovery ...
     
    Last edited: Mar 8, 2017

    #3
  4. Funk Wizard KitKat Moderator Nov 22, 2016

    Funk Wizard, Nov 22, 2016 :
    Flashing TWRP:

    twrp.png

    WARNING: The OnePlus 3T stock boot image has dm-verity, which prevents you from booting if you swipe to enable system modifications!

    SOLUTION: Follow the full rooting steps below, in order, to allow system modifications without the risk of a boot loop!

    Downloads
    Download a custom recovery and the SuperSU zip below:

    Unified TWRP | Credits @eng.stk

    SuperSU | Magisk


    Stock Recovery (N - 7.0)
    Stock Recovery (MM - 6.0)

    Download the latest dm-verity and forced encryption disabler zip


    PS: Flash DM Verity and Format Data only if you want to stay unencrypted else you may just skip and continue with flashing SuperSU

    Download all these files and place it on the phone internal memory or a USB OTG.

    Wait until the phone has fully booted up into android, then adjust the following settings on the phone:
    • USB Debugging - On your phone go to Settings > About phone > Tap on Build number 7 times. This will enable Developer options. Now go back to Settings > Developer options > Enable USB debugging
    • Enable OEM Unlocking - On your phone go to Settings > Developer options. Then enable the 'OEM Unlocking' option and make sure that from now on,OEM unlocking option is enabled before you reboot. Sometimes,it might get disabled itself.
    • Enable Advanced Reboot - On your phone go to Settings > Developer options. Then enable the 'Advanced Reboot' option.
    • Turn the phone off. Then boot it into fastboot mode by holding volume up + power.
    • Rename the recovery file that you downloaded above to recovery.img. *Make sure that you rename it to recovery.img NOT recovery.img.img* ,Make sure that this file is placed on the desktop.
    • Open a new command prompt on desktop and run the following commands:
      Code:
      fastboot flash recovery (file name).img
    • Once the flash has completed, Don't use the "Fastboot Reboot" Command Instead Unplug Your phone then Manually boot it into recovery by keeping Power + Volume Down button pressed or you can also use the command:
    • Code:
      fastboot boot recovery.img
    PS: DO NOT BOOT IN OS JUST YET AND CONTINUE TO THE NEXT ROOTING POST
     
    Last edited: Jun 18, 2017

    #4
  5. Funk Wizard KitKat Moderator Nov 22, 2016

    Funk Wizard, Nov 22, 2016 :
    Rooting:

    PS: Flash DM Verity and Format Data only if you want to stay unencrypted else you may just skip and continue with flashing SuperSU


    This is a continued post from the above post:

    Now when the phone will boot into the TWRP mode:
    You will reach the screen asking you if you want to allow system modifications.
    By swiping right, you will trigger dm-verity, and if you don't follow the next step you will be unable to boot!

    If you are going to root your device and follow the rest of these steps, then it is safe to swipe right and enable modifications.


    Select your preferred Language, Tap “Never show this screen on boot again,” and Swipe allow modification.

    • Without leaving TWRP, transfer the no-verity-opt-encrypt zip to your device over MTP and flash it or select it from internal as placed before and flash it (This will also allow you to use [Format Data] to completely disable your encryption if desired)
    • Go to “Wipe” section and tap “Format Data”, and type “yes” (If you want to mount internal storage).
    • Navigate to Install Zip and select SuperSu or Magisk to root OnePlus 3T.
    • Swipe to install SuperSu or Magisk and reboot your device.
    Keep in mind that the first boot after wiping the phone may take longer than usual, as the phone will need to rebuild the dalvik cache and initialize other first boot and would reboot a few times due to SuperSU Flash.

    Congrats! That is all! Your phone now has an unlocked bootloader, a custom recovery installed and is rooted. Enjoy !!

    The very first thing i highly recommend you to do now is to take EFS Backup and save it at your cloud and PC. It is very very important.
     
    Last edited: Jun 18, 2017

    #5
  6. Funk Wizard KitKat Moderator Nov 22, 2016

    Funk Wizard, Nov 22, 2016 :
    Making a Nandroid Backup

    Warning: before you make a backup with TWRP you must remove all lockscreen security. If you do not do this you will not be able to unlock your device after restoring your backup (entering your pin will result in an "incorrect pin" message), you'll be forced to perform a factory reset to boot into Android. To remove lockscreen security go to Settings>Security>Screen Lock and set it to swipe/none.

    A Nandroid Backup is a very important thing to have before installing any custom software on your device. It's basically a backup of your stock system that you can fall back on if anything goes wrong or if you just want your stock ROM back. You can also use Nandroid Bckup to create a backup of your favorite ROM set up exactly the way you like it. The backup you create can be easily restored using the restore tool in TWRP recovery.

    1. Boot into TWRP Recovery .
    2. Go to Backup Menu and select all the listed partitions.
    3. Swipe to take Backup. This proces should take 3 to 4 minutes.
    4. Reboot System
    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

    1. Reboot the phone and (if you've set a PIN) enter it to decrypt the storage one more time. After that you can simply unlock your phone with a swipe.
      1. Go into Settings > Security and set your preferred unlock method again, Android will ask you if you want to set a boot-time code too so select as per convenience.
    1. Boot into TWRP Recovery .
    2. [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.
    3. Go to Restore Menu and select the backup you want to restore.
    4. Select the partitions you want to restore.
    5. Swipe to Restore. The process will take some time.
    6. Reboot
    **********************************************************************************

    Screenshots attached for the entire process :D

    Device with Initial Build 2.png

    OTA Received 1.png

    OTA Downloaded 5.png

    OTA Installed 7.png

    Enable OEM Unlock 3.png

    Enable USB Debugging
    4.png

    Developer Options 8.png

    Unlock Bootloader
    OEM UNLOCK.JPG

    Flash TWRP Flash TWRP.JPG

    TWRP Welcome Screen T1.png T2.png

    Flash DM Verity Flash No Verity.png Flash NV.png

    Flash SuperSU Flash SuperSU.png Flash SU2.png
     
    Last edited: Dec 19, 2016

    #6
  7. Funk Wizard KitKat Moderator Nov 28, 2016

    Funk Wizard, Nov 28, 2016 :
    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.

    1. Open up Terminal Emulator on your phone (if you don't have it you can download it here).
    2. 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):
      Code:
      su
    3. If this is the first time you've used Terminal Emulator a Superuser or SuperSU popup will appear, make sure you grant root access.
    4. Now enter these two commands:
      Code:
      dd if=/dev/block/sdf1 of=/sdcard/modemst1.bin bs=512
      
      Code:
      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, see the next post.

    Restoring an EFS Backup

    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.

    1. Boot into fastboot mode (power + volume up) and connect your phone to your PC via usb cable.
    2. Keep modemst1.bin and modemst2.bin (backed up earlier) on your desktop and open command window there.
    3. These fastboot commands will restore the files:
      Code:
      fastboot flash modemst1 modemst1.bin
      
    4. Code:
      fastboot flash modemst2 modemst2.bin 
    5. Reboot your device.
      Code:
      fastboot reboot 
    Now disconnect phone from PC. Hope your IMEI etc is back.

    That's it for the guide. Enjoy !
     
    Last edited: Dec 19, 2016

    #7
  8. Funk Wizard KitKat Moderator Nov 28, 2016

    Last edited: Dec 9, 2016

    #8
  9. Funk Wizard KitKat Moderator Nov 29, 2016

    Last edited: Jan 8, 2017

    #9
    Vladi69 and Black River like this.
  10. ggkameleon Gingerbread Nov 30, 2016

    ggkameleon, Nov 30, 2016 :
    Hi ! Good day. I see you make thread for the Op3 T
    I read all your thread for the Op3 "how to update"
    You don't make for op3 oos 3.2.8 ?
    I have the Op3 and I'm afraid that the op3 is left out ?
    You will continue to support op3 ?
     

    #10
    Shubham Sharma324c17 likes this.
  11. brunolouviers Cupcake Nov 30, 2016

    brunolouviers, Nov 30, 2016 :
    Hi there! I'm having a curious problem.

    After installing the recovery without any kind of problem, I can't get into it. When I use power down+power button, it tries, but the led goes white and nothing happens.

    It's kind of annoying because I can't update to 3.5.3.

    Any solutions?
     

    #11
  12. Funk Wizard KitKat Moderator Nov 30, 2016

    Funk Wizard, Nov 30, 2016 :
    Yes buddy i would continue my support for OP3, Ive been keeping busy lately at work so did not get an opportunity to update the thread. I shall try doing so tonight. Thanks for your support

    Are you talking about stock recovery or twrp.. Try flashing the recovery via fastboot again and follow the process on the OP
     

    #12
    ggkameleon likes this.
  13. ggkameleon Gingerbread Nov 30, 2016

    ggkameleon, Nov 30, 2016 :
    Thank you ;-) to support again the OP3 !!! No problem I understand...
     

    #13
  14. imattv4 Ice Cream Sandwich Nov 30, 2016

    imattv4, Nov 30, 2016 :
    For those who know how to root / unlock, here's a simplified post:

    1. Download all the things
    2. Flash all the things
    3. Profit
     

    #14
    ovennotevenonce likes this.
  15. DerDoktor Honeycomb Dec 1, 2016

    DerDoktor, Dec 1, 2016 :
    Is there a way to disable the "Your device is unlocked and can't be trusted" notification?
     

    #15
  16. Funk Wizard KitKat Moderator Dec 1, 2016

    Funk Wizard, Dec 1, 2016 :
    Not that i am aware of
     

    #16
  17. DerDoktor Honeycomb Dec 1, 2016

    DerDoktor, Dec 1, 2016 :
    When I use the
    fastboot boot recovery.img

    command it boots to TWRP just fine, but when I boot into recovery from the phone, the screen stays black and only the LED is glowing white. Does anyone know why this can happen? I flashed the recovery twice from two different PCs.
    The rest of this tutorial works fine :) great job Funky!
     

    #17
  18. Ayuvelo Gingerbread Dec 1, 2016

    Ayuvelo, Dec 1, 2016 :
    I also get a black screen with white LED even after trying to flash twrp again via fastboot.

    Also when you "fastboot oem unlock" you have to choose yes on the phone, then it erases everything and immidiatly restarts after. Thought you may wanna know :)
     

    #18
  19. DerDoktor Honeycomb Dec 1, 2016

    DerDoktor, Dec 1, 2016 :
    Glad I'm not the only one! :)

    I also noticed that I can't enter a pattern to decrypt the storage
     

    #19
  20. G_Claudio_Spinelli_RYmh Cupcake Dec 1, 2016

    G_Claudio_Spinelli_RYmh, Dec 1, 2016 :
    Same here, white LED but does not start recovery.
     

    #20