Coder Social home page Coder Social logo

shufangjian / wxappunpacker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from larack8/wxappunpacker

0.0 0.0 0.0 1.12 MB

Wechat App(微信小程序,.wxapkg)解包及相关文件(.wxss,.json,.wxs,.wxml)还原工具

License: GNU General Public License v3.0

JavaScript 95.19% Shell 4.81%

wxappunpacker's Introduction

MyWxAppUnpacker

版本 0.3 支持的微信版本 >20180111

Wechat App(微信小程序, .wxapkg)解包及相关文件(.wxss, .json, .wxs, .wxml)还原工具

1. 说明

  • 修复 “ReferenceError: $gwx is not defined” 和 extract wxss 等问题
  • 支持分包
  • 支持一键解包
  • 支持一键安装各种依赖

一键匹配、统计文本中的内容,请下载 calcwords

2. wxapkg 包的获取

Android 手机最近使用过的微信小程序所对应的 wxapkg 包文件都存储在特定文件夹下,可通过以下命令查看:

adb pull /data/data/com.tencent.mm/MicroMsg/{User}/appbrand/pkg ./

其中{User} 为当前用户的用户名,类似于 2bc**************b65

3. 用法

用法分 mac 和 windows,请根据系统来操作

1. for Mac OS (Mac操作系统)

  • 安装npm和node
./install.sh -npm
  • 安装依赖
./install.sh
  • 解包某个小程序
./de_miniapp.sh  -d 小程序包路径(.wxapkg格式)
  • 一键解文件夹下所有小程序
./de_miniapp.sh  小程序包所在文件夹
  • 一键解当前文件夹下所有小程序
./de_miniapp.sh

** 举例

Mac OS

./de_miniapp.sh -d ./testpkg/_-751579163_42.wxapkg

解包后的目录文件

2. for 通用操作系统(Windows 和 Mac)

  • 解包某个小程序
node wuWxapkg.js 小程序包路径(.wxapkg格式)

** 举例

node wuWxapkg.js testpkg\_-751579163_42.wxapkg
  • 分包功能

当检测到 wxapkg 为子包时, 添加-s 参数指定主包源码路径即可自动将子包的 wxss,wxml,js 解析到主包的对应位置下. 完整流程大致如下:

  1. 获取主包和若干子包
  2. 解包主包 ./bingo.sh testpkg/master-xxx.wxapkg
  3. 解包子包 ./bingo.sh testpkg/sub-1-xxx.wxapkg -s=../master-xxx

TIP

-s 参数可为相对路径或绝对路径, 推荐使用绝对路径, 因为相对路径的起点不是当前目录 而是子包解包后的目录

├── testpkg
│   ├── sub-1-xxx.wxapkg #被解析子包
│   └── sub-1-xxx               #相对路径的起点
│       ├── app-service.js
│   ├── master-xxx.wxapkg
│   └── master-xxx             # ../master-xxx 就是这个目录
│       ├── app.json

4. 提取统计WXSS或者其他样式

详情参照 calcwords

  1. 下载calcwords源码
git clone https://github.com/larack8/calcwords
  1. 设置统计的.wxapkg路径和输入结果路径,调用 calcWxssStyle
	public static void testCalcWords() throws IOException {
		String fromFilePath = "/Users/Shared/my_git/java/CalcWords/testletters/";
		String resultFilePath = "/Users/Shared/my_git/java/CalcWords/result.txt";

		calcWxssStyle(fromFilePath, resultFilePath);// 统计微信小程序源码WWXSS样式
//		calcWxssProperty(fromFilePath, resultFilePath);// 统计微信小程序源码WXSS属性
	}
  1. 打开输出结果文件

如下图样式

输出结果文件

5. 关于作者

  • jinqianli
  • jinqianli-官方小程序

jinqianli-官方小程序

如果你觉得这篇文章很好,请赞赏作者加个鸡腿吧

jinqianli-赞赏码

jinqianli,2019.02.20

wxappunpacker's People

Contributors

qwerty472123 avatar gudqs7 avatar larack8 avatar wonderffee avatar npm-ued avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.