Android Modding Mondays: Restoring Oxygen OS the OnePlus Way

I don’t know if this will be a regular feature here, but I feel obliged to pass on any pearls of wisdom gleaned in this very specific area of expertise where and when I can. Root, custom ROMs and the like are, after all, the only thing that really differentiates Android from iOS at the end of the day.

The video above is from a thread on the official OnePlus forums, a guide for unrooting a OnePlus 3 and returning it to stock (as in “shelf stock”) condition. You would do this if, for example, you were prepping your device to be sold; you might also follow this procedure if, like me, you were flashing a major OS upgrade to your device. For anyone used to a Nexus there are some peculiarities as to how OnePlus does things, which I learned over the course of a few hours last Friday afternoon, and will now share with you.

So let’s say I was upgrading from Android Marshmallow to Nougat… On a rooted Nexus I would back up my apps and data using Titanium Backup, along with other local media like photos and transfer those files to a desktop computer. Then I would download a device-specific factory image from Google, flash all the partitions manually (I never bother with the “flash all” script) log into my new Android OS and after re-rooting the Nexus would then restore my apps with a fresh install of Titanium Backup from the Play Store.

Like I say OnePlus has their own way of doing things; they do offer downloads of Oxygen OS (and the major revisions to it), but only as flashable zips. So how is one to restore Oxygen from a custom ROM on their OnePlus 3, or perform a clean upgrade to Oxygen v4.x (Nougat) from v3.x (Marshmallow)? The key is OnePlus’ own recovery image, the one partition you can flash to your OP3 via fastboot.

Once you’ve backed up your phone the procedure, in broad strokes, goes like this:

  1. Download the desired flashable zip of Oxygen OS, and also the OnePlus recovery;
  2. Reboot your OnePlus 3 into fastboot mode and flash the OnePlus recovery;
  3. Still in fastboot, re-lock your bootloader via fastboot oem lock—this will wipe your device, and also whatever OS is installed on your phone;
  4. If the phone reboots after Step 3 immediately press and hold the Volume Down key to boot into the OnePlus recovery—understanding that at this point you do not have a bootable operating system on your phone;
  5. Use the OnePlus recovery to flash your zip of Oxygen OS via adb sideload;
  6. Boot into your new OS.
  7. If you want to re-root your phone don’t bother signing in to your Google account—instead go back into fastboot, unlock your bootloader, flash a custom recovery and then use that to flash a SuperSU.zip.

The OnePlus restore method does have some advantages over a Nexus-style restore; if something goes wrong you’ve at least got a working bootloader and recovery partition. There’s just that one tense moment when your phone will try to boot into an OS that isn’t there!

Source: OnePlus Forums