Home > Software engineering >  How can I securely store data on Android that will survive a reinstall?
How can I securely store data on Android that will survive a reinstall?

Time:09-14

Looking at older posts here on Stack Overflow, it appears this is not possible. But I'm wondering if there are any newer SDK APIs that support this ability?

In my specific case, I need to create a UUID the first time my app runs because Android doesn't allow you to access a unique, hardware-based Device ID. I use my UUID instead which works great unless the user uninstalls then reinstalls later, in which case a new UUID is created and the user has lost access to their old data.

If there is no Android API to do this, perhaps there's a way to do it using the Google Account they're currently signed into the device with, which would store the UUID in the cloud somehow?

CodePudding user response:

you could FirebaseAuthentification, its based on Email (Google account) for example and UID FirebaseAuth

CodePudding user response:

Android, and iOS, by design, delete all of an apps data when the app is removed from a phone.

To do what you are talking about would require some sort of authentication API that lives elsewhere (think backend service). You could build your own or use some of the existing authentication frameworks; however, you would still need to manage the persisting of the data you want to store, as well as retrieving it. Authentication would simply allow you to associate a user to a set of data.

  • Related