chelo_c
chelo_c

Reputation: 1779

Libgdx: Obfuscate game assets

i am trying to find a way to obfuscate my libgdx assets. I would like to do it with a private key phrase.

Dont know how can I make this work with the AssetManager class.

The way a load my files is:

dynamicManager = new AssetManager();
game.dynamicManager.load("loadingscreen/loadingscreen0.jpg", Texture.class);
    game.dynamicManager.load("sounds/levelup.ogg", Sound.class);
    game.dynamicManager.load("sounds/bow.ogg", Sound.class);

I have found a way to ecrypt/decrpyt a string:

Java string encrypt

But need some help on obfuscating on a libgdx game asset folder. Has anyone achieved such a thing? Please Help!

Upvotes: 2

Views: 1392

Answers (1)

Jim
Jim

Reputation: 1005

There are many ways to obfuscate or protect your assets. None of them will really stop anyone determined to get your assets. If the game contains the assets AND the key to unlocking them, then they are not really protected. It just takes a little more work to extract.

Lets say you encrypt your assets with a private key as you suggest. No one will be able to read you files. So far so good. The problem comes when you store the key to decrypt the files in your source. Your jar can be easily decompiled and the source is right there just as you wrote it.

You can try to discourage casual hacking/stealing of your assets by going through a lot of hoops and loops, but in the end is it really the casual hackers you should worry about? I found a link with some ideas for some minimal effort ideas to discourage the casual hackers: scirra.com

If you worry about some Chinese clone dev stealing your game, then sometimes all they do is change the package name in the code and sell is as their own. This is what copyrights and trademarks are for.

Upvotes: 3

Related Questions