Original credit goes to JackVanReys for writing this guide. Did a few minor edits for clarification, but the work was originally his. Please show them some love on the forum!
NOTE 1: This only works on non-rooted devices. If your phone or emulator is rooted, it will NOT work. You must use a completely vanilla installation of your device.
NOTE 2: Do not skip any steps in this guide, no matter how tempted you are. Every step is crucial! Also, I cannot translate this into your native language if you don't speak English, so please use https://translate.google.com or https://deepl.com if you need a translation.
NOTE 3: This method will not work if your character is wearing any clothes, accessories, or pet skins that were released after the 5.2.2 update. To save yourself some time, before you do any of the steps below, log into the game using the vanilla app (from the Google Play store) and unequip all of your accessories & pet skins. Put on your default Hogwarts robes and select an old hairstyle too.
HOW TO LOG INTO FACEBOOK ON THE MODDED APP:
1. Delete the game data and cache in your device's app settings menu.
2. Uninstall the game.
3. If you have the Facebook app uninstall it too, for some reason the Facebook login on mods only works through web browser.
4. Restart your device (I'm not 100% sure this is mandatory, but I did it just to be sure)
5. Open your phone's web browser (such as Chrome, Safari, or Firefox) and log into your Facebook account from there.
6. Download and install the game version 5.2.2, it's in the original post on page 1 under the links to the latest version.
7. Run the game, when it prompts you to update it select "later" (some people have an issue where the game doesn't give them the option to update later, this is why you have to delete the game's data and cache first).
8. When you're on the character creation screen, link your Facebook account to the game. Facebook should open through the web browser and then you can retrieve your save.
9. Exit the game and update to the latest version without uninstalling version 5.2.2 (download and run the latest .apk, then when you are prompted to overwrite/update the existing app, choose "Yes").