diff --git a/README.md b/README.md index 7e19541..1bba773 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file diff --git a/cmd/root.go b/cmd/root.go index bd85a61..e78f3f6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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) } diff --git a/cmd/scan-tui.go b/cmd/scan-tui.go index 88f98db..a5eb80c 100644 --- a/cmd/scan-tui.go +++ b/cmd/scan-tui.go @@ -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(). diff --git a/cmd/scan.go b/cmd/scan.go index 6860869..bd9c373 100644 --- a/cmd/scan.go +++ b/cmd/scan.go @@ -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") diff --git a/cmd/unpack.go b/cmd/unpack.go index 9d9e253..5bb106d 100644 --- a/cmd/unpack.go +++ b/cmd/unpack.go @@ -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") diff --git a/demo.gif b/demo.gif new file mode 100644 index 0000000..5d4cfe5 Binary files /dev/null and b/demo.gif differ diff --git a/go.mod b/go.mod index aa09c41..2514786 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module wxapkg +module github.com/wux1an/wxapkg go 1.19 diff --git a/main.go b/main.go index c6addab..5ff2d51 100644 --- a/main.go +++ b/main.go @@ -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() }