bepaald / signalbackup-tools

Tool to work with Signal Backup files.
GNU General Public License v3.0
755 stars 36 forks source link

Read Android .ab backup file? #226

Closed Lucent closed 1 month ago

Lucent commented 1 month ago

In 2016 and 2017, I backed up Signal using adb, which created an unencrypted .ab that when turned into a tar, contains directories: db, f, r, sp. db/ contains messages.db, whisper_directory.db, while r/ contains app_parts/ *.mms.

Can this tool parse these at all or turn them back into a standard backup?

bepaald commented 1 month ago

Hi Lucent,

I'm sorry but, no, this tool does not handle these .ab files.

I've never had my hands on one of those, I'm actually slightly curious what I could do with them (given enough free time). I can imagine importing its contents into a new backup file might not even be too difficult if the database formats aren't too different. But as I understand it, it is no longer possible to create adb backups of Signal anymore, so I don't think there's anything I can do.

Thanks!

Lucent commented 1 month ago

Thanks for considering. If you ever want to give it a try and have free time, just name your price.

bepaald commented 1 month ago

Note, just to be clear, the price is 0. I'd definitely do this just for fun. I might fail, and I might succeed, and it might take me 30 minutes or 2 years to find out which. The problem is that I don't have an adb backup to tinker with. If anyone gives me (doable) instructions on how to get one, I'll get working on this.

Lucent commented 1 month ago

Let me try to scrub out most of the sensitive data from an SQLite encrypted messages.db and most of the .MMS and send it to you if that would work.

bepaald commented 1 month ago

I don't usually do that sort of thing, but in this case, I won't stop you. As long as you are comfortable with it. You can email the data to me directly instead of posting it here if you prefer.

Please do realize, there is no guarantee I get anything working (I think it will be quite a complicated process). And if I do, it could take me a while. I will be fairly busy for the next couple of weeks at least (the next two weeks mostly without a computer even).

Also, some questions:

With the backup data being so old, I can imagine you are not really looking for a working, active Signal installation necessarily, just for a way to view the data in a practical way. With messages and media in context. If this is the case, I could attempt to make the data compatible with this tools --exporthtml option, which (I suspect) will be a lot easier than creating a backup.

I mentioned earlier that one way to get this done might be to import the data into a current actual backup file. When doing this, it is impossible to actually create new contacts in the backup file, they must already exist*. Would it be possible for you to have a backup file with all the contacts that appear in the adb data? You do not necessarily have to have messages exchanged in the new backup, but the contacts should be present (as this tools --listrecipients could show).

* Technically of course, there is no need to create new contacts, since they all must exist in the adb data and could also be imported. However, I suspect the contacts in the adb data may be too old to import (lacking uuid and the proper keys, which would need to be generated server side).