Tuesday, May 19, 2015

rooting - How to root OnePlus One?


I want to root my shiny OnePlus One device aka flagship killer. There is no dearth of guides available on Internet and accessible easily via Google, but I'm not sure which one to follow as I don't want my device to face issues during rooting which could make my phone unbootable.


How can I root my phone safely?





  • Device : OnePlus One (bacon)

  • Android version : CM 11S, COS12, or COS13

  • Status: Untouched bootloader

  • Storage: 16GB or 64GB




Answer



It is true that the guides available for this device are extremely large in quantity. Rooting OnePlus One is fairly easy, safe and doesn't require any prerequisite knowledge of Android OS internals, though having it would ease you to root with confidence.


Note #0: The instructions will wipe everything on your phone including Stock Recovery, and you might possibly not receive OTA updates (I although receive them with no issues). Also, while this guide may seem lengthy (since written from the perspective of a completely new user), the instructions are one of the safest to ensure that any troubleshooting, if required, can be done easily.


Note #1: If you're worried about your data, whatsoever it is, please refer to this one-stop guide - Full Backup on non-rooted devices. I personally prefer adb backup combined with Helium app available at Play Store for free.


Following instructions require ADB and Fastboot tools to be installed. Regarding installation, there is a very helpful guide here - Is there a minimal installation of ADB.



  • Windows users may look here and this for dedicated solution, or use this popular hassle free installation tool called 15 seconds ADB Installer suggested at this guide.

  • As for Linux users, ADB and Fastboot are usually available in the repositories of most of the popular distributions and covered already in this aforementioned guide. See this if in want of an easy installation. Many errors faced in using them are already answered on Android Enthusiasts. Otherwise, running as root user on system (not recommended) solves most of them.

  • I'm unfamiliar with OSX so can't recommend anything :(



Note #2: Before proceeding for further instructions, make sure your device is working fine with ADB and Fastboot.




  • This is required for any OS user to verify (step 3. in Windows section, and Useful fastboot commands) here for smoother further experience.




  • Also, when you'll try adb related commands, a confirmation on your device will be shown to accept the ADB connection initiated from your system. Allow it and check the box to remember it for future,




Note #3: - I'm instructing this as an Ubuntu Linux user, although rooting from Windows is fairly simple.




  • Once you have everything setup and backed up, you need to open a Command Prompt with elevated privileges and enter into the ADB installation directory.

  • Mostly the command will be like cd folder_location\ where folder_location is the location of the ADB installation folder.

  • If this is overwhelming at first, you may refer to this guide (see instruction 0. Installing proper fastboot and adb drivers).

  • About Linux users, I'm assuming they are aware of basic know-how of playing with their favorite terminal application. Google is your friend, always remember.


Note #4: Keep your phone adequately charged, possibly above 70% before venturing into anything unknown to you such as rooting or flashing. Also, this guide summarizes many points of this answer.




Part #1: Unlock the Bootloader of OPO


While this is not important to continue, you may look them out of curiosity:




Instructions:



  1. Plug OPO into system using USB cable and enable the USB debugging.

  2. Gain Administrative in Windows or Superuser in Linux privileges in your CMD/Terminal. For Windows, enter into the ADB directory as well.

  3. Type adb devices to confirm that your device is connected. If you can't see your device somehow, consider querying Google.

  4. Enter adb reboot bootloader to put into Fastboot mode.

  5. Enter fastboot devices to confirm fastboot mode is getting detecting by system. In case if you can't see any device serial no. or something similar, then query the same into Google for troubleshooting.

  6. Enter fastboot oem unlock - this will unlock the Bootloader of OPO and as a default mechanism, will wipe your device.

  7. Enter fastboot reboot to reboot your device. If this doesn't reboot the device or stay stuck at Fastboot screen, you can power-off and power-on by pressing down power key consecutively with few seconds gap.



Congrats! your device is now unlocked for innumerable modifications.




Part #2 : Install and boot into a Custom Recovery via Recovery Mode


You may check them out of curiosity:



Instructions:


While I personally prefer Philz Touch Recovery (being elegant), I've instructed for the most popular one, the TWRP recovery. Instructions for Philz Touch Recovery and CWM are also similar. Apart from these three, I'm unaware of any other recovery for OPO.


(The instructions in this section are divided into two parts: 2.1 and 2.2)


2.1:




  1. Download any recovery viz. TWRP Official (preferred), Philz Touch, CWM, or TWRP Unofficial. Some folks prefer fork of Official TWRP called TWRP Unofficial. You may Google them to suit your needs.

  2. Rename1 the downloaded .img file into recovery.img. For Windows users, place this file into your ADB folder. For Linux users, either cd into the selected Download folder, or know the file path of downloaded file.

  3. Go to Settings -> Developer Options and uncheck Enable Cyanogen Recovery.

  4. Repeat steps 1-5 from Part #1 to enter into Fastboot mode with surety.

  5. Enter fastboot flash recovery recovery.img. Linux users who didn't cd into the selected download folder should replace recovery.img with file path of .img. This command will flash your downloaded Recovery into the Recovery partition of OPO, and as obvious, Stock Recovery can't be booted into.

  6. Repeat step 7 of Part #1.


Congrats! You've successfully replaced Stock Recovery with Custom Recovery.


OR,



Some folks claimed that OPO can be booted into live Recovery without replacing the Stock Recovery which ensured them OTA updates survives. I could not achieve success but they did. Follow 2.2 to boot into a live Recovery.


2.2:



  1. Repeat steps 1-4 of 2.1.

  2. Enter fastboot boot recovery.img. Linux users who didn't cd into the selected download folder should replace recovery.img with file path of .img. This Fastboot command will boot into the downloaded Recovery without touching any installed Recovery. It may take few seconds-minute to boot into this Recovery.


If you can see the Recovery with options like Install Zip, Advanced, etc, and TWRP or the name of your downloaded Recovery mentioned somewhere, then you've booted into your downloaded Recovery. Congrats! Otherwise, you may troubleshoot using Google or go with 2.1 straightly.




Part #3: Flash SuperSu zip and install SuperSu app to enable root access


You would be aware of rooting if you've come here for it. But in any case, you may look at some nicely written answers about Rooting, what rooting would enable you to do, or this short but useful guide at Lifehacker.



You can find many superuser clients that intercepts root access by apps in your device and interactively asks you to take action. Popular ones for OPO are SuperSu app by Chainfire and Superuser by Koush. I'll use the former one here.


Note that most of these Superuser apps requires their own binaries to be flashed into the system to work with their apks.


Instructions:



  1. Download SuperSu zip file from here. The name might be similar to UPDATE-SuperSU-vX.YZ.zip.

  2. Put this .zip file into the root directory (Home folder) of your Internal SD card. You can do so by firing up your favorite File Manager.



    • Users who used 2.1:


      • Easy way : Go to Settings -> Developer options and enable Advanced Reboot. Hold Power button, tap Reboot option and choose Recovery. Your device will now boot into the Recovery.

      • Typical way: Repeat steps 1-3 of Part #1 and then enter adb reboot recovery to boot into Recovery.



    • Users who used 2.2:

      • Repeat all the steps of 2.2 to boot into live Recovery.






  3. Tap Install Zip. Select .zip file you downloaded and choose Yes to install the file. It will show some text as output and will eventually complete. This step will flash SuperSu app compatible binaries into your Android OS. If any unexpected error shows up, query the same into Google Search.

  4. You may now Reboot you device.

  5. (Update: not needed anymore) Go to Play Store and install SuperSu app.

  6. Launch the app. If it shows a popup, choose Continue and you'll be presented with two options where you've to choose TWRP/CWM. It would cause a reboot. If you're not asked for anything by that app, then everything went fine and you're ready to use SuperSU as a superuser manager.

  7. You may now launch this app to tweak some settings suitable to your needs. Also, check whether it has been successfully installed and working or not by using any app that requests root access, such as these apps.




You've now successfully rooted your OnePlus One device. There are many methods which claims to be one-click, completely automated, etc. However, I can't possibly cover all of them and wouldn't, to keep the focus at only one method. :) Anyway, some notable mentions are:




  • Bacon Root Toolkit

  • OnePlus One Toolbox

  • See Methods/Apps in this answer to see what popular rooting methods exist for other Android devices; some might work on OPO as well.

  • You can look for a solution more easily on OnePlus Forums, since it's the common shared source of information for many OnePlus One users including me.


Objective Completed.




1 Per the information received from Rob W here, it is necessary to rename the downloaded recovery to recovery.img, else the fastboot command may execute but wouldn't take effect.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...