[OnePlus 8T Guides, News, & Discussion] OhioYJ:
Installing Lineage​

Few quick things.

Since the 8T does not have a single unified guide like FunkWizard did for other OnePlus devices, I'm adding some things that are likely important, but don't necessarily have to do with installing LOS.

This will be similar to my 6T installing Lineage guide. However the 8T is a newer device, and new to me. Expect it to change and get updated as things change. I'll add in pictures like the 6T guide soon.

I also want to address a common question, you can use Windows for this process. I prefer Linux, and Fastboot just works in Linux without driver issues. If you have Fastboot and ADB working in Windows already feel free to use that if you want. If you use Windows, remove "sudo" from the commands (this is for Linux).

I am using a Global 8T, and have only tested these methods on such.

Make Sure OOS is Updated​

1. Start fresh, and make sure OOS is up to date.

This should be self explanatory. Go to settings, and system, check for updates. Download and install any system updates OOS has to make sure you have the latest firmware on your device.

Unlock the Bootloader​

2. Unlock the Bootloader

sudo fastboot flashing unlock

For this step you will need fastboot. I use Linux, and honestly I feel like it's easier and more reliable for fastboot and ADB so that's what I'm including here in these steps. It's easy to boot from a USB.

To create a bootable Linux flash drive you can use Unetbootin, which you can download for free here (Your other option would be to burn the ISO straight to a DVD and skip the unetbootin step):

https://unetbootin.github.io/

For Linux, I'm using Linux Mint Cinnamon, You can download for free here:

https://www.linuxmint.com/download.php

Then run unetbootin (yours will look a little different, I'm running it in Linux):

Point it to the Linux ISO, and tell it where an empty flash drive is. It will erase everything on the flash drive. Afterwards you can load whatever you want on the flash drive. However be aware when booting Linux from this drive you can't access what is on the drive (at least not by normal methods).

After this has successfully completed, reboot the PC, and boot from the USB drive. Your PC will boot into Linux (turning off the PC and removing the USB drive will make it boot up like normal again).

Next we need to install fastboot and adb. You need to open up the "start menu" and open the "synaptic package manager". You can find this stuff in the menus, however the easiest way to get to these items is to just start typing the name of the item. See below:

Search fastboot, click the boxes, choose install. Then search for ADB, click the boxes, choose install and then click apply. That will install most of the stuff we need, but really old versions of fastboot and adb. You must update fastboot to install LOS. Time to open up a terminal:

In the terminal run these commands to update fastboot and adb (this is downloading them directly from Google).

wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip

unzip \platform-tools-latest-linux.zip

sudo cp platform-tools/adb /usr/bin/adb

sudo cp platform-tools/fastboot /usr/bin/fastboot

Next you need to make sure OEM unlocking is enabled. If you haven't tapped on the build number and enabled devloper options, do this now. enabling USB debugging for the moment, would also be helpful.

Now would be a good time to back everything up. The phone will get wiped.

Place the phone in fastboot mode. You can do this using the advanced reboot menu or ADB, or the key combinations (all key combos listed below for reference):

Volume Up + Power while turning on will boot to fastboot. (<-- Don't believe this works on the 8T)

Volume Down + Power while turn on will boot to recovery.

Holding Volume Up + Power should force the phone to turn off.

Volume Up + Volume Down should put your phone in Download mode for the MSM Tool.

If you enabled USB Debugging in the terminal window, type (the phone will pop up a warning asking you to allow USB debugging, make sure you allow this):

sudo adb reboot bootloader (<-- This command will make the phone restart to the bootloader / fastboot)

Once there type the command below. Your phone will be wiped. Make sure you backed up any important information. Use the volume buttons to select unlock, and press the power button.

sudo fastboot flashing unlock

Backing up Persist / EFS​

3. Backing up the persist partition and EFS backup.

dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img

dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/modemst1.bin

dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/modemst2.bin

Hopefully you never need a backup of your persist paritition or EFS backup. However if anything ever happens you'll be glad you have it. The EFS contains the IMEI, so it is unique to every device. You can do this at any point as long as you have root. The easiest way, epsecially for those not want to root their device is to use the broken TWRP. I got this TWRP and a bunch of my initial rooting information from @Mpolo87 's Guide OnePlus 8T EasyRoot. It is an excellent guide. The TWRP is in step 4. This is not the way you need to root LOS though. Download this TWRP.

Once again from the terminal:

The image explained:

cd Desktop <-- Switched the directory to the Desktop the default directory when you open up the terminal is the /home directory.

sudo fastboot devices <-- Is just checking to see if my PC can see my phone, and making sure it's in fastboot. Sudo is necessary for this distro, as both fastboot and ADB must be run as root.

sudo fastboot boot recovery.img * <-- Sends that TWRP image to the phone to be booted temporarily. Only boot this, never run the command "flash".

With this TWRP loaded it is normal that the screen will be blank and just briefly flash the TWRP logo screen. All we need to do is use the terminal window on the PC. Run these commands:

sudo adb shell

dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img

dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/modemst1.bin

dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/modemst2.bin

exit

sudo adb pull /sdcard/persist.img /home/mint/Desktop

sudo adb pull /sdcard/modemst1.bin /home/mint/Desktop

sudo adb pull /sdcard/modemst2.bin /home/mint/Desktop

It is important to use ADB to pull the files off of the device after creating them. They won't be accessible after you restart. Also if you are using a live Linux distro (USB) the files do not remain on the USB after you restart / power off. So you need to place these files on another hard drive or USB. The persist.img should be ~ 32MB the Modems should be ~ 2MB each. Once you have the files you can run

sudo adb reboot bootloader

Installing Lineage​

4. LOS 18.1 Thread

Quick Common questions:

Gapps are not included, you must sideload them if you want them. Personally I use NikGapps, LOS Recommends MindtheGapps.

Official LOS 8T Download Link

Download the latest build, and the recovery image from the link above.

You must have a current version of fastboot / adb to successfully install this. (Update method mentioned previously in this guide) To install Lineage it is as simple as the instructions listed on the LOS site.

From the terminal:

sudo adb reboot bootloader

sudo fastboot flash recovery lineage-18.1-20210506-recovery-kebab.img

Now reboot in recovery. Doesn't matter how you get there. You can use the volume keys to change the options in the bootloader, you can use volume down and power, etc. Once in Lineage Recovery we need to run the copy partitions zip. The link for this is on the LOS install page. However here is a direct link. In LOS recovery choose:

- Apply Update

- Apply from ADB

From the terminal on the PC

- sudo adb sideload copy-partitions-20210323_1922.zip

LOS recovery will warn you about the zip not being signed, flash this anyways. Hit the back button, choose advanced, and then reboot to recovery. It is now time to actually install LOS. In LOS Recovery:

- Factory Reset. (You did backup everything right?)

- Press Format data / factory reset.

- From the main LOS Recovery menu, Apply Update

- Apply from ADB

From the terminal on the PC

- sudo adb sideload lineage-18.1-20210506-nightly-kebab-signed.zip

If you want to install Gapps or Magisk, you must reboot to recovery. Go to advanced and choose reboot to recovery before install anything else. If you are only installing LOS you are ready to reboot to system now.

Optional, Gapps​

5. Sideloading Gapps.

For Android 11 I've been using NikGapps:

NikGapps <-- For Lineage 18.1 (Use the R Folders for Android 11. I recommend the "Core" version. I also tested Basic though if you want that level of Gapps. I strongly recommend you grab setup wizard out of the R Addons Folder, I used the regular setup wizard, not the pixel one.)

Remember you need to reboot to recovery once after installing LOS (as mentioned above). This does not mean you need to let LOS boot, just reboot to recovery, so that it switches slots.

In LOS recovery choose:

- Apply update

- Apply from ADB

Now in the terminal on the PC:

- sudo adb sideload NikGapps-core-arm64-11-20210501-signed.zip

- Remember between each zip file you must again hit apply from ADB.

- sudo adb sideload NikGapps-Addon-11-SetupWizard-signed.zip

LOS recovery will warn you about the zip not being signed, flash this anyways.

If you get a warning about them not being signed, choose flash anyways. If you are going to flash Magisk, move to the next section. If you don't need Magisk, reboot to system.

Very Optional, Magisk​

5. Sideloading Magisk.

All the devices I've tested with Android 11 have worked fine since Magisk 21.2. At this point I don't see a reason to still run the Canary builds unless you want to for some reason.

Download Magisk: [urlhttps://github.com/topjohnwu/Magisk/releases]Magisk GitHub Link[/url]

This will be flashed in LOS recovery. To get to recovery you can use the ADB (if you enable USB debugging), key combination, or the advanced restart menu, doesn't matter.

In LOS recovery choose:

- Apply update

- Apply from ADB

Now in the terminal on the PC:

- sudo adb sideload Magisk-v22.1.zip

If you get a warning about them not being signed, choose flash anyways. We should be ready to reboot to the system now.

Very Optional, Passing Safety Net​

6. Magisk Required.

These items are add-ons are flashed in Magisk after the first boot (Don't flash these in TWRP anymore):

MagiskHide Props Config

Busybox

To flash modules in Magisk press the puzzle piece icon. Then choose install from storage. Now just choose your addons. After flashing the icons it will have a reboot icon at the bottom. You can reboot or you can press back and flash another. After you are done reboot.

You will also need a Terminal Emulator. I personally use:

Terminal Emulator for Android

Once all these are installed the first step is setup Magisk. Under Magisk go to settings:

In version 20.4+ Magisk Hide is no longer on by default. So make sure the Magisk Hide, Hide Magisk from various forms of detection switch is flipped. Then press Hide Magisk Manager. This will bring up a box for you to choose a random name for the Magisk Manager, type whatever you want here. You can leave it Manager if you wish, but I typically change this.

Now open Magisk again. It will ask you to download it again, click ok, then manually open the app again as it says. Now we need to open Magisk hide. This is now under the shield icon, then click the arrow at the top:

These are the apps you don't want to know that you have root. Less is better. You can cause instability problems by just choosing everything. My general rule of thumb is, Google, steaming video, music, and payment apps get selected. In my experience if I come across an app that needs it and I didn't select it, I just clear cache and/or data and re-open the app and it works. There are some big multiplayer apps that ban hardware / people, so do your research (don't ask me, I don't play those games).

Next time to change the device fingerprint using MagiskHide Props Config Module. We do this using the terminal emulator. In the terminal emulator, type "su" to gain root privileges. Then type props to run the module:

Now it's just following the menus. Choose option 1 - Edit device finger print. (type 1, hit enter)

After this you will see a menu of devices. It doesn't matter what device you pick really. If you want apps / Google to think you have a OPPO or Samsung pick one of those Fingerprints. However there's a bit more to passing Safety-net than that. Since Google has changed how things work not all those fingerprints that used to work will work now. Also now you may get an error when you turn on the phone because of the security dates. My 8T passes saftey net, just choosing the 8T and Android 11 fingerprint. Also keep in mind some fingerprints will require Force basic key attestation to pass.

After choosing the fingerprint you want, it will ask you if you want to reboot. Choose yes. After rebooting, you may need to clear the cache from the play store for some apps to appear in it. You should now pass safety net. Check this in Magisk:

Very Optional, Ad Blocking​

7. Root required.

You can block many things with a hosts file, most popular would be ads. I've been use StevenBlack's host file which is a compilation of several hosts files. This is located on Github:

https://github.com/StevenBlack/hosts (Scroll down you'll see the options of what you can block)

Direct link to the hosts file I use. This will block Adware / Malware.

First we have to make the hosts file. The hosts file must use Unix / Linux line endings. If you are using Linux, don't worry about this, just create the file. If you are using Windows, the easiest thing to do is use Notepad++ (Free).

Notepad++ Downloads

Next one other caveat. The hosts file is quite large. I've never had much luck copy and pasting it from any other browser than Firefox (Windows or Linux), but however you get it into Notepad++ is not a big deal.

Once in you have the hosts file into Notepad++ go to Edit, EOL Conversion, and Choose Unix (LF).

Now save the file as "hosts" no ending. This does mean under file type you will need to change it to All File types *.*. Move this hosts file to your phone.

You will need to use a root file explorer to copy this hosts file to /system/etc/ and replace the file that is there. I used Solid Explorer for this.

Updating Lineage​

Updating Lineage is pretty much the same as installing it, just without the reset or wipe. First reboot to Lineage recovery. Doesn't matter how you get there. You can use the advanced reboot menu, or the adb.

Couple things to remember:

You will need a PC for this.

Fastboot / ADB must be updated for this to work, otherwise you will have problems.

Apply Update --> Apply From ADB

- sudo adb sideload lineage-18.1-20210506-nightly-kebab-signed.zip

If you use Gapps or Magisk, you also need to sideload these. Once again you still need to reboot recovery. Hit the back button, choose advanced, and then reboot to recovery.

Apply Update -> Apply from ADB (This must be done between each zip file)

- sudo adb sideload NikGapps-core-arm64-11-20210501-signed.zip

- sudo adb sideload NikGapps-Addon-11-SetupWizard-signed.zip

- sudo adb sideload Magisk-v22.1.zip

If you get a warning about them not being signed, choose flash anyways.

Then reboot to system. If you were using a hosts file for adblocking you will need to put that back as well when it boots. This gets replaced during the update.