bepaald / signalbackup-tools

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

This tool does not recover disappearing messages. #182

Closed marines1 closed 7 months ago

marines1 commented 7 months ago

Why doesn't this tool recover disappearing messages? Orginial signal.db contains disappearing message.

bepaald commented 7 months ago

Why doesn't this tool recover disappearing messages? Orginial signal.db contains disappearing message.

What do you mean exactly with 'recover'? If a message has disappeared, it is not in the database anymore (not a single trace of it to even know that a message once existed).

Messages that have not yet disappeared will only be in the backup if they aren't set to disappear within 1 day*. These messages are handled just fine by this tool. But note: if the timer has expired when the backup is restored, Signal will immediately delete the messages as part of the restore process. If you want messages with an expiration timer to stay forever, it is trivial to do with this tool (untested, but something like this --runsqlquery "UPDATE message SET expires_in = 0 WHERE [...some condition to select the messages...]", possibly also set expire_started to 0, but not sure if necessary).

Maybe you could explain what you mean a bit better? I feel this issue is invalid and should be closed.

* This is only since the current version, released in the past few days. Before this, no disappearing messages were backed up ever, even before their disappearance.

marines1 commented 7 months ago

But the original signal.db file contains all messages, even those that had a disappearing time set.

bepaald commented 7 months ago

What is this 'signal.db' file you speak of? This tool, as the name implies, deals with backup files.

Up until about 3 days ago (Signal 6.44), these backup files did not contain any disappearing messages.

Since then, only messages with a disappearing timer of 1 day or more are backed up*. This tool handles them correctly.

What do you mean recover? The messages that are in the backup file do not need to be recovered, they are already there. And this tool does not remove them (unless asked to of course). Messages that are not in the backup, because their timer had already expired, can not be 'recovered': they weren't just deleted, they were never backed up in the first place.

You need to be more clear, don't be afraid to write more than one sentence when explaining.


* See: https://github.com/signalapp/Signal-Android/blob/7abff55981d3c440ad90e8792d22a9dc82819058/app/src/main/java/org/thoughtcrime/securesms/backup/FullBackupExporter.java#L80, https://github.com/signalapp/Signal-Android/blob/7abff55981d3c440ad90e8792d22a9dc82819058/app/src/main/java/org/thoughtcrime/securesms/backup/FullBackupExporter.java#L582-L591, and https://github.com/signalapp/Signal-Android/blob/7abff55981d3c440ad90e8792d22a9dc82819058/app/src/main/java/org/thoughtcrime/securesms/backup/FullBackupExporter.java#L162-L163

bepaald commented 7 months ago

One last try:

marines1 commented 7 months ago

This file "/data/user/{User Number}/org.thoughtcrime.securesms/databases/signal.db" is encrypted and contains all messages that occurred. There are also disappearing messages. Why aren't the same messages in the backup?

bepaald commented 7 months ago

This file "/data/user/{User Number}/org.thoughtcrime.securesms/databases/signal.db"

  1. As I mentioned before, this tool is called signalbackup-tools. The 'about' section reads: "Tool to work with Signal Backup files.". The very first sentence of the readme is "Tool to work with backup files generated by the Signal android application (https://signal.org/)." You are in the wrong place.

Why aren't the same messages in the backup?

  1. Once more, to be clear:

    • If the backup file was created with a older version of Signal (< 6.44), all messages with a disappearing timer are skipped.
    • If the backup is created with current, or newer versions of Signal (>= 6.44), messages with a disappearing timer set to expire in 24 hours or more are placed in the backup, shorter ones are still skipped like before.

    If you mean 'why', as in 'what code causes this behavior?', I linked to the relevant parts in Signal's code in my previous message. If you mean 'why', as in 'why was it decided to work this way?', again, you are in the wrong place. I am not a Signal developer and I have nothing to do with their decisions.

You should go to Signal's website (or their community forums (https://community.signalusers.org/) with these questions.