MichaelRocks / paranoid

String obfuscator for Android applications.
Apache License 2.0
673 stars 79 forks source link

Strings are not obfuscated on innerclasses. #7

Closed SamHoque closed 6 years ago

SamHoque commented 7 years ago

Strings are not obfuscated in inner classes when decompiled. for example

Public static void Test(){ AlertDialog test = new AlertDialog(this); test .setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //Strings in here wont be obfuscated dialog.dismiss(); } }); }

MichaelRocks commented 7 years ago

@LynxKik Thanks for reporting this issue. Currently any class that needs to be obfuscated has to be annotated with @Obfuscate. Obviously it doesn't work for anonymous inner classes because they cannot be annotated (before Java 8). Straightforward fix would be to obfuscate all anonymous inner classes of the obfuscated class but it's not trivial. I'll try to fix this issue but as a workaround you can convert the anonymous inner class to a named inner class and annotate it with @Obfuscate.

SamHoque commented 7 years ago

Sounds good, but I tried to make strings as a global var and then call it from the class. but the global var gets broken to regular strings when the java code is compiled. but I will do what you said thanks ^^

MichaelRocks commented 6 years ago

@LynxKik Finally, this issue is fixed. I'm going to release a new version soon with this fix.