> For the complete documentation index, see [llms.txt](https://riteshs4hu.gitbook.io/infosec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riteshs4hu.gitbook.io/infosec-notes/android-appsec/static-analysis/decompiling-and-reverse-engineering/tools.md).

# Tools

## Decompiling Methods

1. **APK → DEX → JAR → JAVA**
2. **APK → JAVA**

***

### **Dex2Jar**

Convert `.dex` files to `.jar` files for analysis.

* Install:

  ```bash
  apt install dex2jar
  ```
* Usage:

  ```bash
  unzip <apk-file>
  d2j-dex2jar <dex-file>
  d2j-dex2jar <apk-file> # Direct decompile
  ```

### **JD-GUI**

View the reconstructed source code from `.jar` files.

* Install:

  ```bash
  apt install jd-gui
  ```
* Usage:

  ```bash
  jd-gui <jar-file>
  ```

***

### **Jadx**

A modern alternative to Dex2Jar/JD-GUI.

* Install:

  ```bash
  sudo apt install jadx
  ```
* Features:
  * Decompile Dalvik bytecode to Java from APK, DEX, AAR, AAB, and ZIP files.
  * Decode `AndroidManifest.xml` and resources from `resources.arsc`.
  * Includes a deobfuscator.
* GUI Features:
  * Syntax-highlighted code view.
  * Jump-to-declaration navigation.
* Usage:
  * Command Line:

    ```bash
    jadx <file>
    ```
  * GUI:

    ```bash
    jadx-gui <file>
    ```

***

### **ApkTool**

Decode and rebuild APK files for deeper analysis.

* Install:

  ```bash
  apt install apktool
  ```
* Usage:

  ```bash
  apktool d <apk-file>  # Decode APK
  apktool b <folder>    # Rebuild APK
  ```

***

### Andro Guard

[Documentation](https://androguard.readthedocs.io/en/latest/intro/index.html)

* Installation:

```bash
sudo apt install androguard
```

or

```
pip install androguard
```

* analyze an APK

```bash
androguard analyze myapp.apk
```

* decompile APK to readable output (smali / other formats)

```
androguard decompile -o out_dir myapp.apk
```

* produce call-graph

```
androguard cg myapp.apk
```
