android-directory Structure and anti-compilation

Source: Internet
Author: User

android-directory Structure and anti-compilation The directory of an installed app
System App:system/app
User App:data/app


Two common folder functions
Android folder: Referenced Framework class Library


SRC: Source code file


Gen: automatically generated files, deleted or automatically generated, corresponding to the Res folder, RES resource mapping


Assets: Using a resource file, such as a MP3 file, accessed through a specific path, is an ordinary folder under the program
Fast, we recommend using Assert,


Res: Application Resource Bundle
Picture Resources
DPI resolution how many points in an inch range
The application icon uses the following folder
DRAWABLE-HDPI 240dpi, higher resolution
DRAWABLE-LDPI 120dpi, smaller resolution
DRAWABLE-MDPI 160DPI Medium Resolution
Generic, non-differentiated use of the following folder
Drawable


Layout: interface layouts file


Value: values, such as strings, write text into a string variable, use a variable instead of a string, and an identifier referenced by @, such as @string, value inside
There is a string file, and the file defines the value of string


Androidmanifest.xml: Global configuration files, class libraries, components, publishing information, etc.


Default.properties:java configuration files, such as the required operating environment


PROGUARD.EFG: Config file, over 2.2, configure application obfuscation to prevent anti-compilation apk


Doc:javadoc file


Menu: Menus


Raw: Native program, picture, video, generate the corresponding ID in R.java, can be accessed via R.java file
Note The raw folder does not participate in compilation


ANIM: Animation


XML: Additional XML files


Two APK structure
Meta-inf Signature configuration information
Res resource File
Androidmanifest.xml Global configuration file
Classes.dex Virtual Machine executable file
RESOURCES.ARSC Resource index file, for applications to find resources faster


Three evils compiling Dex
Method One
DX Tool: Converts a class file to a Dex file, which is a virtual machine executable binary file
AAPT: Package an entire project as an APK
Dexdump: decompile The apk file, add the Dexdump directory to the System environment variable
The above three files are placed in the same directory, and the directory is added to the environment variable
The resulting file is in the language of Smail, but this anti-compilation is not easy to read
Anti-compilation requires the compilation of RES and XML


The main use of the following method two
The command to use for anti-compilation
If you need to add two tools to the path variable, or execute the tool in the appropriate directory of the tool
Apktool stage: Apktool d ***.apk * * * (Name of folder, auto-generated)
Dex2jar stage: Dex2jar Classes.dex ***.jar (does not need to be established, will be generated automatically)


Process: Dex->jar Package->CALSS
Tools require Dex2jar and Xjad
1 Apktool stage, use the command to
2 Unzip the APK package and use Dex2jar to Classes.dex->***.jar
3 using Xjad to decompile ***.jar to Java source files
4 Rename the compiled Java source folder to Src and put it in the folder generated by the Apktool stage


The common thought and method of anti-compilation
Because the APK is a compressed package, anti-compilation is the Dalvik binary and the compressed XML file
The usual method is Apktool+dex2jar+xjad

android-directory Structure and anti-compilation

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.