Based on article on LineageOS website. Took me some time tinkering in order to get this right, and since I usually document stuff like this - I decided to share.
To flash LineageOS you will need:
- Windows computer with USB 2.0 port.
- Be sure you have no important data on your tablet (its built-in memory will be formatted)
- Carefully read the instructions before trying anything. This is always a good idea...
- Be ok with your tablet showing warning messages at startup that it is unlocked and is "unsafe to use".
- I take no responsibility if you ffuark this up, etc...
So, here we go:
- Turn the USB debug on, then go to Developer Options > OEM Unlock mode
- Go to Download mode - turn off the tablet, press and hold UP and DN buttons, plug in the USB cable while holding UP and DN buttons (once you there you can release the buttons ☺)
- Select Unlock Bootloader there (long press UP button)
- It will ask if you want to format. After you answer yes - the tablet will reboot, unplug the cable.
- The initial setup should pop up, connect to wi-fi and skip everything you can for now (accounts setup, apps setup, etc.)
- The tablet should now be clean. Go to settings and enable developer options again.
- Make sure you are using a USB 2.0 port. At least for me, next steps did not work with USB3.
- Go to Download mode again, press UP once
- Download heimdall, in its folder there's an app called zadig, run it. In zadig go to Options > List All Devices and find "Gadget Serial" there (try all of them if there are many), "Reinstall driver" (ensure that "Install" is checked in sidebar)
-
In command line, in heimdall folder, type
heimdall print-pit
. The tablet should restart. If it did - it means everything is OK so far. If not - try heimdall version 1.4.2 (simply unpack on top of the old version) - Download LineageOS and its Recovery (stock Samsung's recovery has a checksum verification which won't allow you to flash unsigned software, therefore you need to flash LineageOS Recovery first)
- In order to flash the recovery - go to Download mode, and switch to download there (press UP)
- In command line -
heimdall flash --RECOVERY <filename>.img --no-reboot
- The blue scrollbar should appear on screen. It will rapidly fill with white. Nothing should be happening at this point, just a white bar.
- Now we have the LineageOS bootloader flashed. If we reboot the tablet the regular way - it will rewrite the newly installed bootloader with samsung's original one, and we will have to repeat steps 12-14 again. Probably, also will have to reinstall the driver (step 09) again, too. (it's OK, just in case). So be cautious with step 16:
- Now we need to exit the download mode and switch to recovery. In order to do so - you have to (without unplugging the cable!) hold PWR and DN buttons for 7-8 seconds and, immediately as the screen turns black, hold PWR and UP buttons.
- In LineageOS bootloader (it's purple, with LineageOS logo on top) we have to select factory Reset and in there - Format data and factory reset. Then tap the "back" button on the top left of the touchscreen.
- Press Apply Update. Now the tablet is waiting for new firmware files over the cable.
- If you need magisk - download its APK file and rename it to ZIP (I got mine here, at it's official site.). If you need Google Apps (playstore and whatnot) - download GApps, I got mine here, I used a file called MindTheGapps-10.0.0-arm64-20220224_161733.zip, but, in theory, any arm64 should work.
-
On your computer's command line -
adb sideload <lineageOS_image_name>
(where<lineageOS_image_name>
is a filename of your LineageOS firmware image). The flashing will take some time. You can get adb archive here, btw. - After that, if needed - repeat for magisk and gapps image files.