Android Quick Analysis apk tool AAPT Tutorial _android

Source: Internet
Author: User
Tags zip

The previous walfred has introduced the use of Apktool to reverse-compile apk, By Apktool we can actually decompile the serialized Androidmanifest.xml and resource files, and so on, but is there a quick and efficient tool to get the basic content, permissions, and basic information of a apk in the context of a package? The answer is yes, this tool is the AAPT to be introduced today.

AAPT Introduction

AAPT is the Android Asset packaging Tool, we can find the tool in the Platform-tools directory of the SDK. AAPT can view, create, and update zip-formatted document attachments (Zip, jar, apk). You can also compile a resource file into a binary file, although you may not have used the AAPT tool directly, but build scripts and IDE Plug-ins Use this tool to package apk files to form an Android application.

Main usage

The following list of parameters basically shows us how to use the AAPT and the basic functionality of AAPT.

Copy Code code as follows:

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]: Packaging to generate resource compression packs.
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 will use an application to do the test sample, the application is: application of the exchange market.
Enumerate all the files in the APK

Copy Code code as follows:

walfred@ubuntu:~/lab$ AAPT L yingyonghui.apk


Of course, this apk too much content, a piece of paper can not display all the content, you could redirect it to a special file, so that the view is also convenient.

Copy Code code as follows:

walfred@ubuntu:~/lab$ aapt L yingyonghui.apk > Yingyonghui.txt

View basic information for APK
AAPT the most useful function, the D (UMP) parameter allows you to view the basic information of the APK, as well as permissions, but this parameter also has a value, the value can be selected as follows:
The syntax for the D parameter is as follows:

Copy Code code as follows:

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.
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.

View basic information

Copy Code code as follows:

walfred@ubuntu:~/lab$ aapt D badging yingyonghui.apk


View Application Permissions

Copy Code code as follows:

walfred@ubuntu:~/lab$ aapt D Permissions yingyonghui.apk

Conclusion

How about, aapt this gadget skill is really not small, when we judge a apk whether there is malicious behavior, we can consider the first step to use AAPT This tool oh, we can analyze this APK permission list, once some of the permissions are too large, such as sending text messages, reading contact information and other permissions, We can further analyze the APK.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.