decompressing .JAR files

Ok so the subject title might be a bit misleading but couldn’t find a better way to put it. Anyway I was just wondering, how come its so easy for anyone to decompress .JAR files with such basic tools that can be found in the internet (or an SDK and command-prompt) and just mess around with the contents, do changes, rip off things…etc. (Sort of like what people do when it comes with modding. Something like minecraft for example, that game wouldn’t be so famous if it wasn’t because of its huge modding community). And well get away with it?
Isn’t there some way to just prevent people from decompressing a .JAR file and go poking around in there? with say, something easily accessible such as WinRAR?

Well you can try a wrapping the .jar in an .exe with something like Launch4j but if you want to make a mac version then people can get the jar that way (even if you package it as a .app (Mac OS X’s native application format) ). You could look into programs that compile java byte code into native machine code (I think there are some still around) but other than that I don’t think there is much you can do. I know some archives can be password protected, but I don’t know if .jars do. They might since their based off of the .zip format. I don’t know how that would affect running it and getting resources from it though.

The thing with distributing software to clients, is that they always will go around poking in the inner workings of it. I know I always decompile the games I play, and look at the source code.
With jars there isn’t much to do for art and assets, but you can always obfuscate your code. Obfuscation doesn’t mean people won’t still look at it, and potentionally figure out some things. Minecraft is obfuscated, and it’s against the… terms?.. to reverse engineer. Yet, modders still release their mods, right? Effectively proving that they have reverse engineered. :emo:

TL;DR:
Obfuscate your code. License both code and art.

Because Jar files are just Zip files (probably the most used compression format). Using zip make it a lot easier for developers to use a the mass of available tools to create them.

Besides no matter what format you use (even *.exe) its possible to reverse engineer, the only thing you can do about it is to try make it harder (using things like obfuscation, DRM, etc).

so there is no way from stopping someone from plagiarizing your work? Like if you making a game in alpha stage, you let some people test it, one of those testers decompresses the .JAR file. does some changes, and just says that its his. But it would be a complete copy off of mine…

is that what those companies with game engines do? License their code? how would they figure out if someone is using a genuine version/license of their engine?

I think you’re being overly protective here.

Code which is obfuscated (or even decoded standard bytecode) is pretty much useless to steal anyway (unless its critical to say security or something), anyone with enough skill to use decompiled code would probably find it easier to just write their own. The main thing is the art and sounds, using a custom format pretty much stops most cases of asset theft. Lastly don’t forget you have legal remedies too, such as copyright, licence, etc.

Its extremely rare that someone will steal your game and pass it off as their own, even if it does happen its usually pretty easy to figure out who the real author is. I think the harder task is writing something someone will want to steal :slight_smile:

hmm, alright, so my inquiries are answered, with this reply and the others. I knew about obfuscating code, but I’m gonna have to take a look at that about custom formats for art and sound… alright thanks everyone. :wink: