doc: add demo

This commit is contained in:
wux1an
2023-05-27 00:25:48 +08:00
parent b712209962
commit 268477e9a2
8 changed files with 30 additions and 12 deletions

View File

@@ -1,7 +1,17 @@
# wxapkg
**Install:**
Download the latest [release](https://github.com/wux1an/wxapkg/releases/latest) or build with `go install` by yourself
```
go install github.com/wux1an/wxapkg@latest
```
**Usage:**
![demo](demo.gif)
- scan mini program
```bash
@@ -26,6 +36,7 @@
**References:**
1. decrypt: https://github.com/BlackTrace/pc_wxapkg_decrypt
2. unpack: https://gist.github.com/Integ/bcac5c21de5ea35b63b3db2c725f07ad
3. introduce: 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/
- decrypt: https://github.com/BlackTrace/pc_wxapkg_decrypt
- unpack: [https://gist.github.com/Integ/bcac5c21de5ea3...](https://gist.github.com/Integ/bcac5c21de5ea35b63b3db2c725f07ad)
- introduce: [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/)
- terminal ui: https://github.com/charmbracelet/bubbletea

View File

@@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
var RootCmd = &cobra.Command{
Use: "wxapkg",
Short: "A tool to scan and decrypt wechat mini program",
CompletionOptions: cobra.CompletionOptions{
@@ -15,7 +15,7 @@ var rootCmd = &cobra.Command{
}
func Execute() {
err := rootCmd.Execute()
err := RootCmd.Execute()
if err != nil {
os.Exit(1)
}

View File

@@ -9,10 +9,10 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/fatih/color"
"github.com/wux1an/wxapkg/util"
"regexp"
"strconv"
"strings"
"wxapkg/util"
)
var baseStyle = lipgloss.NewStyle().

View File

@@ -5,10 +5,10 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/fatih/color"
"github.com/spf13/cobra"
"github.com/wux1an/wxapkg/util"
"os"
"path/filepath"
"regexp"
"wxapkg/util"
)
var scanCmd = &cobra.Command{
@@ -66,7 +66,7 @@ var scanCmd = &cobra.Command{
}
func init() {
rootCmd.AddCommand(scanCmd)
RootCmd.AddCommand(scanCmd)
var homeDir, _ = os.UserHomeDir()
var defaultRoot = filepath.Join(homeDir, "Documents/WeChat Files/Applet")

View File

@@ -11,6 +11,7 @@ import (
"github.com/fatih/color"
"github.com/spf13/cobra"
"github.com/tidwall/pretty"
"github.com/wux1an/wxapkg/util"
"golang.org/x/crypto/pbkdf2"
"io"
"log"
@@ -19,7 +20,6 @@ import (
"regexp"
"sort"
"sync"
"wxapkg/util"
)
var programName = filepath.Base(os.Args[0])
@@ -258,7 +258,7 @@ func decryptFile(wxid, wxapkgPath string) []byte {
}
func init() {
rootCmd.AddCommand(unpackCmd)
RootCmd.AddCommand(unpackCmd)
var homeDir, _ = os.UserHomeDir()
var defaultRoot = filepath.Join(homeDir, "Documents/WeChat Files/Applet", "wx00000000000000")

BIN
demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

2
go.mod
View File

@@ -1,4 +1,4 @@
module wxapkg
module github.com/wux1an/wxapkg
go 1.19

View File

@@ -1,7 +1,14 @@
package main
import "wxapkg/cmd"
import (
"fmt"
"github.com/wux1an/wxapkg/cmd"
)
var version = "v0.0.1"
var commit = "b7122099"
func main() {
cmd.RootCmd.Version = fmt.Sprintf("%s(%s)", version, commit)
cmd.Execute()
}