Dúvidas no In App purchase Android


I have two questions on the In App purchase…

First, I wanted to know what it would be like to hide the key64 that speaks in the test application that you have in Android Studio, because it is not recommended to leave it in a String in the code itself.

The second is that in this case, I'm making a game, and what I could buy would be the coins, but since it's offline , can I, after confirming the purchase, simply save the new amount of coins in Shared Preferences ?


Regarding key64

You must leave the base64EncodedPublicKey public key directly in the code being generated at runtime or retrieve it in encrypted form. This is necessary for security measures to prevent a malicious attacker from discovering you.

after purchase

Yes you can save in shared preferences, but it would not be safe. Since if the device has the root released, the user would be able to see and even change the values ​​of shared preferences . Try to save the data encrypted or at least save to database in SQLite

Scroll to Top