aapt相關(guān)用法

AAPT

AAPT全稱,Android Asset Packaging Tool。開發(fā)者可以在Android SDK的build-tools目錄下找到這個工具。


aapt_dir.png

AAPT使用

  1. 列舉apk內(nèi)容文件
     ./aapt l[ist] <APK PATH>
    
    利用上面的指令,可以列舉出apk中的所有內(nèi)容
    可以使用重定向符“>”講內(nèi)容輸出到指定的文件中
    ./aapt l[ist] <APK PATH> > <DEST PATH>
    
  2. 查看指定文件信息
    ./aapt d[ump] [--values]<APK PATH>
    
    values的取值可以分為以下幾類
    • strings Print the contents of the resource table string pool in the APK.
    • badging Print the label and icon for the app declared in APK.
    • permissions Print the permissions from the APK.
    • resources Print the resource table from the APK.
    • configurations Print the configurations in the APK.
    • xmltree Print the compiled xmls in the given assets.
    • xmlstrings Print the strings of the given compiled xml assets.
      xmltree和xmlstrings 兩個參數(shù)在apk后面要寫出具體的xml文件的路徑
    ./aapt d badging app-debug.apk|grep package
    
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內(nèi)容