Hello everyone, I recently saw my game on third-party sites (but already in the cracked version). I have resources in the game: coins (earned in the game) and diamonds (with the help of donating). So, in the cracked version, all values on gold and diamonds are 9999999. And I do not know how to fix my code so that later on users could not use this function.
Any serious, money-involving function, like storing how much credit your users have should be stored on a server. Never locally. Unless you’re willing to live with cracks. Never trust any code locally, no matter if you wrote it, every client, all code can be hacked on the client side.
But can I do anything for now? Maybe any other steps I can make that in the future not to make these errors. Maybe there are any kinds of testing that will help me discover other holes in my application?
IL2CPP and some nasty checks would make cheaters life much harder.
I doubt someone would ever buy 999999 diamonds, so you might execute some nasty check and do some crazy stuff. Like changing all text to “Dirty Cheater” or smth like that.
Although its not bullet proof. Heck, even Denuvo can be hacked, so don’t be upset if someone does decompile your game. If you’re using mono backend - especially. Code is just right there, without any obfuscation.
If I will transfer all the data to the server, can I change the data to any user? For example, add coins to me? Not by Unity editor, but on the server, so that the data come will synchronize with a server and my android device
You will pretty much have to set this up yourself: set up a Server, a protocol, and the security measures. Usually, your users will have to log in to your Server, and therefore they’ll need an account with you, so you’ll have to implement a front end as well as the back end. I don’t know if there are off-the-shelf solutions for this (we implemented our own - anyone here has a recommendation for an established, reliable Service?), but the upshot is that how you transfer the data to the server, and what options you have is pretty much up to you.