Unlock/Root/Flash for OnePlus Two [GUIDE]


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
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
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
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
- How To Unlock Your Bootloader
- How To Install A Custom Recovery On Your Device
- How To Make A Nandroid Backup With TWRP Recovery
- How To Root Your Stock Rom
- How To Install A ROM with TWRP Recovery
- How To Install A Custom Kernel With TWRP Recovery
- 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
- 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
- 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.
How to unlock your Droid Turbo bootloader, install TWRP and gain root access
READ THIS FIRST
Please consider the following:
- Ask yourself these two questions: "Why do I want to unlock my bootloader? Why do I need root access?" If the answer to either one of those is "I don't know," don't do it. Both of these actions weaken the security of your phone, and there's no reason to do that if you're not sure why.
- This guide is for the Droid Turbo, model XT1254. It is not for the Droid Turbo 2, and it is not for any phone that is not named Droid Turbo.
- Standard XDA rules apply. I'm not responsible for anything you do, and neither is anyone else other than you.
- I'm assuming that you are running a Windows PC. If you have a Mac, I can't help you. If you're running Linux, you shouldn't need help.
- This method is not free. It costs $25 (USD). If that's not okay with you, don't do this.
- Once your bootloader is unlocked, you CANNOT safely re-lock and unlock it again. See this thread for what happens when you try to do that:http://forum.xda-developers.com/droi...1#post65095391
Still here? Cool.
Section 0: Installing Firmware Version SU4TL-44
1. Go to Settings -> About Phone
2. Look at your Build Number. Is it SU4TL-44? Look at your System Version. Is it 23.21.44.quark_verizon.verizon.en.US vzw? Look at your Kernel Version. Is it 3.10.40-perf-g90ddf4a? If the answer to all of these questions is yes, skip to section 1. If the answer is no, keep reading.
3. Is your Build Number higher than SU4TL-44? If so, you may be out of luck. This guide will probably not work for you. In the future, please remember that the cardinal rule of unlocking anything is never, ever take the OTA unless someone knowledgeable tells you to.
BACKUP YOUR DATA IF YOU NEED TO PERFORM THE FOLLOWING STEPS! ALL DATA ON YOUR PHONE WILL BE ERASED!
4. Download and install Minimal ADB and Fastboot from here: Link.
5. Download and install the Motorola Device Manager from here: https://motorola-global-portal.custh...ail/a_id/88481
6. Download the SU4TL-44 firmware package from here: http://rootjunkysdl.com/getdownload....44_CFC.xml.zip
7. Extract the contents of the firmware package to the installation directory of Minimal ADB and Fastboot. The default install directory on 64-bit Windows is C:\Program Files (x86)\Minimal ADB and Fastboot.
8. Power off your phone.
9. Hold the volume down button and press the power button to boot into bootloader mode. You should see a green android lying on his back with his chest open, and some information about your phone. It's much less gruesome than it sounds.
10. Plug your phone into your PC.
11. Navigate to the Minimal ADB and Fastboot installation directory.
12. Double click on VRZ_XT1254_SU4TL-44_44_CFC.bat.
13. You should see a command prompt pop up, and the script will use Fastboot to flash all of the SU4TL-44 firmware images. When it finishes, it will say "press any key to continue." Press the "any" key to continue. Where's the "any" key, you ask? Keep looking. You'll find it.
Section 1: Unlocking the Bootloader
1. Download Sunshine from here: http://theroot.ninja/download.html
2. Move the apk file to a convenient location on your phone. If you downloaded it with your phone, it's in your downloads folder already, so leave it there.
3. Use any file browser on your phone to navigate to the folder that contains the Sunshine apk file. Tap on it to install it.
4. If a message comes up and says that you need to enable installation of apps from unknown sources, follow the instructions on that message to enable it.
5. Enable Wi-Fi on your phone if it is disabled. Even if you aren't connected to a Wi-Fi network, it still needs to be on.
6. Open your app drawer and start Sunshine.
7. Follow the instructions.
8. If, when your phone reboots, you see a "Warning: The bootloader is unlocked" message, you have successfully unlocked your bootloader. If you do not see this message, open Sunshine again and follow the directions again.
Section 2: Installing TWRP
Team Win Recovery Project is arguably the most important tool to have on a bootloader-unlocked phone. This is how you install it:
METHOD 1: Using Fastboot
This is the method that I prefer. If you can't get TWRP working properly using this method, skip to method 2 below.
1. Download and install Minimal ADB and Fastboot from here: http://forum.xda-developers.com/show....php?t=2317790. If you already did this in section 0, you don't have to do it again.
2. Download the latest TWRP .img file from here: https://dl.twrp.me/quark/
3. Download and install the Motorola Device Manager from here: https://motorola-global-portal.custh...ail/a_id/88481. If you already did this in section 0, you don't have to do it again.
3. Rename the file that you downloaded in step 2 to TWRP.img
4. Copy TWRP.img to the directory that you installed Minimal ADB and Fastboot to. The default location on an installation of 64-bit Windows is C:\Program Files (x86)\Minimal ADB and Fastboot.
5. Turn off your phone.
6. Hold the volume down button and press the power button to boot into bootloader mode. You should see a green android lying on his back with his chest open, and some information about your phone. Poor little guy...
7. Plug your phone into your PC.
8. Double click on the Minimal ADB and Fastboot shortcut that's on your desktop. It will open a command prompt.
9. Type "fastboot devices" without quotes and press enter. If it gives you your phone's serial number, you're good to go. If it gives you nothing, your device is not detected. This can happen for several reasons, and I won't discuss them here. However, if you followed these directions and all of your hardware is functioning properly, you should be good to go.
10. Type "fastboot flash recovery TWRP.img" without quotes and press enter. It should tell you that the flash was successful.
11. Highlight Recovery on your phone using the volume up and down buttons.
12. Press the power button to boot into TWRP.
13. TWRP will boot, and it will ask you if you want to allow write access to the system partition. IT IS VERY IMPORTANT THAT YOU ALLOW THIS. Check the box that says to never ask this question again.
14. Select Reboot, followed by System to boot the phone normally.
METHOD 2: Using Sunshine and TWRP Manager
1. Download TWRP Manager from the Google Play Store.
2. Open Sunshine.
3. Follow the instructions until Sunshine tells you that it has obtained root access.
4. Open TWRP Manager.
5. Tap Device Name and select Motorola Moto MAXX (quark).
6. Tap Install Recovery.
7. Hold the volume down button and press the power button to boot into bootloader mode.
8. Highlight Recovery with the volume buttons and press the power button to select it.
9. TWRP will boot, and it will ask you if you want to allow write access to the system partition. IT IS VERY IMPORTANT THAT YOU ALLOW THIS. Check the box that says to never ask this question again.
10. Select Reboot, followed by System to boot the phone normally.
Section 3: Gaining Root Access
If you intend to install a custom rom, these steps are not necessary. Custom roms almost always come with root access built in. Refer to the thread of your custom rom of choice for installation instructions.
If you do not want a custom rom, and you simply want root access on the stock Droid Turbo rom, continue reading.
1. Download SuperSU from here: http://download.chainfire.eu/supersu-stable
2. Transfer that file to a convenient location on your phone. If you downloaded the file with your phone, it's in your downloads folder. You can keep it there.
3. Turn off your phone.
4. Hold the volume down button and press the power button to boot into bootloader mode. You should see a green android lying on his back with his chest open, and some information about your phone. Andy, what have they done to you?
5. Use the volume up and down buttons to highlight "Recovery mode."
6. Press the power button to select Recovery mode.
7. Select Install from the TWRP main menu.
8. Navigate to the location where you saved the file that you downloaded in step 1, and select it.
9. Swipe the bar at the bottom of the screen to flash this zip file.
10. When it finishes, select Reboot System to boot your phone normally.
Section 4: Miscellaneous
Here are some links to stuff you can flash now that your bootloader is unlocked:
Official Cyanogenmod 12.1 (Android 5.1.1): https://download.cyanogenmod.org/?device=quark
Official Cyanogenmod 13.0 (Android 6.0.1) Preview Build: http://forum.xda-developers.com/moto...t1254-t3315912
Resurrection Remix (a great Cyanogenmod-based rom, Android 5.1.1): http://forum.xda-developers.com/moto...5-5-5-t3197643
Resurrection Remix Work in Progress (Android 6.0.1): http://forum.xda-developers.com/moto...remix-t3316232
Computerfreek274's optimized stock rom: http://forum.xda-developers.com/droi...ed1-0-t3255945
Change the splash screen (the bootloader unlocked warning message) that you see when you first start your phone: http://forum.xda-developers.com/droi...uests-t3262873
Xposed framework and installer (make sure to use the sdk22-arm version if you're running a lollipop rom, sdk23-arm if you're running marshmallow): Click Here
Pon-3 Audio Mod (modified and improved Viper4Android. It makes your phone sound better.): http://forum.xda-developers.com/show....php?t=2530976
Theme your TWRP with different colors: http://forum.xda-developers.com/andr...olors-t3310235
Section 5: Troubleshooting
Issue: When you try to boot TWRP, you see a screen that says "no command." TWRP does not boot.
Solution: The screen you are seeing is the stock Droid Turbo recovery menu (the menu that you're trying to replace with TWRP). If you see this after flashing TWRP, one of two things happened:
-You did not boot into the recovery menu immediately after flashing TWRP, and it was therefore replaced by the stock recovery menu.
-When you flashed TWRP, the process did not complete successfully.
The solution to both of these problems is to repeat section 2 and follow the instructions more carefully. If you used method 1 before, try method 2.
Issue: When TWRP asked you if you wanted to allow write access to the system partition, you selected no. Now you cannot flash anything.
Solution: At the main TWRP menu, select Mount. Uncheck the box that says "Mount system partition as read-only."
Toturial How to root Xiaomi Redmi2 and install CWM
ARE YOU SEARCHING TO ROOT YOUR REDMI 2 ?
DISCLAIMER:
DO THIS ON YOUR OWN. I'M NOT RESPONSIBLE FOR ANYTHING HAPPENS TO YOU AND YOUR DEVICE.
PLEASE DONOT MIRROR THE LINKS
THE METHOD WILL WORK FLAWLESSLY ON WINDOWS-8 WHILE YOU MAY ENCOUNTER SOME ISSUES ON WINDOWS-7.
STEP 1- FLASHING CWM ON YOUR PHONE
1.At first, you'll need the "adb" and "fastboot" tools. Get them HERE
2.Extract them into a folder, let's name it "Redmi2" (You can give your own name to the folder. That doesn't matter here.)
3.Now get the CWM .img file from HERE
4.Extract the "recovery.img" in the Redmi2 folder.
Now the folder will look like this-
5.Press and hold "shift" button and right click in the blank area of the folder and click on "open command promt window here". The command prompt will open.
6.Now turn off your Redmi2. Wait until it vibrates. After it's vibrated press and hold "Volume down and Power" keys together until it boots into "fastboot mode". Now connect the Redmi2 to your PC/Laptop through USB cable in fastboot mode itself.
7.Get to the command prompt now.
Now type: " fastboot devices " (without these- " " )
Like this-
8.Once you enter that command, you will get a non-empty name for the device meaning the device is connected. Proceed to enter the next command
9.Now enter the next command: " fastboot flash recovery recovery.img "
Like this-
10. Now this ends... :P
Type the last command: " fastboot reboot "
Like this-
11.Now your phone will reboot with ClockWorkMod(CWM) installed. CHEERS... 

FOLLOW THE SAME PROCEDURE FOR TWRP (LINKS ARE AT START OF THE GUIDE)
STEP 2- ROOTING YOUR PHONE
1. Firstly get the SuperSU.zip from HERE
2. Now copy the downloaded zip to your sdcard (not in any folder just in sdcard)
3. Boot into CWM recovery by turning off the phone and pressing "Volume UP and Power" button together after the phone vibrates.
4. Once CWM main menu is displayed, select "Install from zip" and browse to the zip that you downloaded earlier and select it.
5. Install the zip. If you get any warning, ignore and proceed.
6. After the installation is complete, reboot your device. (I think you can do that)
7. VOILA..!!! YOU ROOTED YOUR REDMI2 

IF YOU HAVE ANY QUERIES, ASK ME BELOW...
CREDITS:
1. I don't claim any credit for "adb and fastboot tools" and the "recovery.img" and "SuperSu.zip"
2. Thanks to @subhrajiNath on Miui english forums who wrote the original guides.
Thread link is here and here
1. I don't claim any credit for "adb and fastboot tools" and the "recovery.img" and "SuperSu.zip"
2. Thanks to @subhrajiNath on Miui english forums who wrote the original guides.
Thread link is here and here