-
Notifications
You must be signed in to change notification settings - Fork 22
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
Ability to import iOS Sqlite DB #60
Comments
Back then, the only way was to import the ID Backup (a string of the form AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA-AAAA) together with the password used for encrypting this backup. What is your plan? Do you want to re-import your ID into the Threema app? If so, open openMittsu, and click "Database" -> "Create Backup...". This will allow you to create a new ID Backup with a password of your choice that you can use in the App. I think you have to click something because the app at first only asks for the Threema Safe thingy, but there is the option to use the old ID Backup somewhere. If you want to import the sqlite file into openMittsu... That is not possible out of the box, but it could be done with a bit of work I guess. Could you dump the table structure of the file for me (I guess you do not want to send me the entire file ;) )? Tools like https://sqlitebrowser.org/ work great for this. I do not have access to an iOS device, so I need something to go on here. Did you use a modern version of openMittsu for trying to load the sqlite? If so, could you use a debug build? If you can compile it yourself, supply "-DCMAKE_BUILD_TYPE=Debug -DOPENMITTSU_DEBUG=On" to CMake. This will greatly increase logging output and maybe give us an idea on what is currently not working. |
My plan is indeed to import the sqlite file into openMittsu. Maybe data recovery works and I will also want to merge the messages received by openMittsu with the more recent messaged of the app... but that's not of concern for now 😄 I have dumped the schema: https://pastebin.com/UDPHvD8J Unfortunately, the log is not very informative:
Only the last two lines appeared after trying to load the file. |
The schema looks similar, but it is not the same as the one used by openMittsu, a direct import is out of question. If you need pointers, write here or send me a mail. Unfortunately I currently do not have time to work on this myself. |
There is a script from "back then" which converts the iOS format into a CSV-like structure, basically one file per contact. However, the script doesn't work for me. I'm pretty sure I could fix it, though. After briefly looking at the code it seems that it is possible to merge a backup into an existing database, can you say anything about that? Also, it would be handy if you could tell me how to open the openMittsu.sqlite. I tried it with sqlcipher and adding key using pragma, but the response to commands such as .tables was "not a database". |
Merging backups: This should be possible with a little bit of new logic around how existing stuff is handled, but it should be very straight forward. Opening openMittsu.sqlite: If you use the most recent version of https://sqlitebrowser.org/ (the one for SQLCipher, mind you, also - the latest alpha works well), it should "just work". Also: Do you have any non-standard characters in your password? If so, look in the openMittsu log for a message like "The password contains non-printable or non-basic-ASCII characters. Converting to UTF-8 and stringifying resulting hexadecimal sequence.". |
Just fyi: I am implementing support for the Threema Safe feature atm, did you have that set up? If so, everything (ID, contacts, groups) excluding messages can be recovered that way, which is much easier than getting the script to work I would guess. |
Ok, sorry for the late reply – I've been very busy last week, but it's better now. I managed to open the database using sqlitebrowser (using version 3 compatibility), but it didn't work using the sqlcipher command line tool (even if I enter the settings that sqlitebrowser uses via pragmas). Do you have any experience with that tool? It would be nice to access the database that way in scripts, but using the Qt application should also be fine. I didn't have Threema Safe set up. However, I managed to get the export script to store at least messages in CSV (but not media). Their contents seem a bit weird, each line begins like an SQL statement |
contacts.csv:
groups.csv:
group_message_a21fca2f9e4aab20-ECHOECHO.csv:
message_ECHOECHO.csv:
Is this what you were looking for? |
Yes, except that I only have message_THREEMAID.csv files and no group messages.
which is the same minus "caption" (do you have an idea what that is)? The actual contents are SQL INSERT statements, but that could be fixed by extracting the VALUES tuple. So the real problem with the script is that it mixes group messages with regular messages by the same user (there are definitely group messages in these csv files). My personal view is that rather than fixing the script, adding the possibility to read the sqlite file directly (which should not be a big deal since openMittsu is using sqlite already). What's your thought on this? |
Hi, it happened to me that my iOS device crashed and of course I don't have a Threema backup.
However, I have already tried openMittsu three years ago and managed to import the old Threema ID.
So first of all this is a huge thank you for your work which now enables me to stay connected ;)
I also have a ThreemaData.sqlite from that time.
Since now openMittsu uses sqlite itself, would it be possible to import that database?
It appears to be unencrypted, but my first attempt failed (no error message, just not loaded).
Also, I must have somehow been able to import my Threema ID into openMittsu back then, but I can't remember how.
The version I used back then is openMittsu_0.9.2plus106-g74a18cb-linux-x64-le, starting it I could import my
client
file which contains a backup string and password... so it seems that back then only ID import worked?Any help is appreciated, I'm also willing to share more information or spend some of my own time on that.
The text was updated successfully, but these errors were encountered: