Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

PNG -> scaled JPEG attachment -> saves with ".png" extension

Open unrulygnu opened this issue 11 years ago • 0 comments

When sending a media message with a PNG attachment, Signal converts the PNG to JPEG (and scales it) before sending. Later, when choosing to save the image from the conversation, this JPEG is saved with a ".png" extension. This occurs because Attachment#updateAttachmentData replaces the attachment data stream without updating the attachment content type.

Steps to reproduce

  1. Take a completely unamusing screenshot (PNG) to send to a contact
  2. Open Signal
  3. Open the conversation with said contact
  4. Tap the Attach button
  5. Tap the Image button
  6. Select the new screenshot from the documents provider
  7. Observe the draft media message with thumbnail
  8. Tap the Send button
  9. Wait for the media message progress to complete (converting to JPEG, scaling, sending)
  10. Long press the media message
  11. Tap the Save button
  12. Reluctantly embrace the security warning
  13. Observe the new Signal-yyyy-mm-dd-hhmmss.png in /sdcard/Pictures
  14. adb pull this curious file and check check it
  15. Behold, a JPEG in disguise

Device info: Nexus 5, stock Android 6.0 MRA58K, Signal 3.5.0 (473e470)

App state: Signal registered, SMS enabled, default SMS app

unrulygnu avatar Nov 23 '15 04:11 unrulygnu