ioana’s
internet website

Some notes about the OnePlus 6

The OnePlus 6 (codename enchilada) was a flagship phone released in 2018. It came with a Snapdragon 845, a 1080p AMOLED, a fingerprint sensor, and a really neat slider to change alert profiles. It’s a relatively old phone at this point but it’s still plenty fast for daily tasks, and can run fairly modern Android if that’s something you need.

On this page I’m collecting some notes I’ve picked up along the way using this phone, so I don’t have to keep re-learning them every single time.

Quick links

Custom ROMs and recoveries

Both LineageOS and TWRP have official builds for this phone. There is an unofficial archive of LineageOS builds, along with the official archive of TWRP builds. LineageOS runs very well, and will make for a great phone running recent Android (15 at the time of writing).

Not every firmware version works with every custom ROM or recovery; here is a table of versions that I was able to verify:

Stock firmwareLineageOS versionTWRP version
Android 8N/ATWRP 3.2.1-0
Android 9LineageOS 16TWRP 3.3.1-2
Android 10
Android 11LineageOS 22Newest TWRP

PostmarketOS

Support for PostmarketOS is quite good, it even has mainline support! That being said, it’s still PostmarketOS, so don’t expect a very smooth user experience quite yet. Things are improving quickly, though.

Refer to the wiki page for installation instructions and additional information.

SailfishOS

There is a good SailfishOS port for the OnePlus 6. Everything works well out of the box, except for Waydroid, which doesn’t seem to work after running “waydroid init” command. A friend of mine theorized that you would need to initialize it with the same LineageOS version that runs underneath Sailfish, which is 16 at the time of writing. This would leave you with a relatively old Android version. I didn’t attempt this.

Restoring the stock firmware or recovering from a brick

Regardless of what’s happened, the easiest way to get back to stock is probably to use the Qualcomm EDL mode. If you’re using Windows, people will recommend the MSM Download Tool for this, which should do everything by itself. You can find this tool together with various versions of the firmware on this XDA thread.

EDL mode flashing on Linux

The MSM Download Tool doesn’t work natively on Linux. It would work fine in a VM if you can do USB passthrough, but there is an easier (though slightly more manual) way to do this. You’ll need a few things:

First, unzip your firmware download; all you need from it is the .ops file, which contains the firmware itself. Follow the oppo_decrypt instructions to extract it. The set of files you’ll be left with are missing the necessary “patch” and “rawprogram” XMLs the flasher will read; these are all combined into “settings.xml”.

To split them back, you can use this Python script provided by chayleaf in this Github issue thread:

with open('settings.xml', 'rt') as f:
xml = f.read()
for intag, outtag, out in (('Program', 'data', 'rawprogram'), ('Patch', 'patches', 'patch')):
for pr in xml.split(f'<{intag}')[1:]:
num, data = pr.split('>', 1)
lines = filter(lambda x: x, map(lambda x: x.strip(), data.split(f'</{intag}')[0].split('\n')))
with open(f'{out}{num}.xml', 'wt') as f:
print(f'<?xml version="1.0" ?>\n<{outtag}>', file=f)
for line in lines:
print(' ', line, file=f)
print(f'</{outtag}>', file=f)

You should now have a “prog_firehose_ddr.elf” alongside some “patch” and “rawprogram” XML files. When you’re ready to flash your firmware, you can run this command:

qdl prog_firehose_ddr.elf rawprogram*.xml patch*.xml

I only have 16GB of storage now

This can happen when restoring to stock from PostmarketOS. As described on the wiki page, it’s a simple process to fix this:

  1. Lock the bootloader if it’s unlocked
  2. Unlock the bootloader
  3. Reboot into fastboot, and erase userdata
  4. Reboot into recovery and wipe