Extension Prometheus

Please add a feature request in the extension repo!

@Chung_Xa please, look and comment

1 Like


Today I’ve tried many times but still stuck at this file by this error.
Any clues to solve it?

Does it say anything in the editor logs?

I have some errors, when prometheus can’t build.
It was when I use “continue” string as a table key.

I recommend you to try build with Bob. You will see all prometheus errors.

Or read log in build folder

It’s exactly my issue. Not as a table key but a variable name

Which file in build folder contains infor about prometheus errors?

1 Like

I’m afraid that this is not true. I’ve just tested and this is what I recieved although I didn’t change any in code and setup already the Seed value to my number.

how your prometheus.lua file looks?

There’s also a mistery thing with this extension.
I’ve updated the extension so that it will be only worked when having prometheus.lua file but the when running it acted just like using somewhere Prometheus.java file, not my file.
I even deleted .internal/cache, .internal/libs, build/plugins/prometheus folders and then fetched libraries, tried to restart the editor. I can see the code changed but every time I run building, it says

2024-07-13 15:56:00 INFO    Obfuscating D:\Defold\Projects\KyHoang\scripts\utf8.lua 

C:\Users\chung\AppData\Local\Temp\5204355870568368611\x86_64-win32\luajit-64.exe: ...s\chung\AppData\Local\Temp\554505601878780961\logger.lua:54: The config file "D:\Defold\Projects\KyHoang\prometheus.lua" was not found!
stack traceback:
	[C]: in function 'error'
	...s\chung\AppData\Local\Temp\554505601878780961\logger.lua:54: in function 'errorCallback'
	...s\chung\AppData\Local\Temp\554505601878780961\logger.lua:57: in function 'error'
	...sers\chung\AppData\Local\Temp\554505601878780961\cli.lua:70: in main chunk
	[C]: at 0x7ff685ca8910
e[0me[31mPROMETHEUS: The config file "D:\Defold\Projects\KyHoang\prometheus.lua" was not found!e[0m

java.lang.Exception: Unable to run prometheus, return code: 1

	at com.defold.extension.pipeline.Prometheus.obfuscate(Prometheus.java:176)

	at com.dynamo.bob.pipeline.LuaBuilder.build(LuaBuilder.java:436)

	at com.dynamo.bob.Project.runTasks(Project.java:1892)

	at com.dynamo.bob.Project.createAndRunTasks(Project.java:1563)

	at com.dynamo.bob.Project.doBuild(Project.java:1690)

	at com.dynamo.bob.Project.build(Project.java:742)

	at editor.pipeline.bob$run_commands_BANG_$fn__56498.invoke(bob.clj:150)

	at editor.pipeline.bob$run_commands_BANG_.invokeStatic(bob.clj:149)

	at editor.pipeline.bob$bob_build_BANG_.invokeStatic(bob.clj:224)

	at editor.disk$async_bob_build_BANG_$fn__57606$fn__57609$fn__57610.invoke(disk.clj:250)

	at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)

	at clojure.lang.AFn.call(AFn.java:18)

	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

	at java.base/java.lang.Thread.run(Thread.java:833)

but my file is like this:

return {
	-- The default LuaVersion is Lua51
	LuaVersion = "Lua51", -- or "LuaU"
	-- All Variables will start with this prefix
	VarNamePrefix = "",
	-- Name Generator for Variables that look like this: b, a, c, D, t, G
	NameGenerator = "MangledShuffled",
	-- No pretty printing
	PrettyPrint = false,
	-- Seed is generated based on current time 
	-- When specifying a seed that is not 0, you will get the same output every time
	Seed = 7034,
	-- Obfuscation steps
	Steps = {
		{
			-- This obfuscation step puts all constants into an array at the beginning of the code
			Name = "ConstantArray",
			Settings = {
				-- Apply to Strings only
				StringsOnly = true,
				-- Apply to all Constants, 0.5 would only affect 50% of strings
				Treshold    = 1,
			},
		},
	}
}

What if you remove obfuscation step? Will be content same?

If you changed java cole, you need to rebuild plugin.
After plugin rebuild you will have jar file in build folder. Then you need change plugin.jar to your new version

2 Likes

There are a few files changed hexDigest value unknown cause but not as much as when using obfuscation.

The extension uses a pipeline extension, and it’s built from Prometheus.java.
As mentioned, have you rebuilt the plugin?
The is a pre-build step, and is not done automaticlally.

See build_plugin.sh for guidance.

3 Likes

I’ve built it and it works as expected

1 Like