OnePlus One Android device originally shipped with CyanogenMod OS. OnePlus does no longer support its first model. Stock CyanogenMod OS discontinued too. So one of the possible options, how to keep this still great Android device up-to-date, is to replace the system with LineageOS – the successor of CyanogenMod. LineageOS provides not only the latest features and tweaks from the community around the OS, but also ( and more importantly ) the continuous development and the latest security and bug fixes. Good example is the fix for the KRACK exploit in WPA2 protocol, which has been not addressed by the vendor for this model. Following guide briefly describes experience with installation of LineageOS on OnePlus One, which was OEM locked and not rooted since the purchase. Process has been assisted by PC with Linux OS.
- In the first revision of this article usage of TWRP version 22.214.171.124 has been mentioned. This version was not able to decrypt data partition encrypted on more recent Android versions. Even that this does not affect LineageOS installation over stock ROM, which has Android that works well with TWRP 126.96.36.199, article was updated with more recent versions of used software, including TWRP, LineageOS and Google Apps.
❢ Be aware that you accept full responsibility for the actions you take. You are performing the procedure out of your own free will. Also make sure that you know what you are doing – that helps a lot. Actions performed during this customization might breach the warranty of your device – if there is any – and in some circumstances your device might become unusable and bricked.
❢ Installation of the system not supported by the manufacturer, requires the device to be OEM unlocked. Such operation will ERASE ALL DATA on the device and therefore all important data must be copied from the OnePlus One device before taking any steps and if necessary restored afterwards on the device.
I mostly followed in the steps of the guide from the OnePlus Forums: https://forums.oneplus.net/threads/step-by-step-guide-to-flash-twrp-install-lineageos-no-root-required.500678/. Not all the steps applied for me, but mentioned guide was the main source of the procedure. Feel free to check it out, if you want to have more information and some screenshots too.
I’ve used PC with Fedora 30 OS for installation of LineageOS to OnePlus One. The only tool I needed was fastboot, which is provided by android-tools package and can be installed using:
# sudo dnf -y install android-tools
Here is the version I used:
# rpm -q android-tools android-tools-20180828gitc7815d675-3.fc30.x86_64
# fastboot --version fastboot version c7815d675
For the installation you need to get 3 files:
TWRP – TeamWin Recovery for OnePlus One (bacon) at https://dl.twrp.me/bacon/ – I used twrp-3.3.1-0-bacon.img
LineageOS for OnePlus One (bacon) at https://download.lineageos.org/bacon – I used lineage-16.0-20190731-nightly-bacon-signed.zip
Google Apps at OpenGapps.org – I used open_gapps-arm-9.0-nano-20190801.zip. Of course, this step is optional, so install Google Apps only if you want to have Google applications ( like Google Play Store and so on ) available after the installation. To obtain the working file for LineageOS installation, compatible configuration must be selected:
- Platform: ARM for OnePlus One (bacon) – see https://wiki.lineageos.org/devices/bacon for more information about the device’s parameters.
- Android: 9.0 for LineageOS 16.0 – see https://wiki.lineageos.org/gapps.html for more information about relation between Android and LineageOS version.
- Variant: Nano – this may vary based on what you want to have installed on the device at the start.
If you plan to install TWRP recovery tool to the recovery partition and replace the original stock recovery from CyanogenMod, you need to disabled CyanogenOS Update recovery setting in Developer options, which would prevent usage of non-stock recovery: Open Android settings menu, select About phone, tap 7 times on Build number item, go one step back and there you can see Developer options menu. Installation of TWRP is not necessary as it can be directly boot-ed on Android from the image file.
Usually, it is required to enable USB debugging on the existing ( stock ) Android. This settings enables then usage of adb tool to connect to the Android device, transfer files and so on. I didn’t use adb, so no USB debugging is needed.
❢ This actions will delete all data from the Android device without any confirmation. Also encryption of the device is disabled again, so make sure that you re-enable the encryption after you are done with installation.
Connect the device to the PC via USB and restart the Android to the FastBoot mode. To get to FastBoot mode I just powered off the device, started it again by holding Power button + Volume Down button. Then in CyanogenMod recovery menu selected Advanced and Reboot to recovery. If you manage to switch off the phone while it is booting by holding the buttons for too long, just release and press the Power button.
When device is in Fastboot mode, verify that PC detects it:
# sudo fastboot devices
Then disable the OEM lock:
# sudo fastboot oem unlock ... OKAY [ 0.023s] finished. total time: 0.023s
This will trigger an Android device reboot and complete wipe. Afterwards OEM unlocked stock OS will start.
Enter the FastBoot mode again and start TWRP recovery. There are two options on how to do it:
- Either you directly execute one-time start of the TWRP from the downloaded file by command:
# sudo fastboot boot twrp-3.3.1-0-bacon.img
- Or you can flash the TWRP to the recovery partition ( requires CyanogenOS recovery to be disabled as mentioned above ). After the reboot into recovery mode ( Power button + Volume down button ) TWRP should start:
# sudo fastboot flash recovery twrp-3.3.1-0-bacon.img Sending 'recovery' (13886 KB) OKAY [ 0.444s]
Writing 'recovery' OKAY [ 0.261s]
Finished. Total time: 0.712s # sudo fastboot reboot Rebooting
Finished. Total time: 0.055
While the device is in TWRP recovery mode, at first press the Wipe button and start the process by swiping the slider. As a result, this operation factory resets your phone ( again ), but also cleans the cache and Dalvik cache partitions. Afterwards you should see storage device attached to your PC. Follow by copying the necessary files: LineageOS and Google Apps to the device. I’ve placed them into existing TWRP directory. As soon as files are present on the device, in TWRP press the Install button and select LineageOS file. If you plan to install Google Apps too, proceed by selecting Add more zips and select Google Apps file now. Then swipe the slider to confirm the flash operation. As soon as the operation is finished, your Android device can be rebooted. Welcome to the LineageOS.