Giter Site home page Giter Site logo

eeeeeeeeeeeeeeeeeeeieeeeeeeeeeeeeeeeee / wechat-dump Goto Github PK

View Code? Open in Web Editor NEW

This project forked from caspartse/wechat-dump

0.0 1.0 0.0 3.67 MB

Dump wechat messages from android

License: GNU General Public License v3.0

Shell 13.27% Python 81.87% HTML 3.70% Smarty 0.13% JavaScript 1.03%

wechat-dump's Introduction

Dump WeChat Messages from Android

导出安卓微信聊天数据

WeChat(微信), as the most popular mobile IM app in China, doesn't give users any method to export well-formatted history message. This tool can parse and export WeChat messages on a rooted android phone.

Right now it can dump messages in text-only mode, or generate a single-file html containing voice messages, images, emoji, etc.

NEWS: WeChat 6.0+ uses silk to encode audio. The code is updated.

NEWS: WeChat 6.3 uses a new avatar storage. The code is updated.

If this tools works for you, please take a moment to add your phone/OS to the wiki. If it doesn't work, please leave an issue together with your phone/OS/wechat version.

How to use:

Dependencies:

  • python-PIL
  • PyQuery
  • pysox
  • pysqlcipher
  • numpy
  • python-csscompressor (suggested, optional)
  • adb and rooted android phone connected to a Linux/Mac OS.
  • Silk audio decoder (just run ./third-party/compile_silk.sh)
  • gnu-sed

Get Necessary Data:

  • Get decrypted WeChat database (Linux & Mac Only):
    • Automatic: ./android-interact.sh db-decrypt
    • Manual:
      • Get /data/data/com.tencent.mm/MicroMsg/long-long-name/{EnMicroMsg.db,sfs/avatar.index} from root filesystem, possible ways are:
        • ./android-interact.sh db
        • Use your rooted file system manager app
      • Get WeChat uin, possible ways are:
        • ./android-interact.sh uin
        • Login to web wechat, get wxuin=1234567 from document.cookie
      • Get your phone IMEI number, possible ways are:
        • ./android-interact.sh imei
        • Call *#06# on your phone
        • Find IMEI in system settings
      • Decrypt database, will produce decrypted.db:
       ./decrypt-db.py <path to EnMicroMsg.db> <imei> <uin>
      

NOTE: you may need to try different ways to getting imei & uin, because things behave differently on different phones.

Also, if the decryption doesn't work with pysqlcipher, maybe try the version of sqlcipher in legacy.

  • Get WeChat user resource directory from your phone to resource directory:
    • ./android-interact.sh res
    • You might need to change the resource location in this script if the default doesn't work
    • This takes a long time.

Run:

  • Parse and dump text messages of every chat (resource directory is not needed to run this):
./dump-msg.py decrypted.db output_dir
  • List all chats:
./list-chats.py decrypted.db
  • Generate statistical report on text messages:
./count-message.sh output_dir
  • Dump messages of one contact to html, containing voice messages, emojis, and images:
./dump-html.py decrypted.db avatar.index resource <contact name> output.html

Examples:

See here for an example html.

Screenshots of generated html:

byvoid

TODO List

  • Search by uid/username
  • Faster way to copy a directory from android (I don't know..).
  • Fix rare unhandled types: > 10000 and < 0
  • Better user experiences... see grep 'TODO' wechat -R
  • more easy-to-use for non-programmers (GUI?)

Donate!

Paypal: [paypal]

wechat-dump's People

Contributors

ppwwyyxx avatar trammel avatar swordyork avatar chaserhkj avatar vuryleo avatar ymy513 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.