APKURLGrep是一个专门用于从安卓APK安装包中提URL的自动化工具。APKURLGrep通过反编译APK文件并分析其内容,能够有效识别应用中的API接口地址,同时自动过滤图片、字体等无关文件。工具采用Go语言开发,具有轻量高效的特点。
apktool.RunApktool(baseApk, tempDir) //反编译
extractor.Extract(tempDir) //url提取
//使用系统命令执行apktool
func RunApktool(apk string, tempDir string) string {
cmd := exec.Command("apktool","d", apk, "-o", tempDir, "-fq")
output, err := cmd.CombinedOutput()
if err != nil {
return ""
}
return string(output)
}
// 判断是否为需要跳过的文件类型
func SkipExtension(filename string) bool {
ext := filepath.Ext(filename)
return IsOtherExt(ext) || IsImageExt(ext) || IsFontExt(ext)
}
六、安装与使用
go get -u github.com/ndelphit/apkurlgrep
apkurlgrep -a ~/path/to/file.apk
Result of URLs:
https://example.com
https://example.net
https://example.edu
Result of URLs Paths:
/example
/admin
/onboarding
github链接地址:https://github.com/ndelphit/apkurlgrep.git