Giter VIP home page Giter VIP logo

signal-backup's Introduction

SIGNAL SAVE

Signal-backup is a python3 script to backup signal conversations, wether its a group or not, as html pages.

Requirements

A signal backup (tested with Android) fully decrypted using signal-backup-decode.

Usage :

$ cat pass_signal
123451234512345123451234512345

$ signal-backup-decode --output-path out --password-file pass_signal signal-1970-01-01-01-00-00.backup
Database Version: ...
Copy successful, sqlite at signal-backup/out/signal_backup.db

$ ls -1 out
attachment/
avatar/
config/
stickers/
signal_backup.db

Basic usage

$ python3 signal_backup.py -h
usage: signal_backup.py [-h] [--db DB_PATH] [--attachment ATTACHMENT_DIR] [--conv_name CONV_NAME [CONV_NAME ...]] [--yourself YOUR_NAME]
                      [--output_dir HTML_OUTPUT_DIR]

optional arguments:
  -h, --help            show this help message and exit
  --db DB_PATH          Path to signal_backup.db file
  --attachment ATTACHMENT_DIR, -a ATTACHMENT_DIR
                        Path to attachment directory
  --conv_name CONV_NAME [CONV_NAME ...], -cn CONV_NAME [CONV_NAME ...]
                        Name of the conversation you wish to display
  --yourself YOUR_NAME, -y YOUR_NAME
                        Your name
  --output_dir HTML_OUTPUT_DIR, -o HTML_OUTPUT_DIR
                        html output dir

ipfyx@mysecretmachine:~/signal/signal-backup$ ls -1
bootstrap
CSS.py
example
--> out
README.md
signal_backup.py
signal.css
signal_structure.py

python3 signal_backup.py --db out/signal_backup.db --attachment out/attachment/ -cn 'Conversation Name 1' "Conversation Name 2" -y 'Your Name' --o output_directory 
Creating outpur directory backup_1970-01-01/Conversation Name 1/
Saving conversation Conversation Name 1
Copying attachment to backup_1970-01-01/Conversation Name 1/Conversation Name 1
# Sometimes files are deleted Failed fo move ./out/attachment//1618845228949_15172.docx because it does not exist
#TODO File not found. Unknown file type application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for attachment 1618950490743_15207
3396 attachments successfuly copied
Conversation Conversation Name 1 successfuly saved
Creating outpur directory ...
Saving conversation ...
Copying attachment to ...
194 attachments successfuly copied
Conversation ... successfuly saved

ipfyx@mysecretmachine:~/signal/signal-backup$ ls -1
--> backup_1970-01-01
bootstrap
CSS.py
example
--> out
README.md
signal_backup.py
signal.css
signal_structure.py

How does it work

Signal-backup requests sms and mms in the database, their parts, their quotes etc. and format them in an html page using bootstrap. The parts are then copied from the attachment directory to the attachment directory in each conversation saved.

Result

Here is the index html file it will generate. You can then click on any month to view the messages sent during that month, sender names were anonymised. Alt text Here is the resulting conversation. Alt text

TODO

  • Support color by contact
  • Better embedding of mp4, pdf etc.
  • Find and fix more bugs
  • Feel free to contributes !

signal-backup's People

Contributors

hjacobs avatar

Stargazers

Hassan Najm avatar Ahmed El Gabri avatar Leonard avatar  avatar Mark Burst avatar adri avatar Ryan McQuen avatar Alice OsDel avatar  avatar  avatar Karan Naik avatar  avatar Ben Chang avatar shinevision avatar Grigoris Tsakouridis avatar  avatar  avatar  avatar

Watchers

 avatar

signal-backup's Issues

sqlite3.OperationalError: no such column: thread.recipient_ids

I wrote a similar tool for Signal desktop but in Java. I see the schema of the databases of desktop and Android are entirely different. So, I attempted to use your tool and received the following. There is no column recipient_ids in the thread table. This is a new backup of Android Signal App and the first I attempted.

Traceback (most recent call last):
  File "signal_backup.py", line 304, in <module>
    MYSELF = get_contact(db_cursor,args.your_name)
  File "signal_backup.py", line 98, in get_contact
    contact = fetch_group(db_cursor, conv_name)
  File "signal_backup.py", line 85, in fetch_group
    db_cursor.execute("SELECT groups._id, groups.title, groups.members, groups.recipient_id, thread._id FROM groups LEFT JOIN thread ON groups.recipient_id = thread.recipient_ids WHERE groups.title = ?", (group_name,))
sqlite3.OperationalError: no such column: thread.recipient_ids

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.