Jump to content
  • Advertisement
Sign in to follow this  
guyver23

Someone Had Their Hand in My Cookie JAR (Java Question)!

This topic is 4858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have just begun my study of AP Computer Science, and Java's method of distributing applications has me concerned. Since Jar files are mere archives, isn't it possible for someone to simply crack into it, and thus steal or alter my code very easily? If so, what do professionals developing with Java do to get around this? Thanks! ^_^

Share this post


Link to post
Share on other sites
Advertisement
Thinking as how most Java code can be easily decompiled, I assume people use obfuscator to make the application unreadable.

Also, a lot of applications ship as .exe's, which make it a bit harder to acquire the JAR files(But not impossible).

The .NET framework has the the same issues, and there are several (professional) obfuscators for .NET out. They mangle all the function/variables names.

Most applications ship with a license aswell, which mostly clearly states how it is illegal to reverse engineer/decompile the code(Or any other way to obtain the original source-code). If people would decompile it and use it in their applications and someone would find out, they'd be in a big trouble, as most companies will press charges.

Toolmaker

Share this post


Link to post
Share on other sites
Yes.

You can use something like JAD to reverse engineer JAR files, and it provides reasonably readable code.

As for preventing it: First rule of any form of security is that there is always a way around it. The Second rule is that the more security you have, the more of a pain it is for the people who have to put up with that security. Basically, if someone wants your source badly enough, they will get it given time.

So, if you use a Java obfuscator for example; I have no idea what this would do to, say, log messages that name classes and methods, or to stack traces for Exceptions; but I bet it makes them effectively unreadable, and hence, not a lot of use for people like me.

Just put a copyright notice at the top of your code.

Jon

EDIT: And what Toolmaker said; ship a licence with your JAR-ed class files (a plain "licence.txt" document is fine). In case you didnt know, if you decompile a .class file you will not find any comments, including copyright notices, that were placed in the code as these are removed during compilation - not that this matters anyway, as someone decompiling your code probably doesn't give a hoot about copyright notices. I encourage you to experiment with JAD so you can see how these things work, it can only improve your overall understanding. Good luck.

[Edited by - polly on August 24, 2005 4:12:28 AM]

Share this post


Link to post
Share on other sites
JAD, a Java decompiler.

I started out by writing simple very simple classes, compiling them, then decompiling them with JAD to see what came out the other end. It has actually helped me debug a few weirder Java problems by seeing what the compiler has done.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!