Code Monkey home page Code Monkey logo

jd-cmd's Introduction

jd-cmd - Command line Java Decompiler

jd-cmd is a command line Java Decompiler which uses natives from Java Decompiler GUI project. It's based on native libraries for IntelliJ plugin.

This project was originally forked from jd-core-java and then from JDCommandLine.

Supported Platforms

jd-cmd supports:

  • Linux 32/64-bit
  • Windows 32/64-bit
  • Mac OSX 32/64-bit on x86 hardware

Requirements

Java runtime is required, at least version 6 is needed but we suggest usage of Java 7. Native libraries (at least the Linux ones) crashes occasionally with Java 6.

For an initial build you should install Git and Maven.

Build the software yourself

You should have git installed

$ git clone git://github.com/kwart/jd-cmd.git

or you can download current sources as a zip file

Then you need to have Maven installed

$ cd jd-cmd
$ mvn clean package

Test it by running:

$ java -jar jd-cli/target/jd-cli.jar

Usage

The jd-cmd comes with 2 modules:

  1. jd-cli command line interface for the decompiler. It's uses jd-lib module.
  2. jd-lib core API functionality.

Command line

Use all-in-one jd-cli jar located in jd-cli/target/jd-cli.jar

Usage: java -jar jd-cli.jar [options] [Files to decompile]
  Options:
    --displayLineNumbers, -n
       Include line numbers in decompiled classes
       Default: false
    --help, -h
       Show this help
       Default: false
    --logLevel, -g
       Log level, one of: ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF
       Default: INFO
    --outputConsole, -oc
       Output to system output stream
       Default: false
    --outputDir, -od
       Output to a directory with given path
    --outputZipFile, -oz
       Output to a zipped file with given path
    --showLocation, -l
       Include Location info in decompiled classes metadata part
       Default: false
    --skipMetadata, -sm
       Don't include metadata in decompiled classes
       Default: false
    --skipResources, -sr
       Skip processing resources
       Default: false

Programmatically

Add jd-lib as a dependency for your App and then do something like

import java.io.File;
import jd.core.input.JDInput;
import jd.core.input.ZipFileInput;
import jd.core.output.DirOutput;
import jd.core.output.JDOutput;
import jd.ide.intellij.JavaDecompiler;

public class App {
	public static void main(String[] args) {
		JavaDecompiler javaDecompiler = new JavaDecompiler();
		//choose input plugin for your decompiled file (class, zip, directory)
		JDInput jdIn = new ZipFileInput("path/to/myFavorityLib.jar");
		//choose output plugin (zip, directory, console)
		JDOutput jdOut = new DirOutput(new File("/tmp/decompiled"));
		//decompile
		jdIn.decompile(javaDecompiler, jdOut);
	}
}

License

jd-cmd's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.