0

I am using c file to store my string constants and have written methods to access these strings in java code using android ndk. Every thing is working fine. But When I generate the apk and decompile it and open the .so file , the strings are visible and readable.

How to Obfuscating or hiding strings in c file in android apk?

    #include <jni.h>

jstring Java_eu_ratikal_helloc_MainActivity_getString( JNIEnv* env, jobject thiz )
{
    jstring na = "Hello android from  C World";

    return (*env)->NewStringUTF(env, na);
}
Prabhu M
  • 3,534
  • 8
  • 48
  • 87
  • 4
    You should encrypt your data.[THIS](http://stackoverflow.com/questions/4427238/hiding-strings-in-obfuscated-code) may help. – LPs Feb 23 '16 at 09:59
  • IMO The best way to 'hide' strings in C is to hide them as bytes; that way they're not as easily spotted from the sky, and have ambigous uses. But - i'm no expert on this. – Shark Feb 23 '16 at 10:40

0 Answers0