[Treble-Enabled Device Questions and Answers] Matty1993:
Hey mate,

Yep so for data call or emergency only problems what you need to do is extract the rom using 7zip

Once the rom is extracted depending on how it was compiled you will end up with folders as follows

META-INF

System

boot.img

Now copy from your original stock firmware these folders to an sd card or internal storage so you can transfer to a pc desktop use ES file explorer as you dont need SU right to copy from the /system only to write

So head over to

System/etc/firmware (copy the entire folder )

System/etc/permissions (copy the ril, radio and google widevine permissions)

System/etc/apn-conf

System/etc/spn-conf

If you have a folder called modem also in /system/etc copy this also, NOTE though i have had problems using the modem folder on some builds will connect to network until device goes into sleep mode after that nothing but emergency calls only so if you have this folder delete it first and rezip to make sure its not the culprit

Anyhow after you have copied those files & folders from your stock /etc folder head over to

System/lib/

Now copy these libs as follows

Libcustom_nvram.so

ALL libnvram***.so files

Libmtkril.so

Libmtkril2.so if you have it

Copy all copied files to pc desktop or folder

Enter the rom folder you extracted open /system/

Folder then /etc/ & delete the entire firmware folder

Now copy from the stock the entire firmware folder to system/etc of the extracted rom

Replace the apn-conf & spn-conf files also from the stock files you copied

Head over to /lib/ now & replace all the files you copied from stock

Now before zipping the rom back up open your build.prop which is located in /system/ scroll through to see if there have been edits made under telphony or ril, sometimes there will be no header depends on the person editing, make sure theyre are no ril ro. Props added as these can also break your ril if even 1 ro. Prop has been entered that shouldnt be there.

Once done head back to where all 3 or more folders/files are located

META-INF

SYSTEM

BOOT.IMG

Now highlight them all by using ctrl + A on the pc keyboard the right click and select add to archive through 7zip

Youll want to set normal compression & it MUST be zipped back up into a .zip file TWRP or any other recovery can not read .rar files

So select .zip and zip it up after simply copy to SD and either dirty flash over the top of the existing rom or make a clean flash by formatting /data

The wiping

/system

/data

/cache

/dalvik-cache

throgh twrp or which ever recovery your using

Thats it :) if you need any more help just holla ive built a fair few version of android so there isnt much i dont know :)

Oh also there are no ril libs or anything to do with ril in the /vendor unless the build has specificall been made a vendor build.

Another note once you unzip your rom to change the files out if there is no /system/ folder and only a system.img or system.img.br file then you will need to decompile the image first in order to make the changes,

I recommend classy kitchen for decompiling the system.img or system.img.br files hope this was a little easier to understand i spent like 45 mins trying to type it out in simple terms for you :)