aapt相关用法

AAPT

AAPT全称,Android Asset Packaging Tool。开发者可以在Android SDK的build-tools目录下找到这个工具。


aapt_dir.png

AAPT使用

  1. 列举apk内容文件
     ./aapt l[ist] <APK PATH>
    
    利用上面的指令,可以列举出apk中的所有内容
    可以使用重定向符“>”讲内容输出到指定的文件中
    ./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 两个参数在apk后面要写出具体的xml文件的路径
    ./aapt d badging app-debug.apk|grep package
    
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容