diff --git a/README.md b/README.md index 946396c..ff4f61a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ ![gui1](run1.png) -![gui1](run2.png) +![gui2](run2.png) 支持的功能 @@ -34,3 +34,9 @@ √ 校验签名:校验V2签名,判断是否存在Janus漏洞 √ 密钥泄露:扫描Apk文件内容,匹配是否有密钥字符串 √ 反环境检测:扫描Dex文件搜索是否有Root、模拟器、反调试检测 + +使用参数-s=true(默认false)开启全文件硬编码信息扫描 + + ApkCheckPack.exe -s=false -f test.apk + +![gui3](run3.png) \ No newline at end of file diff --git a/main.go b/main.go index 3f51f33..075f65f 100644 --- a/main.go +++ b/main.go @@ -1,35 +1,44 @@ package main import ( + "flag" "fmt" "os" "path/filepath" "strings" ) +var arg_scanhardcode = flag.Bool("s", false, "-s=true\t是否扫描全文件的硬编码信息") +var arg_filepath = flag.String("f", "", "-f test.apk\t指定apk文件路径或目录") + +//var dirpath = flag.String("d", "", "-d D:/apkfiles") + func main() { if len(os.Args) < 2 { - fmt.Println("请提供APK文件路径或文件夹路径作为命令行参数。") + fmt.Println("请提供APK文件路径或文件夹路径作为命令行参数s。") + fmt.Println("用法:ApkCheckPack.exe -s=false -f test.apk") + return + } + flag.Parse() + //fmt.Println("命令行参数arg_filepath的值:", *arg_filepath) + //fmt.Println("命令行参数arg_scanhardcode的值:", *arg_scanhardcode) + //fmt.Println("参数:", flag.Args()) + + info, err := os.Stat(*arg_filepath) + if err != nil { + fmt.Printf("无效的路径:%s\n", *arg_filepath) return } - for _, arg := range os.Args[1:] { - info, err := os.Stat(arg) + if info.IsDir() { + err := scanAPKFolder(*arg_filepath) if err != nil { - fmt.Printf("无效的路径:%s\n", arg) - continue + fmt.Printf("扫描APK文件夹 %s 失败:%v\n", *arg_filepath, err) } - - if info.IsDir() { - err := scanAPKFolder(arg) - if err != nil { - fmt.Printf("扫描APK文件夹 %s 失败:%v\n", arg, err) - } - } else { - err := scanAPKFile(arg) - if err != nil { - fmt.Printf("扫描APK文件 %s 失败:%v\n", arg, err) - } + } else { + err := scanAPKFile(*arg_filepath) + if err != nil { + fmt.Printf("扫描APK文件 %s 失败:%v\n", *arg_filepath, err) } } } @@ -66,9 +75,12 @@ func scanAPKFolder(folderPath string) error { func scanAPKFile(filePath string) error { //fmt.Printf("scanAPKFile") + verifyApk(filePath) PackByLibSo(filePath) ScanAPKAnti(filePath) - verifyApk(filePath) - ScanAPKHardCoded(filePath) //匹配规则待调整 + if *arg_scanhardcode { + ScanAPKHardCoded(filePath) //匹配规则待调整 + } + return nil } diff --git a/run2.png b/run2.png index 65faed6..e1919d7 100644 Binary files a/run2.png and b/run2.png differ diff --git a/run3.png b/run3.png new file mode 100644 index 0000000..9058d12 Binary files /dev/null and b/run3.png differ