APK decompile

The previous apk decompilation method is no longer available, because the project needs to re-learn the decompilation, here is a record.

1. Introduction to Decompilation Tools

apktool  

 

     Function: Resource file acquisition, you can extract image files and layout files for use and viewing

     https://ibotpeaches.github.io/Apktool/

 

dex2jar

     Function: Decompile apk into java source code (classes.dex is converted into jar file)

     https://sourceforge.net/projects/dex2jar/

 

jd-gui

 

     Function: View the jar file converted from classes.dex in the APK, that is, the source file

     http://jd.benow.ca/

 

 

2. Operation steps

1. Unzip the resource file:

1) Go to the apktool official website, download apktool.bat and apktool_2.3.1.jar, rename the downloaded jar to apktool.jar, and put these two files in the same directory, for example, create a new apktools folder, put Both files are placed in this folder

 

2) Put the apk to be decompressed in the apktools directory, run cmd, enter the directory, and then execute the command: apktool d xxx.apk After the command is executed, the decompiled file will be in this directory, where d means to decompress the file

 

2. Unzip the source code

1) Download dex2jar, which is a zip package, unzip it directly, for example, extract it to the dex2jar directory

 

2) Change the suffix of the apk to be decompressed to zip or .rar, decompress it, get classes.dex, put the classes.dex file in the dex2jar directory, run cmd, enter this directory, and execute the command:

dex2jar classes.dex , the classes-dex2jar file is obtained after the command is executed

 

 

3) Download jd-gui, which is also a zip package, unzip it, run the jd-gui.exe file, and then open the jar file obtained in the previous step in jd-gui, then you can see the source code

 

3. Note:

1. If you unzip the apk to get two dex files, for example, classes.dex and classes2.dex are extracted, then you need to extract both dex files through dex2jar at the same time to see the complete code.

 

2. In addition, when I use the latest version of jd-gui to view the jar file, it prompts me to use jre1.7, but my environment is 1.9, I don't know why it doesn't work? At present, I can download a lower version of jd-gui.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326032113&siteId=291194637