Android decompilation tool and android decompilation Tool

Source: Internet
Author: User

Android decompilation tool and android decompilation Tool
Directory

  • Directory
  • Preface
  • Tools
  • Flowchart
  • Obtain classesdex
    • Apk
    • Jar
    • Odex
      • Baksmail
      • Smail
  • 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.

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.