Actually it's something that happens with the best families... well, this days I had some code which the original code I found only after I had decompiled it, but at the end at least I had JAD and its eclipse plugin working :)
Here is how to have both working together:
Installation
- Jad: download and uncompress (wherever you want) jad from here. That's the 1.58 version for windows (latest by now). Here is the Jad webpage.
- jadclipse Eclipse Plugin: You can download here the jadeclipse plugin. This is the 3.3.0 version for Eclipse >=3.3 M6. Again here is the webpage of the plugin.
- You need then to go to eclipse, menu window->preferences->java->jadClipse and insert the correct path to the jad application. It's the entire path, including the executable file name. Eg: C:\jaddecompiler\jad.exe
One problem of Jad is that it doesn't support Jar files (see explanation here). A quite annoying problem I would say. So you will have to uncompress the classes you want to decompile.
Decompiling
To decompile a class, you will have to add it to the classpath. As said before you will have to uncompress your jar file to be able to decompile it. Also, you will need to add it to your classpath using "Add class folder", as shown in the following picture:
After this, you can double click your classes and see their source code.
There are loads of configurations available, one was really useful for me to check the location where I was getting an exception (with the line number) . The sources generated don't usually match the same line numbers as shown in stacktraces of the compiled code. But there is an available choice that brings the old line number to the new source code as comments. Go to the submenu debug of JadClipse configuration and choose "output original line number as comment".
But I should say that some code generated with this option gave me some code that just didn't compiled, like:
private static String addHttp(String aUrl)
{
if(aUrl.indexOf("http:
aUrl = "http:
return aUrl;
}
a bit weird... but without the option of the line number it generated a compilable source.
Didn't spend much time researching other solutions, but Jad+JadClipse, although having a couple of issues, did its job.
See ya
Emerson
0 comments:
Post a Comment