Java Decompiler [closed]

2019-01-11 22:47发布

Can you recommend a Java decompiler for Eclipse? My other questions is what restrictions is there for using a decompiled code from an other Java program? Illegal or what? I dont know much about licenses. Thanks for reading.

7条回答
爷、活的狠高调
2楼-- · 2019-01-11 22:55

I like JadClipse - but it shows its age in places. You will need:

  • a jad binary
  • jadClipse installed
  • point the Eclipse preferences to the above jad binary
  • tell it to produce line numbers and align for debugging

There are several shortcomings:

  • code is produced sequentially, if byte code was rearranged so something comes late in the byte code but was early in the original source jad does not rewind to put the disassembled code to the right line.
  • jad does not understand Java 5 + 6 bytecode very well.
查看更多
Evening l夕情丶
3楼-- · 2019-01-11 23:05

I have used this eclipse plugin: JadClipse

and this java decompiler: JAD

查看更多
放我归山
4楼-- · 2019-01-11 23:06

I found JD to be very good. Though, there were one or two minor bugs I came across that resulted in unexpected behaviour at runtime.

For example, I had an example where the original case statement didn't have a 'break' on the last node (because naturally this is unnecessary), but because JD ended up re-ordering the nodes it meant the 'default' case was called unexpectedly. I also had an issue with character sets where I required some extra toString() calls on the end of things for it to log out as expected. Apart from that it was great!

I used another decompiler DJ to help me work out what was wrong with the code decompiled by JD. But there were other things that DJ couldn't handle, so I guess a mixture of both decompilers worked for me :)

Hopefully Mr Dupuy will read this!

查看更多
老娘就宠你
5楼-- · 2019-01-11 23:09

JD is the best Java Decompiler I know.

查看更多
乱世女痞
6楼-- · 2019-01-11 23:10

I'd suggest the one that pops up on google, which is the JD Java decompiler. It works really nice.

As for the restrictions, you'd have to read a license of particular software, there might be written that any way of decompilation is forbidden.

查看更多
倾城 Initia
7楼-- · 2019-01-11 23:15

I have tried several decompilers and most of them have failed to produce a correct source for the applet I was trying to decompile (which was http://mrl.nyu.edu/~perlin/experiments/emotive-actors/, in case anyone wants to reproduce).

The one which has worked absolutely flawlessly was Cavaj 1.11, the code produced by it contains no syntax errors and the applet compiled from the sources runs identically to the original. What I was missing on the UI side was: Ctrl-A/Ctrl-C keyboard shortcuts not working, and no batch conversion available.

The other decompilers I have tried were:

  • JD Java decompiler (freeware) looks nice, but it made a lot of mistakes with variable declarations (some declarations were missing, other were placed badly)
  • Neshkov DJ Java Decompiler (shareware) also looks nice, the code produced by it contained less syntax errors then JD, but the code was not working. Given the product is not free, one would expect a bit more from it.
查看更多
登录 后发表回答