signalbackup-tools
signalbackup-tools copied to clipboard
Make HTML from SMS Backup & Restore XML files.
First I'd like to express my appreciation for this tool. The freedom it provides is just such a breath of fresh air in contrast to the opacity and rigidity that have unfortunately become synonymous with so many aspects of Signal. I've really enjoyed watching this project grow over the past few years. After nearly 20 years in the software industry, I can honestly say that the quality you have achieved while building a significant body of functionality is impressive.
One of the features I have really been enjoying is the HTML export feature: the output is beautiful and remarkably functional; the embedded media handling is especially nice. After reading through issue [#227], I started wondering: could I somehow use signalbackup-tools to generate gorgeous HTML archives of my SMS/MMS messages from SMS Backup & Restore's XML files? The idea here would be to either use --exportplaintextbackuphtml
to directly generate HTML, or even better, perform multiple --importplaintextbackup
operations starting from an empty backup to effectively integrate multiple XML backups. In the latter case, the goal would just be to ultimately run --exporthtml
on the resulting backup; it wouldn't have to be a perfectly valid Signal backup file since it would never actually be restored in Signal.
So, I tried a few experiments with --importplaintextbackup
, --exportplaintextbackuphtml
, and --listxmlcontacts
. All of them produced the same result, and I also had similar experiences with different XML files. Here is an example:
H:\sjevtic\testing>signalbackup-tools-20250112-1_win.exe --exportplaintextbackuphtml sms.xml .\html *** Starting log: 2025-01-18 11:37:05 *** signalbackup-tools (signalbackup-tools-20250112-1_win.exe) source version 20250112.125109 (Win) (SQlite: 3.47.2, OpenSSL: OpenSSL 3.4.0 22 Oct 2024) [Error]: During sqlite3_prepare_v2(): near "m": syntax error -> Query: "INSERT INTO smses (date, type, read, body, contact_name, address) VALUES (1373919414774, 2, 1, 'I'm at the cinema', 'redacted-contact', 'redacted-number')"
Here's the corresponding line from the backup that caused the issue:
<sms protocol="0" address="redacted-number" date="1373919414774" type="2" subject="null" body="I'm at the cinema" toa="null" sc_toa="null" service_center="null" read="1" status="-1" locked="0" date_sent="1373919414774" sub_id="-1" readable_date="Jul 15, 2013 4:16:54 PM" contact_name="redacted-contact" />
I don't have a lot of knowledge about XML, but the two highest rated responses to this post break down the escaping rules well, and it seems that a single quote (') enclosed in a double-quoted (") attribute is valid.
I have a few questions:
- Can I achieve what I wish to accomplish with signalbackup-tools?
- If yes to (1), is my approach correct, or can you provide guidance as to how to do this correctly?
- If yes to (1), do I need to preprocess my XML backups to change the quoting, or is this an issue in signalbackup-tools?
Thanks!