• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Development [ROM][11.0][UNOFFICIAL] Lineage OS 18.1 for Redmi Note 10 (mojito / sunny)

Search This thread

rien333

Member
Dec 29, 2019
5
0
Thanks for the info! It seems that you're right, and that unlocking the bootloader requires you to wait a while.

I hadn't expected this because my previous phone (a Mi A3) didn't require me to do so - however, that was a Android One device.
 

zamiboi I

New member
Jun 22, 2021
3
0
Thanks for the info! It seems that you're right, and that unlocking the bootloader requires you to wait a while.

I hadn't expected this because my previous phone (a Mi A3) didn't require me to do so - however, that was a Android One device.
No worries. Its a bit weird also they make you stay logged in on your mi account on the phone for that week its kind of weird.
 

Zirila

Senior Member
Jul 31, 2015
168
63
Could somebody give me info or link me to an info about how to update Custom ROMs nowadays?
I tried simulating updating to a new LineageOS version by flashing the rom.zip again, and I experienced a lot of problems and difficulties.

TWRP always flashes to the inactive slot. by following the guideline so far, the inactive slot however doesn't have TWRP installed, it also fails switching slots after updates.
I managed to fix it by manually switching slots with fastboot and flashing TWRP to the inactive slot again.

then if you use spoofed LOS with microg:
the next problem is Magisk, it's modules, MicroG and ALL the apps relying on Magisk->MicroG(minmicrog)->GCM/FCM->APPS.

if you can't flash Magisk.zip right after flashing the new lineageos version to the correct a/b slot, microG won't be loaded, then GCM is unavailable and therefor ALL installed Apps (messenger etc) relying on GCM lose their GCM registration. If that happens, you have to uninstall and reinstall ALL these apps to register them again for GCM. This must be prevented at all cost.

I kinda got it working by:

  1. let "a" be the active slot with the old ROM+TWRP+Magisk already installed.
  2. make "a" the active slot (with fastboot --set-active=a) if it's not.
  3. boot to recovery on "a"
  4. flash the new updated rom.zip with TWRP recovery
  5. TWRP will install ROM update to inactive "b" slot
  6. "b" has ROM now, but no Recovery or Magisk and the TWRP currently running from "a" cannot install itself to ramdisk on "b"
  7. set "b" active with fastboot (reboot to recovery should actually switch to "b" here, but it NEVER did it for me)
  8. load TWRP with fastboot boot twrp.img - TWRP now running and "b" active. -> now install TWRP to Ramdisk
  9. TWRP is now on "b"
  10. boot to recovery on "b", don't start the updated ROM on "b" yet.
  11. in TWRP on "b" flash Magisk.zip again.
  12. now boot to system

this way the updated ROM on "b" has the boot patched for TWRP+Magisk and on first boot, Magisk can load it's modules (f.i. MicroG) and all apps should have GCM available again like before. well, if you're lucky at least..

the process is very risky and cumbersome, and I really want to have a crystal clear, functional way to apply updates in the future..

someone here maybe have tested it more than I and could add some guides, that would be really good.
 

MPK99

Senior Member
Jun 25, 2017
524
365
Mexico
gitlab.com
Redmi Note 10
Could somebody give me info or link me to an info about how to update Custom ROMs nowadays?
I tried simulating updating to a new LineageOS version by flashing the rom.zip again, and I experienced a lot of problems and difficulties.

TWRP always flashes to the inactive slot. by following the guideline so far, the inactive slot however doesn't have TWRP installed, it also fails switching slots after updates.
I managed to fix it by manually switching slots with fastboot and flashing TWRP to the inactive slot again.

then if you use spoofed LOS with microg:
the next problem is Magisk, it's modules, MicroG and ALL the apps relying on Magisk->MicroG(minmicrog)->GCM/FCM->APPS.

if you can't flash Magisk.zip right after flashing the new lineageos version to the correct a/b slot, microG won't be loaded, then GCM is unavailable and therefor ALL installed Apps (messenger etc) relying on GCM lose their GCM registration. If that happens, you have to uninstall and reinstall ALL these apps to register them again for GCM. This must be prevented at all cost.

I kinda got it working by:

  1. let "a" be the active slot with the old ROM+TWRP+Magisk already installed.
  2. make "a" the active slot (with fastboot --set-active=a) if it's not.
  3. boot to recovery on "a"
  4. flash the new updated rom.zip with TWRP recovery
  5. TWRP will install ROM update to inactive "b" slot
  6. "b" has ROM now, but no Recovery or Magisk and the TWRP currently running from "a" cannot install itself to ramdisk on "b"
  7. set "b" active with fastboot (reboot to recovery should actually switch to "b" here, but it NEVER did it for me)
  8. load TWRP with fastboot boot twrp.img - TWRP now running and "b" active. -> now install TWRP to Ramdisk
  9. TWRP is now on "b"
  10. boot to recovery on "b", don't start the updated ROM on "b" yet.
  11. in TWRP on "b" flash Magisk.zip again.
  12. now boot to system

this way the updated ROM on "b" has the boot patched for TWRP+Magisk and on first boot, Magisk can load it's modules (f.i. MicroG) and all apps should have GCM available again like before. well, if you're lucky at least..

the process is very risky and cumbersome, and I really want to have a crystal clear, functional way to apply updates in the future..

someone here maybe have tested it more than I and could add some guides, that would be really good.
How did you spoof the ROM?
Here's the Magisk module for it.
 

Zirila

Senior Member
Jul 31, 2015
168
63
I think that's probably about the same.
I created my own Magisk module for signature spoofing by patching the /system/framework/services.jar
using haystack and extracting and patching the classes.dex and compiling them to a magisk module. (see: https://gitlab.com/oF2pks/haystack/-/tree/11-attempt)

but I would have to do that again whenever a LineageOS update makes changes to the services.jar, otherwise I'd have the old files applied by the Magisk module, despite having newer versions on the system.

I'm still hoping LineageOS is getting official for Redmi Note 10 sometime soon, so we can all get automatically generated microG builds from lineageos.microg.com.
 

StaryMuz

Senior Member
Dec 27, 2012
400
127
I wanted to build flash files of Lineage OS to run in MiFlash.
In the Miui image folder I would replace only the ones that the Lineage OS rom contains and then use the Miui script for flash.
But I can't put system.img+vendor.img+product.img+system_ext.img into a common super.img
If anyone can do it, put it together.
Especially for vanilla and gapps.
I think then the flash rom would be correct.
 
Last edited:

lyoko_xana

Senior Member
Apr 20, 2017
62
31
Redmi Note 10
Hi everyone, I got `ErrorCode::kPostinstallRunnerError` after flasing this rom by TWRP, reflash the TWRP into rawdisk, reboot into recovery, reboot to system and my device bootloop into fastboot. Does anyone know why ? Thank you very much ! (LOS Recovery works fine though.)
 

Zirila

Senior Member
Jul 31, 2015
168
63
Hi everyone, I got `ErrorCode::kPostinstallRunnerError` after flasing this rom by TWRP, reflash the TWRP into rawdisk, reboot into recovery, reboot to system and my device bootloop into fastboot. Does anyone know why ? Thank you very much ! (LOS Recovery works fine though.)
I got this error too one time.. I don't remember what helped, but I've installed LOS so many times on this phone in the meanwhile that I know of other ways that pretty sure works. give this a try:

you need:
  • the TWRP alpha build twrp.img,
  • latest android platform tools (adb+fastboot),
  • latest redmi firmware.zip (link found in first post of the thread),
  • the lineageOS ROM.zip.
  • if you need to make a clean flash: MiFlash Tool and the current/latest MIUI ROM (links found in this forum)
I make this guide a more-than-usual detailed step-by-step guide so many users can follow.
  1. start from a clean stock flash (flash the current/most recent official MIUI ROM with MiFlash, make sure you check "clean" and -not- "clean and lock" at the bottom before flashing, otherwise you lock your phone again)
  2. now the phone has MIUI and slot "a" is active, just boot to it and create a PIN/3-dot-pattern (in some cases TWRP can't decrypt data with default PW when you don't set this)
  3. switch off your phone, restart it into fastboot mode (vol-down + power).
  4. connect it with your PC, have the latest fastboot.exe from the most recent platform tools (https://developer.android.com/studio/releases/platform-tools)
  5. set the active slot to "b" with: fastboot.exe --set-active=b
  6. load the TWRP.img (currently the alpha build from this forum) with fastboot: fastboot.exe boot twrp.img
  7. load firmware.zip, lineagerom.zip and twrp.img to your phone: in TWRP enable MTP and copy files from your computer to the phone. if this does not work, see next step.
    Then install firmware.zip, then lineageOS.zip. lineageOS gets installed to slot "a".
  8. (if the above step fails to copy files to your phone try ADB sildeload:
    in TWRP go to advanced -> start ADB sideload. in your console cmd: adb sideload firmware.zip, and: adb sideload lineageos.zip. it installs the ROM to slot "a". there might be an error at the end but it works anyway.)
  9. switch off the phone. return to fastboot mode (vol-down + power)
  10. make the active slot now "a" with fastboot.exe --set-active=a
  11. reboot your phone normally to system, let the ROM start. at this point you should be able to launch LineageOS but without recovery. Load it so you can set up a PIN or 3-dot-pattern and then enable MTP connection with your PC.
  12. copy the TWRP.img (and if you want Magisk.zip) to your phone (internal/external storage), we want to install TWRP recovery now.
  13. switch off the phone, boot into fastboot mode.
  14. start TWRP with: fastboot.exe boot twrp.img, enter your PIN/Pattern to decrypt your user[0] data, in TWRP now go to Advanced -> install TWRP to ramdisk. select the TWRP.img you uploaded before. TWRP gets installed to slot "a".
  15. reboot your phone to recovery: Reboot -> Recovery.
  16. If you want to use Magisk/Root, go to Install -> Magisk.zip (If you want to use a custom Kernel in the future, flash the kernel before Magisk)
  17. now reboot to system, LineageOS should start normally and you can finish installing the rest.
Lets note that this works at the stage of TWRP alpha with current available LineageOS (2021-06). Future versions of TWRP and LOS may change these steps completely.

also if you have an error intalling or flashing files due to an snapshotted state (happens when you mess up custom ROM installation before and switchin a/b within TWRP), cancel the snapshot first with the command:
fastboot.exe snapshot-update cancel
 
Last edited:

lyoko_xana

Senior Member
Apr 20, 2017
62
31
Redmi Note 10
I got this error too one time.. I don't remember what helped, but I've installed LOS so many times on this phone in the meanwhile that I know of other ways that pretty sure works. give this a try:

you need:
  • the TWRP alpha build twrp.img,
  • latest android platform tools (adb+fastboot),
  • latest redmi firmware.zip (link found in first post of the thread),
  • the lineageOS ROM.zip.
  • if you need to make a clean flash: MiFlash Tool and the current/latest MIUI ROM (links found in this forum)
I make this guide a more-than-usual detailed step-by-step guide so many users can follow.
  1. start from a clean stock flash (flash the current/most recent official MIUI ROM with MiFlash, make sure you check "clean" and -not- "clean and lock" at the bottom before flashing, otherwise you lock your phone again)
  2. now the phone has MIUI and slot "a" is active, just boot to it and create a PIN/3-dot-pattern (in some cases TWRP can't decrypt data with default PW when you don't set this)
  3. switch off your phone, restart it into fastboot mode (vol-down + power).
  4. connect it with your PC, have the latest fastboot.exe from the most recent platform tools (https://developer.android.com/studio/releases/platform-tools)
  5. set the active slot to "b" with: fastboot.exe --set-active=b
  6. load the TWRP.img (currently the alpha build from this forum) with fastboot: fastboot.exe boot twrp.img
  7. load firmware.zip, lineagerom.zip and twrp.img to your phone: in TWRP enable MTP and copy files from your computer to the phone. if this does not work, see next step.
    Then install firmware.zip, then lineageOS.zip. lineageOS gets installed to slot "a".
  8. (if the above step fails to copy files to your phone try ADB sildeload:
    in TWRP go to advanced -> start ADB sideload. in your console cmd: adb sideload firmware.zip, and: adb sideload lineageos.zip. it installs the ROM to slot "a". there might be an error at the end but it works anyway.)
  9. switch off the phone. return to fastboot mode (vol-down + power)
  10. make the active slot now "a" with fastboot.exe --set-active=a
  11. reboot your phone normally to system, let the ROM start. at this point you should be able to launch LineageOS but without recovery. Load it so you can set up a PIN or 3-dot-pattern and then enable MTP connection with your PC.
  12. copy the TWRP.img (and if you want Magisk.zip) to your phone (internal/external storage), we want to install TWRP recovery now.
  13. switch off the phone, boot into fastboot mode.
  14. start TWRP with: fastboot.exe boot twrp.img, enter your PIN/Pattern to decrypt your user[0] data, in TWRP now go to Advanced -> install TWRP to ramdisk. select the TWRP.img you uploaded before. TWRP gets installed to slot "a".
  15. reboot your phone to recovery: Reboot -> Recovery.
  16. If you want to use Magisk/Root, go to Install -> Magisk.zip (If you want to use a custom Kernel in the future, flash the kernel before Magisk)
  17. now reboot to system, LineageOS should start normally and you can finish installing the rest.
Lets note that this works at the stage of TWRP alpha with current available LineageOS (2021-06). Future versions of TWRP and LOS may change these steps completely.

also if you have an error intalling or flashing files due to an snapshotted state (happens when you mess up custom ROM installation before and switchin a/b within TWRP), cancel the snapshot first with the command:
fastboot.exe snapshot-update cancel

Thank you very much ! Will try when I have time
 

Zirila

Senior Member
Jul 31, 2015
168
63
I digged a bit deeper in this ROM and I'm suddenly having Certificate Issues.

whenever I browse to a website with webview (a browser which uses androids native webview module) I get "Certificate not trusted" errors.

It's like either the ROM is missing CA root certificates, or they are outdated or maliciously modified.
Some websites (like google) work however without warning.


I tested the same setup on another phone with official LineageOS and the errors were gone.
Maybe there is something wrong with CA on this debug build?

EDIT: hm maybe it is actually the used Browser (NB Pro), I tested other webview browsers and normal browser that don't have this problem.
strange that the same version runs perfectly fine on the other 18.1 phone and on this one it gets SSL errors..
(i can just speculate that the other phone has CA's from earlier LOS versions and they have been kept with dirty flashes, so the browser can see these CAs whereas on the new phone with clean LOS install, the older CAs are missing)


The Problem was something completely different: AdAway + Ad-domain localhost redirects + localhost webservers.
see details here.

solved.
 
Last edited:

Zirila

Senior Member
Jul 31, 2015
168
63
Could anybody using this ROM test if the Alarm is working when the Phone is switched off?

When you open the Clock for the first time it asks for permission to be able to switch on the phone to start the alarm. Grant this permission. Then set an alarm clock at least 3 minutes in the future and switch off the phone.

My phone starts like 1-2 minutes before the time of the alarm clock. it boots up to the simcard pin and waites until it's time to ring the alarm. Then the Alarm starts correctly BUT it is not making any sounds, it's a silent alarm, and therefor useless.

When setting an alarm clock while the phone is on, the alarm starts normally and with sound.


please, someone test this too if it works for you!
 

Zirila

Senior Member
Jul 31, 2015
168
63
another bug or strange behaviour: the ROM does not support exFAT for SD Cards.

whenever I insert my exFAT formated 64GB sdcard, this ROM tells me there is an "issue with the sd card" and it can only use the sdcard when the ROM formats it again. unfortunately it formats the SD Card with Fat32 and there is no option for exFAT. Fat32 is no option due to the 4GB filesize limitation.

I read somewhere that this might be a flag settings issue when building the unofficial ROM. Also, the official 18.1 ROM has no issue accepting exFAT sdcards when I insert them.
 

Subhan.

Member
Feb 8, 2020
37
19
Redmi Note 10
another bug or strange behaviour: the ROM does not support exFAT for SD Cards.

whenever I insert my exFAT formated 64GB sdcard, this ROM tells me there is an "issue with the sd card" and it can only use the sdcard when the ROM formats it again. unfortunately it formats the SD Card with Fat32 and there is no option for exFAT. Fat32 is no option due to the 4GB filesize limitation.

I read somewhere that this might be a flag settings issue when building the unofficial ROM. Also, the official 18.1 ROM has no issue accepting exFAT sdcards when I insert them.
Are you on the latest build?
Well on the latest build sdCard with exFAT is accessible
 

Zirila

Senior Member
Jul 31, 2015
168
63
Are you on the latest build?
Well on the latest build sdCard with exFAT is accessible
sorry, i'm on build from 12/06/21, I didn't get the attention of a new version. Could you append a new post to the thread on ROM updates so we get notifications (contrary to post-edits)?

I'll try to update to the 29th June version and (if successful) test if exFAT works. I'll keep you updated.

oh and thank you for maintaining the rom now! (y)


 

Zirila

Senior Member
Jul 31, 2015
168
63
I've got massive problems updating/dirty flashing LOS rom. I thought I could dirty flash the new rom.zip within TWRP but it failed. I tried flashing it from slot_b to active slot_a, because thats the way that worked before when clean installing the rom. but it doesn't work from either slot... I get kPostInstallErrors and it didn't work. I ended up reflashing MIUI back without userdata to keep my data, but after that it couldn't decrypt userdata anymore, so I ended up losing all my data and previous state before.

please, if anybody is experienced with that in it's current state, make a detailed guide how to update the ROM without losing all data again (not installing it clean from scratch)
 
Last edited:

MPK99

Senior Member
Jun 25, 2017
524
365
Mexico
gitlab.com
Redmi Note 10
I've got massive problems updating/dirty flashing LOS rom. I thought I could dirty flash the new rom.zip within TWRP but it failed. I tried flashing it from slot_b to active slot_a, because thats the way that worked before when clean installing the rom. but it doesn't work from either slot... I get kPostInstallErrors and it didn't work. I ended up reflashing MIUI back without userdata to keep my data, but after that it couldn't decrypt userdata anymore, so I ended up losing all my data and previous state before.

please, if anybody is experienced with that in it's current state, make a detailed guide how to update the ROM without losing all data again (not installing it clean from scratch)
It's recovery prob. Re-install recovery or reflash boot, then u might successfully update the rom through dirty flash.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Changelog (01/10/21):
    • Fixed Spoofing on microg variant
    • QS size set to 2x4
    • Fixed Slow charging
    • Fixed camera color shift
    • Moved to Lineage Recovery
    • Allow all filesystems for USB-OTG
    • Don't check prox before pulsing

    Caution: Failed SafetyNet.
    1
    Thanks for the Rom. Just wanted to know if there is any fix for safety net as I use some banking apps and that might be issue.
    Try this root method.
    Get the following magisk modules: Riru, Universal SafetyNet Fix & PropsHide.
    Flash all three & reboot (Universal Fix needs a riru reboot)
    Get any terminal & do
    Code:
    su
    props
    1. Edit device fingerprint
    f (Pick a certified fingerprint)
    7 (Google)
    23 (Pixel 4 XL)
    Yes to confirm
    Reboot to apply the changes
    Make sure you enable MagiskHide after that.
    1
    @Ujjawal1810 Could you please let me know if it fixed safetynet? I'd also need this for my banking app. Cheers!
  • 23
    1633823826022.png


    LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.

    All the source code for LineageOS is available in the LineageOS Github repo. And if you would like to contribute to LineageOS, please visit out Gerrit Code Review. You can also view the Changelog for a full list of changes & features.

    Downloads :

    Note :

    • SafetyNet will fail.
    GCam recommended. No issues with Ultrawide & Macro
    • If you guys experience spoofing issues, try Spoof magisk module.

    Installation:
    • Sideload / Flash
    • Reboot to Recovery
    • Format (optional)

    or Install through Fastboot

    CURRENT KNOWN ISSUES :
    - Safety Net

    Reporting Bugs :
    • DO NOT Report bugs if you're running a custom kernel or you installed Xposed
    • Grab a logcat right after the problem has occurred. (Please include at least a few pages of the log, not just the last few lines, unless you know what you're doing.)

    XDA::)evDB Information
    [ROM][11.0][UNOFFICIAL] Lineage OS 18.1 for Redmi Note 10 (mojito / sunny)
    Source Code:
    https://github.com/LineageOS
    Kernel Source Tree: https://github.com/Neternels/android_kernel_xiaomi_mojito
    ROM OS Version: Android 11
    ROM Kernel: 4.14.206
    Security patch level: September 2021

    Version Information
    Status:
    Stable

    Created 2021-06-01
    Last Updated 2021-10-01

    👍SMASH THE LIKE & SHOW YOUR APPRECIATION👍
    4
    Changelog (01/10/21):
    • Fixed Spoofing on microg variant
    • QS size set to 2x4
    • Fixed Slow charging
    • Fixed camera color shift
    • Moved to Lineage Recovery
    • Allow all filesystems for USB-OTG
    • Don't check prox before pulsing

    Changelog (26/09/21):
    • Included OrangeFox Recovery
    • Smarter decisions on whether to use 2/5Ghz AP
    • Disabled wifi firmware logging
    • Disabled NUD failure occurs logging
    • Fixed whatsapp mic delay or crashes
    • Improved overall system performance

    Changelog (23/09/21):
    • Moved to armv8-2a
    • Added BatteryHealth & Charge Cycle
    • Added Auto Call Record
    • Added Dirac Enhancer
    • Added camera cutout ring like memeui
    • Added main display cutout overlays
    • Updated device cutout corners
    • Fixed wifi display cast
    • Updated brightness overlay configs
    • Bring back full stack of audio ACDB
    • Removed virtual framebuffer cmdline
    • Set voice call volume steps to 10
    • Addressed more sepolicy rules
    • Fixed thermal crash

    Changelog (21/07/21):
    • Dropped gapps variant
    • Switched to User builds
    • Increased system partition's size
    • Included TWRP 3.5.2
    • Set props for Rounded Gboard(If you install Gboard)
    • Setup required props for userspace LMKD
    • Switched Skia rendering backend to Vulkan
    • Enabled force triple frame buffers
    • Added bluetooth aptX blobs from redfin

    Changelog (30/06/21):
    • Initial Build
    • Fixed flashing of libs for ANX
    • Tweaked qs panel a bit

    Changelog (12/06/21):
    • Removed addons (simple calendar, mix, gboard, etc)
    • Included Audio FX

    Changelog (01/06/21):
    • Initial build
    • Replaced native apps with lighter ones
    • MiX & Terminal included
    4
    Changelog (23/09/21):
    • Moved to armv8-2a
    • Added BatteryHealth & Charge Cycle
    • Added Auto Call Record
    • Added Dirac Enhancer
    • Added camera cutout ring like memeui
    • Added main display cutout overlays
    • Updated device cutout corners
    • Fixed wifi display cast
    • Updated brightness overlay configs
    • Bring back full stack of audio ACDB
    • Removed virtual framebuffer cmdline
    • Set voice call volume steps to 10
    • Addressed more sepolicy rules
    • Fixed thermal crash

    Notes:
    • SafetyNet will fail.
    GCam recommended. No issues with Ultrawide & Macro
    • MicroG variant supports spoofing out of the box
    4
    Changelog (26/09/21):
    • OrangeFox Recovery pre-included
    • Smarter decisions on whether to use 2/5Ghz AP
    • Disabled wifi firmware logging
    • Disabled NUD failure occurs logging
    • Fixed whatsapp mic delay or crashes
    • Improved overall system performance
    3
    Hi everyone, I got `ErrorCode::kPostinstallRunnerError` after flasing this rom by TWRP, reflash the TWRP into rawdisk, reboot into recovery, reboot to system and my device bootloop into fastboot. Does anyone know why ? Thank you very much ! (LOS Recovery works fine though.)
    I got this error too one time.. I don't remember what helped, but I've installed LOS so many times on this phone in the meanwhile that I know of other ways that pretty sure works. give this a try:

    you need:
    • the TWRP alpha build twrp.img,
    • latest android platform tools (adb+fastboot),
    • latest redmi firmware.zip (link found in first post of the thread),
    • the lineageOS ROM.zip.
    • if you need to make a clean flash: MiFlash Tool and the current/latest MIUI ROM (links found in this forum)
    I make this guide a more-than-usual detailed step-by-step guide so many users can follow.
    1. start from a clean stock flash (flash the current/most recent official MIUI ROM with MiFlash, make sure you check "clean" and -not- "clean and lock" at the bottom before flashing, otherwise you lock your phone again)
    2. now the phone has MIUI and slot "a" is active, just boot to it and create a PIN/3-dot-pattern (in some cases TWRP can't decrypt data with default PW when you don't set this)
    3. switch off your phone, restart it into fastboot mode (vol-down + power).
    4. connect it with your PC, have the latest fastboot.exe from the most recent platform tools (https://developer.android.com/studio/releases/platform-tools)
    5. set the active slot to "b" with: fastboot.exe --set-active=b
    6. load the TWRP.img (currently the alpha build from this forum) with fastboot: fastboot.exe boot twrp.img
    7. load firmware.zip, lineagerom.zip and twrp.img to your phone: in TWRP enable MTP and copy files from your computer to the phone. if this does not work, see next step.
      Then install firmware.zip, then lineageOS.zip. lineageOS gets installed to slot "a".
    8. (if the above step fails to copy files to your phone try ADB sildeload:
      in TWRP go to advanced -> start ADB sideload. in your console cmd: adb sideload firmware.zip, and: adb sideload lineageos.zip. it installs the ROM to slot "a". there might be an error at the end but it works anyway.)
    9. switch off the phone. return to fastboot mode (vol-down + power)
    10. make the active slot now "a" with fastboot.exe --set-active=a
    11. reboot your phone normally to system, let the ROM start. at this point you should be able to launch LineageOS but without recovery. Load it so you can set up a PIN or 3-dot-pattern and then enable MTP connection with your PC.
    12. copy the TWRP.img (and if you want Magisk.zip) to your phone (internal/external storage), we want to install TWRP recovery now.
    13. switch off the phone, boot into fastboot mode.
    14. start TWRP with: fastboot.exe boot twrp.img, enter your PIN/Pattern to decrypt your user[0] data, in TWRP now go to Advanced -> install TWRP to ramdisk. select the TWRP.img you uploaded before. TWRP gets installed to slot "a".
    15. reboot your phone to recovery: Reboot -> Recovery.
    16. If you want to use Magisk/Root, go to Install -> Magisk.zip (If you want to use a custom Kernel in the future, flash the kernel before Magisk)
    17. now reboot to system, LineageOS should start normally and you can finish installing the rest.
    Lets note that this works at the stage of TWRP alpha with current available LineageOS (2021-06). Future versions of TWRP and LOS may change these steps completely.

    also if you have an error intalling or flashing files due to an snapshotted state (happens when you mess up custom ROM installation before and switchin a/b within TWRP), cancel the snapshot first with the command:
    fastboot.exe snapshot-update cancel