Skip to content
sgilda edited this page Jun 19, 2015 · 9 revisions

Decompiling

DRAFT : Needs work!

THIS IS NOT UP TO DATE! There is no DecompilerConfig!

The Decompiler API

Windup provides a decompiler API to process the following application artifacts.

  • Directories

  • JARS or Archives

  • Class files

  • The DecompilerConfig should also contain Filter<String> (or maybe Filter<TypeReference>) to decide whether to decompile the class or not.

The following is not right!

  • windup.ProcyonConfiguration should extend abstract windup.DecompilerConfig<T>, which would contain the configurables common to all decompilers. In case of Procyon, outputDir would be delegated to procyon.DecompilerSettings.

Fernflower

Windup includes the Fernflower decompiler as the default decompiler, but other decompilers can be swapped in if preferred.

To use a different compiler, pass the -Dwindup.decompiler argument on the Windup command line. For example, to use the Procyon compiler, specify -Dwindup.decompiler=procyon.

Config

Decompiler settings and preferences…​

TO_DO: Make that a parameter to method call?

TypeReference

TO_DO: Check how we get info about Java files; perhaps cache the TypeReference results - if worth it?

ITypeLoader
  • JarTypeLoader - iterates a JarFile, expects a .jar File as input.

  • ClasspathTypeLoader - loads classes from a list of classes.

  • ClasspathTypeLoader("some/path:other/path")

  • ClasspathTypeLoader() → sysprop("java.class.path") : sysprop("sun.boot.class.path")

  • InputTypeLoader

  • CompoundTypeLoader - 2 typeloaders, queried in succession

TO_DO: Create a simple FileSystemTypeLoader.

Clone this wiki locally