Note: This method is applicable to Android phones, ios models unknown applicability. Of course, you can also grab small packages using the PC Nighthian emulator.

Through decompilation to obtain micro channel small program source code, a bunch of online tutorials, here is a simple operation steps.

Prepare the environment

PC and mobile phone in any environment to obtain small program source.

  • PC:

    Install the Nighthian simulator and then enable root permission. As follows:

    Then download RE manager and wechat from Night God.

  • Android phone:

    Jailbreak to obtain root permission. In view of the fact that most root software does not support android advanced versions, it is recommended that ji users use Magisk Manager once and for all, and obtain stable and reliable root permissions. After obtaining the root permission, download the RE manager and wechat.

Began to get

  • Obtain the small program source file package xxxxx.wxapkg

    1. Visited the WeChat small package of online directory: / data/data/com. Tencent. The mm/MicroMsg /} {here for a string of hexadecimal characters/appbrand/PKG /.

    2. Grant Root permission to the RE manager. Open this directory with the RE manager and you may find more than one file of type XXXXxxx. wxapkg, which is the source file package of wechat applets.

    3. Press and hold the package, then click on the option in the upper right corner to compress it into a ZIP package, and then send the package to your computer to extract xxxxXXx. wxapkg.

  • Node decompiles the script

    • Download the decomcompiled script and run NPM install to install dependencies in Node, or install dependencies separately (recommended) :

      npm install esprima
      npm install css-tree
      npm install cssbeautify
      npm install vm2
      npm install uglify-es
      npm install js-beautify
      Copy the code
    • Important: download decomcompiled script code has a problem, need to modify!

      Wuwxss.js file functions:

      function runVM(name,code){
         let wxAppCode={},handle={cssFile:name};
         let vm=new VM({sandbox:Object.assign(new GwxCfg(),{__wxAppCode__:wxAppCode,setCssToHead:cssRebuild.bind(handle)})});
         vm.run(code);
         for(let name in wxAppCode)if(name.endsWith(".wxss")){
             handle.cssFile=path.resolve(frameName,"..",name); wxAppCode[name](); }}Copy the code

      Replace:

      	function runVM(name,code){
      		let wxAppCode = {};
      		let handle = {cssFile: name};
      		let gg = new GwxCfg();
      		let tsandbox = {
      			$gwx: GwxCfg.prototype["$gwx"].__mainPageFrameReady__: GwxCfg.prototype["$gwx"].$GWX is not defined
      			__vd_version_info__: GwxCfg.prototype["$gwx"].// Resolve __vd_version_info__ is not defined
      			__wxAppCode__: wxAppCode,
      			setCssToHead: cssRebuild.bind(handle)
      		}
      		let vm = new VM({sandbox: tsandbox});
      		vm.run(code);
      		for (let name in wxAppCode) {
      			if (name.endsWith(".wxss")) {
      				handle.cssFile = path.resolve(frameName, "..", name); wxAppCode[name](); }}}Copy the code
    • Run node wuwxapkg. js [-d]

      can. Files is the wxapkg file name that you want to decompile.

      After success: