Page 1 of 2

Protecting Source Code

Posted: Thu Nov 10, 2016 2:31 am
by sbhargav_13
I have purchased the Game
oh my giraffe
and was able to extract .love files by simply exploring .apk file!!! So is there any method by which I can protect my source code??

Re: Protecting Source Code

Posted: Thu Nov 10, 2016 11:58 am
by raidho36
Why.

Re: Protecting Source Code

Posted: Fri Nov 11, 2016 4:07 am
by josefnpat

Re: Protecting Source Code

Posted: Fri Nov 11, 2016 6:17 am
by ivan
sbhargav_13 wrote:So is there any method by which I can protect my source code??
Somebody else mentioned before, very poignantly: it's the licensing that protects your code and assets.
Hiding your code from the user is usually a waste of time,
nowadays it's considered better practice to open up your project as much as possible to allow user modding.
If you're concerned about cheating in an online game, then there are ways to do that without hiding the code either.

Re: Protecting Source Code

Posted: Fri Nov 11, 2016 10:22 am
by easy82
I used to think like you do, and yes, there are use cases when an easily readable source code is a drawback. But once you start thinking the other way around, it opens up a range of new possibilities. I think it's a great selling point when you provide a well documented, easily readable and modifiable source code. It also extends the lifetime of your game, it might create a community around your game, etc. By the way, I love the Love2D attitude on this: you can learn a lot from others by reading their source code (and LUA is a great language to start hacking anyway, it's easy to read and to understand). My personal view on this: open up your source and choose a suitable license.

Re: Protecting Source Code

Posted: Fri Nov 11, 2016 10:23 am
by raidho36
In case this needs elaboration.

Preventing easy access to assets and source code will not prevent any potential problems with it. Chinese companies have been extremely successful ripping everyone off without any access to the game files altogether. Any cheating software out there works without any access to the files either. Hackers have been able to crack all sorts of protection using nothing but readily available executable files you ship with the game. For people that want to dig into the game, there are disassembly programs exist to deal with packages that have been locked away behind package format twisting, and there are prettifyers that turn mangled source code into perfectly good (possibly better than original) text. Given enough reason, people will gut through it anyway, see Minecraft for example. And on the flipside, if people can not be assed to decompile your game, then it only means that there's nothing worth protecting in it in the first place. This makes it a lose-lose strategy: regardless of the outcome it's a waste of time, effort and good public image; if game is popular then none of that will help, and if it isn't then there was no need to do it to begin with.

It's a correct statement that licenses protect your IP, not any physical or digital means of obstructing access to it. I however don't believe that you possibly need even that. There is no need to prevent access to any of the assets, since they are readily available for anyone to view when the game is running anyway. The only possible reason not to give out easy access is to prevent IP "theft", but again there are licenses for that, and splitting hair over someone reusing your stuff is extremely petty and you should know better than that. It is probably not reasonable to expect someone who's bothered over availability of their assets to embrace the idea of open source software, but that is indeed the best approach.

Re: Protecting Source Code

Posted: Sat Nov 12, 2016 11:13 am
by Murii
I used to think that it's a good idea to hide your game code/assets but then I thought about other languages too and realized they are also easy to hack into and get the data you want. Just think about Java and C#, you can get whatever you want from them with almost no effort.
So yeah, as Ivan said, you better add a proper license and you're covered.

Re: Protecting Source Code

Posted: Sun Nov 13, 2016 6:49 am
by Evermore
raidho36 wrote:And on the flipside, if people can not be assed to decompile your game, then it only means that there's nothing worth protecting in it in the first place. This makes it a lose-lose strategy: regardless of the outcome it's a waste of time, effort and good public image; if game is popular then none of that will help, and if it isn't then there was no need to do it to begin with.
And we shouldn't forget that John Carmack (creator of Doom, etc.) allowed modding culture to develop in the first place because there was clearly demand for it. Unless in specific instances where serious trade secrets are at stake, protecting IP is a thuggish way of doing business that ultimately only serves the owner(s).

Re: Protecting Source Code

Posted: Sat Nov 19, 2016 4:39 pm
by sbhargav_13
Thanks for your suggestions :awesome:

Re: Protecting Source Code

Posted: Sat Nov 19, 2016 6:07 pm
by Positive07
I'm currently developing with Electron, there apps are just an ASAR archive (similar to a TAR) that lies on the "resources" directory, that is all the "protection" you get... I think you can recompile or something, but I that would be far too much trouble... so yeah, .love files being .zip is pretty similar to what other interpreted language engines use

Your best protection is copyright and the license file!