[POLL] Should IntelliJad bundle Jad with it?

Pros -
plugin is ready to use immediately
if the Jad site ever goes offline, users aren't screwed (this point can be address with independent hosting)

Cons -
download is much larger (roughly an extra 1600kb)
upgrading to later versions is slightly more problematic (this point can be addressed with GUI enhancements)

Two points to note:
1. With regards to Hani's post (http://www.intellij.net/forums/message.jspa?messageID=5198071#5198071) any bundled version of Jad would not be in the plugin jar file but open on the filesystem for easy swap-out.
2. I am exceptionally dissatisfied with having to call an external app to decompile something within IntelliJ, so when time and circumstance allow I'll be starting a project to write a 100% Java Java decompiler to make this kind of poll irrelevant. (I will of course google any issues with decompilation first, i can't afford to get sued :) )

7 comments
Comment actions Permalink

I vote for 2. :)
A better decompiler would be great. JAD often fails badly for exceptions handling code and knows nothing about generics (last time I looked).

Seriously : Personally I don't care for another MB (or 5 or 20).
But maybe there still are developers without broadband connection?!
Ideal solution would be to host Jad files at some other, reliable host and make the plugin ask on first start whether to download from there or configure an already existing local
version.
That way you could also check the platform and download a single version for a specific OS.


Steve Chaloner wrote:

Pros -
plugin is ready to use immediately
if the Jad site ever goes offline, users aren't screwed (this point can be address with independent hosting)

Cons -
download is much larger (roughly an extra 1600kb)
upgrading to later versions is slightly more problematic (this point can be addressed with GUI enhancements)

Two points to note:
1. With regards to Hani's post (http://www.intellij.net/forums/message.jspa?messageID=5198071#5198071) any bundled version of Jad would not be in the plugin jar file but open on the filesystem for easy swap-out.
2. I am exceptionally dissatisfied with having to call an external app to decompile something within IntelliJ, so when time and circumstance allow I'll be starting a project to write a 100% Java Java decompiler to make this kind of poll irrelevant. (I will of course google any issues with decompilation first, i can't afford to get sued :) )

0
Comment actions Permalink

i was thinking about a solution : package the jad executables in a independent plugin (let's call it "external jad") and make your plugin dependent on it.
(I've read it's now possible to have dependency between plugins, right ?)

This would allow decoupling the 2 lifecycles, and your users wouldn't have to re-dowload the executables on every update of your plugin, while still taking advantage of the easy install.

Regarding solution 2 this is a huge work :) especially as all compilers do not compile the same constructs in the same way (i've played with writing one some years ago, it's a lot of fun, but not easy task !)

0
Comment actions Permalink

I don't mind whether Jad is bundled or not. Personally I'd rather it wasn't,
but for new users I can see that it would make life that much easier. Does
the Jad license allow for redistribution like this (or as Stephen suggested
below)?

Regarding a new decompiler. That would be fantastic(!) since there's plenty
about Jad that could be improved. Generics however likely isn't one of them
though thanks to type erasure (Come on Sun, what were you thinking?! This
should have been done properly first time around...).

Other comments:
- A couple of files I've decompiled have resulted in huge amounts of blank
lines and rather messed up formatting (eg sequential abstract methods all
end up on a single line). Not sure what's causing the formatting issues but
would it be possible to eliminate the multiple blank lines? My suggestion
would be to just replace all occurrences of multiple blank lines with a single
one.
- I find the way that the decompiled code is first displayed a bit confusing.
The class file is (sometimes?) shown first, then the Jad version, then the
comments etc are folded. All in all, a lot of flickering and also the ctrl-e
list gets polluted with .class files. I don't know if the OpenAPI allows,
but ideally I'd like to only ever see the final cleaned up and folded .java
file.

Thanks Steve for a great plugin, it's already significantly better than IdeaJad.
In particular being able to decompile to a temp dir (rather than my project
build directories!) is a huge improvement for me.

Regards,
Chris

I vote for 2. :)
A better decompiler would be great. JAD often fails badly for
exceptions handling code and knows nothing about generics (last time I
looked).
Seriously : Personally I don't care for another MB (or 5 or 20).

But maybe there still are developers without broadband connection?!

Ideal solution would be to host Jad files at some other, reliable host
and make the plugin ask on first start whether to download from there
or configure an already existing local

version.

That way you could also check the platform and download a single
version for a specific OS.



0
Comment actions Permalink

Hi Chris

answers to comments...
1. the blank lines are in place to sync the class file with the source for debugging. One change you'll see in the next couple of days is the option to have source code compatible for debugging OR have it reformatted according to the preferred style. Unless your preferred style is very esoteric there's a good chance it will not be compatible with debuggable code.
2. The decompilation is triggered when a class file is opened. I'll see if there's a way to intercept and block the editor from opening, and also see if .class entries for decompiled files can be removed from the recent file list.

Thanks for the comments!

- Steve

0
Comment actions Permalink

Interesting solution. I may check on the support for direct downloads to get the decompiler (this will be built into the config, and also into the improved "You don't have Jad" message Hani commented on) but this is definitely an avenue worth exploring, licence permitting (been on a first aid course all day, reading licences right now at 10pm is just not going to happen :) ).

0
Comment actions Permalink

I would vot to bundle JAD with the plugin. 1.6 MB is a drop in the bucket.

A pure java decompiler would be awesome. I'm surprised there isn't anything today. I guess it must be a very difficult problem.

Checkout out this list of abandoned and derelict java decompilers.
http://mindprod.com/jgloss/decompiler.html

There is a note about JAD no longer allowing you put a frontend in front of it. Would this plugin violate that restriction? Or maybe it only applies to commercial frontends.

If you checkout eclipse Jad plugin page, it looks like they don't bundle JAD.
http://jadclipse.sourceforge.net/wiki/index.php/Main_Page

There was an open source project JODE, but that doesn't look like it's under development anymore. http://sourceforge.net/projects/jode/

The only book I know of on the subject is "Decompiling Java" in 2004, but it doesn't come with a fully (or even partially) working decompiler source code, just bits and pieces.

0
Comment actions Permalink

Regarding generics:

IIRC a generic class itself stores information about generic type parameters
in the class file, so decompiling it correctly should be possible.

Decompiling usages of a generic class is a tougher beast. Maybe a brilliant
decompiler could use the type casts that are inserted in the byte code to
figure out the correct argument when the generic class is used.

All in all for most scenarios I would prefer a plugin that simply finds the
right sources for the library I used and attaches them.
(I think Sixth And the Red River had once planned something similar but
abandoned it.)
If sources are not freely available chances are the library is obfuscated
and a decompiler does not help much anyway.

Chris Miller wrote:

I don't mind whether Jad is bundled or not. Personally I'd rather it
wasn't, but for new users I can see that it would make life that much
easier. Does the Jad license allow for redistribution like this (or as
Stephen suggested below)?

Regarding a new decompiler. That would be fantastic(!) since there's
plenty about Jad that could be improved. Generics however likely isn't
one of them though thanks to type erasure (Come on Sun, what were you
thinking?! This should have been done properly first time around...).

Other comments:
- A couple of files I've decompiled have resulted in huge amounts of
blank lines and rather messed up formatting (eg sequential abstract
methods all end up on a single line). Not sure what's causing the
formatting issues but would it be possible to eliminate the multiple
blank lines? My suggestion would be to just replace all occurrences of
multiple blank lines with a single one.
- I find the way that the decompiled code is first displayed a bit
confusing. The class file is (sometimes?) shown first, then the Jad
version, then the comments etc are folded. All in all, a lot of
flickering and also the ctrl-e list gets polluted with .class files. I
don't know if the OpenAPI allows, but ideally I'd like to only ever see
the final cleaned up and folded .java file.

Thanks Steve for a great plugin, it's already significantly better than
IdeaJad. In particular being able to decompile to a temp dir (rather
than my project build directories!) is a huge improvement for me.

Regards,
Chris

>> I vote for 2. :)
>> A better decompiler would be great. JAD often fails badly for
>> exceptions handling code and knows nothing about generics (last time I
>> looked).
>> Seriously : Personally I don't care for another MB (or 5 or 20).
>>
>> But maybe there still are developers without broadband connection?!
>>
>> Ideal solution would be to host Jad files at some other, reliable host
>> and make the plugin ask on first start whether to download from there
>> or configure an already existing local
>>
>> version.
>>
>> That way you could also check the platform and download a single
>> version for a specific OS.


0

Please sign in to leave a comment.