Search code examples
androidsecuritygradleandroid-ndkandroid-security

Android - Best way to hide API clientId & clientSecret


I would like to have your opinion on the best way to hide an API key and secret key.

I found 2 ways :

I know that risk 0 does not exist but what is the most secure solution ?

Thank in advance


Solution

  • The NDK seems like your best bet, although not being 100% secure, but it sure is hard to reverse engineer. The gradle way doesn't seem secure at all.

    For obfuscation and encryption purposes, you could also take advantage of DexGuard.