feat: write docs and add GitHub Action for automated release

This commit is contained in:
wux1an
2026-04-15 00:37:25 +08:00
parent 38cf2bd65a
commit fd9e1768b2
4 changed files with 208 additions and 12 deletions
+125
View File
@@ -0,0 +1,125 @@
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
strategy:
matrix:
include:
- os: windows-latest
artifact_name: wxapkg-gui-windows-x64
extension: .exe
- os: macos-latest
artifact_name: wxapkg-gui-macos-x64
extension: ''
- os: macos-latest
artifact_name: wxapkg-gui-macos-arm64
extension: ''
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Get Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build Windows
if: matrix.os == 'windows-latest'
env:
CGO_ENABLED: 0
run: wails build
working-directory: .
- name: Build macOS x64
if: matrix.os == 'macos-latest' && matrix.artifact_name == 'wxapkg-gui-macos-x64'
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
run: wails build -platform darwin/amd64
working-directory: .
- name: Build macOS ARM64
if: matrix.os == 'macos-latest' && matrix.artifact_name == 'wxapkg-gui-macos-arm64'
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
run: wails build -platform darwin/arm64
working-directory: .
- name: Rename artifact (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: mv build/bin/wxapkg-gui.exe build/bin/${{ matrix.artifact_name }}.exe
- name: Rename artifact (macOS)
if: matrix.os == 'macos-latest'
shell: bash
run: mv build/bin/wxapkg-gui.app "build/bin/${{ matrix.artifact_name }}.app"
- name: Download UPX
if: matrix.os == 'windows-latest'
shell: bash
run: |
UPX_VERSION="4.2.2"
curl -LO https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-win64.zip
unzip upx-${UPX_VERSION}-win64.zip
- name: Compress with UPX (Windows only)
if: matrix.os == 'windows-latest'
run: ./upx-${UPX_VERSION}-win64/upx.exe --best --lzma build/bin/${{ matrix.artifact_name }}.exe
env:
UPX_VERSION: "4.2.2"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: build/bin/${{ matrix.artifact_name }}${{ matrix.extension }}
publish:
needs: release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create DMG (macOS x64)
if: false # 需要手动创建或使用 create-dmg 工具
run: |
APP_NAME="wxapkg-gui-macos-x64.app"
DMG_NAME="wxapkg-gui-macos-x64.dmg"
hdiutil create -volname "$APP_NAME" -srcfolder "artifacts/wxapkg-gui-macos-x64/$APP_NAME" -ov -format UDZO "$DMG_NAME"
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
generate_release_notes: true
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+37 -12
View File
@@ -1,19 +1,44 @@
# README
# wxapkg
## About
> **免责声明**:此工具仅限于学习和研究软件内含的设计思想和原理,用户承担因使用此工具而导致的所有法律和相关责任!作者不承担任何法律责任!
This is the official Wails Vue-TS template.
基于 [Wails](https://wails.io) 构建的微信小程序 (`.wxapkg`) 解密与解包桌面工具,支持 Windows 与 macOS。
You can configure the project by editing `wails.json`. More information about the project settings can be found
here: https://wails.io/docs/reference/project-config
![界面截图](assets/screenshot.png)
## Live Development
## ✨ 功能
To run in live development mode, run `wails dev` in the project directory. This will run a Vite development
server that will provide very fast hot reload of your frontend changes. If you want to develop in a browser
and have access to your Go methods, there is also a dev server that runs on http://localhost:34115. Connect
to this in your browser, and you can call your Go code from devtools.
- [x] 自动扫描微信小程序安装目录
- [x] 手动指定小程序文件、目录或安装目录
- [x] 解析并还原成小程序原始源码文件结构
- [x] 代码美化(JSON / HTML / JavaScript
- [ ] 获取小程序信息
## Building
## ⚒️ 安装
To build a redistributable, production mode package, use `wails build`.
直接从 [Releases](https://github.com/wux1an/wxapkg/releases) 下载对应平台的预编译版本,双击运行即可。
## 🛠️ 自行编译
环境安装
```bash
# 安装 Wails CLI(自动安装 Go 依赖)
go install github.com/wailsapp/wails/v2/cmd/wails@latest
# 安装前端依赖
cd frontend && npm install && cd ..
```
编译运行
```bash
wails build # 构建到 build/bin/
wails dev # 开发模式(热更新)
```
## 🔗 参考
- 小程序解密: https://github.com/BlackTrace/pc_wxapkg_decrypt
- 小程序解包: [https://gist.github.com/Integ/bcac5c21de5ea3...](https://gist.github.com/Integ/bcac5c21de5ea35b63b3db2c725f07ad)
- 原理介绍: [https://misakikata.github.io/2021/03/%E5%BE%...](https://misakikata.github.io/2021/03/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%A7%A3%E5%8C%85/)
+46
View File
@@ -4,11 +4,14 @@ import (
"context"
"errors"
"fmt"
"math/rand/v2"
"os"
"os/exec"
"path/filepath"
goruntime "runtime"
"slices"
"sync"
"time"
"github.com/wailsapp/wails/v2/pkg/runtime"
"github.com/wux1an/wxapkg/wechat"
@@ -71,9 +74,52 @@ func (a *AppService) GetDefaultPaths() wechat.PathScanResult {
}
func (a *AppService) ScanWxapkgItem(path string, scan bool) ([]wechat.WxapkgItem, error) {
//return a.generateWxapkgItemDemo()
return wechat.ScanWxapkgItem(path, scan)
}
func (a *AppService) generateWxapkgItemDemo() ([]wechat.WxapkgItem, error) {
generateWxId := func() string {
hexChars := "0123456789abcdef"
id := "wx"
for i := 0; i < 16; i++ {
id += string(hexChars[rand.IntN(16)])
}
return id
}
items := make([]wechat.WxapkgItem, 10)
startTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC).Unix()
endTime := time.Date(2025, 12, 31, 23, 59, 59, 0, time.UTC).Unix()
for i := 0; i < 10; i++ {
wxId := generateWxId()
location := filepath.Join("C:\\Users\\Example\\Documents\\WeChat Files\\Applet", wxId)
randomTime := startTime + rand.Int64N(endTime-startTime)
item := wechat.WxapkgItem{
UUID: fmt.Sprintf("demo-%d", i+1),
WxId: wxId,
Location: location,
Size: int64(rand.IntN(5*1024*1024) + 1024*1024),
IsDir: true,
LastModifyTime: randomTime,
}
items[i] = item
}
slices.SortFunc(items, func(e wechat.WxapkgItem, e2 wechat.WxapkgItem) int {
return (int)(e2.LastModifyTime - e.LastModifyTime)
})
items[0].UnpackStatus = wechat.StatusTypeFinished
items[1].UnpackStatus = wechat.StatusTypeRunning
return items, nil
}
func (a *AppService) ClipboardSetText(text string) error {
return runtime.ClipboardSetText(a.ctx, text)
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB