bepaald/signalbackup-tools

[FEATURE] Direct export/conversion from Desktop app

Opened this issue · 2 comments

It's clear that reconstructing entries from the Desktop database into a backup file with mismatching recipients will not work currently. I wonder if (after reading the complaints and comments from the closed issue that discussed most Desktop-related issues) it makes sense then to allow a bypass mode to directly output data into the chosen format, since technically all the UX/non-internal details are already present and sufficient in the Desktop app database.

Creating a backup with forged details would likely lead to some interesting side-effects if people try importing them, hence my suggestion to make it an export-only capability.

I'm not completely sure if it is what you mean, but there exists an (undocumented) option --addincompletedataforhtmlexport (for use in conjunction with --importfromdesktop), which does add missing recipients and some other data. The way they are imported is (most likely) not correct and would cause errors when actually restoring the backup in Signal. However, the data should be enough to export to html (and maybe a few of the other formats, exporttxt will probably work).

It is not a 'bypass mode' really (you can still use --output to create a backup file, or any other option this program supports) but if you just run signalbackup-tools [input] [passphrase] --importfromdesktop --addincompletedataforhtmlexport --exporthtml [dir] that should do the trick.

Is this what you meant?

edit if you wanted this functionality without needing an android backup file at all, it is currently not possible, and not trivial to implement, but I could give it a go if you want, it might be possible.

I had a quick go at this. The implementation is a bit of a hack, and definitely a little rough still. It was only superficially tested, so there may very well be bugs (some may only appear when adding certain modifying options). But I'd like some initial feedback if you have time and feel like it.

Just signalbackup-tools --exportdesktophtml [dir] should hopefully do it, --exportdesktoptxt [dir] is also implemented (CSV and XML may follow later). Additionally, most of the same modifiers are supported that are available for importfromdesktop, exporthtml and exporttxt. I think the only ones not supported are --limittothreads and --includesettings.

Thanks!