0

I am implementing backup/restore functionality like Whatsapp with Realm as a database.

So fare i am able to Backup and Restore users chat history, but could not get a way to validate the backup file.

Is there any documentation or reference on how Whatsapp validates the backup file with users phone number to avoid restoring database if number used for login and backup were different?

I have gone through Whatsapp whitepaper but there is not much to understand their technique.

  • I guess you'll have to generate a checksum of the realm file, then concat this hash and user phone number to generate a new checksum ? Some methods can be found here : https://stackoverflow.com/questions/13152736/how-to-generate-an-md5-checksum-for-a-file-in-android – Maelig Jun 12 '19 at 12:04

1 Answers1

0

During backup: Save a key into the user's keychain. This key will only be deletable by your app. Upload the same key to iCloud.

During restore: Compare both keys to see if they match

smoothBlue
  • 203
  • 4
  • 12