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.

3
  • 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? Commented Mar 8, 2018 at 20:38
  • i just need to make things harder for reverse ingeniers Commented Mar 8, 2018 at 20:42
  • 1
    Simple obfuscation enough? See here :stackoverflow.com/questions/16384444/… ? Commented Mar 9, 2018 at 14:32

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.