Pageviews

Posts

Followers

Popular posts

Archive for May 2016

Unlock/Root/Flash for OnePlus Two [GUIDE]

Friday 6 May 2016
Posted by Unknown



Intro


This post will serve as a location for basic how-to guides for the OnePlus Two. I'm going to start off with a couple of the more obvious ones and go from there. If anyone has any suggestions for additions please feel free to let me know.

Prerequisites:

You'll need a working adb/fastboot environment on your PC to get through some of these guides. Go here to download the Android SDK, which will give you most updated version of adb and fastboot. Scroll to the bottom of the page and find Other Download Options>SDK Tools Only, and grab the right version for your OS. While it's downloading create a folder in C:\ called SDK (C:\SDK). Once you've downloaded the zip you can extract it into your C:\SDK folder. Navigate to C:\SDK\android-sdk-windows and open SDK Manager.exe. In SDK Manager you need to install the following packages:

Tools> Android SDK Tools, Android SDK Platform-tools
Extras> Android Support Library

Once you have installed those, inside C:\SDK you should see some new folders, one of them will be called platform-tools, within that folder you should see fastboot.exe and adb.exe. I'll refer to this as your fastboot folder/directory or working folder/directory during this guide. To make sure adb is correctly installed, open a command prompt from within your fastboot folder (hold shift + right click, select open command prompt here) and issue this command:
Code:
adb version
If it returns a version number for Android Debug Bridge then you're good to go.

You'll find universal adb/fastboot drivers here, download it and follow the installer, then reboot your PC.

You can test adb by connecting your device to your PC while booted into Android (making sure that adb/usb debugging is enabled in Settings>Developer Options) with the screen unlocked and issuing this command:
Code:
adb devices
It should return your device serial number, if so, adb is working.

You can test fastboot by connecting your device to your PC while booted into fastboot mode (power + volume up) and issuing this command:
Code:
fastboot devices
It should return your device serial number, if so, fastboot is working.

By attempting any of the processes listed this thread you accept full responsibility for your actions. I will not be held responsible if your device stops working, catches on fire, or turns into a hipster and claims to have been modified before it was cool.




Index
  1. How To Unlock Your Bootloader
  2. How To Install A Custom Recovery On Your Device
  3. How To Make A Nandroid Backup With TWRP Recovery
  4. How To Root Your Stock Rom
  5. How To Install A ROM with TWRP Recovery
  6. How To Install A Custom Kernel With TWRP Recovery
  7. How To Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System




1. How To Unlock Your Bootloader
  • If you're on Hydrogen OS you'll need to go into Developer Options and enable unlocking first.
  • Power off your phone then boot into fastboot mode (power + volume up).
  • Connect your phone to your PC via usb cable.
  • Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here).
  • Check your fastboot connection by issuing this command:
    Code:
    fastboot devices
    It should return your device serial number, if not you need to make sure your drivers are installed correctly.
  • Once you've confirmed your fastboot connection issue this command:
    Code:
    fastboot oem unlock
    The device will now go through the automated unlocking process, just let it do its thing and it'll boot up into Android.

    Depending on the model of your device you may be greeted with a screen displaying Chinese text after issuing the fastboot oem unlock command. This screen requires your input to continue, the top option translates to proceed and the bottom option translates to cancel. Choose the appropriate option.
  • Go back to fastboot mode and issue this command to ensure that it worked:
    Code:
    fastboot oem device-info
    You'll see multiple lines of text on the screen, this is the one you need to pay attention to:
    Code:
    (bootloader) Device unlocked: true
    As long as that says true you've successfully unlocked your bootloader.
  • You can now reboot your phone using this command:
    Code:
    fastboot reboot
  • It's now safe to disconnect your usb cable.

Please note: this will erase all user data from your device, it is best to do this before you really start using the device and installing apps or putting data on the internal storage




2. How To Install A Custom Recovery On Your Device

Prerequisites: unlocked bootloader.
  • Download the recovery of your choice. Here's a link for official TWRP:
    https://dl.twrp.me/oneplus2
  • Make sure you check the md5 to verify its integrity.
  • Place the file in your fastboot folder (this is where fastboot.exe is located on your PC).
  • Put the phone in fastboot mode and connect it to your PC via usb cable.
  • Open a command prompt from within your fastboot folder (shift + right click, select open command prompt here), and enter the following commands:
    Code:
    fastboot flash recovery <filename>.img
    (Replace <filename> with the actual filename of the recovery, the recovery filename in the command will change depending on which recovery you're flashing)
  • Wait for the recovery to flash, it'll only take a few seconds, you'll get a finished message in your command prompt window once it's done. It's now safe to disconnect your usb cable.
  • Use the recovery button combo (power + volume down) to boot directly into recovery now, once you've booted into TWRP once you can reboot the phone as normal.




3. How To Make A Nandroid Backup With TWRP Recovery

Prerequisites: unlocked bootloader, TWRP recovery.

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 the backup tool to create a backup of your favourite ROM set up exactly the way you like it. The backup you create can be easily restored using the restore tool in TWRP recovery.

All you need to do is enter TWRP recovery, select the backup option from the TWRP home screen, check the system/data/boot boxes, and swipe to backup. The process will take a few minutes.




4. How To Root Your Stock Rom

Prerequisites: unlocked bootloader, TWRP recovery.
  • First you need to download SuperSU.
  • Enter TWRP recovery via the advanced power menu (or power + volume down).
  • Select the install option from the TWRP home screen.
  • Navigate to where you have SuperSU stored on your sd card and select it.
  • Swipe to install.
  • Once you've installed SuperSU you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button. That's it.


5. How To Install A ROM with TWRP Recovery

Prerequisites: unlocked bootloader, TWRP recovery.

Installing a ROM is a pretty straight forward and easy process. Before you install anything you should make a nandroid backup (instructions above).
  • Download a ROM and appropriate Gapps package and place on your device.
  • Boot into your custom recovery.
  • Perform a full wipe.
    • Select the wipe option from the TWRP home screen.
    • Select advanced wipe.
    • Check the system, data, cache, and dalvik cache options.
    • Swipe to wipe.
  • Install the ROM.
    • Select the install option from the TWRP home screen.
    • Navigate to where you have the ROM zip stored on your sd card and select it.
    • Swipe to install.
      Most ROMs will run an installer script at this point but some ROMs have what is called an Aroma Installer which allow you to choose some install options before the script runs.
    • You will also need to install the appropriate gapps package directly after installing the ROM.
  • Once you've installed all necessary zips you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button.

6. How To Install A Custom Kernel With TWRP Recovery

Prerequisites: unlocked bootloader, TWRP recovery.

A custom kernel can open up a new level of control over your device, such as overclocking/underclocking, undervolting, changing governors, changing I/O schedulers, adjusting colour calibrations, adjusting sound calibrations, and many other options.
  • Download a kernel that is compatible with your current ROM.
  • Check the md5 to verify its integrity.
  • Enter TWRP recovery.
  • Select the install option from the TWRP home screen.
  • Navigate to the kernel and select it.
  • Swipe to install.
  • You'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button.

Once your phone has booted up you can use a kernel tuning app to change governors, I/O scheduler, clock speed, and other options. Some of the popular kernel apps are Trickster Mod, No Frills, Kernel Tuner, Kernel Auditor, and many more.

7. How To Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System

Prerequisites: unlocked bootloader, TWRP recovery.

There may come a time when you accidentally wipe your OS while trying to perform a basic cache wipe in recovery. Don't laugh, it can happen to the best of us. The best way to insure yourself against being stuck in recovery is to keep a ROM zip or a TWRP/CWM backup (a nandroid backup) on your sd card at all times.
This solution seems like common sense but apparently there are quite a few people out there who don't store a ROM or backup on their phone. You might think it's easy to just mount the OTG storage and copy a ROM across to your phone from your PC (which is definitely an option), but there's always a chance that you won't be near your HDD or sd card at the time, or it won't recognise your phone properly. Basically you need to insure yourself against Murphy's law.