Get all messages from Whatsapp

前端 未结 8 1445
执念已碎
执念已碎 2020-11-27 11:33

I\'m trying to implement an app that will show in a textview all the messages received from Whatsapp. Is there any way to do it? Is it possible to extract all the messages f

8条回答
  •  没有蜡笔的小新
    2020-11-27 12:08

    If you really want something simple and know how to write/run Python, take a look at the script Bas Bosschert: sources

    #!/usr/bin/env python
    
    import sys
    from Crypto.Cipher import AES
    
    try:
        wafile=sys.argv[1]
    except:
        print "Usage: %s " % __file__
        sys.exit(1)
    
    key = "346a23652a46392b4d73257c67317e352e3372482177652c".decode('hex')
    cipher = AES.new(key,1)
    open('msgstore.db',"wb").write(cipher.decrypt(open(wafile,"rb").read()))
    

    Full run:

    (scratch)ehtesh@ackee:/tmp/whatsapp$ mkvirtualenv whatsapp_decrypt
    New python executable in whatsapp_decrypt/bin/python
    Installing setuptools, pip...done.
    (whatsapp_decrypt)ehtesh@ackee:/tmp/whatsapp$ pip install pycrypto >/dev/null
    (whatsapp_decrypt)ehtesh@ackee:/tmp/whatsapp$ wget https://gist.githubusercontent.com/shurane/ffa15e959e2d134086c9/raw/bc99a9997123bea0ea0acde185e24c7e89133559/whatsapp_decrypt.py >/dev/null
    (whatsapp_decrypt)ehtesh@ackee:/tmp/whatsapp$ ls
    msgstore.db.crypt  whatsapp_decrypt.py
    (whatsapp_decrypt)ehtesh@ackee:/tmp/whatsapp$ python whatsapp_decrypt.py msgstore.db.crypt
    (whatsapp_decrypt)ehtesh@ackee:/tmp/whatsapp$ ls
    msgstore.db.crypt  msgstore.db  whatsapp_decrypt.py
    (whatsapp_decrypt)ehtesh@ackee:/tmp/whatsapp$ sqlite3 msgstore.db
    SQLite version 3.7.17 2013-05-20 00:56:22
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> PRAGMA table_info(messages);
    0|_id|INTEGER|0||1
    1|key_remote_jid|TEXT|1||0
    2|key_from_me|INTEGER|0||0
    3|key_id|TEXT|1||0
    4|status|INTEGER|0||0
    5|needs_push|INTEGER|0||0
    6|data|TEXT|0||0
    7|timestamp|INTEGER|0||0
    8|media_url|TEXT|0||0
    9|media_mime_type|TEXT|0||0
    10|media_wa_type|TEXT|0||0
    11|media_size|INTEGER|0||0
    12|media_name|TEXT|0||0
    13|media_hash|TEXT|0||0
    14|media_duration|INTEGER|0||0
    15|origin|INTEGER|0||0
    16|latitude|REAL|0||0
    17|longitude|REAL|0||0
    18|thumb_image|TEXT|0||0
    19|remote_resource|TEXT|0||0
    20|received_timestamp|INTEGER|0||0
    21|send_timestamp|INTEGER|0||0
    22|receipt_server_timestamp|INTEGER|0||0
    23|receipt_device_timestamp|INTEGER|0||0
    24|raw_data|BLOB|0||0
    25|recipient_count|INTEGER|0||0
    sqlite>
    

    Pritam Baral has mentioned an even simpler way:

    openssl aes-192-ecb -d -in msgstore.db.crypt -out msgstore.db -K 346a23652a46392b4d73257c67317e352e3372482177652c
    

提交回复
热议问题