[General Questions and Answers] thesapiensfactr:
Well, today I succeed after 2 weeks of sleepless nights in search of a solution that elaborates how to flash a custom rom successfully on the mentioned device(i.e. Lenovo A2016a40 (also known as Lenovo vibe B)). Now, as I felt the frustration of seeing the phone without network and everything else, I want to mention the whole process I've gone through.

Here is the step-wise guide on how to flash a custom ROM on Lenovo A2016a40 (Hope it works with other devices too)

NOTE: Here in this tutorial I'm not asking you to try a custom rom, it's upon u to use custom rom or not. this tutorial is to guide those who has already stepped into the process and get into an error or so(hope not so). any damage to your device is solely your responsibility, try in your own risk if you want.

GOOD LUCK

BEFORE FLASHING:

1. Take your normally functioning device.

2. Root that device.

For Lenovo A2016a40 I've followed this neat and clean page and found it helpfull.

Here is the summary of that really clean page (the page is a bit outdated follow my paths for updated method (as in December 2020) ).

a) Download and install Magisk Manager app on your andrid device.

b) Launch the app and tap on "install" that is on the same slide as the logo, and then choose to patch boot image by tapping on "Patch Boot Image File" after which the patching process will start which will create a image file called "magisk_patched.img".

c) Transfer that magisk patched image file on your PC.

d) Connect your device to your pc where you have stored magisk patched image.

e) Now enable "USB Debugging" and "Enable OEM unlock" from Settings>Developer's option (or, Settings>About Phone>7x tap on Build Number>Settings Home> Developer's option)

e) (Assuming you have ADB and Fastboot installed, if not follow whatever google says.:ROFLMAO:) Now, open cmd on the folder where you have kept that magisk pathced image by

Shift+Right Click

and selecting "Open Command window Here" and check for your device's connectivity by typing

adb devices

in cmd, and after confirmation(seeing device's serial number) type

adb reboot bootloader

to enter fastboot mode (Fastboot Mode written on screen), confirm connectivity by

fastboot devices

, being confirmed type

fastboot oem unlock

to unlock bootloader and then do press

Volume up

button to unlock bootloader.After seeing "Okay " on command window, type

fastboot flash boot magisk_patched.img

and finally

fastboot reboot

and then press and hold

power + volume 'up'

buttons of your phone for about 10 seconds and then navigate to 'Normal mode' by using

volume up

button and confirm by using

volume down

button and wait for device to start.

f) Check Root status using Root Checker like apps

2. Backup some important system files.

This step is essentially important. I got into this from this thread.

a) Install Root Manager or similar apps and grant them root permisions.

b) Head to /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name folder.

c) Copy the mentioned files into a safe place(generally in external sd card) or newly created folder.

expdb
nvdata
nvram
proinfo
protect1
protect2
secro

d) Now, head to /data/nvram/md/NVRAM/NVD_IMEI and copy the file named

MP0B_001

to another safe place generally in external sd card.

NOTE: All the above mentioned files are important for your device's network functioning.

e) Now, backup or replace whatever you want to keep (personal things).

FLASHING:

1. Download your preferred custom rom(.zip file) strictly for your device and transfer them into the inserted sd card or phone internal memory.

2. Install a custom reecovery.

Download your preferred custom recovery. I've used TWRP custom recovery and going to describe processes for that only.

a) Connect your device to pc and confirm connect by above mentioned method from the downloaded folder and then unlock bootloader the same way as mentioned above.

b) After unlocking bootloader run the commands as mentioned below (press "Enter" after each line)

fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot reboot

c) Now, enter the menu containing "Normal mode" option by the same mentioned method and this time select "Recovery mode" and you will get into TWRP custom recovery.

NOTE: Critical error can occur if you do pull out the battery and power off the device by any other means.

NOTE. After entering TWRP you can face an error saying

/data not mounting

or something like that, in that case head toward wipe section, select "Advanced wipe", select 'Data' and select 'Repair File system', then change partition style to "ext2" and then back into "ext4" and this solves the problem.

3. Backup your system and whatever you like. (generally "secro" "nvram" & "nvdata")

4. Free space for new custom rom by entering Wipe section and selecting the following

Dalvik/ART
system
Data
Cache
Internal Stoage (if you want to or optional)

5. Install your custom rom (with Gapps and Root if you want).

Enter "Install" section select and install .zip files for custom rom, gapps and root one by one or at once, whatever you want.

AFTER FLASHING:

Welcome to your literally new phone.

while you are expecting to celebrate it, you will find some of the most frustrating errors like Unknown Basband, Null IMEI.

Now to solve those errors follow the below mentioned points one by one

1. install root manager like app and grant root permission.

2. copy and paste the 7 files that you have copied earlier (expdb, proinfo, protect1, protect2, nvdata, nvram, secro ) to the path as " /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name", if prompted select "Overwrite", then select the files and provide them all 9 permissions you will get in permission section for those files.

3. Reboot Device.

4. now, delete the folder named "nvram" in path "/data/nvram" to get your baseband version back, as mentioned in this thread, and it worked for me, you may have to try deleting it 3-4 times continuously.

5. Reboot device.

6.Now, copy and paste the copied 'MP0B_001' file to the path as "/data/nvram/md/NVRAM/NVD_IMEI" and similarly assign all the 9 permissions asked in permission window.

7. Set APN if needed. follow this tutorial and you may not be able to save changes (hope not), if so, try putting some random name in the 'Name' field like "avghbejugcbjnsjckln".

8.Reboot Device.

Enjoy the fresh new customization.

NOTE: Keep your device's stock firmware and sp flash tool with you. it will help you get your device back from a bricking type error. try in your own risk.