Is it possible to obfuscate/protect script code somehow?
I have my own urcap plugin, which is provided to the clients. The polyscope allows operator to save robot program on e.g. USB stick (if I’m not wrong, there are two files, one with extension .txt → the robot program and the second one with .script). The ".script" file contains script code in its original, human readable form. In my case, script code is not simple but contains some logic, checks, prevention, etc. The client can change ".script" file (e.g by removing checks or similar) after the original logic e.g. becomes corrupted and use it changed (Polyscope allows to load the program from USB stick). This also leads to maintenance problems. Is there any way to:
obfuscate script code or
make public and private methods in script writer, so the client can see and use only public methods and not private or
any other way how to prevent script code readability/changes??
I might be missing the mark here, but the only way they could take your generated script code, change it, and run it, would be to completely ditch the polyscope URP file and instead run the entire program through a single script command. This would mean there is NO WAY to easily edit the robot waypoints, among tons of other issues. Is it possible? Yeah I guess, but it would be incredibly difficult to debug if anything went wrong.
If they are opening the URP file, it won’t matter if they change anything in the script, because your URCAP is just going to write overtop of whatever they changed anyway, and they have no way of changing what your CAP is writing.
All that said, I think there are still ways of using rpc calls to execute code out of your CAP, and then in the script, the only human readable bit is that you’re making an rpc call to a function. You don’t see its definition or what it does. I haven’t done any of that personally, I just think I vaguely remember seeing that when opening the script for someone else’s CAP I had installed.
a word of caution is that these methods are not fool prof and the script is still reachable if a someone would really like to get their hands on it, they are just not readily available.