The Android game I am building needs to store certain game data such as “levels unlocked” and “coins owned”. It is all accepted that PlayersPrefs is unsecure. Given that there will be some IAPs (for coins purchase) in the game I need to exercise certain measures to avoid users getting coins to avoid paying money too easily.
From other threads, I have learnt of two possible ways to solve the problem:
(1) using anti-cheat kits (or write my own script to encrypt data) on PlayersPrefs.
(2) Serialization of data (does it work on Androids?)
But the other threads have not compared the two methods.
Which method would you consider the better way to protect my data? Thank you.
Thanks for your suggestion but my game will have no online elements. (i.e. players can earn its coins in-game and spend it offline). It would be an overkill to use servers.
I don’t anticipate full-protection either, so using either anti-cheat kits or serialization would do, and I want to pick one of them.
If there is no online option then binary serialization is not easily modifiable for the common user.
If your game gets popular, then I think it is impossible for an offline app data to remain safe if there is a dedicated person that wants to crack it.
Just be cautious about losing players progress if you have no way to track it and your game is a progressive game.
Otherwise, either choice works. I’m not sure where playerprefs is stored on Android, but I know it’s easy enough to access files stored in the persistentDataPath.
Note that android does allow you to hide folders by added a . in front of the folder name, so saving to .gameData/aFileName.data for example will make the gameData folder hidden on the device. They can still find it if they look, but the average user probably doesn’t have hidden folders visible in their options.