Decompile the APK on Mac, and decompile the MacAPK

Source: Internet
Author: User
Tags java decompiler

Decompile the APK on Mac, and decompile the MacAPK
Window for the APK decompilation is very simple, there are a lot of integration tools, select the installation package and then you can easily decompile the jar of the resource file and source code, and then use the JD-GUI to view the source code, use a text editor to view resource files. I haven't found any powerful decompilation tools since I changed my MAC. I can't help but sort out the decompilation process and share it with me.
In fact, The Decompilation tool set eventually uses several commonly used components to decompile the APK, namely, apktool: Extracts various resource files, files, la S, and various resources in the APK; dex2jar: set classes in APK. convert dex to a jar file and view the source code.

1. apktool: Extracts various resource files from the APK.

The basic syntax of apktool is:

{your path}/sh apktool.sh d {your path}/food.apk

Then, we will see a food folder in the directory of apktool. sh, which contains all the resource files. The/res/values/public. xml contains the various ID resources we have defined.

:
Https://code.google.com/p/android-apktool/
Https://code.google.com/p/android-apktool/wiki/Install
Https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.0.0rc3.jar

2. dex2jar: Convert classes. dex in the APK to a jar file.

Basic Syntax:

{your path}/sh dex2jar.sh {your path}/classes.dex

So we can see classes_dex2jar.jar in the directory of classed. dex, and then we can open it with the JD-GUI.

Classes. dex is the file we extract from the APK.
:
Https://code.google.com/p/dex2jar/
Https://dex2jar.googlecode.com/files/dex2jar-0.0.9.15.zip

3, JD-GUI: View jar file this tool is relatively simple, is used to view the jar file. Use this tool to view the jar file generated by dex2jar. I did not expect the official website to provide the mac version. Big love ~
In addition, android studio has integrated JD-IntelliJ (Java Decompiler Intellij Plugin) with the latest version 0.6.
:
Http://jd.benow.ca/
Http://jd.benow.ca/jd-gui/downloads/jd-gui-0.3.5.osx.i686.dmg

The initial directory is as follows:



4. perform the following operations:
$ Sh apktools/apktool. sh d food.apk // generate a food folder in the current directory, which is the extracted resource file $ unzip-o-d tmpfood food.apk // generate a tmpfood folder in the current directory, $ sh dex2jar-0.0.9.15/dex2jar. sh tmpfood/classes. dex // generate a classes_dex2jar.jar file in the tmpfood directory. This file is the source code file.

The final file is as follows:


View the obtained jar file:



Download resources:

Http://download.csdn.net/detail/ttdevs/8317793


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.