Private API creation

Hello all, I am wishing to create an Unity C# API for a University project however because this API is getting interest from industries I am wishing to make it private / closed source but am unsure how to go about doing this, maybe sections of compiled code that an open API can interact with? I’m just spit-balling at the moment, any suggesting on where to start looking and what unity has available to help this work?

Thank You.

It’s not really possible to do that with C# - even if you made it a DLL it’s still fairly trivial to decompile it back into C#. You could obfuscate the code first which would help a little but not much. The best way to do a closed system is to make it online only (where the user just requests data from a black box) but that only works for certain systems.

In the industry with this many clever people who can decompile anything, it’s not the source code is the main problem when you’re writing proprietary software. Obviously you will create a DLL and ship that, but you should also pay attention to the legal texts accompany your software.
It is futile to try to make your code immune to decompilation. The people who want to steal it, they will, the people who want to use it legally will pay you. Simple as that. Make it awesome enough to worth the money.

Unity does not support extra source code protection. You get DLLs and that’s it. Which is next to nothing.

2 Likes

You should also check whether or not you’re the one that has to worry about it at all.

It’s pretty common that there’s some agreement when you get enrolled, in which the university claims the copyrights in exchange for the “working places”, hardware, software, technical and educational support etc.

Of course this may vary from country to country / university to university.

Thanks for the replies, It’s something I was asked by the University to look into, not just for this one project but also for educational purposes, I will look into obfuscating c# and .dll’s because even if it can be decompiled easier they don’t know the original variable names etc which does at least make it harder