Skip to content

A Java decompiler built on top of Emmanuel Dupuy's original version of jd-core based on byte code pattern matching

License

Notifications You must be signed in to change notification settings

nbauma109/jd-core-v0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeQL Maven Release Github Release Coverage Status

JD-Core v0

A Java decompiler built on top of Emmanuel Dupuy's original version of jd-core based on byte code pattern matching

Code sample

import org.jd.core.v1.loader.ClassPathLoader; // uses v1 loader for compatibility

import jd.core.preferences.Preferences;
import jd.core.printer.PlainTextPrinter;
import jd.core.process.DecompilerImpl;

public class Sample {

    private static final DecompilerImpl DECOMPILER = new DecompilerImpl();

    public static void main(String[] args) {
        try {
            ClassPathLoader loader = new ClassPathLoader();

            PlainTextPrinter printer = new PlainTextPrinter();

            Preferences preferences = new Preferences();
            preferences.setRealignmentLineNumber(true);
            preferences.setShowDefaultConstructor(true);
            preferences.setShowLineNumbers(true);
            preferences.setShowPrefixThis(true);
            preferences.setUnicodeEscape(false);
            preferences.setWriteMetaData(true);

            String out = printer.buildDecompiledOutput(loader, "java/lang/String", preferences, DECOMPILER);

            System.out.println(out);

        } catch (Exception e) {
            System.err.println(e);
        }
    }
}

About

A Java decompiler built on top of Emmanuel Dupuy's original version of jd-core based on byte code pattern matching

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages