How to protect/detect database restore on Android device? -
i have app android, saves data sqlite database in common way. user works application, data changed etc. far no problem...
but when user use back-up software (like titanium backup or others), make backup of application, can restore data old state. need way protect application or detect restoration , handle it.
the simple workflow:
- install app
- work app
- reach state1 of app's database
- back-up app (with backup/restore application, device can rooted)
- work app
- reach state2 of app's database
- restores app (or data) state1 - point need deny or detect on next execution of app.
so far played access-time detection , comparsion, seems un-reliable through different devices , roms.
thank you.
to need save state off device, or @ least outside of data
directory. easiest way save fingerprint of db file in 'hidden' directory on external storage (sd card). or if app has web login, etc. store fingerprint each user.
in case, user has full control on device can't prevent 100%. app needs gracefully handle changes in db or fail if detects fatal inconsistency.
Comments
Post a Comment