"how to protect/detect database restore on android device?" Code Answer

3

to do this you need to save some state off the device, or at least outside of the data directory. the easiest way is probably to save the fingerprint of the db file in some 'hidden' directory on external storage (sd card). or if your app has web login, etc. store the fingerprint for each user.

in any case, the user has full control over the device so you can't prevent this 100%. your app needs to gracefully handle any changes in the db or simply fail if it detects a fatal inconsistency.

By klimpond on March 2 2022

Answers related to “how to protect/detect database restore on android device?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.