How to save in activation billing applications to make intervention more difficult

I am trying to use billing v3 in an application and I saw in the example before save () set this warning

/*
 * WARNING: on a real application, we recommend you save data in a secure way to
 * prevent tampering. For simplicity in this sample, we simply store the data using a
 * SharedPreferences.
 */

      

Using preference usually seems like an easier way to maintain license status, but make spoofing easier, according to his post.

How do I keep my license status? Is there a way to use Preference in a safer way?

Note that I know there is always a way to break any defense, but to make it harder the better.

+3


source to share


2 answers


It is recommended to maintain your own server. Store and use sensitive data from there.



The way would be to use SharedPreference. Encrypt data before storing it and decrypt it when you use it. For this you need to use the javax.crypto package. *. Here's an example.

0


source


All license-related information is provided to you by the Google Market API - usually you don't need to deal with your own server. The information is cached on the device and should be presented to you even if there is no connectivity. But it is good practice to store this information locally as well. SharedPreferences is a good way. I think encrypting / decrypting the data stored in SharedPrefercnes in private is overkill, but if you fill it better - do it as arol_123 advises. You can find a useful helper for SharedPrefernces here .



0


source







All Articles