forked from Ackites/KillWxapkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (45 loc) · 1.64 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"flag"
"fmt"
"github.com/Ackites/KillWxapkg/cmd"
)
var (
appID string
input string
outputDir string
fileExt string
restoreDir bool
pretty bool
noClean bool
)
func init() {
flag.StringVar(&appID, "id", "", "微信小程序的AppID")
flag.StringVar(&input, "in", "", "输入文件路径(多个文件用逗号分隔)或输入目录路径")
flag.StringVar(&outputDir, "out", "", "输出目录路径(如果未指定,则默认保存到输入目录下以AppID命名的文件夹)")
flag.StringVar(&fileExt, "ext", ".wxapkg", "处理的文件后缀")
flag.BoolVar(&restoreDir, "restore", false, "是否还原工程目录结构")
flag.BoolVar(&pretty, "pretty", false, "是否美化输出")
flag.BoolVar(&noClean, "noClean", false, "是否清理中间文件")
}
func main() {
// 解析命令行参数
flag.Parse()
if appID == "" || input == "" {
fmt.Println("使用方法: program -id=<AppID> -in=<输入文件1,输入文件2> 或 -in=<输入目录> -out=<输出目录> [-ext=<文件后缀>] [-restore] [-pretty] [-noClean]")
flag.PrintDefaults()
return
}
banner := `
_ __ _ _ _ __ __ _
| | / /(_) | | \ \ / / | |
| |/ / _| | | \ \ / / __ ____ _ ___| | ____ _
| \ | | | | \ \/ / / / / / _ / __| |/ / ' \
| |\ \| | | | \ / / /_/ / (_| \__ \ <| | | |
\_| \_/_|_|_| \/ \__,_|\__,_|___/_|\_\_| |_|
Wxapkg Decompiler Tool v2.0.0
`
fmt.Println(banner)
// 执行命令
cmd.Execute(appID, input, outputDir, fileExt, restoreDir, pretty, noClean)
}