Protected lua plug-ins (libraries?) Can we make these locally?

I’ve seen some of the docs for the new possibilities of LUA-based libraries and plug-ins, and what I want to know is if we have the means to make a protected library that is for use for our internal projects only?

In part this is to make sure no-one messes around with working code, and also to enable us to pass out actual projects to a select few tweakers without letting them get access to the actual juicy bits of code.

Barry

What type of protections are you looking for? If you use our lua plugin template, you can use build.sh to create a compiled lua file, meaning opening the file with a text editor does not give you anything normally readable. You can distribute this to people without much concern.

Yes, that was pretty much what I was hoping for, but the docs are a bit unclear on various things. I wanted to know if it was possible before I looked into actually doing it. Thanks!

Which documents did you find unclear?  We can look into improving them if there is a problem.

Well, pretty much all the documention. I just found the blog post here https://coronalabs.com/blog/2015/06/23/tutorial-building-a-pure-lua-plugin-for-corona/ and it suffers from the same issue.

The implication throughout is that the only way to share this plugin is to submit it to corona, whereas I just want to have a protected library I can include as part of a project template to hand out directly (think supplying students with demo code including the protected plug-in directly).

Also, how do I distribute the file? The end result of the build.sh process is a single file I just keep in the plugins/whatever/ folder and it’ll just work and the project can be built without problem, correct?

There are a couple of things you can do.

  1. Run the build script and extract the created .zip file. Locate your lua file inside of it and distribute it however you want.
  2. Compile the file into bytecode yourself. This can be done by using luac -s -o “path/to/new/compiled/lua/file.lua” – “/path/to/lua/file/to/compile.lua” Note that you should be using our version of luac.

As for how to distribute it, that’s up to you if you do not want to use the Corona Store. You can just send it to whoever you want to use it.

Cheers, I look forward to exploring this, it’ll help a lot!

What type of protections are you looking for? If you use our lua plugin template, you can use build.sh to create a compiled lua file, meaning opening the file with a text editor does not give you anything normally readable. You can distribute this to people without much concern.

Yes, that was pretty much what I was hoping for, but the docs are a bit unclear on various things. I wanted to know if it was possible before I looked into actually doing it. Thanks!

Which documents did you find unclear?  We can look into improving them if there is a problem.

Well, pretty much all the documention. I just found the blog post here https://coronalabs.com/blog/2015/06/23/tutorial-building-a-pure-lua-plugin-for-corona/ and it suffers from the same issue.

The implication throughout is that the only way to share this plugin is to submit it to corona, whereas I just want to have a protected library I can include as part of a project template to hand out directly (think supplying students with demo code including the protected plug-in directly).

Also, how do I distribute the file? The end result of the build.sh process is a single file I just keep in the plugins/whatever/ folder and it’ll just work and the project can be built without problem, correct?

There are a couple of things you can do.

  1. Run the build script and extract the created .zip file. Locate your lua file inside of it and distribute it however you want.
  2. Compile the file into bytecode yourself. This can be done by using luac -s -o “path/to/new/compiled/lua/file.lua” – “/path/to/lua/file/to/compile.lua” Note that you should be using our version of luac.

As for how to distribute it, that’s up to you if you do not want to use the Corona Store. You can just send it to whoever you want to use it.

Cheers, I look forward to exploring this, it’ll help a lot!