0

When attempting to decompile a JAR file into a Java project using the Java Decompiler JD-GUI, I encountered an issue with the decompiled methods. Here is an example:

public Node getNode() {
    Node res = null;
    try {
      Exception exception2, exception1 = null;
    } catch (Exception e) {
      e.printStackTrace();
    } 
    return res;
}

I'm seeking assistance in two aspects:

  1. How can I resolve the apparent issue with the Exception exception2, exception1 = null; try/catch block, as the original method should contain different code?

  2. Are there alternative methods available that are more efficient for decompiling JAR files into Java projects and executing them?

  • Re 2.: Yes, there are. Do not decompile external dependencies, but reference the jar as a library. If a library does not come with source code, you are probably not allowed to decompile the jar anyways. Case in point, your sample code looks like it was decompiled from a flow-obfuscated class file which means the jar was intentionally modified to prevent decompilation. – Thomas Behr May 26 '23 at 15:50
  • 1
    Re 1: How do you know what the "original method" should contain? There's zero context in the question so it's impossible to know if it makes sense or not--it could be an obfuscated parent class method that's **supposed** to return `null` for all we know. – Dave Newton May 26 '23 at 16:11

1 Answers1

0

Some things to note about decompiling ...

Some libraries, like the CyberArk libraries, are intentionally coded in such a way that makes them hard to understand.

Also, if the library is compiled from a language other than Java, you will not get what you expect. This is particularly true with Groovy, where a bunch of sitecall commands appear.