michnovka
michnovka

Reputation: 3389

Can you change Shared Preferences from outside your app?

Is there a way user could mess with the shared preferences values without the help of my app? E.g. can I store license details here and not worry about user extracting and copying the license key?

Upvotes: 5

Views: 2583

Answers (3)

Evripidis Drakos
Evripidis Drakos

Reputation: 870

Its really easy to access the shared preferences. All you need is a file explorer with root access, they are saved in an xml file in /data/data/YOUR_APP_NAME/shared_prefs/YOUR_APP_NAME_preferences.xml

For licencing you should either use google play's licence check or implement your own checking on a remote server.

Upvotes: 5

Niki van Stein
Niki van Stein

Reputation: 10724

Shared preferences are stored inside the app's space, when you uninstall the app, the preferences are also gone.

So normally users cannot get these values, they are stored privately.

However, with root access and a simple memory search app, a user could be able to access the data. (It is always better to store such things server side.)

Upvotes: 0

Sandro Machado
Sandro Machado

Reputation: 10205

If the context of the shared preferences are private (you define it when you create) only with root access it is possible to access them, without being the application who created.

Upvotes: 2

Related Questions