12

I want to create an android app which reads inbox as well as whatsapp messages. I want to make a backup kind of thing. Though there is option for doing so in whatsapp. But I want to read the messages and then back them up from my app. I got to know that whatsapp stores messages in encrypted format in the file system. So can anyone please tell me how to read that encrypted file.

Empty
  • 350
  • 2
  • 4
  • 22
  • Check this answer for decrypting the [whatsApp crypt5 DB(android code).](http://stackoverflow.com/a/23380177/2219600) – amalBit Apr 30 '14 at 05:22

3 Answers3

8

WhatsApp makes a chat backup everyday at 4 AM on your SD Card. This is a single database encrypted with an AES key. Since it is on the external storage, your app can read it if you have access to the external storage.

You can easily decrypt this database (there is a paper available on this online).

However, this will only give you updated chats once every 24 hours.

If you want more realtime updates, your device has to be rooted, and you will need a completely new parser, as on the internal storage the chats are stored in more than one database.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
  • i found a python script for decrypting the database but how do i do it in java. I want to read the messages from the database and display them in an android list. – Empty Mar 19 '13 at 10:23
  • 1
    @MridulaTripathi There is a research paper on it. I can assure you it is possible, because I've done it myself. However, I'm afraid I can't tell you how to crack the encryption on private user data on a public forum. – Raghav Sood Mar 19 '13 at 12:56
  • i got a paper where the method is not mentioned in java but python.anyways thanks – Empty Mar 19 '13 at 13:14
  • @MridulaTripathi Just Google Java AES decryption, and give it the database while and the key. – Raghav Sood Mar 19 '13 at 13:14
  • Hey , Do you have link to the paper that describes the process – Anuranjit Maindola Mar 13 '14 at 07:04
1
  1. check out what is the decryption key of whatsapp ( you have to decompile it)
  2. read that file content
  3. decrypt the content with decryption key

Remark, with rooted phone you can have everywhere access, others maybe need JNI to do some tricks

upvote, if helps ! :)

  • thanks...I am new to android,I will try these things and let you know if it helps...thanks – Empty Mar 19 '13 at 08:49
1

use Whatsapp Xtract 2.0 tool to decrypt the whatsapp databases and convert it to HTML.

Link for download & discussion on xda forum

Ranco
  • 893
  • 2
  • 13
  • 43