Android decompilation tool and android decompilation Tool
Directory
- Directory
- Preface
- Tools
- Flowchart
- Obtain classesdex
- Classesdex-classes-dex2jarjar
- Jd-gui
- View resource files and xml
- Apk Installation
- Unpack Apk
- Package Apk
Preface
Why does it need to be decompiled?
Which of the following statements is required?:
This article only describes the use of Android decompilation tools and does not explain the principles. (Ps: It's mainly because I don't know a lot of things about principles, so I don't want to miss people !)
Tools
As the saying goes, "to do a good job, you must first sharpen the tool." to decompile Android, we need the following four powerful tools (ps: these tools can all be cross-platform ):
Flowchart
In Android development, decompilation is usually required for apk, jar package, and odex files. I first use a flowchart to describe the decompilation process and The Decompilation tool to be used.
Obtain classes. dex
Based on the flowchart, let's take a look at how to obtain the classes. dex file from files such as apk, jar, and odex.
Apk
We need to use unzip to decompress the apk. The command is as follows:
unzip test.apk -d /tmp/test
After decompression, we can find the classes. dex file in the decompressed directory (ps: above is/tmp/test.
Jar
Jar is also a collection of java files. We can decompress it using the jar-xf command. This command is often used to decompile jar files in the/system/framework directory of Android.
jar -xf classes.jar
After decompression, you can see the classes. dex file.
Odex
Retrieving classes. dex from the odex file is more troublesome than apk and jar packages. Some conversions are required in the middle.
The odex file must first be converted to a smail file set using the baksmail tool, and then packaged into a classes. dex file using the smail tool.
The following uses the telephony-common.odex file under the/system/framework directory as an example to describe how to use the baksamil and smail tools.
Baksmail
Use the baksmail. jar file to break down the odex file. The specific command is as follows:
java -jar baksmali-2.0.6.jar -x telephony-common.odex
If it succeeds, an out directory will be generated under the current directory, which contains some files suffixed with ". smail.