Get WeChat Mini Program Source Code Tutorial

Recently, I am researching WeChat applets. Many small programs on the Internet can be used for reference, so how to obtain the source code is very important.

Table of contents

1. Install the corresponding environment (Node, js)

2. Download the decompilation script

3. Download the Android emulator to get the WeChat applet decompilation file

4. Decompile


 

1. Install the corresponding environment (Node, js)

Official website: http://nodejs.cn/download/

8d412751e13d4de0884f8edc34ae5e9e.png

 Just select the corresponding installation package, I am win10 64-bit.

NOTE: Download the installer, not the binary! ! Otherwise, the system will fail to recognize that node has been installed! ! !

adb3a5fbfb6f4e8db7a91ef5c065b3a0.png

c80078374c3a45ef812077e907ce5bfd.png 

After downloading, select the folder to install. All the way to the default installation, there is a box on the last page that needs to be checked.

Then we will check whether the installation is successful:

2d67cf8536d34d7f887cff950ad96294.png 

Open the cmd command line mode

d9f20f1a631345a3ba1ab534c4db4266.png

Then enter npm -v, if the installation is successful, the version number will be printed.

2. Download the decompilation script

WeChat applet decompilation script (for use with Node.js)-Node.js Documentation Resources-CSDN Library

Just download it directly, no need to install dependencies. Note that the storage location should be in the root directory of disk d or e as much as possible.

Check whether it can be used: use win+R to enter the cmd command line interface as above, enter d: press Enter (enter d: or e: depends on the storage location), enter cd wxappUnpacker again and press Enter to enter the corresponding folder ( The input content depends on the storage location of the decompiled script, cd+space+folder name and press Enter)

Then enter npm install esprima and press Enter. If a progress bar appears, it will prompt that the installation is complete, indicating that it can be used normally.

3. Download the Android emulator to get the WeChat applet decompilation file

I am using the MEmu Simulator as the emulator. This step requires root, so it is not recommended to use a mobile phone.

b82c0ec9491d451e9efd649daef29b87.png 

 Just open root.

Then install WeChat, qq and RE file manager, search and download in the software store of the Android emulator.

024c6165597a43aa9783219b1b5ef345.png

 Then open WeChat, enter the corresponding applet page, then switch back to the home page, and open the RE file manager

Enter the following address

/data/data/com.tencent.mm/MicroMsg/{{a string of 32-bit hexadecimal string folders}}/appbrand/pkg/

c9b8382890ae44ca81504fb82ba0b960.png 

Choose a smaller file size

0e9a017edf7140499d58f67abd17c69a.png

 Compress the file, and then send it to the computer via qq.

4. Decompile

Unzip the file, store it in the root directory of a certain disk, and then open the node command line interface

Input: node .\wuWxapkg.js D:\_-334220218_1.wxapkg

The red font is the name of the file. My file is on the d drive. You can modify it according to the actual situation, and then press Enter to decompile it. After completion, the source code file will be generated in the same folder as the original file.

 

Guess you like

Origin blog.csdn.net/Reasally/article/details/128081667