Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Obfuscator

 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is OBFUSCATOR...& its use...??
tia
 
Tim B.
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Malhar Barai,
As you maybe know Java bytecode (.class and .jar files) contains much of the information stored in your Java source files, leaving your bytecode exposed to reverse engineering and decompiling. An obfuscator program removes the unrequired information, obfuscates symbol names and sometimes even mangles the control-flow of your application to confuse decompilers. All in all obfuscator programs are there to secure your code and to make it harder, if not impossible, to decompile your Java applications.
Greetings,
Tim
 
Ashish Mahajan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Malhar and Tim,
ya, that's the power of obfuscators. But am wondering of one thing :- What about maintenance?? What if the user comes with bug report stating exception something like -
Exception in thread "main" java.lang.NullPointerException:
at g.s(g.java:11)
at f.main(f.java:16)
then it will be developer's nightmare to figure out which (original) class?? which method?? etc.
I think the obfuscator should have a user interface to allow user type obfuscated class name and methods and get the original class/methods as response.
Any input will be highly appreciated
Thanx.
 
Tim B.
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashish,
That's an interesting issue you came up with in your post. It probably wouldn't be that hard to extend an obfuscator with the possibility to create a text file, or some other file, in which a mapping of the renamed functions is stored. I think it would be a lot harder to also keep track of line numbers and other information. And don't forget, the information should be stored in a separate file which would have to be kept by the creators of the application.
But to be honest, if you write a good application, the problem you raise is non existant. Don't get me wrong, I'm not that ignorant that I think you can write an application with no errors, but I think you should write an application in which all possible exceptions are nicely handled. In other words, an application should never show the stacktrace you wrote down, but show a message which is atleast, even when using an obfuscator, meaningful to the user and/or the programmer.
Of course there are still the non catchable errors in Java, but good use of logging should make it always easy for a programmer to find out where something went wrong.
Just my two cents,
Tim
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ashish Mahajan:
Hi Malhar and Tim,
ya, that's the power of obfuscators. But am wondering of one thing :- What about maintenance?? What if the user comes with bug report stating exception something like -
Exception in thread "main" java.lang.NullPointerException:
at g.s(g.java:11)
at f.main(f.java:16)
then it will be developer's nightmare to figure out which (original) class?? which method?? etc.
I think the obfuscator should have a user interface to allow user type obfuscated class name and methods and get the original class/methods as response.
Any input will be highly appreciated
Thanx.

is this the answer to your problem...
JShrink
for more you can surely go through this..More...
cheers
MB
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic