bepaald / signalbackup-tools

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

Android 12, Signal 6.40.5, disappearing messages still encrypted? #162

Closed InfiniteBSOD closed 11 months ago

InfiniteBSOD commented 11 months ago

My setup: Galaxy S21 Android 12 Signal v. 6.40.5

Hello,

Testing with the phone above and having two messages set to disappear (but not having expired when taking the backup) in a group chat I see the following when generating an HTML-report: Screenshot 2023-11-21 104517

When dumping the Signal DB and checking the following table: messages I can see that the message contents for the two messages are still encrypted / in ciphertext but I can see the contact names and their phonenumbers.

Any idea why? AFAIK the password is correct (since the output doesn't complain that it is the wrong password which it would otherwise notify me of, right?) but I've had problems with other tools telling me the backup password is incorrect.

I have triple checked the password and took a photo of the code generated when creating the backup so I'm 100% sure it is the correct passphrase.

Best Regards

bepaald commented 11 months ago

Hi!

Disappearing messages are not backed up at all, regardless of whether they have expired or not.

The messages you are seeing in the backup are — as the HTML says — group update messages. I thought nearly all of them were decoded by the export function, but you are running into the catch-all at the end of the function:

https://github.com/bepaald/signalbackup-tools/blob/634e45a8c38471f42e16bfc9f14e1e1f31f19a7f/signalbackup/decodestatusmessage.cc#L594-L604

If you want to help me improve the export, I would love to get:

Given the context of this issue, I will at least test if the 'disappearing messages timer update'-message was changed somehow, causing it not to be properly decoded. EDIT Well I checked the 'disappearing messages timer update'-message and they at least still work, so I'm curious what these two messages are. Thanks! Screenshot 2023-11-21 at 17-07-24 new test group

Thanks for reporting!

InfiniteBSOD commented 11 months ago

Hi!

Disappearing messages are not backed up at all, regardless of whether they have expired or not.

The messages you are seeing in the backup are — as the HTML says — group update messages. I thought nearly all of them were decoded by the export function, but you are running into the catch-all at the end of the function:

https://github.com/bepaald/signalbackup-tools/blob/634e45a8c38471f42e16bfc9f14e1e1f31f19a7f/signalbackup/decodestatusmessage.cc#L594-L604

If you want to help me improve the export, I would love to get:

  • The 'ciphertext' of the message (it is not encrypted, it is just a base64 encoded protocol buffer)
  • The 'type' of the message. In the same database dump, each message has a number in the 'type' column.
  • What these messages actually look like on your phone, feel free to change or censor names of course. (For example "John Doe set the disappearing message timer to 1 week", or maybe they don't show up at all. Try to match the date and time if possible).

~Given the context of this issue, I will at least test if the 'disappearing messages timer update'-message was changed somehow, causing it not to be properly decoded.~ EDIT Well I checked the 'disappearing messages timer update'-message and they at least still work, so I'm curious what these two messages are. Thanks! Screenshot 2023-11-21 at 17-07-24 new test group

Thanks for reporting!

Sure thing, thank you for developing an awesome tool :) Just happy to help in any way I can to improve it. Thank you for the information regarding disappearing messages (that they don't get included in a backup), very useful information.

Table "messages" and: "Body": CiQKIKQiSKHUiRd49l7s2q+JHUiKzidD8sB/UAijgYWYjvG9EAAawwESCE1pZyBNYWNzIgMIkBwqBggCEAIYBDo2ChCyBunbaq9NH4jEOkWd+KumEAIaICZ7pdXGXY5p8iDCHZ10V/rgSnh146UoLIpXtLouc5uSQnAKEFb3ksKYM0yFtBYLYDELz9sQARoQsgbp22qvTR+IxDpFnfirpiDGv96HvzEqQQAoLBCXuJwHhz0NE+WjLxE06kebm7f9ObgEII8msUsCNGhcjnUheY5sw/9EczfUJfSoy2bR3+fXDM0Sbz7VDrZoYAI=

"Type": 11075604

Table "messages" and: "Body": CoYICiCkIkih1IkXePZe7NqviR1Iis4nQ/LAf1AIo4GFmI7xvRABGt8HCpoHCkEAKCwQl7icB4c9DRPloy8RNOpHm5u3/Tm4BCCPJrFLAjRoXI51IXmObMP/RHM31CX0qMtm0d/n1wzNEm8+1Q62aBABStIGCskFAOLyrgpqvE5xqISpYcUAUV9Y4wtqpYLdjbamWUXgjS124vKuCmq8TnGohKlhxQBRX1jjC2qlgt2NtqZZReCNLXbi8q4KarxOcaiEqWHFAFFfWOMLaqWC3Y22pllF4I0tduLyrgpqvE5xqISpYcUAUV9Y4wtqpYLdjbamWUXgjS124vKuCmq8TnGohKlhxQBRX1jjC2qlgt2NtqZZReCNLXbi8q4KarxOcaiEqWHFAFFfWOMLaqWC3Y22pllF4I0tduLyrgpqvE5xqISpYcUAUV9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hY3MiAwiQHCoGCAIQAhgEMAE6NgoQsgbp22qvTR+IxDpFnfirphACGiAme6XVxl2OafIgwh2ddFf64Ep4deOlKCyKV7S6LnObkjo8ChBW95LCmDNMhbQWC2AxC8/bEAEaIM5X95bP+qPzyHefl1Vi4MCzJPhsyStCE9O7XuCkppwMKP////8PYAIiwwESCE1pZyBNYWNzIgMIkBwqBggCEAIYBDo2ChCyBunbaq9NH4jEOkWd+KumEAIaICZ7pdXGXY5p8iDCHZ10V/rgSnh146UoLIpXtLouc5uSQnAKEFb3ksKYM0yFtBYLYDELz9sQARoQsgbp22qvTR+IxDpFnfirpiDGv96HvzEqQQAoLBCXuJwHhz0NE+WjLxE06kebm7f9ObgEII8msUsCNGhcjnUheY5sw/9EczfUJfSoy2bR3+fXDM0Sbz7VDrZoYAI=

"Type": 11075607

The messages themselves have expired but I can give you a screenshot of the group however not even the system messages are showing now. (It's Signal in Swedish and a groupchat, the system notifications says: "< user > invited you to the group" and "You accepted the invitation to join the group"): Screenshot_20231121-172347_Signal

I can redo it if you'd like and provide you with a picture of the actual contents of the disappearing messages together with the other data from the DB that you requested?

bepaald commented 11 months ago

Thanks, this is exactly what I need. I'll get to work on this as soon as I have time.

I can redo it if you'd like and provide you with a picture of the actual contents of the disappearing messages together with the other data from the DB that you requested?

No need, this is it. The two messages you were seeing ("(group V2 update)"), should say "< user > invited you to the group" and "You accepted the invitation to join the group". I think I can find out what the problem is from the info you provided. Thanks!

InfiniteBSOD commented 11 months ago

Thanks, this is exactly what I need. I'll get to work on this as soon as I have time.

I can redo it if you'd like and provide you with a picture of the actual contents of the disappearing messages together with the other data from the DB that you requested?

No need, this is it. The two messages you were seeing ("(group V2 update)"), should say "< user > invited you to the group" and "You accepted the invitation to join the group". I think I can find out what the problem is from the info you provided. Thanks!

Appreciate it.

Perhaps a stupid question but is there any way for you to indicate if a disappearing message have been sent in the chat and if so by who (even if the body of the message itself isn't retrievable)?

So for instance: User1 12:00:00: <User1 sent a message, however the chat / group was set to disappearing message therefore this message body isn't exported with the backup>

bepaald commented 11 months ago

Perhaps a stupid question but is there any way for you to indicate if a disappearing message have been sent in the chat and if so by who (even if the body of the message itself isn't retrievable)?

I would if I could, but it's not just the body that's missing. There is nothing in the backup at all. Not a single indication that any message was ever sent. So there is nothing I can do.

If your aim is to save disappearing messages somehow, your only options are to screenshot the chat before messages expire or run a custom version of Signal where you patch out the deletion of the expired messages (or enable them for backup).


I have just pushed an update that hopoefully properly shows the group-update-messages. I realize you may have lost interest in the HTML export (as it can't show the messages you wanted), but if you find the time and don't mind: maybe you could try the current version once more and let me know if the two messages now show up correctly.

Thanks!

InfiniteBSOD commented 11 months ago

Perhaps a stupid question but is there any way for you to indicate if a disappearing message have been sent in the chat and if so by who (even if the body of the message itself isn't retrievable)?

I would if I could, but it's not just the body that's missing. There is nothing in the backup at all. Not a single indication that any message was ever sent. So there is nothing I can do.

Ah thought that might be the case :/ A suggestion: Since the chat / groupchat itself has knowledge about if disappearing messages have been used / toggled: Disappearing messages: 1 hours can that be indicated through an icon in the chat without having to expand the details? Untitled Above is my hacky illustration of it, both on the "Signal conversation list"-view and in the actual (chat) itself.

If your aim is to save disappearing messages somehow, your only options are to screenshot the chat before messages expire or run a custom version of Signal where you patch out the deletion of the expired messages (or enable them for backup).

I have just pushed an update that hopoefully properly shows the group-update-messages. I realize you may have lost interest in the HTML export (as it can't show the messages you wanted), but if you find the time and don't mind: maybe you could try the current version once more and let me know if the two messages now show up correctly.

Thanks!

Thank you so much for fixing this issue, attaching screenshot: image Old is the right one and the new is the left one, perfect!

bepaald commented 11 months ago

A suggestion: Since the chat / groupchat itself has knowledge about if disappearing messages have been used / toggled: Disappearing messages: 1 hours can that be indicated through an icon in the chat without having to expand the details?

I've added a badge in the actual chat, that was not too hard, and I notice Signal also shows this information at the top when a chat with disappearing messages enabled is opened. I haven't added one in the conversation overview because it is more difficult to implement and to make it look nice, and also because Signal also does not have any indication like this in the overview. I hope that's all right.

Old is the right one and the new is the left one, perfect!

Thanks for reporting back, that looks good.

If there's nothing else, this issue can probably be closed? If you think of anything later you can always open new issues of course.

Thanks again!