"aapt dump" Command - Printing Contents of .apk Package

This section describes the 'aapt dump' command for providing the list of all files, the resource table and the manifest of an .apk package file.

After figuring out roughly how the "ant debug" build process works. Now I am interested to review the content of the final .apk package file: .\bin\HelloAndroid-debug.apk using the "aapt list" command:

C:\herong\HelloAndroid>
   \local\android-sdk-windows\build-tools\\22.0.1\aapt
   list -a bin\HelloAndroid-debug.apk

AndroidManifest.xml
res/drawable-hdpi-v4/ic_launcher.png
res/drawable-ldpi-v4/ic_launcher.png
res/drawable-mdpi-v4/ic_launcher.png
res/drawable-xhdpi-v4/ic_launcher.png
res/layout/main.xml
resources.arsc
classes.dex
META-INF/MANIFEST.MF
META-INF/CERT.SF
META-INF/CERT.RSA

Resource table:
Package Groups (1)
Package Group 0 id=0x7f packageCount=1 name=com.herongyang
  Package 0 id=0x7f name=com.herongyang
    type 1 configCount=4 entryCount=1
      spec resource 0x7f020000 com.herongyang:drawable/ic_launcher: flags=0x0000
0100
      config ldpi-v4:
        resource 0x7f020000 com.herongyang:drawable/ic_launcher: t=0x03 d=0x0000
0001 (s=0x0008 r=0x00)
      config mdpi-v4:
        resource 0x7f020000 com.herongyang:drawable/ic_launcher: t=0x03 d=0x0000
0002 (s=0x0008 r=0x00)
      config hdpi-v4:
        resource 0x7f020000 com.herongyang:drawable/ic_launcher: t=0x03 d=0x0000
0003 (s=0x0008 r=0x00)
      config xhdpi-v4:
        resource 0x7f020000 com.herongyang:drawable/ic_launcher: t=0x03 d=0x0000
0004 (s=0x0008 r=0x00)
    type 2 configCount=1 entryCount=1
      spec resource 0x7f030000 com.herongyang:layout/main: flags=0x00000000
      config (default):
        resource 0x7f030000 com.herongyang:layout/main: t=0x03 d=0x00000000 (s=0
x0008 r=0x00)
    type 3 configCount=1 entryCount=1
      spec resource 0x7f040000 com.herongyang:string/app_name: flags=0x00000000
      config (default):
        resource 0x7f040000 com.herongyang:string/app_name: t=0x03 d=0x00000005
(s=0x0008 r=0x00)

Android manifest:
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=2)
    A: android:versionCode(0x0101021b)=(type 0x10)0x1
    A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
    A: package="com.herongyang" (Raw: "com.herongyang")
    A: platformBuildVersionCode=(type 0x10)0x16 (Raw: "22")
    A: platformBuildVersionName="5.1.1-1819727" (Raw: "5.1.1-1819727")
    E: application (line=6)
      A: android:label(0x01010001)=@0x7f040000
      A: android:icon(0x01010002)=@0x7f020000
      A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
      E: activity (line=7)
        A: android:label(0x01010001)=@0x7f040000
        A: android:name(0x01010003)="HelloAndroid" (Raw: "HelloAndroid")
        E: intent-filter (line=9)
          E: action (line=10)
            A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "andr
oid.intent.action.MAIN")
          E: category (line=11)
            A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
 "android.intent.category.LAUNCHER")   

Pretty good. "aapt dump" command provides me the list of all files in the package. It also provides me the resource table and the manifest of the package.

Last update: 2015.

Table of Contents

 About This Book

 Installing JDK 1.8 on Windows System

 Installation of Android SDK R24 and Emulator

 Installing Apache Ant 1.9 on Windows System

 Developing First Android Application - HelloAndroid

 Android Application Package (APK) Files

 Android Debug Bridge (adb) Tool

 Android File Systems

 Android 4.0.3 File Systems

 AboutAndroid - Application to Retrieve System Information

 android.app.Activity Class and Activity Lifecycle

 View Objects and Layout Resource Files

 Using "adb logcat" Command for Debugging

Build Process and Package File Content

 "android create project" Command Options

 Android Project Folder Structure

 Android Application Project Build Process

 Project Build Process Done by "ant debug" Command

 Detailed Output of "ant -verbose debug" Command

 Output of "ant -verbose debug" - Android SDK R17

 "aapt" - Android Asset Packaging Tool

 "aapt package" Command - Resource Code Generation

 "javac" - Java Compilation Command

 "dx.bat --dex" Command - Converting .class Files into .dex File

 "apkbuilder" Command - Packaging and Signing .apk File

 "zipalign" Command - Aligning File Locations in .apk Package

"aapt dump" Command - Printing Contents of .apk Package

 META-INF Files - Digests, Signature and Certificate

 Building Your Own Web Browser

 Android Command Line Shell

 Samsung Galaxy Tab 3 Mini Tablet

 USB Debugging Applications on Samsung Tablet

 Android Tablet - LG-V905R

 USB Debugging Applications on LG-V905R Tablet

 Android Phone - LG-P925g

 USB Debugging Applications on LG-P925g Phone

 Outdated Tutorials

 References

 PDF Printing Version