seedvault-app / seedvault

A backup application for the Android Open Source Project.
1.19k stars 73 forks source link

WhatsApp showing ! next to it with every backup. #596

Closed havalo-lolawo closed 3 months ago

havalo-lolawo commented 7 months ago

I am currently running GrapheneOS latest and everytime the backup runs, WhatsApp seems to have a exclamation mark next to it. Has anyone managed to backup and restore WhatsApp with all data successfully?

I have the automatic restore enabled and when I re-installed the App, I did not get the data restored.

eylenburg commented 7 months ago

Same here.

when I re-installed the App, I did not get the data restored.

That's because while you can backup your encrypted chats (in /Android/media/com.whatsapp I think?) you need the key to decrypt them. This key is hidden somewhere in /Android/data/data/com.whatsapp/files/ where you can't access the files unless you have a rooted device.

If Seedvault can back this key up and restore it to a new phone this would make it possible to backup and restore Whatsapp without a Google Drive backup

havalo-lolawo commented 7 months ago

Thanks for the explaination @eylenburg - would be interested to see if this something the developers could get this resolved. @grote amigo, please save us!

eylenburg commented 7 months ago

I actually got a green ✔️ next to WhatsApp today

havalo-lolawo commented 7 months ago

Can you test a restore to see if it works?

grote commented 7 months ago

WhatsApp doesn't use the Android backup API. See https://github.com/seedvault-app/seedvault/issues/147 and https://github.com/seedvault-app/seedvault/issues/36

eylenburg commented 7 months ago

WhatsApp doesn't use the Android backup API. See #147 and #36

So is there no way to back up that decryption key saved in "data"? I mean the encrypted messages are not the problem, they can be accessed by the user and backed up manually.

Can you test a restore to see if it works?

Sorry I'm too scared to lose my messages if it doesn't work! Also I think it might work anyway, because that decryption key seems to be tied to the device somehow (just my guess) or alternatively doesn't get deleted when you uninstall Whatsapp. On my old phone I once uninstalled Whatsapp by accident and reinstalled it and could then restore the messages from the local backup. But when I copied the local backup (the encrypted messages) to my new phone, Whatsapp didn't offer to restore the messages.

grote commented 7 months ago

So is there no way to back up that decryption key saved in "data"?

You may be able to use the (experimental) files backup of Seedvault to back up this folder. If everything in /sdcard/Android/something/whatsapp-something gets backed up, the app may be able to use that for restore.

eylenburg commented 7 months ago

I can't see the /data folder... shouldn't Seedvault have "root" access to the file system?

havalo-lolawo commented 7 months ago

Sorry I'm too scared to lose my messages if it doesn't work! Also I think it might work anyway,

I restored WhatsApp to a new device by installing WhatsApp and moving com.whatsapp folder to the new device and restored during initial setup so that definitely works so by taking a backup of that folder in data, you should be fine haha - I will wait to get a green tick during Backup. Maybe the dev guys can do some magic?

havalo-lolawo commented 7 months ago

I had a green tick next to WhatsApp - I restored it over Pixel 5 but alas no joy.

eylenburg commented 4 months ago

Does anyone know if the "device-to-device backup" feature in the Expert Settings works for a Whatsapp key restore?

The D2D backup also says "Android may overwrite D2D backups for apps which normally allow backups" and that D2D backups cannot be done automatically. So when restoring, is it necessary to first do a D2D backup restore (for the Whatsapp key) and then a normal restore from the automatic backup (for the newest data that was backed up)?

grote commented 4 months ago

Does anyone know if the "device-to-device backup" feature in the Expert Settings works for a Whatsapp key restore?

No, WhatsApp implements its own backup agent which basically doesn't back up anything due to its built-in backup mechanism.

So when restoring, is it necessary to first do a D2D backup restore (for the Whatsapp key) and then a normal restore from the automatic backup (for the newest data that was backed up)?

That's off-topic in this ticket. The feature is still experimental and will change in the future. One restore is enough. Just ensure the latest backup was done manually (for now).

grote commented 3 months ago

Duplicate of #147