User Tools

Site Tools


android:oneplus:full-os-and-twrp

This is an old revision of the document!


Full Custom ROM install with TWRP

Overview

The OnePlus 6T uses the newer AB partition scheme. As such there is no recovery partition. Instead, the recovery is part of the boot image. We will install the latest stock OnePlus OxygenOS on both slots before installing custom ROM (LineageOS). You will temporarily boot TWRP to perform and later perform a more permanent TWRP installation.

Basic requirements

  • Ensure that the device is on the latest Android 10 firmware.
  • Ensure that the device has at least 60% battery remaining.
  • Make sure your computer has adb and fastboot. Setup instructions can be found here.
  • Make sure that bootloader is unlocked
  • In case there is encrypted data on the phone that should remain available after the installation: if you use anything else than a PIN code to unlock your phone, change it now. Last TWRP image for Android 10 asks for a data decryption password. It will be easier if it’s a PIN code. Go to Settings > System > Security and change your screen locking choice by a PIN code.

Preparations

  1. Enable Developer options: Settings > System > About. Tap repeatedly on “build number”
  2. Go back to System, then go to developer options.
  3. Enable USB debugging
  4. Enable bootloader OEM unlocking, if present. Make sure that from now on, OEM unlocking option is enabled before you reboot. Sometimes, it might get disabled itself.
  5. Enable advanced reboot options.
  6. Connect the device to your PC via USB.
  7. Download all the files and put them on your PC:
    1. TWRP installer zip
    2. TWRP img
    3. stock-oos-10.zip
    4. Lineage full image (los-10.zip)
    5. Magisk installer zip

Installation latest OxygenOS on first Slot

  1. Boot into fastboot bootloader mode. Open a terminal window, and type:
    adb reboot bootloader

    You can also achieve this via a key combination: With the device powered off, hold Volume Up + Volume Down + Power. You can also achieve this on the computer.

  2. Temporarily boot into TWRP:
    fastboot boot twrp-img-name.img

    Wait for TWRP to start. Decrypt your data thanks to your PIN code. Swipe to allow system modifications.

  3. On your computer, execute adb devices (it should list your device)
  4. Transfer the TWRP installer to the phone, by executing:
    adb push twrp-installer.zip /storage/
  5. In TWRP, go to Wipe, don’t check any of the advanced wipe options, and swipe to do a factory reset
  6. Go to TWRP home, then install. Click on “Up a level” to go to your device drive root. Select “twrp-installer.zip” and swipe to execute.
  7. Go to TWRP home, then “Reboot”. Select reboot to recovery.
  8. You should now be in the durably installed TWRP. It won’t ask for your PIN code this time, and this will result to weird named folders in the “install” section if you go in it.
  9. Go to Wipe and execute a factory reset
  10. Transfer the ROM image to the phone, by executing:
    adb push stock-oos-9.zip /storage/
  11. Transfer the TWRP installer to the phone, by executing:
    adb push twrp-installer.zip /storage/
  12. Go to TWRP home, then install, click on “up a level”, go to “storage”, select “stock-oos-9.zip” and swipe to install
  13. Go back to TWRP home, then install, click on “up a level”, select “twrp-installer.zip” and swipe to install
  14. Go back to TWRP home, then go to reboot, and here comes the tricky part: note (and please don’t forget) the selected slot. Let’s say it’s A for this tutorial. If it’s B for you, just invert it at each step you see it from now.
  15. Reboot to recovery.

Installation latest OxygenOS on second Slot

  1. In this tutorial, we should be on slot B. If you were on slot B earlier, you should be on slot A now. If you aren’t on the wanted slot, click on it and reboot to recovery again and check that it actually changed.
  2. Go to TWRP home, then wipe, and swipe to do a factory reset like earlier
  3. Go to install (everything should have weird names)
  4. Transfer the ROM image to the phone, by executing:
    adb push stock-oos-9.zip /storage/
  5. Transfer the TWRP installer to the phone, by executing:
    adb push twrp-installer.zip /storage/
  6. Go to TWRP home, then install, click on “up a level”, go to “storage”, select “stock-oos-9.zip” and swipe to install
  7. Go back to TWRP home, then install, click on “up a level”, select “twrp-installer.zip” and swipe to install
  8. At this point, we have flashed a stock OxygenOS ROM based on Android 9, as well as TWRP, on both slots.
  9. Go to TWRP home, select reboot.

Install LineageOS

  1. You should be on slot B (for this tutorial’s sake). Reboot to recovery, and check again: you should be on slot A.
  2. Go to Wipe and swipe to do a factory reset one more time
  3. Execute
    adb push e-os-9.zip /storage/
  4. In TWRP, select install, click on “up a level”, go to storage, select “e-os-9.zip” and swipe to install.
  5. Go to reboot, select “recovery”.
  6. You should have rebooted into LineageOS recovery (which is the ROM of top of what is built /e/ OS).
  7. If you rebooted into TWRP, go to reboot again, and select “recovery”.
  8. In LineageOS recovery, select factory reset, then format data / factory reset and do the formatting process.
  9. his will remove encryption entirely and delete all your data one more time, as well as format your cache partition.
  10. Go to advanced, select sideload
  11. On your computer, execute adb sideload twrp-installer.zip. If you have a permission issue, execute adb kill-server to kill adb deamon on your computer, and then execute sudo adb devices. Deamon will start with sudo permission, and should list your device, showing that it is waiting for sideload. So re-execute the command.
  12. Select reboot to recovery
  13. You should now be in TWRP again and you shouldn’t have any data in “install”. Go into “advanced”, select adb sideload and swipe to begin sideloading
  14. On your computer, execute (with sudo if required) adb sideload e-os-9.zip. At the end, you should be able to press “reboot system”, and this should get you to your fresh /e/ OS install! (note that we didn’t install TWRP after that, so we won’t have it on the device. You should be able to flash it also, if you want)
  1. PS: DO NOT BOOT IN OS JUST YET & CONTINUE TO THE ROOTING POST
android/oneplus/full-os-and-twrp.1600274866.txt.gz · Last modified: (external edit)