FORUMS
Remove All Ads from XDA

[GUIDE] How to * Unlock * Flash TWRP * Root * OnePlus X [Including Oxygen 3.1.3]

3,027 posts
Thanks Meter: 2,372
 
By the Doctor, Forum Moderator on 7th November 2015, 12:19 AM
Post Reply Email Thread
Notice: Rooting your device will break OTAs because they require an unmodified system, so you might want to check for updates before rooting your X. However, there is a workaround:
  1. Boot into TWRP via step 5E below, but DO NOT flash it (step 5D)!!
  2. Do a backup of your completely stock, unrooted ROM
  3. Root the device by flashing SuperSU...zip
When an OTA hits, you can get it by doing this:
  1. Boot into TWRP again without flashing it (same as step 1 above)
  2. Restore your stock, unrooted ROM (from step 2 above)
  3. Apply the update from stock recovery
  4. Backup the unmodified ROM with the update if you want, then re-root as above.

Note: You will lose any changes, mods or app data since you did the backup, but hey, at least the OTA is applied.

If you get stuck with an update that won't flash and you haven't backed-up your unrooted ROM as above, look here:

[Guide] How to Install OTA's with TWRP, and please hit thanks for @SpiritBreak3r


_____________________



Disclaimer: Rooting does not void the OnePlus X’s warranty, though damaging your hardware (i.e., burning up your CPU by overclocking, hardbricking the device) will. You proceed at your own risk! I accept no responsibility for what you do with your phone. Follow the directions closely, and the odds are you will succeed without any trouble. If you are not sure what you are doing, do some more research before you try. If you get confused with terminology, try looking here for answers or Google it. If you get stuck, post a question in the thread—we're here to help you.


Preliminary steps

1. Make sure that your phone is always charged above 50%!!!
Running out of battery in the middle of flashing something could brick your phone.

2. Make sure that your computer can properly communicate with the device:
We will be issuing commands to the phone from your PC via the USB cable using Android’s SDK tools, in particular ADB and fastboot. If you have not done so already, you must install the following on your Windows computer for this to work:
  1. Java runtime
  2. The Universal Android ADB Driver for Windows.
  3. SDK tools for Android (alternately just ADB & fastboot). Remember where this is installed on your harddrive for later!
You can verify the connection between your PC and phone by running the following procedure:
A. With the phone booted normally, connect it to your computer with the USB cable.
B. Enable Android debugging by going to Settings > About phone and tapping on “Build number” 7 times.
C. Go to Settings > Developer options and check “Android debugging”. A dialogue box will appear asking you to authorize your computer’s RSA fingerprint. Click “Always allow...”

D. Open a command prompt in Windows and navigate to the folder where you put SDK tools for Android (ADB & fastboot) above.
E. Type the following command:
Code:
adb devices
You should get a return like this:

If you cannot get the connection to work:
1. Check your USB connection, then verify that Android debugging is enabled in settings and that your computer’s RSA fingerprint has been authorized.
2. Still not working? Open Device Manager in Windows and make sure that you don’t have a yellow exclamation point next to something like “Android Device” or “One.” This would indicate a driver problem that must be resolved. Try re-installing the Universal Android ADB Driver for Windows, and make sure to restart your computer. Once you’ve rebooted, if you still have a yellow triangle, right-click on the device and select “Update Driver Software,” then “Search automatically for updated driver software.”
3. If you still have a yellow exclamation point, then try forcing the driver to install:
  • In Device Manager, right-click on the device and select “Update Driver Software.”
  • Select “Browse my computer for driver software”
  • Select “Let me pick from a list of device drivers on my computer”
  • Select “ADB Interface” from the list
  • Select manufacturer “Google”
  • Select “Android Testing Interface Version xxx”
  • Click “Next.” If you get a warning, select “Yes” to continue and wait for the driver to install properly.

3. Know how to enter “fastboot mode” on the OnePlus X
To root the device, you must be competent at booting it into fastboot mode. There are two ways to accomplish this:
  1. Power off the phone. Then simultaneously hold down the volume up & power buttons until it vibrates. When done correctly, you will see the words “Fastboot Mode” on a black screen. If not, you dumb-thumbed it, and the device will boot normally into Android. Power off the device and try again.
  2. With the phone running Android normally and Android debugging enabled (see above), open a command prompt in Windows, navigate to the folder where you installed SDK tools (ADB & fastboot) and type:
Code:
adb reboot bootloader

Rooting the OnePlus X

There are three essential steps to rooting the device:
  1. Unlock the bootloader
  2. Flash or boot into TWRP custom recovery [For OxygenOS 3.1.3 use TWRP blu_sp★rk r175]
  3. Flash SuperSU...zip from recovery [For OxygenOS 3.1.3 use SuperSU v2.78 SR1 beta]
However, we're going to add a few more to protect your data and device in case something gets borked.

1. Backup your phone’s data
Unlocking the bootloader will involve doing a factory reset resulting in the loss of all accounts, emails, texts, apps and app data, pictures, music, etc. on the device. Move anything you need to keep onto your PC or a cloud service like DropBox.


2. Unlock the bootloader
2A.Go into Developer Options and enable bootloader unlocking
2B. Boot the device into fastboot mode. (Simultaneously hold down the volume up & power buttons until it vibrates.) You should see a black screen with the words “Fastboot Mode”.
2C. Plug in the USB cable.
2D. Verify that your device is connected with this command:
Code:
fastboot devices
You should get a return like the image above under Preliminary Steps
2E. Unlock the bootloader using the following commands:
Code:
fastboot oem unlock
The device will unlock the bootloader, erase all user data and reboot itself into Android. You will have to set up everything from scratch.


3. Re-enable Android debugging
3A. Re-enable Developer options by going to Settings > About phone and tapping on “Build number” 7 times.
3B. Go to Settings > Developer options. Check “Android debugging” and re-authorize your computer’s RSA fingerprint.


4. Download SuperSU zip
4A. Head over to Chainfire’s CF-Root thread and download the SuperSU access management tool from the “CWM / TWRP / MobileODIN installable ZIP” link. It will probably called something like UPDATE-SuperSU-v2.XX.zip. This zip file will root your device and install the SuperSU access management app in one smooth motion. Hit the thanks button for Chainfire or donate to his Paypal account and buy him a Coke.
NOTE: For OxygenOS 3.1.3 use SuperSU v2.78 SR1 beta
4B. Copy UPDATE-SuperSU-v2.XX.zip to your phone’s SD card.


5. Flash TWRP custom recovery
5A. Download TWRP recovery.
NOTE: For OxygenOS 3.1.3 use TWRP blu_sp★rk r175
5B. Place file you downloaded above to the location where you installed SDK tools (ADB & fastboot).
5C. Boot the device into fastboot mode and connect it to your computer with the USB cable.
5D. In this step, we will replace your stock recovery with TWRP recovery.
Note: This step is optional. If you want to root but preserve stock recovery, skip straight ahead to step 5E below. Thanks @rockuppl for the reminder.

Open a command prompt in Windows and navigate to the folder where you installed SDK tools (ADB & fastboot). Type the following commands:
Code:
fastboot flash recovery twrp-3.0.0-0-onyx.img
5E. Reboot into TWRP recovery with the following command.
Code:
fastboot boot twrp-3.0.0-0-onyx.img
You should now see the custom recovery you just flashed, not the stock recovery.


6. Backup your stock ROM before making any changes
In TWRP press “Backup.” <--- See how simple this is???

Don’t be a noob—backup your device!!! Right now we don't have stock boot debuggable image files for the OnePlus X, so borking your device could leave you with a nice paperweight until we do. Restoring from a backup in recovery is easy, and only works if you've backed-up first


7. Root the device
7A. The device should still be in recovery from step 6 above. Go back to the main menu and press “Install,” find UPDATE-SuperSU-v2.XX.zip on the SD card, then flash it.
7B. Reboot the phone. It is now rooted!
7C. Go to the app drawer and open SuperSU. Update the binary if prompted. Its icon looks like this:

7D. Download and install Root Checker from the Play Store to verify that you have root access.
The Following 79 Users Say Thank You to the Doctor For This Useful Post: [ View ] Gift the Doctor Ad-Free
 
 
7th November 2015, 02:43 AM |#2  
Senior Member
Flag Bangalore
Thanks Meter: 81
 
More
Yes I already own the phone and I see the bootloader unlock switch in dev options. I also checked the stock recovery which gives options to flash files from phone memory or otg. So it must be fairly easy. But I still don't want to risk it without it being tried and tested. If there were a custom recovery I could have also backed up the factory image. Only choice is to wait and see I guess
The Following User Says Thank You to Savya For This Useful Post: [ View ] Gift Savya Ad-Free
7th November 2015, 04:29 AM |#3  
ukanth's Avatar
Recognized Developer
Thanks Meter: 2,783
 
Donate to Me
More
I could try today evening... will update here.
The Following 2 Users Say Thank You to ukanth For This Useful Post: [ View ]
7th November 2015, 05:16 AM |#4  
Member
Flag Earth
Thanks Meter: 11
 
More
@CafeKampuchia
Is it ok to flash supersu.zip with stock recovery.
Before flashing supersu.zip, will unlock bootloader . Will follow the guide from oneplue two procedure to unlock..
7th November 2015, 05:24 AM |#5  
the Doctor's Avatar
OP Forum Moderator
Flag In the TARDIS
Thanks Meter: 2,372
 
More
Flashing supersu is safe on hundreds of devices, but I don't have the X so I can't say one way or the other.
7th November 2015, 12:46 PM |#6  
Junior Member
Flag Paris
Thanks Meter: 8
 
More
I tried the OnePlus One tutorial to unlock bootloader and root it thanks to this guide.

When it comes to install TWRP, adb tells me it's ok but when I boot into recovery, it's the "official" one that show up.

Even from this recovery, I tried to install the SuperSU.zip, but it keeps telling me it failed, so I think I'll just wait for someone to do it correctly
The Following User Says Thank You to Knockys For This Useful Post: [ View ] Gift Knockys Ad-Free
7th November 2015, 01:21 PM |#7  
the Doctor's Avatar
OP Forum Moderator
Flag In the TARDIS
Thanks Meter: 2,372
 
More
Quote:
Originally Posted by Knockys

I tried the OnePlus One tutorial to unlock bootloader and root it thanks to this guide.

When it comes to install TWRP, adb tells me it's ok but when I boot into recovery, it's the "official" one that show up.

Even from this recovery, I tried to install the SuperSU.zip, but it keeps telling me it failed, so I think I'll just wait for someone to do it correctly

I wouldn't try flashing a recovery for another device, especially if the stock recovery isn't available.

I'm surprised that supersu wouldn't flash from stock, though.
7th November 2015, 01:27 PM |#8  
Junior Member
Flag Paris
Thanks Meter: 8
 
More
Quote:
Originally Posted by CafeKampuchia

I wouldn't try flashing a recovery for another device, especially if the stock recovery isn't available.

I'm surprised that supersu wouldn't flash from stock, though.

Well I thought that TWRP was for all devices and I already went to the stock one before installing TWRP without success to flash SuperSU.

But apprently, installing TWRP the way I did wasn't the right way because I still boot to the stock recovery :/
7th November 2015, 01:31 PM |#9  
Member
Flag Earth
Thanks Meter: 11
 
More
Quote:
Originally Posted by Knockys

I tried the OnePlus One tutorial to unlock bootloader and root it thanks to this guide.

When it comes to install TWRP, adb tells me it's ok but when I boot into recovery, it's the "official" one that show up.

Even from this recovery, I tried to install the SuperSU.zip, but it keeps telling me it failed, so I think I'll just wait for someone to do it correctly

Hi, after unlocking bootloader, you are not able to update/flash supersu.zip from stock recovery? right?
if it so, then we need to wait for custom recovery to flash root.

Thanks.
7th November 2015, 01:33 PM |#10  
the Doctor's Avatar
OP Forum Moderator
Flag In the TARDIS
Thanks Meter: 2,372
 
More
Quote:
Originally Posted by Knockys

Well I thought that TWRP was for all devices and I already went to the stock one before installing TWRP without success to flash SuperSU.

But apprently, installing TWRP the way I did wasn't the right way because I still boot to the stock recovery :/

No, TWRP is definitely not for every device. You have to use the version made for your specific device.
7th November 2015, 01:36 PM |#11  
Junior Member
Flag Paris
Thanks Meter: 8
 
More
Quote:
Originally Posted by CafeKampuchia

No, TWRP is definitely not for every device. You have to use the version made for your specific device.

My bad then ahah

Quote:
Originally Posted by mjose

Hi, after unlocking bootloader, you are not able to update/flash supersu.zip from stock recovery? right?
if it so, then we need to wait for custom recovery to flash root.

Thanks.

Yes it fails on stock recovery, we'll have to wait for a custom one indeed...
The Following User Says Thank You to Knockys For This Useful Post: [ View ] Gift Knockys Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes