It's just like I wrote, if you got pieces of code that you'd like to keep away from the user, then keep them away from the user. Run that code serverside. That's the only way to ensure complete control of your code...
Java/C#/Python can all be reverse engineered, decompiled, deobfuscated, etc...