yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] ztedd:
Linking of Images (Iphone)

At first: Are you guys ever reading the provided FAQ? post Some Additional Information on the first page:

Because "online media files are available only for the last ~ 3 weeks", the direct image link only works for the recent images.

Then, linking of offline images. The current script works like this: it assumes the following database structure of the ZWAMEDIAITEM table:

# Z_PK INTEGER PRIMARY KEY
# Z_ENT INTEGER
# Z_OPT INTEGER
# ZMOVIEDURATION INTEGER
# ZMEDIASAVED INTEGER
# ZFILESIZE INTEGER
# ZMESSAGE INTEGER
# ZLONGITUDE FLOAT
# ZHACCURACY FLOAT
# ZLATITUDE FLOAT
# ZVCARDSTRING VARCHAR
# ZXMPPTHUMBPATH VARCHAR
# ZMEDIALOCALPATH VARCHAR
# ZMEDIAURL VARCHAR
# ZVCARDNAME VARCHAR
# ZTHUMBNAILLOCALPATH VARCHAR
# ZTHUMBNAILDATA BLOB

It uses ZTHUMBNAILDATA to display the thumbnail (which is obviously not working for you) and uses ZMEDIALOCALPATH to link the offline image. The generated link looks somehow like this:

file:///C:/Whatsapp/Media/01234567890@s.whatsapp.net/a56567c36767d6726732a7.jpg

(having ChatStorage.sqlite.html in file:///C:/Whatsapp/)

So if you didn't copy the image files from your Iphone device into this correct folder, of course, the linking of the image won't work!

And again, if Whatsapp changed the database structure, then the script needs to be updated. You can check this with SQLite Database Browser ( http://sqlitebrowser.sourceforge.net/ - also linked in the FAQ). open ChatStorage.sqlite with it and check if the database structure of the table ZWAMEDIAITEM is the same.

If the database structure was changed (also the table ZWACHATSESSION is relevant), then I need a copy of your ChatStorage.sqlite file to be able to update Whatsapp. Again, please contact me via private message: ztedd
[Android Apps and Games] ztedd:
Send me your ChatStorage.sqlite file. Please contact me via private message: ztedd.
[Android Apps and Games] squeeish:
This is some fantastic programming. Thank you! How do I donate to you?
[Android Apps and Games] banman008:
guys plz help

i m facing this problem when i am draging database on drag and drop option can any one tell me how to solve this prolem this is android database
[Android Apps and Games] cycch:
Thanks so much for the programme!

However, when I view group chat history, I can only see whether it is from me or the group as a whole, but cannot identify the individual who write the corresponding message. I would be grateful if the person for corresponding message in a group chat can be identified. Thanks!
[Android Apps and Games] ztedd:
You aren't using the newest version. Google code is hosting an outdated version :(

Please download the newest version from the first page. It should be named Whatsapp_Xtract_V2.1_2012-05-16.zip.

Then install again, also using !install pyCrypto.bat ; rightclick on it and choose "run as administrator".
[Android Apps and Games] ztedd:
Are you using Android or Iphone version? With Android version, it should work correctly.
[Android Apps and Games] ztedd:
Donation

Thanks!

Please buy me a paysafecard voucher code and send it to me. You can contact me via private message: ztedd

I'm still heading on including the new emoji smileys...
[Android Apps and Games] cycch:
Unfortunately it was iphone version. so the people in the group cannot be identified?
[Android Apps and Games] ztedd:
I would need a sample Chatstorage.sqlite containing group messages to be able to update Whatsapp Xtract. If you are willing to send me your database file, contact me via private message.
[Android Apps and Games] ztedd:
I also need a package of the according .png image files...
[Android Apps and Games] muk12:
Works for me Android + iOS
[Android Apps and Games] duendetuc:
D:\NotBackedUp\Whatsapp>python "D:\NotBackedUp\Whatsapp\whatsapp_xtract.py" "D:\
NotBackedUp\Whatsapp\msgstore.db (4).crypt"
Python Version 2.x
Android mode!

trying to repair android database...
trying to decrypt android database...
decrypted database written to D:\NotBackedUp\Whatsapp\msgstore.db (4).crypt.plai
n.db
trying to repair decrypted android database...
Could not open database file. Guess it's not a valid Android or Iphone database
file.
Press any key to continue . . .

Hi. I get this error but I can´t follow the faq procedures because the unencrypted file isn´t saved after running the script. I want to repair the database as the instruction in the faq but I need the decrypted file. What can I do?

EDIT: PROBLEM SOLVED
[Android Apps and Games] Untamed86:
Still "Not Authorized"

Hi guys,

I'm still having the same problem: When I click on the "THUMBNAIL" to collect the image from the Whatsapp server I also get the "Not Authorized" error displayed.

Also the links look different to what they used to look like... Maybe a decryption error?

They used to look like this: https://mms603.whatsapp.net/d7/14/07/1/b/1b14d337abc8e153c98854633f59d3fc.jpg (This link is older than 3 weeks, so yea I know it won't work now!)

All the new links look like this: https://mms816.whatsapp.net/d/Akw8aJSEkebYJf0fP0t7NSJxxq1zi8vHygXkpLXZrl5_.jpg (this one is from yesterday, so it should work.)

Clicking on it, or following it gets me to the "Not Authorized" error...

Same with videos: https://mms918.whatsapp.net/d/RFSbe17g6Zq3bmlAZtWhtCU5nDE/Am60VfGdkGL_c2JygPzSj7cj_oldZY5buF4AiQ36mphE.3gp

Saying the "Media object not found", looks like the same problem though...

This effect is with every media I send, and with most of the media I receive from others. Weird thing is, the thumbnails all display fine...

Could I please get some help here?

Thank you very much!
[Android Apps and Games] andcha:
Hi

I am getting ImportError: No module named Crypto.Cipher

I have already reinstalled !install pyCrypto.bat (run as admin) several times but no success, though I get a screen with following text:

C:\Whatsapp>rem If you want to decrypt android whatsapp msgtore.db.crypt files,
then you need to run this (after installing ActivePython). If you get errors the
n try to do this: rightclick on this !install pyCrypto.bat and choose "run as ad
ministrator"!

C:\Whatsapp>"C:\Program Files\Python27\Scripts\pypm" install pycrypto
Expanding "%APPDATA%\Python\Scripts" in user's %PATH%; please launch a new Comma
nd Window

Any help will be greatly appreciated.

Note: I have installed 32bit ActivePython as indicated in the tutorial.
[Android Apps and Games] ztedd:
Installation of pyCrypto

Which version of Windows, ActivePython and Whatsapp Xtract did you use?

I can't really help you with ActivePython and pycrypto install issues. Please use google search and ActivePython support by yourself. The first option might be to try if you can use the provided shortcut in the windows Start Menu:

Start - ActiveState ActivePython 2.7 (32-bit) - Python Package Manager (PyPM)

and then in the opened window, type: pypm install pycrypto
[Android Apps and Games] ztedd:
Online links to media files don't work anymore

Whatsapp changed the security somehow, now it's not possible anymore to access these media files online without authentication. Anyway the online media link was just a nice addition, not a main feature. Since it wasn't accessible after some ~3 weeks, I never relayed too much on it.

Now you have to keep with your local, offline media files. Copy them in the right directory before running the script, and you can use the offline links. Maybe now I change the script, omitting the online links completely and only linking the offline files.

This isn't weird. The thumbnails are included in your local whatsapp database file, they can't be "Not Authorized".
[Android Apps and Games] andcha:
Windows 7 32 Bit

ActivePython-2.7.2.5-win32-x86.msi

Whatsapp_Xtract_V2.1_2012-05-16.zip

Also, I have deluge client installed on my PC. There is a file "pycrypto.pyc" in C:\Program Files\Deluge\beaker-1.4.2-py2.6.egg\beaker\crypto. Does this have anything to do with it.
[Android Apps and Games] Untamed86:
Hi,

thanks for the quick reply.

Are you sure there is no possible way? I mean you are the genius who already made this program possible :good: :)

Maybe you could figure it out? :fingers-crossed:

Greetz
[Android Apps and Games] andcha:
Fixed it. Worked on your reply and took google's help.

I am guessing ActivePython didn't get pycrypto so maybe !install pyCrypto.bat was unable to install pycrypto.

So I downloaded pycrypto prebuilt windows installer from www voidspace org uk python modules.shtml#pycrypto and installed it in the python27 directory and it worked.

Hope this helps others like me.

Many thanks for such a great tool.
[Android Apps and Games] ztedd:
No, this isn't my focus.
[Android Apps and Games] ztedd:
Thank you, andcha, I included your suggestion in the tutorial on the first page.
[Android Apps and Games] ztedd:
In the new version, Whatsapp_Xtract_V2.2_2012-11-17.zip, the decoded file won't be deleted anymore.

How did you solve the problem?
[Android Apps and Games] ztedd:
In the new version, Whatsapp_Xtract_V2.2_2012-11-17.zip, I included an hotfix for this problem. It shouldn't occur again.
[Android Apps and Games] ztedd:
New version released - new emoji smileys supported

Finally I was able to update Whatsapp Xtract, now the new emoji smileys are included. New download: Whatsapp_Xtract_V2.2_2012-11-17.zip - see download links on the first page.

Thanks for all your suggestions regarding the new smileys and especially thanks to aced84 and jouce for your donations.
[Android Apps and Games] beastie_carrion:
Windows phone

Hey, any plans to include windows phone compatability ? Desperate to backup some old conversations.
[Android Apps and Games] ztedd:
Windows Phone

No plans yet. I included it in the Feature Requests.

First step would be that you create a sample database file, copy it from your Windows Phone device (I guess http://wp7roottools.com/ should help you with this) and send it to me. Here you can send ma a private message and we can exchange mail addresses: ztedd.
[Android Apps and Games] droopyar:
New Tool

Hi,

I have develop a new tool, which do the same but extremely easy to use.

You dont need to install anything, just execute 1 file (whatsapp.exe) and the database is decrypted, and also converted to .CSV which could be opened just by double click on it.

It is very easy to use, as you just put the encypted file, execute the whatsapp.exe and thats all.

Forget to install python, and any complex configuration. Just 1 file.

Advice me if you want to test it. I wil upload a video on youtube soon.

droopy
[Android Apps and Games] aced84:
No problem at all, Ztedd, and thanks for working day in day out to update it to the latest version, and you're welcome :)
[Android Apps and Games] cobra1909:
Hello,

works well, but i have a question:

What means msg Status 4 or 5?

Thanks
[Android Apps and Games] ztedd:
Try to open the file using SQLite Database Browser - http://sqlitebrowser.sourceforge.net/

Can it be opened? What do you see?

If it can't be opened, then open the file with an editor (make sure not to save and backup before!). Copy the first lines and post it here (or send it by PM to me, you also might send the whole file to me if you want).

Then perhaps we will know if it's because the file is encrypted or something else..
[Android Apps and Games] basmaje:
Thanks a lot! :)
[Android Apps and Games] TSAnouaar:
I can open it with SQLite but it keeps blank so i opened it with notepad and the first rule is
[Android Apps and Games] redlag:
Will the chat output from this software show all the smileys of whatsapp? not the regular ones, the whatsapp ones...
[Android Apps and Games] ztedd:
It should show all the smileys of whatsapp. In the download archive you find a folder called "emoji" with all the smiley images that are included.
[Android Apps and Games] ztedd:
Okay, this seems like a normal whatsapp database. But if SQLite Editor can't open it then the database file is somehow corrupted. Where did you get the file from? Did you copy it from the original position /data/data/com.whatsapp/databases? Or how exactly did you receive that file?

I can try to have a look at the file if you don't bother.

Otherwise you should research on SQLite Database file recovery / database repairing / open corrupted SQLite database / ...

You may also try this: put the file on the SD card in /sdcard/WhatsApp/Databases as the only file there, then reinstall Whatsapp (it should be deinstalled first or at least the file /data/data/com.whatsapp/databases/msgstore.db should be deleted) and choose Yes when you are asked to import the backup. Maybe whatsapp itself still can import it.

If this succeeds, then copy the now created file /data/data/com.whatsapp/databases/msgstore.db - this should be uncorrupted now.
[Android Apps and Games] 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.

Other than that, great concept! ;-)
[Android Apps and Games] TSAnouaar:
I used TitaniumBackup, connect SD to PC, opened the folder titaniumbackup and searched for Whatsapp and there is where the .db file is located, I will try to reinstall Whatsapp with these files thanks
[Android Apps and Games] redlag:
Ok thanks! Just what I was looking for! :D

Will provide you the feedback after I try it. :)
[Android Apps and Games] 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
[Android Apps and Games] 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.
[Android Apps and Games] 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?
[Android Apps and Games] roeylee:
I got the same error

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
[Android Apps and Games] ztedd:
Bug in smiley conversion?

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.
[Android Apps and Games] 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!
[Android Apps and Games] roeylee:
I used version 3 indeed.
[Android Apps and Games] Ghaanz:
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)?
[Android Apps and Games] ztedd:
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):

################################################################################
# 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

################################################################################
[Android Apps and Games] nomad4ever:
Wanna ask again, if that would be possible?
[Android Apps and Games] ztedd:
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!
[Android Apps and Games] Miladje:
Is there any possibility to to do it this for Blackberry?

Or is this only working for Iphone and Android?

I loved to test it for you :)
[Android Apps and Games] ztedd:
message status

I'm not sure, but I think it's like this in android database:

0 - message received from others

4 - message sent by me (group chat)

5 - message sent by me (single chat)
[Android Apps and Games] reesi014:
whatsapp extract

Hi, got this thing working finally, happy now.

However if i open the whatsapp storage file in NOTEPAD I find many entries that do not appear in the printout of the extractor.

Apparently (and seeing the contents of the messages) it is understandable that those have been deleted.

Is there an option to show deleted messages as well? It's a hell of a job to convert the sql file to something readable from ext editing, is there an option to show deleted messages as well?

I have noticed that regular sql programs as sqlite database etc do not show deleted messages as well.....

grtz,

Frank
[Android Apps and Games] Xelai:
First of all thanks for the tool and time for answering questions.

I got the following weird problem, I lost my android phone and the last backup I have is from July, on my new andrid phone there is no absolute way Whatsapp recognizes the db.crypt files for restoring the chat at that time, as I am completely unable to restore that chat history I was thinking of decrypting it, and trying again as a plain .db file. Would that work?

Another issue I was considering is a chat with a specific person, I got their version of the conversation divided in two db.crypt files. From what I have read could I decrypt, merge, change the sender and receiver value, and import the plain .db file so I could have my end of the conversation on my phone?

Sounds convoluted, but I cannot think of any other way of recovering that specific chat.

Thanks again for everything.
[Android Apps and Games] ztedd:
This is the normal way of importing the old chat history:

- uninstall Whatsapp on the new phone

- copy the folder /sdcard/WhatsApp from the old device to the new device (both Android). It should include a msgstore.db.crypt file inside /WhatsApp/Databases

- make sure only one file called msgstore.db or msgstore.db.crypt is inside that folder

- freshly install Whatsapp. In one of the final steps you will be asked whether you want to import the old database. Choose "yes"

That really should work!

If not, there is another, more complicated, option provided you have root access.

- Use TitaniumBackup to backup the application data on the first device and recover it on the second device

- alternatively use Whatsapp Xtract to decrypt the msgstore.db.crypt file and then copy the msgstore.db file to /data/data/com.whatsapp/databases/

(overwrite the existing file)

In my opinion, that's WAY to much work. You just want to read the chat again, do you? For that, it's absolutely not necessary to have it inside Whatsapp. You can use Whatsapp Xtract to convert the chat into an html file and then read it using your browser (on computer or on the android device).
[Android Apps and Games] ztedd:
Yes, we know, and this is already on the Feature Requests list.

As you see, there are no existing SQL tools to display the deleted content and that's the reason why it won't be easily included in the next time. If you find a third-party solution, please tell us!

It's not on my priority, either. If you want to backup your personal chats, you won't need to display deleted messages. You just may backup first and delete afterwards, then all the messages are included in the converted file (no hassle with deleted messages necessary). If you care about your privacy, that information is helpful because you know you shouldn't delete single messages (or chats), but you should empty ALL chats at once (after taking a backup, of course!), in so doing your deleted chats won't be able to restored.

If however someone is interested in reading the deleted messages from ANOTHER person, I'm quite happy with that not being too easy...
[Android Apps and Games] Xelai:
Yep, I have followed the normal way of doing it to no avail. I have been able to recover a November backup of a friends phone on mine, but not my own July backup.

I am going to try and decrypt de database and try recovering with a simple .db file, are you positive that Whatsapp will recognize a .db file as a valid backup and try to recover it?

If not I will try rooting and installing in the /data folder.

I want to read the chat and really continue to add to it and carry it around, I know it may sound a bit weird, but I got my motives :p

That is why I am willing to try a hard way of doing it.

Can you change in the .db file the sender for the receiver? That could work or it is beyond reasonable?

PD I have managed to decrypt and recover my old backup, great! No need for root till now. Thanks a lot!
[Android Apps and Games] FeBe95:
How did you do that?