Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decompiling java possible? 2

Status
Not open for further replies.

threedim

Technical User
Mar 18, 2002
22
MY
I've heard that it is possible to decompile java. was that for old versions of java or is that true now too?

I've heard of a program called mocha but that was long time ago
 
It's definitely possible. There's a product called Dasho-Pro that provides obfuscation for your code to prevent (or at least inhibit) decompiling. "When you have eliminated the impossible, whatever remains, however
improbable, must be the truth." ~ Arthur Conan Doyle
 
so does obfuscating the code gurantee protection against decompiling?

cause i was wondering if java can be decompiled, why would people develop software with it :p
 
It’s been my experience that nothing is guarantee...obfuscating like what idarke said may inhibit other from looking at your code... However if someone REALLY what to look at your source code they will find a way to...be it java or another language...

*** The following is what I found on the web...doing a search on this topic ***
The only way of protecting your code is to obfuscate it. Some IDEs have this facility, but you usually have to pay for it. Instead, when your code is written and tested, change all the variables and methods and class names to mixtures of lower-case 'L's and '1's. This looks like l11l1l1l1l1 which when viewed in moonscapes fonts like courier, i.e. as in a coding environment, it is extremely hard to tell the difference between L and 1. Therefore it is extremely difficult for hackers to translate your code. Even if they can tell the difference between these character, then determining actually what the class if used for is even harder.

An easy way of making decompilation difficult is to use anonymous classes for your event handlers. Most decompilers cannot process these classes perfectly and so the java source code they produce is not 100% perfect. Alternatively, go through your code, and at the end of each line, press delete to make the next line continue on the current one. Therefore, you end up with a one-line source file, which is very tricky to parse, so writing a program to parse it would be almost too time consuming.

There are many techniques to obfuscate your code and prevent other people understanding it, but no matter what lengths you got to, somebody somewhere will be able to decipher it.

As for you other question > Why use java?

Well java like other languages has its up and downs - some plus are:

Reducing the number of buffer-over runs.
More flexibility and extensibility than in other languages
Error-processing system is quite advanced
Cross-Platform options
No pointers!

This is just my two cents...
 
If you very serious about preventing decompilation, you could encrypt your compiled .class files, and then develop your own classloader that de-codes the .class file prior to passing it to the standard class loader.... I think ;-)
 
Thanks everyone for clearing things up
I will probably look into encryption to protect the source:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top