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:

  1. install app
  2. work app
  3. reach state1 of app's database
  4. back-up app (with backup/restore application, device can rooted)
  5. work app
  6. reach state2 of app's database
  7. 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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -