Decompilation of Android .apk files

Source: Internet
Author: User

[Copyright belongs to the author wixe. You are welcome to repost it, but please inform the author and indicate the source in advance]

To decompile an APK translation, perform the following steps:
1. Find the APK Installation File.
2. Find the *. Dex translation for installing the software.
3. Dump Dex File
4. Analyze the DEX file to obtain the desired code

1. Find the APK Installation File.
This is relatively easy. After installing the mobile phone or the plug-in, you can find the APK translation of the installation program under file explorer of Eclipse, or you can find it through the ADB command:

$ ADB Shell
# Cd/system/APP
CD/system/APP
# Ls

2. Find the *. Dex translation for installing the software.
After the software is installed, a *. Dex file is generated in the android file system, which is usually in the directory/data/Dalvik-Cache. You can also find the file by running the ADB command:

$ ADB Shell
# Cd/data/Dalvik-Cache
CD/data/Dalvik-Cache
# Ls

3. Compile the DEX file corresponding to the software using the following commands:

ADB shell dexdump-D-f-h/data/Dalvik-Cache/data@app@be.citylive.twitpic.apk @ classes. Dex> Twitpic. Text

Command Parameter explanation:
-D: disassemble code sections
-F: display summary information from File Header
-H: display file header details
-C: Decode (demangle) low-level symbol names
-S: Compute sizes only

4. Get the required code:
Open the compiled text file and you will see the following code:

Class #0 header:
Class_idx: 32
Access_flags: 196625 (0x30011)
Superclass_idx: 61
Interfaces_off: 0 (0x000000)

From this translation, we can easily obtain code information.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/lastsweetop/archive/2009/11/24/4864090.aspx

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.