Users that are new to rooting and/or with a new device NEED to back up critical partitions related to signal and fingerprint.
adb kill-server
adb devices
adb shell
bakdir=my_backup_$(date --utc "+%Y%m%dT%H%M%S")
su -c mkdir /tmp/$bakdir
# EFS (baseband)
su -c dd if=/dev/block/bootdevice/by-name/fsc of=/tmp/$bakdir/fsc.img
su -c dd if=/dev/block/bootdevice/by-name/fsg of=/tmp/$bakdir/fsg.img
# modemst1 (Contains IMEI)
su -c dd if=/dev/block/bootdevice/by-name/modemst1 of=/tmp/$bakdir/modemst1.img
# modemst2 (Contains IMEI)
su -c dd if=/dev/block/bootdevice/by-name/modemst2 of=/tmp/$bakdir/modemst2.img
# ocdt (Contains device identifers)
su -c dd if=/dev/block/bootdevice/by-name/ocdt of=/tmp/$bakdir/ocdt.img
# persist (Contains Attestation Key and security items)
su -c dd if=/dev/block/bootdevice/by-name/persist of=/tmp/$bakdir/persist.img
# metadata (FBE key stoarge)
# You should back it up along with `userdata` partition.
su -c dd if=/dev/block/bootdevice/by-name/metadata of=/tmp/$bakdir/metadata.img
exit
adb pull /tmp/my_backup_*
adb kill-server
adb devices
adb reboot fastboot
fastboot flash fsc fsc.img
fastboot flash fsg fsg.img
fastboot flash modemst1 modemst1.img
fastboot flash modemst2 modemst2.img
fastboot flash ocdt ocdt.img
fastboot flash persist persist.img
# do not restore it unless your `userdata` cannot be decrypted.
fastboot flash metadata metadata.img
fastboot reboot