Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Pre-compiling files — Gideros Forum

Pre-compiling files

MellsMells Guru
edited July 2013 in General questions
Hi,

how can I pre-compile files so that I can share files with others without giving the actual source?
How are you dealing with it?

Likes: Fiam, ckapucu

twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
+1 -1 (+2 / -0 )Share on Facebook

Comments

  • atilimatilim Maintainer
    Accepted Answer
    This is a little bit tricky. Unfortunately, Lua has different bytecodes for 32-bit and 64-bit architectures. (Windows, iOS and Android is 32 bit but Mac is 64 bit).

    If you ignore Mac, you can directly use 32-bit luac which can be found in Tools directory to compile your Lua files. Otherwise you need to check if the host is 32-bit or 64-bit and load the correct Lua files which can be tricky if you have many.

    Likes: fxone

    +1 -1 (+1 / -0 )Share on Facebook
  • Hi,

    how can I pre-compile files so that I can share files with others without giving the actual source?
    How are you dealing with it?
    ...just so that you are aware that lua compiled files can be decompiled...

    The Lua encryption to the source code (available with the Pro subscription of Gideros) helps get over that issue.

    Not sure if there is a utility that allows to compile and encrypt and then use that in Gideros (when distributed)

    Likes: Mells

    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
    +1 -1 (+1 / -0 )Share on Facebook
  • MellsMells Guru
    edited July 2013
    @atilim :-? that's tricky.

    @OZApps
    So you mean Lua encryption is all I need if I want to share the code around me without giving the source and also when I will send my app to the App Store?

    Also is that a process that is automatically done?
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • @mells,
    I think this is not an issue as it is just encrypting the file from casual browsing and decompiling. Like for some of the controls, I provide the bytecode, this can be decompiled (if someone has the time and the inclination) if this was encrypted, it would make it one more step difficult.

    I can also tell you several issues why creating classes or modules in Lua are a bad idea specially if you are overtly concerned about your libraries.

    yes, that should be it if you want (for example) to share the source of your new app but not give it to me as text to compile.
    yes, this process is automatic when you export and when the app is run.

    An alternative is developer builds and resigning the app, but the files could or could not be encrypted.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • MellsMells Guru
    edited July 2013
    @OZApps
    I think my lack of english skills shows because sometimes I can not follow your thoughts.
    I can also tell you several issues why creating classes or modules in Lua are a bad idea specially if you are overtly concerned about your libraries.
    -> You can tell me there are issues with creating classes in Lua?

    This is what I understand :
    1. there are issues. You "can" tell me. But you don't? won't?
    2. creating classes in lua is a bad idea. Which is a new perspective to me?
    Indeed, I would like to understand what you meant.

    My question is : is lua encryption a default step that everyone is happy with, or do you think extra steps should be involved?

    I am not overly concerned with my libraries but want :
    1. An easy and secure way to share it with developers (instead of xx files easily readable)
    2. Make things not too easy for anyone who would like to see what's inside

    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • OZAppsOZApps Guru
    Accepted Answer
    @Mells,
    The point of discussion was to save your IP/source code, and the chain of thought was in the similar context.

    1. I could tell you, but I did not want to on a public forum, it is like a vulnerability that if placed on a public forum can be misused/abused.
    2. "Creating classes in Lua" per se is not a bad thing, but to safe guard your IP/Code it is

    From the other two points of what you want, then the Lua file encryption offered by Gideros is good enough to deter a casual browser.

    C*SDK uses a resource.car file that is nothing but a composite of all the Lua bytecode together, this can be disassembled easily using a small Lua script and then disassembled using a couple of tools and source code reconstructed with a slight effort. In Gideros the Lua files are available as a single file in the assets folder but when encrypted, it is there but not there for casual browsing.

    Sharing with other developers, you can use bytecode files which are compiled Lua code but can be easily decompiled with a bit of work. Alternatively you can share the packaged binary that the developer can "re-sign" and upload to their device and test.

    I might be repeating myself, I will try to write an article explaining this process, I wanted to steer away from "decompiling Lua" or "deconstructing an app" type articles, best that we do not delve on those...

    Likes: Mells

    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
    +1 -1 (+1 / -0 )Share on Facebook
  • @OZApps now I understand the reason behind not revealing it openly on a public forum.
    Thanks for the explanations, I got a better understanding of the topic.
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
Sign In or Register to comment.