carderne / signal-export

Export your Signal chats to markdown files with attachments
Other
436 stars 46 forks source link

Running in manual mode without docker and pysqlcipher #63

Closed scharlach closed 1 year ago

scharlach commented 2 years ago

This is more a possible recipe for others than an issue report.

I was trying to run signal-backup without docker, straight on my Linux computer.

  1. I had sqlcipher installed from the Arch repository
  2. I couldn't get pysqlcipher to work. After from pysqlcipher3._sqlite import * it kept dying with ImportError: .../envs/signal/lib/python3.10/site-packages/pysqlcipher3-1.0.5-py3.10-linux-x86_64.egg/pysqlcipher3/_sqlite3.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_AsStringAndSize
  3. Delving into the code, I discovered the manual mode -m switch, decrypting the database with sqlcipher utility outside Python.
  4. After commenting out from pysqlcipher3 import dbapi2 as sqlcipher in main.py I was able to export my Signal history by python main.py -m dest_dir without pysqlcipher
  5. I noticed I'd had an old version of signal-export where this worked. After pulling new commits, it started crashing with sqlite3.OperationalError: no such table: conversations. I am quite happy in the moment and I don't feel the need to dig further. bfe3f2d85a68ef1d614774b86f173ab0c986f768 on 15th Dec is the last good commit for this.
artelse commented 2 years ago

Thanks, that finally also worked for me. Interestingly, I tried signal-backup before this one and it exported from db fine. After trying signal-export, which failed with the undefined symbol, signal-backup then gave me the same error. No way to revert to the previous working setup.

artelse commented 2 years ago

Ok, found the problem with the no such table problem. On line 228, secho is not a terminal command, so the sqlcipher fails. Change it to echo and you can run the latest commits.

carderne commented 1 year ago

@scharlach @artelse is there any action I can take here?

(Finally fixed the secho issue in https://github.com/carderne/signal-export/commit/06426c0bd67ae0df32ee3b3333200d20d5cb6f87)