有一堆a(bǔ)pk,要解析出包名和應(yīng)用名,怎么搞?
現(xiàn)學(xué)現(xiàn)用,正好遇到了
使用了Android sdk的aapt工具
cmd文件內(nèi)容如下:
chcp 65001
REM Copyrights: youngpen
REM version:1.0
title 批量提取apk包名和應(yīng)用名
rem 獲取所有apk文件,使用aapt獲得apk信息所在行
for /f "delims=" %%a in ('dir /b *.apk') do (
echo %%a >>temp_info.txt
aapt dump badging %%a |find "application-label:" >>temp_info.txt
aapt dump badging %%a |find "package:" >>temp_info.txt
)
rem 將apk安裝后的應(yīng)用名和包名單獨(dú)打印
for /f "tokens=2 delims='" %%i in ('find /i ":" temp_info.txt') do (
echo %%i >>result.txt
)
rem 刪除臨時(shí)文件
del temp_info.txt
echo 任務(wù)完成,點(diǎn)擊任意鍵退出
exit
不過win7下chcp有問題似乎……
而且只能滿足自己的需求用
運(yùn)行效果如下圖
