简体   繁体   中英

Why .Jar decompiling result is different in decompilers?

I decompiled .jar file with two decompilers, JD-GUI and Luyten, But the result is different.

For example, result from Luyten have namespaces more specific.

Also the source code is different in some lines.

Why two decompilers decompile the same .jar file differently?

The decompilers you list use different backends for handling the parsing of java bytecode.

  • Luyten uses Procyon .
  • JD-GUI uses JD-Core (No source available) .

You can think of decompilers like different scholars translating ancient text into modern English. The source material being transcribed by the scholars "Luyten" and "JD-GUI" is the same, but each scholar transcribes the text differently. Both create modern english that usually is fairly legible but each have their own minor differences.

For example: If the ancient source material stated that "a man reached down and picked up an apple" the scholars may say:

The man picked up an apple.

The man grabbed an apple.

Both get the meaning across but they are slightly different. Sometimes one may understand a odd quirk of the source material more than the other, and thus will produce more accurate results than the other.

For example, JD-GUI can't decompile a method if the last instruction of a method is the last one in a try-catch block but Procyon will be able to translate it into java it just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM