README.md 5.2 KB
Newer Older
S
Skylot 已提交
1
## JADX
2 3

[![Build Status](https://travis-ci.org/skylot/jadx.png?branch=master)](https://travis-ci.org/skylot/jadx)
4
[![Code Coverage](https://codecov.io/gh/skylot/jadx/branch/master/graph/badge.svg)](https://codecov.io/gh/skylot/jadx)
S
Skylot 已提交
5
[![SonarQube Bugs](https://sonarcloud.io/api/project_badges/measure?project=jadx&metric=bugs)](https://sonarcloud.io/dashboard?id=jadx)
S
Skylot 已提交
6
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
7
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
8

S
Skylot 已提交
9 10
**jadx** - Dex to Java decompiler

S
Skylot 已提交
11
Command line and GUI tools for produce Java source code from Android Dex and Apk files
S
Skylot 已提交
12

D
dgorshkov 已提交
13
![jadx-gui screenshot](https://i.imgur.com/h917IBZ.png)
S
skylot 已提交
14

15

S
skylot 已提交
16
### Downloads
S
Skylot 已提交
17 18 19
- latest [unstable build: ![Download](https://api.bintray.com/packages/skylot/jadx/unstable/images/download.svg) ](https://bintray.com/skylot/jadx/unstable/_latestVersion#files)
- release from [github: ![Latest release](https://img.shields.io/github/release/skylot/jadx.svg)](https://github.com/skylot/jadx/releases/latest)
- release from [bintray: ![Download](https://api.bintray.com/packages/skylot/jadx/releases/images/download.svg) ](https://bintray.com/skylot/jadx/releases/_latestVersion#files)
S
skylot 已提交
20

S
Skylot 已提交
21 22 23 24 25 26
After download unpack zip file go to `bin` directory and run:
- `jadx` - command line version
- `jadx-gui` - graphical version

On Windows run `.bat` files with double-click\
**Note:** ensure you have installed Java 8 64-bit version
S
Skylot 已提交
27

S
Skylot 已提交
28 29 30 31 32 33 34

### Related projects:
- [PyJadx](https://github.com/romainthomas/pyjadx) - python binding for jadx by [@romainthomas](https://github.com/romainthomas)


### Building jadx from source
JDK 8 or higher must be installed:
S
Skylot 已提交
35

S
Skylot 已提交
36 37
    git clone https://github.com/skylot/jadx.git
    cd jadx
S
Skylot 已提交
38
    ./gradlew dist
S
Skylot 已提交
39

S
skylot 已提交
40
(on Windows, use `gradlew.bat` instead of `./gradlew`)
S
Skylot 已提交
41

S
Skylot 已提交
42 43 44
Scripts for run jadx will be placed in `build/jadx/bin`
and also packed to `build/jadx-<version>.zip`

45 46 47 48
### macOS
You can install using brew:

	brew install jadx
S
Skylot 已提交
49 50 51 52

### Run
Run **jadx** on itself:

S
Skylot 已提交
53
    cd build/jadx/
S
Skylot 已提交
54
    bin/jadx -d out lib/jadx-core-*.jar
S
Skylot 已提交
55
    # or
S
Skylot 已提交
56 57
    bin/jadx-gui lib/jadx-core-*.jar

S
Skylot 已提交
58 59 60

### Usage
```
61
jadx[-gui] [options] <input file> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc)
S
Skylot 已提交
62
options:
63 64 65 66 67 68
  -d, --output-dir                    - output directory
  -ds, --output-dir-src               - output directory for sources
  -dr, --output-dir-res               - output directory for resources
  -j, --threads-count                 - processing threads count
  -r, --no-res                        - do not decode resources
  -s, --no-src                        - do not decompile source code
69 70
  --single-class                      - decompile a single class
  --output-format                     - can be 'java' or 'json' (default: java)
71 72 73 74 75 76 77 78 79 80 81 82 83 84
  -e, --export-gradle                 - save as android gradle project
  --show-bad-code                     - show inconsistent code (incorrectly decompiled)
  --no-imports                        - disable use of imports, always write entire package name
  --no-debug-info                     - disable debug info
  --no-inline-anonymous               - disable anonymous classes inline
  --no-replace-consts                 - don't replace constant value with matching constant field
  --escape-unicode                    - escape non latin characters in strings (with \u)
  --respect-bytecode-access-modifiers - don't change original access modifiers
  --deobf                             - activate deobfuscation
  --deobf-min                         - min length of name, renamed if shorter (default: 3)
  --deobf-max                         - max length of name, renamed if longer (default: 64)
  --deobf-rewrite-cfg                 - force to save deobfuscation map
  --deobf-use-sourcename              - use source file name as class name alias
  --rename-flags                      - what to rename, comma-separated, 'case' for system case sensitivity, 'valid' for java identifiers, 'printable' characters, 'none' or 'all'
85
  --fs-case-sensitive                 - treat filesystem as case sensitive, false by default
86 87 88 89 90 91
  --cfg                               - save methods control flow graph to dot file
  --raw-cfg                           - save methods control flow graph (use raw instructions)
  -f, --fallback                      - make simple dump (using goto instead of 'if', 'for', etc)
  -v, --verbose                       - verbose output
  --version                           - print jadx version
  -h, --help                          - print this help
S
Skylot 已提交
92 93
Example:
 jadx -d out classes.dex
94 95
 jadx --rename-flags "none" classes.dex
 jadx --rename-flags "valid,printable" classes.dex
S
Skylot 已提交
96
```
S
Skylot 已提交
97
These options also worked on jadx-gui running from command line and override options from preferences dialog
S
Skylot 已提交
98

S
Skylot 已提交
99 100
### Troubleshooting
##### Out of memory error:
S
Skylot 已提交
101
  - Reduce processing threads count (`-j` option)
S
Skylot 已提交
102
  - Increase maximum java heap size:
S
Skylot 已提交
103
    * command line (example for linux):
S
Skylot 已提交
104 105 106 107 108
      `JAVA_OPTS="-Xmx4G" jadx -j 1 some.apk`
    * edit 'jadx' script (jadx.bat on Windows) and setup bigger heap size:
      `DEFAULT_JVM_OPTS="-Xmx2500M"`

---------------------------------------
S
Skylot 已提交
109 110
*Licensed under the Apache 2.0 License*

S
Skylot 已提交
111
*Copyright 2018 by Skylot*