How to Obtain and Unpack WeChat Mini Program .wxapkg Files (Part 1)
This step‑by‑step tutorial explains how to locate the .wxapkg package of a WeChat Mini Program on a jail‑broken iPhone or rooted Android device, copy it to a computer, and unpack it to reveal the obfuscated JavaScript, JSON configuration, WXML, WXSS and resource files.
WeChat Developer Tools compile a Mini Program into a compressed .wxapkg file that bundles JavaScript, wxml , wxss and other resources; to reverse‑engineer a Mini Program you first need to retrieve this package from the device.
On a jail‑broken iPhone (or rooted Android) open a file‑browser app such as Cydia → iFile / Filza and navigate to /var/mobile/Containers/Data/Application/ . Locate the WeChat sandbox directory (e.g., 297286CE-9055-400A-99FA-D2D7C0735DCF ) and search for the keyword wxapkg . The Mini Program packages appear as numerically named files (e.g., 2.wxapkg , 25.wxapkg ) under /Library/WechatPrivate/{UserId}/WeApp/LocalCache/release/ , where {UserId} is the MD5 hash of the logged‑in WeChat account.
Copy the discovered .wxapkg files to a computer. On iOS you can install OpenSSH via Cydia, note the device’s Wi‑Fi IP (e.g., 192.168.1.17 ), then use ssh and scp from a Mac terminal to transfer the package, e.g.: scp [email protected]:/var/mobile/Containers/Data/Application/297286CE-9055-400A-99FA-D2D7C0735DCF/Library/WechatPrivate/c15d9cced65acecd30d2d6522df2f973/WeApp/LocalCache/release/wx48...85db/2.wxapkg ~/Desktop/WeApp/
After obtaining the .wxapkg , unpack it using the Python script from github.com/leo9960/wechat-app-unpack . Run: python unwxapkg.py 2.wxapkg The extraction yields a directory containing app-service.js (obfuscated JS), app-config.json (merged app.json and page configs), page-frame.html (combined .wxml and app.wxss ), individual *.html files with style information, and all resource assets.
The article concludes that the .wxapkg retrieval and unpacking steps are now covered, and the next part will discuss how to restore the original source code from the extracted files.
JD Tech Talk
Official JD Tech public account delivering best practices and technology innovation.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.