0

I need to hide some important Strings in the module core from My LibGdx Game

public class MyStrings {


public static String Key1 = "XXXXXXXXXXXXXXX";
public static String Key2 = "XXXXXXXXXX";
public static String Key3 = "XXXXXXXXXXXXXXXXXXXX";
....
}

I tried to use the Gradle method, but i can't use BuildConfig. i can't use also Base64.decode...... ProGuard didn't help, and i think i can't use C/C++ way either.

Please Help.

Mounir Elfassi
  • 2,242
  • 3
  • 23
  • 38
  • Usually my first reaction when reading questions like these is "Why do you need to do this?" - What exactly do these strings represent that they need to be secret and in the binaries you ship to your client? – UnholySheep Mar 08 '18 at 20:38
  • i just need to make things harder for reverse ingeniers – Mounir Elfassi Mar 08 '18 at 20:42
  • 1
    Simple obfuscation enough? See here :https://stackoverflow.com/questions/16384444/simple-algorithm-for-mixing-obfuscating-a-string-with-pre-defined-chars ? – Rob Audenaerde Mar 09 '18 at 14:32

1 Answers1

2

The obfuscation feature that you are looking for is String Encryption, which as you noted is not supported by ProGuard. Other obfuscators, such as DashO, KlassMaster, and DexGuard (for Android only) do support this feature.

Alternatively, as @RobAu suggested, you can write your own solution.

Full disclosure: I work at PreEmptive solutions, the company that produces DashO.

Peter Tefft
  • 126
  • 1