0
How to hide JS code
Hello everyone. I am making a simulator game and I have just added secret cheats. The cheats will give you free money or rewive you when the game is over, but I want to be the only one to know them. Problem is that when you play it on PC, you can press F12 and see JavaScript code. There you can easily figure out what do you need to do. You can find in in my code easily (JS, lines 180 - 331). And my queston is: Can I somehow disable ability to open source code from a broswer, or how can I at least hide cheat codes?
6 odpowiedzi
+ 2
you could use a javascript obfuscator, but i‘m not sure which one is the best, since i mainly work on binary deobfuscation. don‘t use jsf*** because there is a tool called jsunf***. using an obfuscator will have a performace penalty
+ 2
Hi Jan
probably the simplest thing is just to minify the JavaScript, makes it hard to understand the code.
0
is it really a problem for other developers to cheat your game? most people online have never used f12.
0
Thank you all for your answers. I changed numbers into codes like \x37\x35 and it works. It isn´t very good, but I hope some people aren´t smart enough to put /x away and subtract 30.