提交 1f21760b 编写于 作者: S Skylot

rename jadx-cli, update build scripts

上级 67eb55a9
......@@ -16,7 +16,7 @@ Latest version available at
git clone https://github.com/skylot/jadx.git
cd jadx
./gradlew clean build pack
./gradlew clean build
(on Windows, use `gradlew.bat` instead of `./gradlew`)
......@@ -28,15 +28,14 @@ and also packed to `build/jadx-<version>.zip`
Run **jadx** on itself:
cd build/jadx/
bin/jadx-cli -d out lib/jadx-core-*.jar
or
bin/jadx -d out lib/jadx-core-*.jar
#or
bin/jadx-gui lib/jadx-core-*.jar
### Usage
```
jadx [options] <input files> (.dex, .apk or .jar)
jadx[-gui] [options] <input file> (.dex, .apk or .jar)
options:
-d, --output-dir - output directory
-j, --threads-count - processing threads count
......
apply plugin: 'idea'
ext.jadxVersion = file('version').readLines().get(0)
subprojects {
......@@ -17,7 +15,7 @@ subprojects {
}
manifest {
mainAttributes("jadx-version" : jadxVersion)
mainAttributes('jadx-version' : jadxVersion)
}
dependencies {
......@@ -31,7 +29,7 @@ subprojects {
}
}
task copyArtifacts (type: Sync, dependsOn: ["jadx-cli:installApp", "jadx-gui:installApp"]) {
task copyArtifacts (type: Sync, dependsOn: ['jadx-cli:installApp', 'jadx-gui:installApp']) {
destinationDir file("$buildDir/jadx")
['jadx-cli', 'jadx-gui'].each {
from tasks.getByPath(":${it}:installApp").destinationDir
......@@ -44,6 +42,10 @@ task pack (type: Zip, dependsOn: copyArtifacts) {
from copyArtifacts.destinationDir
}
task build (dependsOn: pack) {
description = 'Build jadx distribution zip'
}
task clean(type: Delete) {
delete buildDir
}
......
apply plugin: 'application'
mainClassName = "jadx.cli.JadxCLI"
mainClassName = 'jadx.cli.JadxCLI'
applicationName = 'jadx'
dependencies {
compile(project(":jadx-core"))
compile(project(':jadx-core'))
compile 'com.beust:jcommander:1.30'
}
build.dependsOn distZip
build.dependsOn installApp
startScripts {
doLast {
// increase default max heap size
......
......@@ -80,6 +80,7 @@ public class JadxArgs implements IJadxArgs {
processArgs();
} catch (JadxException e) {
LOG.error(e.getMessage());
printUsage();
System.exit(1);
}
}
......@@ -103,10 +104,13 @@ public class JadxArgs implements IJadxArgs {
if (input.isEmpty()) {
if (inputRequired)
throw new JadxException("Please specify at least one input file");
throw new JadxException("Please specify input file");
else
return;
}
if (input.size() > 1) {
throw new JadxException("Only one input file is supported");
}
if (outDirName == null) {
File file = new File(files.get(0));
......@@ -129,6 +133,7 @@ public class JadxArgs implements IJadxArgs {
JCommander jc = new JCommander(this);
// print usage in not sorted fields order (by default its sorted by description)
PrintStream out = System.out;
out.println();
out.println("jadx - dex to java decompiler, version: " + Consts.JADX_VERSION);
out.println();
out.println("usage: jadx [options] " + jc.getMainParameterDescription());
......
......@@ -2,11 +2,7 @@ package jadx.cli;
import jadx.api.Decompiler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JadxCLI {
private static final Logger LOG = LoggerFactory.getLogger(JadxCLI.class);
public static void main(String[] args) {
JadxArgs jadxArgs = new JadxArgs(args, true);
......
......@@ -8,9 +8,6 @@ dependencies {
compile 'com.fifesoft:rsyntaxtextarea:2.0.7'
}
build.dependsOn distZip
build.dependsOn installApp
startScripts {
doLast {
// increase default max heap size
......
......@@ -4,7 +4,6 @@ import javax.swing.Icon;
import java.awt.Component;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class OverlayIcon implements Icon {
......@@ -48,10 +47,6 @@ public class OverlayIcon implements Icon {
icons.add(icon);
}
public void addAll(Collection<Icon> icons) {
icons.addAll(icons);
}
public List<Icon> getIcons() {
return icons;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册