preface

V2EX yesterday on a grab package to get wechat jump source code popular article, article link click here

I have also captured the packet through the way mentioned in the article, but I did not detect the download connection of the small game, which may have been repaired by wechat. The download link provided above also displays a 404 status code.

Although failed to catch the package, but still can be extracted from the local source, the following will introduce how to find the source of the small game downloaded from the Android phone

The preparatory work

  • An Android phone with root status
  • Install wechat 6.6.1 version of APK
  • The Android SDK is installed on your computer and you can use ADB commands

Note that the Android phone must be root; otherwise, the system folder of the phone cannot be accessed

Connect your phone to your computer via USB and run the following command

$  adb devices
Copy the code

If the following information is displayed

List of devices attached
71MBBL6228EU	device
Copy the code

Note The mobile phone is connected to the PC. If the ADB command is not found, it indicates that the Android SDK is incorrectly installed or ADB is not added to the PATH of the PC

After the phone successfully connects to the computer, run the command

$  adb shell
$  su
Copy the code

If the terminal is similar to the prefix root@{mobile phone model}, the terminal is in root mode

$ cd /data/data/com.tencent.mm/MicroMsg/{User}/appbrand/pkg
Copy the code

{User} is the User name of the current User, similar to 1ed**********c514a18

Then the current directory is wechat used to store small programs and small game download package location

$ ls
_-791877121_3.wxapkg
_1079392110_5.wxapkg
_1079392110_5.wxapkg_xdir
_1123949441_92.wxapkg
_576754010_1.wxapkg
Copy the code

The above is my wechat downloaded small program and small game source

Because the /data directory is a system-level directory, it cannot be copied directly and needs to be mounted to the operational mode again

$ mount -o remount,rw /data
Copy the code

At this point, you can copy the files in the current directory to SDcard

$ cp /data/data/com.tencent.mm/MicroMsg/{User}/appbrand/pkg/_1079392110_5.wxapkg /mnt/sdcard
Copy the code

Then copy the _1079392110_5.wXAPkg file to the computer, through the script decompression, that is, for its source code

Compile the source code

Create a blank mini program or mini game project through wechat mini game development tools, mainly do not choose the quick start template

Then copy the unzipped source code to the project directory you just created. The development tool will prompt you with a compilation error. In this case, just create a new game.json file in the project and write the following code into the file

{
  "deviceOrientation" : "portrait"
}
Copy the code

Then change the debug base library of the development tool to Game

The application will now run in the developer tools

reference

  • Wechat can directly change the score with a hop. POST requests do not have verification
  • Micro channel small program source reading notes 1
  • Micro channel small program vulnerability: you can download any micro channel game source code
  • Wxapkg Decompression script