-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlite3.OperationalError: malformed database schema (messages) - near "AS": syntax error #26
Comments
Hi @berrytsakala, are you comfortable to try opening the decrypted database in another SQLite browser and see if you're able to query that way? |
Also am having this problem:
System Info:Signal Version: 5.14.0 |
Running this script also shows a similar error:
This outputs:
Along with this, I tried opening up the file in both sqlitebrowser and sqlite3 and both said that the "file is not a database." Could the data base be corrupted? |
@coletonodonnell did you try opening the decrypted database produced by Lines 257 to 258 in 8e119b1
finally ), so you want want to comment that out.
|
Ah I see that now, only issue is that it seems to be blank. Opening it up in sqlitebrowser yields nothing and opening it in sqlite3 and running .tables shows no tables. I am not very experienced with sql so. |
Running this command with
Not sure if this has anything to do with it. |
If you're keen to keep digging, here's what I'd do. First get the decryption key: Lines 569 to 570 in 8e119b1
Lines 576 to 578 in 8e119b1
Then try running the "manual decryption" directly in bash and see if you have any luck, get any interesting messages: Lines 188 to 196 in 8e119b1
i.e. echo "PRAGMA key = "x'your-key-here'"; ATTACH DATABASE 'db-output.sqlite' AS plaintext KEY ''; SELECT sqlcipher_export('plaintext'); DETACH DATABASE plaintext;" | sqlcipher db.sqlite And if it's still giving an empty output maybe we can figure it out... All these incantations are just copied from somewhere, I'm no expert either... |
Alright I ran the command, got my key using:
With that, I ran the above command and it ran successfully, only issue is that again, |
Weird that it doesn't say anything... Can you try this. Also that SO page prompts a question: are you on Android? |
Alright this is confusing me on so many levels. So I first tried with the backup of the data base I made on my home, and it actually outputted just fine, though the 'plaintext.db' database was sadly blank. I then attempted to try it on the actual original non-copied database in
Yes, I am on Android. The main reason I am attempting this is because my phone is bootlooping and I am trying to backup my signal messages before factory resetting my phone. |
If you mean is this database on Android, no this is the Signal Desktop app on Gentoo. I am trying to export the messages on my Desktop. |
This response to that same SO question suggests that Android SQLCipher (presumably what your Android Signal is using) is built with ICU… A bit of searching found this issue, which is not super promising… I have no idea if this is the issue. Would be great if @berrytsakala could confirm whether they’re also on Android. |
Yeah that is not super promising... Are you running Apple? I find it hard to believe that everyone who has used this thus far has been an Apple user and hasn't ran into this issue yet, though, it isn't impossible. |
Actually, I understand now why. Apple can't export Signal Messages, so Desktop would be the only way. That makes sense, I and most likely @berrytsakala are probably abnormalities. |
Hmm good point, Android probably not relevant since the db is presumably generated on your desktop. I use Ubuntu (and an iOS phone). |
Ohhh that is interesting… so maybe Android is relevant and the rest of us are all using iOS. Will add something to the README to see if we can get any data on that… |
Not really sure then, I would assume that there isn't any difference between how Android and Apple send messages to the Desktop client, but perhaps there is? |
Sounds good, I am still going to factory reset my device though, I have a backup from about a month ago anyway. |
I'm on android as well. |
@franklin-be did it work or did you get a similar error? |
export generally works. Only have issues with received media lately as stated here: #28 |
@coletonodonnell |
Solved it. Problem 1: Problem 2: |
Sweet, great work. Are you running Apple or Android? I haven't looked at the old issue too hard but iirc we thought it could've been a problem with Apple vs. Android. |
Desktop Signal on Linux. I actually don't think it's a matter of platform. I briefly insttalled sqlcipher on Android (via Termux) and it managed to open the Desktop database without effort. |
@haarp I haven't quite followed the discussion here but is there a PR you could submit? |
Thanks! And the |
Yes, that's probably the problem. I discovered this while messing around on the commandline, and presumably @coletonodonnell did too. Syntax looks to be correct inthe script: Line 190 in 8e119b1
I must admit I haven't used this script, just found this issue on Google trying to use sqlcipher on Signal :) |
:P well thanks for your contribution! |
what have i done to deserve this:
my setup:
thanks.
The text was updated successfully, but these errors were encountered: