[Asus Zenfone Max Pro M2 Guides, News, & Discussion] Tyakrish:
IMPORTANT NOTE TO USERS UPGRADING TO AN ANDROID 10 ROM:

Please BACKUP YOUR PERSIST PARTITION IN RECOVERY BEFORE FLASHING AN ANDROID 10 ROM, otherwise your device may be messed up seriously. Please read this post before upgrading to A10.

Update on this issue:

https://xdaforums.com/max-pro-m2/how-to/discussion-fixing-persist-issues-t4024247/post81656725

Apparently, due to the changes made by Google, some hacks needed to be done to make Q work with our device. Due to this, when installing an Android 10 ROM and other things like Magisk on it, some modifications are made to the persist partition. These changes might break some important stuff like Camera, Wifi, Torch etc for users who go back to Pie ROMs. Even when switching between TEN Roms, similar problems have come to some users.

*******************************************

****** WAYS TO BACKUP PERSIST ******

*******************************************

1) Using persist backup option in recovery

-> This option is present in recent versions of TWRP and other TWRP based recoveries. Its a good practice to always backup all the important partitions like Persist, EFS and Modem. These contain the most important stuff like IMEI, Wifi Mac address etc. which are unique to your device.

2) Making an Image backup of persist via recovery terminal

-> If the persist backup option isn't available, you can use the dd command from a terminal app (needs root rights) or from the recovery terminal.

Usage:

To create a backup and place it at /sdcard/persist.img:

dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img

To restore a backup which is placed at /sdcard/persist.img:

dd if=/sdcard/persist.img of=/dev/block/bootdevice/by-name/persist

Thanks to [MENTION=7346927]NZedPred[/MENTION], due to which I came across these commands. These appear to work universally and work on our device as well. Please be careful while typing the commands, especially while restoring the persist.img. Even a small mistake could be fatal for the device.

*************************************

********* FIXING PERSIST *********

*************************************

There is no guaranteed way to fix your broken ORIGINAL persist, but currently the only way to fix the broken stuff on your device is using someone else's persist. We need to obtain a twrp backup of the persist or persist.img from some other user who has not upgraded to Android 10.

Before fixing your persist, make a BACKUP of your ORIGINAL PERSIST even if it is broken. It contains important stuff UNIQUE to your device. It might be very helpful, in case someone discovers a fix to it in the future.

Please BEWARE, there are RISKS associated with using someone else's persist. Historically in other devices, it has been used to store IMEI and other important things.

But the following things are CONFIRMED TO BREAK if using someone else's persist.

1) WIDEVINE WILL BE PERMANENTLY STUCK AT L3, since the drm certificates unique to your device will be lost forever.

2) Persist stores your serial number as well, so your ORIGINAL SERIAL number may get lost when switching to stock.

***************************************

****** FIXING SERIAL NUMBER ******

***************************************

Fortunately there is a way to fix your serial number. In the root of your persist, there is a hidden file ".sn.bin". Opening it in a text editor, we can see the last 15 digits of the serial number of the other person's device, whose persist you have used. Copy and keep this number somewhere. Then follow below steps:

1) Backup the current persist.img using the above dd commands.

2) Open the persist.img using a hex editor. You can use any hex editor software for windows/linux or Hex Editor app from Play Store.

3) In the search option, set it to find strings. Set it to 'String' or something similar depending on your software.

4) Search for the 15 digit serial number which you found previously in .sn.bin file.

5) After you find it, replace or edit it to your original serial number. Make sure that you modify ONLY THOSE 15 DIGITS AND NOTHING ELSE.

6) Then save the modified persist.img

7) Restore the modified persist.img using dd commands as above.

8) Almost done, but the new changes in persist won't be detected by the system. So you will have to install the stock pie ROM. Relocking the bootloader is not required as per my testing. So follow the steps to install stock. Use OFRP and decrypt.zip as necessary, to deal with encryption.

9) Now boot up the device.

And voila. Go to settings and check your serial. It should be restored. You can now return to your custom ROM if you want. The serial number will be retained.