Patrick Zinner
Patrick Zinner

Reputation: 364

Android: Cheating prevention for "last level"

I'm building an Android game and I'm not sure where I should save something like "last completed level" or "remaining lives".

I'm pretty sure that I should not save this information in the database, because it's really simple to access an app's database with root access and some SQLite browser. And I don't want to send it to a webserver, because the game should be playable offline.

What is the most secure place where I can store this information to prevent the player from cheating?

Thanks in advance

Upvotes: 2

Views: 98

Answers (3)

Smile
Smile

Reputation: 375

So you can use Cipher to save your game information file
check this https://stackoverflow.com/a/10782267/2773264

or you can save your file as Object by using ObjectOutputStream (don't save String Object, save a custom class to prevent from cheating).

Upvotes: 0

Tom Susel
Tom Susel

Reputation: 3437

You could use a non secure storage (like SharedPreferences for example) but use a digital signature to make sure that the value wasn't tampered with.

Upvotes: 2

Morendo
Morendo

Reputation: 800

You may wanna try one of the three options described here : http://developer.android.com/training/articles/security-tips.html

Since android is base on UID, it is almost impossible to prevent root user to retrieve data, but you can still encrypt it .

I would go for the internal storage with encryption, and skip the content provider option due to the few data you will store

Upvotes: 2

Related Questions