[Nokia 7.2 Guides, News, & Discussion] Ujwal2000:
While I was trying to install GApps for Lineage OS 18.1 on my Nokia 7.2, I always lost my wi-fi. This is apparently due to flashing TWRP as boot image, which replaces the stock boot messing with wi-fi as the boot image has thee kernel.

Although, I did figure it out, it took me three days to get a proper solution from multiple sources. Here, I will explain how to install Lineage OS 18.1 on Nokia 7.2 with Gapps and Magisk. This can be applied to other ROMs as well. I am assuming you are on stock firmware.

Requirements:

Any custom ROM without GApps

vbmeta file

vendor image

Gapps zip file of your choice

platform-tools

twrp image

magisk file

payload dumper tool

Preperation:

The wifi stops working because we change the boot image. To prevent this, we must flash the boot image of the rom after we are done with our work with TWRP

For this, we ,ust get the boot image for the ROM. As this is not available readily, we must extract it from the ROM zip

Install latest python on your pc

Get the payload dumper tool from the link given below. Extract the contents into the root directory of python. It should be in C:\Users\USER-NAME\AppData\Local\Programs\Python\Python <version number>

Extract the ROM zip into any folder. Copy the payload.bin file and paste it in the folder where you put the payload dumper tool

Open a command prompt in the python root folder and type

python -m pip install -r requirements.txt

Then type

python payload_dumper.py payload.bin

After it finishes, go to the folder named Output inside the python folder. Here there will be a file named boot.bin. Rename this as lineage_boot.bin and paste it into the platform tools folder

Installation:

Download the twrp image, rename it to twrp.img and place it in the platform-tools folder. Connect your phone to the computer, switch on usb debugging on your phone.

Open command shell in the platform-tools folder and type

adb reboot bootloader

. In the bootloader, type

fastboot flash boot_b twrp.img

.

Next, type

fastboot --set-active=b

and then reboot to recovery using volume buttons and selecting using power button

In TWRP swipe to allow modifications. Copy your ROM and vendor image files to your SD Card. Now, click wipe, format data and type yes. Go back to home screen and the press install. Select your ROM file and install it. Sometimes it is required to flash vendor image. In that case flash that too. This step is required for Lineage OS 18.1

Now on the twrp home screen, tap on reboot. At the bottom, the current slot should be B. Tap slot A. THis changes the active slot to A. Now go back and tap on bootloader, this should boot you to the bootloader.

Take your vbmeta.img file and place it in the platform tools folder. Now, while in the bootloader mode, type,

fastboot flash vbmeta_a --disable-verity --disable-verification vbmeta.img

Next type

fastboot flash boot_a twrp.img

and boot to recovery using volume buttons

Now, press install in TWRP and select install and install the GApps file and reboot to bootloader

Next, in the bootloader type

fastboot flash boot_a lineage_boot.img

. Now start your phone. You should have lineage os with GApps

Installing Magisk:

Copy the lineage_boot.img into your phone. Download magisk.apk file from the link given below

Install the magisk app and open it. If it asks for additional setup select no. Beside the magisk option select install. Under options, if Recovery Mode is selected, deselect it and click next.

Now click on Select and patch a file under method. Select the lineage_boot.img

The patched image will be saved in downloads folder. Rename this file to lineage_magisk.img and copy it to the platform tools folder on your computer. Reboot your phone to bootloader mode

On your computer in the command window opened in the platform tools folder, type,

fastboot flash boot lineage_magisk.img

Reboot and you will have a rooted lineage os with GApps

Files:

Lineage OS 18.1 and vbmeta.img

TWRP

vendor

NikGApps

Payload Dumper tool

platform tools

Magisk

Guides that I Followed:

Extracting boot.img from ROM zip

Installing magisk using patched boot image

Credits:

Raghu varma for Lineage OS 18.1 port and twrp

Providers of the guides mentioned above