apkanalyzer
files
: Analyze the files inside the APK file.manifest
: Analyze the contents of the manifest inside the APK file.dex
: Analyze the DEX files inside the APK file.
- apkanalyzer -h apk file-size myapk.apk
View APK file attributes | Description |
---|---|
apk summary apk-file | Prints the application ID, version code, and version name. Example output: |
apk file-size apk-file | Prints the total file size of the APK. |
apk download-size apk-file | Prints an estimate of the download size of the APK. |
apk features [—not-required] apk-file | Prints features used by the APK that trigger . Add the —not-required option to include features marked as not required in the output.Example output:
|
apk compare [options] apk-file | Compares the sizes of apk-file and apk-file2 . You can include the following options:- —different-only : Print directories and files with differences.- —files-only : Do not print directory entries.- —patch-size : Show an estimate of the file-by-file patch instead of a raw difference.Example output (old size / new size / size difference / path): |
View the APK file system | Description |
Lists all files in the APK. Example output:
| |
files cat —file path apk-file | Prints out the file contents. You must specify a path inside the APK using the —file path option, such as —file |
View information in the manifest | Description |
manifest print apk-file | Prints the APK manifest in XML format. |
manifest application-id apk-file | Prints the application ID value. |
manifest version-name apk-file | Prints the version name value. |
manifest version-code apk-file | Prints the version code value. |
manifest min-sdk apk-file | Prints the minimum SDK version. |
manifest target-sdk apk-file | Prints the target SDK version. |
manifest permissions apk-file | Prints the list of permissions. |
manifest debuggable apk-file | Prints whether the app is debuggable. |
Access DEX file information | Description |
dex list apk-file | Prints a list of the DEX files in the APK. |
dex references [—files path] [—files path2] | Prints the number of method references in the specified DEX files. The default is all DEX files. Add the —files option to indicate specific files that you want to include.Example output: |
dex packages [option1 option2 …] apk-file | Prints the class tree from DEX. In the output, P , C , M , and F indicate packages, classes, methods, and fields, respectively. And x , k , r , and d indicate removed, kept, referenced and defined nodes, respectively.Add the following options to refine the output: - —defined-only : Include only classes defined in the APK in the output.- —files : Specify the DEX file names to include. Default: all DEX files.- —proguard-folder file : Specify the Proguard output folder to search for mappings.- : Specify the Proguard mappings file. - —proguard-seeds file : Specify the Proguard seeds file.- —proguard-usages file : Specify the Proguard usages file.- —show-removed : Show classes and members that were removed by Proguard.Example output (type / state / defined methods / referenced methods / byte size / name): |
dex code —class class [—method method] | Prints the bytecode of a class or method in smali format. The class name is required and prints the fully qualified class name to decompile. Add the —method option to specify the method to decompile. The format for the method decompile is name(params)returnType , for example, someMethod(Ljava/lang/String;I)V . |
View resources stored in res/ and resources.arsc | Description |
resources packages | Prints a list of the packages that are defined in the resources table. |
resources configs —type type [—package package] apk-file | Prints a list of configurations for the specified type . The type is a resource type such as string . Include the —package option if you want to specify the resource table package name, otherwise the first defined package will be used. |
resources value —config config —name name | Prints the value of the resource specified by config , name , and type . The type option is the type of the resource, such as string . Include the —package option if you want to specify the resource table package name, otherwise the first defined package will be used. |
resources names —config config —type type | Prints a list of resource names for a configuration and type. The type option is the type of the resource, such as string . Include the —package option if you want to specify the resource table package name, otherwise the first defined package will be used. |
resources xml —file path apk-file | Prints the human-readable form of a binary XML file. Include the file option to specify the path to the file. |