Variable Name Obfuscation

Would it be possible for Gdevelop to comb through your project and gather variable names (scene variables, global variables, object variables) and store it in a list (or maybe we could add it manually if its too much trouble)

Then during an export we can have Gdevelop go through the list and replace all the variables in the project with random character variables like “AaBbbZs” so in our final export our code is obfuscated and hard to understand

I’ve recently learned about some software called ApkTool and I used it on my Apk file to test

Its very easy for anyone to just decompile your apk file and then create a clone of your game

Being able to make the naming scheme of variables random would greatly deter and even prevent anyone from doing that

Lol apk tool? You don’t need to go that far, we are talking about a Cordova app. You just unzip it and you have the whole Js code, no need for apktook which decompiles Java Dalvik VM Bytecode into Small.

I don’t think this is something GDevelop should do, but that you should do as part of your build pipeline. As example you can see GDevelop-Open-Game/build at master · Gdevelop-game/GDevelop-Open-Game · GitHub which is a build pipeline building the game and also making it a pwa and adding a custom loading screen. You could make such a pipeline and scramble manually the variables names in code.

I played around a bit and it looks like even the cordova proguard plugin causes some problems

My game is complete, the only thing left is securing it before I upload it

Sadly, it looks like I’m going to have to manually look through all of my code, collect the variable names, and then use some text manipulation software to find and replace in all of the code.js files via a batch command

Why don’t you think this is something Gdevelop should do?

Whats the point of creating a game if someone is just going to steal it and profit off of it?
I really hope they put this feature in, it would save alot of time

I’m surprised something like this doesn’t exist already

The next time I make a game I’ll start collecting the variables and mapping them to “dummy variables” ahead of time

That’s why copyright exists, just sue anyone doing that. You will win considering you are the owner of the source code (GDevelop project).

Because GDevelop is not a security toolkit but a game making software. Nothing stops you from writing an obfuscation script if you want but there are features actually needed for the game engine.

I’m sorry to break it to you but you don’t need obfuscation. Obfuscation is for making sensitive code harder to reverse engineer. Your code is a game it isn’t security related or sensitive code. If anything obfuscation would slow your game down. And nobody cares about stealing your game/code. And nobody steal games in general. And if someone did you only would be able to sue them. And obfuscation wouldn’t stop them, maybe only slow them down for a day or two.

1 Like

Suing requires you can afford to sue, and if you are dealing with someone who has more money than you do then there’s a lot of legal games they can play to stall you and make you basically go broke before you can even sue them

Either way it just isn’t really all that feasible, if 10 different people steal your app are you doing to pay all the fees to sue all ten of them?, I doubt it

Also obfuscation actually speeds up your app/game as it makes variable names smaller and reduces the file size significantly

You can test it out here if you think I’m wrong:

Its just that in the case of Gdevelop obfuscation on that level breaks the game code

Dude, nobody cares about stealing your app. And obfuscation won’t stop them from stealing it. It will maybe make cheating a small bit more difficult, but your code still runs, so a “stealer” could still copy your code and republish the game.

No. That’s minification. Obfuscation is not that at all.

I don’t think I know you are wrong.

1 Like

Dude, nobody cares about stealing your app. And obfuscation won’t stop them from stealing it. It will maybe make cheating a small bit more difficult, but your code still runs, so a “stealer” could still copy your code and republish the game.

Obfuscation would deter most from bothering to try, and someone republishing your game isn’t a problem, its them cloning it that’s the problem (using different assets), harder to make a case its your game that way

Even if no one cares to steal it, I see no point to take the chance

No. That’s minification. Obfuscation is not that at all.

https://www.cloudflare.com/learning/performance/why-minify-javascript-code/
How is minification different from obfuscation, compression, encryption, or uglification?:
“Obfuscation is accomplished by changing the names of variables, functions, and members. The resulting reduction in file size also improves performance, though this is not the primary goal of obfuscation”

don’t think I know you are wrong.

Think again lol, thanks for the advice

Here’s a question to ask yourself though

If you think the app/game you are creating isn’t worth stealing, then why bother making it, whats the point?

Doesn’t sound like a very profitable venture if you ask me, I wouldn’t bother

Maybe I’m just deluded and overvaluing what I made, but I’d rather be that deluded than to seriously waste time creating something that would not yield any benefit