Extension Prometheus

Hello everybody,

I don’t quite understand how this module works. In Flash,
the code obfuscation software would take the SWF file and create a version of the SWF with the obfuscated code.

When I installed the package in a simple test example and compiled
for the HTML5 version I got errors like this:


Do I understand correctly that in Defold code obfuscation works similarly, ie.

  1. I add a Prometheus package to a project
  2. I compile the project (and code obfuscation occurs during compilation)
  3. The compiled version of the project already has the code obfuscated
    Is this how it works?

Is it possible to obfuscate 1 selected script ?

Yes, during the build process the Lua code gets obfuscated.

No, the extension currently obfuscates all scripts in the project.


Thank you.
And what is the reason for this error during compilation ? The project has only one script with “Hello Word”

This error only appears when compiling for the HTML version

Which error?

You mean when you do “Project->Bundle->HTML5” or “Project->Build HTML5”?

errors on the following screen


Ok, so it happens in both cases? But not when you bundle for other platforms?

My first guess is that the files in builtins are not processed, but it looks like it isn’t able to process any file…

Sorry, the error appears when compiling for all platforms. It does not appear only when run Project-Build.

I have added an example and a Prometheus module that I download from the local server

Ah, I see what’s going on. The obfuscator works when run using bob.jar from the project root, but when run from the unpack folder of the editor it obviously can’t find the prometheus.lua config file.

@FredZX there’s a new release which fixes the path issue when run from the editor: Release Fix path issue when run from the editor · defold/extension-prometheus · GitHub


Great, thanks a lot !

Attempting to use this on our game, there were a few problems obfuscating narrator by @astrochili

in test/runtime/jumping.lua line 18:
local paragraphs = story:continue()
unexpected token <Keyword> “continue”, expected <Identifier>

and narrator/narrator/parser.lua line 56:
local address = id * ('.' * id) ^ -2
Parsing Error at Position 56:36, Unexpected Token “-”. Expected a Expression!

The first I thought wouldn’t occur given that the configuration file specifies LuaVersion = “Lua51”, and the second (and others) are presumably also errors, if we assume the code is valid Lua.

Is the best course of action for me to raise issues at https://github.com/prometheus-lua/Prometheus ?

Wow, sorry, just interesting in the context of using a narrator. What is the game? Is there public screenshots/videos or is it in-house yet? :slight_smile: