Skip to content
Dump wechat messages from android
Python Shell HTML Other
Branch: master
Clone or download
Pull request Compare This branch is 40 commits behind ppwwyyxx:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

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:


  • 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/
  • gnu-sed

Get Necessary Data:

  • Get decrypted WeChat database (Linux & Mac Only):
    • Automatic: ./ db-decrypt
    • Manual:
      • Get /data/data/{EnMicroMsg.db,sfs/avatar.index} from root filesystem, possible ways are:
        • ./ db
        • Use your rooted file system manager app
      • Get WeChat uin, possible ways are:
        • ./ uin
        • Login to web wechat, get wxuin=1234567 from document.cookie
      • Get your phone IMEI number, possible ways are:
        • ./ imei
        • Call *#06# on your phone
        • Find IMEI in system settings
      • Decrypt database, will produce decrypted.db:
       ./ <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:
    • ./ res
    • You might need to change the resource location in this script if the default doesn't work
    • This takes a long time.


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


See here for an example html.

Screenshots of generated html:



  • 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?)


Paypal: [paypal]

You can’t perform that action at this time.