Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How safe is Internal Storage?

Tags:

java

android

What I need:

For Android: I need to save data permanently, but also be able to edit (and obviously read) it. This data should NOT be accessible by the user - it can contain things like a highscore, which must not be edited by the user.

My Problem

I would have (and have already) used Internal Storage, but I´m not sure how safe it actually is. Here it says:

You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed.

That´s basicly exactly what I need - but is it really safe? Can it be accessed (maybe only read?) through a rooted device? (Or any other way?)

What about SQLite-Databases or Shared Memory? Are they better suited for saving (small amounts of) data?

Also: is it generally recommended to handle "secret" data in a different way internally? (like not saving it (internally) as Integer/String but some kind of encrypted)

like image 400
Benjamin Schwalb Avatar asked Jul 23 '13 14:07

Benjamin Schwalb


1 Answers

Can it be accessed (maybe only read?) through a rooted device?

It can be read from and written to.

it can contain things like a highscore, which must not be edited by the user.

It is the user's data, not yours. It is the user's device, not yours. Hence, the user can edit that data if the user wants, so long as their data is stored on their device.

Now, if you wanted to prevent somebody else from editing that data, then encryption, with a user-supplied password, is a reasonable measure. That would seem unnecessary for a game high score.

Otherwise, if you do not want them editing that data, do not store it on their device.

like image 191
CommonsWare Avatar answered Oct 01 '22 17:10

CommonsWare