FORUMS
Remove All Ads from XDA

[TOOL] Whatsapp Xtract: Backup Messages Extractor / Database Analyzer / Chat-Backup

207 posts
Thanks Meter: 286
 
By ztedd, Senior Member on 5th April 2012, 07:13 AM
Post Reply Email Thread
26th April 2012, 10:22 AM |#31  
OP Senior Member
Thanks Meter: 286
 
More
Quote:
Originally Posted by TSAnouaar

Weird, Notepad can read it, inbuild db reader from RootExplorer can read it but if I export to computer, SQLite opens it but it keeps blank

Are you sure that it's exactly the same file you are opening with RootExplorer db viewer and SQLite on PC? Maybe it was somehow altered during copying or after opening in Notepad.

Do you still have the corresponding .db.crypt file from the SD card? Then it also should be possible to reimport the database to whatsapp and then export it again using another method.
Also you could reimport the backup with TitaniumBackup.

The next version of Whatsapp Xtract will support the encrypted msgstore.db.crypt files making it much easier, I guess.
Also there is work in progress on combining the Iphone and Android version.
 
 
26th April 2012, 01:22 PM |#32  
Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by ztedd

Are you sure that it's exactly the same file you are opening with RootExplorer db viewer and SQLite on PC? Maybe it was somehow altered during copying or after opening in Notepad.

Do you still have the corresponding .db.crypt file from the SD card? Then it also should be possible to reimport the database to whatsapp and then export it again using another method.
Also you could reimport the backup with TitaniumBackup.

The next version of Whatsapp Xtract will support the encrypted msgstore.db.crypt files making it much easier, I guess.
Also there is work in progress on combining the Iphone and Android version.

Tried to print screen CMD

I think that he can read the DB but getting stuck on a line, i think a smiley?
What's your opinion?
26th April 2012, 05:07 PM |#33  
roeylee's Avatar
Member
Thanks Meter: 1
 
More
I got the same error
Quote:
Originally Posted by TSAnouaar

Tried to print screen CMD


I think that he can read the DB but getting stuck on a line, i think a smiley?
What's your opinion?

I got the same error!

---------- Post added at 07:07 PM ---------- Previous post was at 07:03 PM ----------

I got the same error:

C:\Users\Kids\Desktop\Whatsapp>whatsapp_xtract.bat

C:\Users\Kids\Desktop\Whatsapp>whatsapp_xtract.py -i msgstore.db -w wa.db
File "C:\Users\Kids\Desktop\Whatsapp\whatsapp_xtract.py ", line 166
newtext = newtext.replace(u'\ue415', '<img src="emoji/e415.png" />')
^
SyntaxError: invalid syntax
26th April 2012, 06:54 PM |#34  
OP Senior Member
Thanks Meter: 286
 
More
Bug in smiley conversion?
Quote:
Originally Posted by roeylee

I got the same error:

Code:
C:\Users\Kids\Desktop\Whatsapp>whatsapp_xtract.py -i msgstore.db -w wa.db
  File "C:\Users\Kids\Desktop\Whatsapp\whatsapp_xtract.py", line 166
    newtext = newtext.replace(u'\ue415', '<img src="emoji/e415.png" />')
                                      ^
SyntaxError: invalid syntax

Thanks for reporting this. I guess it's a python version issue as I don't get the error with Python 2.7 on windows 7.

Which version of
- Python
- Whatsapp Xtract
- Windows

do you use?

For the time till I fix the bug, you can help yourself by using python 2.7 instead of python 3.
26th April 2012, 08:50 PM |#35  
OP Senior Member
Thanks Meter: 286
 
More
Alright, my guess concerning the python version was correct, I think:

http://wiki.python.org/moin/Python2orPython3
Quote:

Should I use Python 2 or Python 3 for my development activity?
What are the differences?

Short version: Python 2.x is the status quo, Python 3.x is the present and future of the language

...

Guido van Rossum (the original creator of the Python language) decided to clean up Python 2.x properly, with less regard for backwards compatibility than is the case for new releases in the 2.x range. The most drastic improvement is the better unicode support (with all text strings being unicode by default) as well as saner bytes/unicode separation.

...

The What's New in Python 3.0 document provides a good overview of the major language changes and likely sources of incompatibility with existing Python 2.x code.

I'll have a look at this and hope being able to fix it soon!
26th April 2012, 09:28 PM |#36  
roeylee's Avatar
Member
Thanks Meter: 1
 
More
Quote:
Originally Posted by ztedd

Alright, my guess concerning the python version was correct, I think:

http://wiki.python.org/moin/Python2orPython3


I'll have a look at this and hope being able to fix it soon!

I used version 3 indeed.
27th April 2012, 02:43 AM |#37  
Junior Member
Thanks Meter: 0
 
More
I also tried to open a WhatsApp database from an iPhone, but I cannot get it to work.

I downloaded and installed Python version 2.7
Then I run the python script from the command line and I get the following error messages:

C:\TEMP>whatsapp_xtract.py -i ChatStorage2.sqlite
Traceback (most recent call last):
File "C:\TEMP\whatsapp_xtract.py", line 632, in <module>
main(sys.argv[1:])
File "C:\TEMP\whatsapp_xtract.py", line 158, in main
curr_message = Message(msgs[0],msgs[3],msgs[9],msgs[10],msgs[12],msgs[11])
File "C:\TEMP\whatsapp_xtract.py", line 96, in __init__
self.msg_date = datetime.datetime.fromtimestamp(int(msgdate)+11323 *60*1440)
TypeError: int() argument must be a string or a number, not 'NoneType'

C:\TEMP>

I don't know what I'm doing wrong. I also tried renaming the ChatStorage2.sqlite file to msgstore.db, but this gives the same error messages.

I hope someone can show me what's going wrong.

Is there any news on the updated version that should also work with iPhone DB's and newer media types (smilies, etc)?
27th April 2012, 08:13 AM |#38  
OP Senior Member
Thanks Meter: 286
 
More
The new version is almost done. It supports both Android and IPhone db, Iphone version has many of the features of 1.3 (e.g. smileys, images) and Android version is able to decrypt msgstore.db.crypt files.

Your error can be patched if you replace the "class Message" function in the 1.0 script by this one, I guess (added error handling of "None" type):

Code:
################################################################################
# Message obj definition
class Message:

    # init
    def __init__(self,pkmsg,fromme,msgdate,text,contactfrom,contactto):

        # if invalid params are passed, sets attributes to invalid values
        # primary key
        if pkmsg == "" pr pkmsg is None:
            self.pk_msg = -1
        else:
            self.pk_msg = pkmsg
        # "from me" flag
        if fromme == "" or fromme is None:
            self.from_me = -1
        else:
            self.from_me = fromme
        # message timestamp
        if msgdate == "" or msgdate is None:
            self.msg_date = "N/A"
        else:
            self.msg_date = datetime.datetime.fromtimestamp(int(msgdate)+11323*60*1440)
        # message text
        if text == "" or text is None:
            self.msg_text = "EMPTY"
        else:
            self.msg_text = text
        # message sender
        if contactfrom == "" or contactfrom is None:
            self.contact_from == "EMPTY"
        else:
            self.contact_from = contactfrom
        # message receiver
        if contactto == "" or contactto is None:
            self.contact_to == "EMPTY"
        else:
            self.contact_to = contactto        

    # comparison operator
    def __cmp__(self, other):
        if self.pk_msg == other.pk_msg:
                return 0
        return 1

            
################################################################################
27th April 2012, 12:16 PM |#39  
nomad4ever's Avatar
Senior Member
Flag Cebu City, Philippines
Thanks Meter: 28
 
More
Quote:
Originally Posted by nomad4ever

Would it be possible to make this app similar to SMS Backup +, so that it backs up your Whatsapp messages into Gmail, assigning a separate label? Would do tons for user friendliness and ease of use.

Wanna ask again, if that would be possible?



Sent from my Galaxy Nexus using Tapatalk
The Following User Says Thank You to nomad4ever For This Useful Post: [ View ] Gift nomad4ever Ad-Free
27th April 2012, 11:56 PM |#40  
OP Senior Member
Thanks Meter: 286
 
More
Unhappy
Quote:
Originally Posted by nomad4ever

Would it be possible to make this app similar to SMS Backup +, so that it backs up your Whatsapp messages into Gmail, assigning a separate label? Would do tons for user friendliness and ease of use.

Wanna ask again, if that would be possible?

Yes, generelly spoken it would be possible As both SMS Backup + and Whatsapp Xtract are OpenSource, someone could bring them together.
I also would appreciate an android app version of this tool and Google Mail export option sounds interesting.
However I don't have the time / the money to do it

But thanks a lot for this suggestion!
The Following User Says Thank You to ztedd For This Useful Post: [ View ] Gift ztedd Ad-Free
27th April 2012, 11:59 PM |#41  
OP Senior Member
Thanks Meter: 286
 
More
Smile New Version 2.0 of Whatsapp Xtract - now supports Iphone, Android, crypt database
Here is the new version 2.0 of Whatsapp Xtract!

V2.0 (updated by Fabio Sangiacomo and Martina Weidner - Apr 28, 2012)
- supports WhatsApp DBs coming from both Android and iPhone platforms
- (Android Version) wa.db is optional
- (Android Version) now also crypted msgstore.db.crypt from the SD card can be imported
- chat list is sorted by the last sent message
- fixed some bugs (e.g. that the script didn't work with python 3)

Download:

see first post!
The Following User Says Thank You to ztedd For This Useful Post: [ View ] Gift ztedd Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes