# APK decompilers

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS红队专家）</strong></a><strong>！</strong></summary>

支持HackTricks的其他方式：

* 如果您想在HackTricks中看到您的**公司广告**或**下载PDF格式的HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[**NFT**](https://opensea.io/collection/the-peass-family)收藏品
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我们 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>

**有关每个工具的更多详细信息，请查看原始帖子**[**https://eiken.dev/blog/2021/02/how-to-break-your-jar-in-2021-decompilation-guide-for-jars-and-apks/#cfr**](https://eiken.dev/blog/2021/02/how-to-break-your-jar-in-2021-decompilation-guide-for-jars-and-apks/#cfr)

### [JD-Gui](https://github.com/java-decompiler/jd-gui)

作为开创性的GUI Java反编译器，**JD-Gui**允许您查看APK文件中的Java代码。使用简单；获取APK后，只需用JD-Gui打开它以检查代码。

### [Jadx](https://github.com/skylot/jadx)

**Jadx**提供了一个用户友好的界面，用于从Android应用程序中反编译Java代码。它因跨不同平台的易用性而备受推荐。

* 要启动GUI，请转到bin目录并执行：`jadx-gui`
* 对于命令行用法，使用以下命令反编译APK：`jadx app.apk`
* 要指定输出目录或调整反编译选项：`jadx app.apk -d <输出目录路径> --no-res --no-src --no-imports`

### [GDA-android-reversing-Tool](https://github.com/charles2gan/GDA-android-reversing-Tool)

**GDA**是一个仅适用于Windows的工具，为反向工程Android应用程序提供了丰富的功能。在Windows系统上安装并运行GDA，然后加载APK文件进行分析。

### [Bytecode-Viewer](https://github.com/Konloch/bytecode-viewer/releases)

使用**Bytecode-Viewer**，您可以使用多个反编译器分析APK文件。下载后，运行Bytecode-Viewer，加载您的APK，并选择您希望用于同时分析的反编译器。

### [Enjarify](https://github.com/Storyyeller/enjarify)

**Enjarify**将Dalvik字节码转换为Java字节码，使Java分析工具能够更有效地分析Android应用程序。

* 要使用Enjarify，请运行：`enjarify app.apk` 这将生成所提供APK的Java字节码等效物。

### [CFR](https://github.com/leibnitz27/cfr)

**CFR**能够反编译现代Java特性。使用方法如下：

* 对于标准反编译：`java -jar ./cfr.jar "app.jar" --outputdir "输出目录"`
* 对于大型JAR文件，请调整JVM内存分配：`java -Xmx4G -jar ./cfr.jar "app.jar" --outputdir "输出目录"`

### [Fernflower](https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler/engine)

**Fernflower**是一款分析反编译器，需要从源代码构建。构建后：

* 反编译JAR文件：`java -jar ./fernflower.jar "app.jar" "输出目录"` 然后，使用`unzip`从生成的JAR文件中提取`.java`文件。

### [Krakatau](https://github.com/Storyyeller/Krakatau)

**Krakatau**提供了对反编译的详细控制，特别适用于处理外部库。

* 通过指定标准库路径和要反编译的JAR文件使用Krakatau：`./Krakatau/decompile.py -out "输出目录" -skip -nauto -path "./jrt-extractor/rt.jar" "app.jar"`

### [procyon](https://github.com/mstrobel/procyon)

对于使用**procyon**进行简单反编译：

* 将JAR文件反编译到指定目录：`procyon -jar "app.jar" -o "输出目录"`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hacktricks.xsx.tw/mobile-pentesting/android-app-pentesting/apk-decompilers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
