The previous walfred has introduced the use of Apktool to reverse-compile the APK, By Apktool we can indeed decompile the serialized Androidmanifest.xml and resource files and so on, but is there a quick and efficient tool to get the basic content of an APK, permissions, and basic information about the APK without the need for a package? The answer is yes, this tool is the AAPT to be introduced today.
AAPT Introduction
AAPT is the Android Asset Packaging tool, which we can find in the Platform-tools directory of the SDK. AAPT can view, create, and update zip-format document attachments (Zip, jar, apk). You can also compile the resource files into binaries, although you may not have used the AAPT tool directly, but the build scripts and IDE plugins Use this tool to package the APK file to form an Android application.
Main usage
The following list of parameters basically shows us how to use the basic functions of AAPT and AAPT.
123456 |
AAPT L[ist]: Lists the contents of the resource compression package. AAPT D[ump]: View the contents specified in the APK package. AAPT P[ackage]: Package generates a resource compression package. AAPT R[emove]: Deletes the specified file from the compressed package. AAPT A[DD]: Adds the specified file to the compressed package. AAPT V[ersion]: Prints the version of the AAPT. |
Using AAPT
Here I use an application to do the test sample, the application is: the application of the market application.
Enumerate all the files in the APK
1 |
[Email protected]:~/lab$ aapt L yingyonghui.apk |
Of course, this apk is too much content, a piece of paper does not show all the content, you can redirect it to a special file, so it is convenient to view.
1 |
[Email protected]:~/lab$ aapt L yingyonghui.apk > Yingyonghui.txt |
See the basic information of the APK
AAPT most useful function, through the D (UMP) parameter can see the basic information of the APK and permissions, etc., but this parameter also has a value, the value can be selected as follows:
The syntax for the D parameter is as follows:
12345678 |
AAPT D[ump] [--values] what file. {APK} [Asset [Asset ...] Values:badging Print the label and icon for the app declared in Apk.permissions Print the permissions from the APK.RESOURC ES print the Resource table from the Apk.configurations print the configurations in the Apk.xmltree print the compiled XML s in the given assets.xmlstrings Print the strings of the given compiled XML assets. |
View basic information
1 |
[Email protected]:~/lab$ aapt D badging yingyonghui.apk |
View app Permissions
1 |
[Email protected]:~/lab$ aapt D permissions yingyonghui.apk |
Conclusion
How, aapt This gadget is really not small, when we determine whether an apk is malicious behavior, we can consider the first step to use AAPT This tool oh, we can analyze the APK's permission list, once some of the permissions are too large, such as sending text messages, reading contact information and other permissions, You can further analyze this apk.
Quick Analysis APK Tool AAPT use