Get the App
SLTechnology News&Howtos  ›  Development  › 

How to build decompilation environment under Mac os

Shulou Source: shulou.com Published: 2022-06-02 12:45:56 09月12日 Update

This article will explain in detail how to build a decompilation environment under Mac os. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Installation environment

Establish a basic folder

Mkdir-p ~ / study/apkkiller/soft/bin

Mkdir-p ~ / study/apkkiller/soft/src

Mkdir-p ~ / study/apkkiller/output/

The installation file for andorid app is the apk package. To decompile the apk file, you need to download apktool and dex2jar, both of which are hosted on google code:

Http://code.google.com/p/android-apktool/

Http://code.google.com/p/dex2jar/

Find the download address from the above two pages, and here we find the download address of apktool1.5.2 and dex2jar-0.0.9.15:

Cd ~ / study/apkkiller/soft/src

Wget http://android-apktool.googlecode.com/files/apktool1.5.2.tar.bz2

Wget http://dex2jar.googlecode.com/files/dex2jar-0.0.9.15.zip

After decompression, the files are stored in the following directory:

~ / study/apkkiller/soft/src/apktool1.5.2

~ / study/apkkiller/soft/src/dex2jar-0.0.9.15

For ease of use, establish two soft connections:

Ln-s ~ / study/apkkiller/soft/src/apktool1.5.2/apktool.jar ~ / study/apkkiller/soft/bin/apktool

Ln-s ~ / study/apkkiller/soft/src/dex2jar-0.0.9.15/dex2jar.sh ~ / study/apkkiller/soft/bin/dex2jar

Test decompilation environment

Let's start decompiling our test apk file to see if the environment is working properly

Cd ~ / study/apkkiller mkdir-p ~ / study/apkkiller/output/test/source mkdir-p ~ / study/apkkiller/output/test/result cp. / test.apk. / output/test/source/test.zip-d. / output/test/source/test cp. / output/test/source/test/classes.dex. / output/test/source/classes.dex ~ / study/apkkiller/soft/bin/dex2jar. / output/test/source/classes. Dex # output. / output/test/source/classes_dex2jar.jar

To view the decompiled file, download the jd-gui tool and open the. / output/test/source/classes_dex2jar.jar file generated above, which exports all the source packages. Download jd-gui from the following address:

Http://jd.benow.ca/

Http://jd.benow.ca/jd-gui/downloads/jd-gui-0.3.5.osx.i686.dmg

The resource files of apk are stored in the folder we extracted above. / output/test/source/test, there are a lot of xml files, but they are encrypted and cannot be viewed directly. At this point, you need to use the apktool tool:

Java-jar ~ / study/apkkiller/soft/bin/apktool d. / test.apk. / output/test/source/test_resource

Merge the exported source code and resource files and get the results we want.

This is the end of this article on "how to build a decompilation environment under Mac os". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Files compilation environment two addresses tools articles folders more source code resources tests good practical content articles directories knowledge results software Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Xiaomi Shulou Information Microsoft macOS