Why my obfuscation is not working?

1.my proguard-rules.pro has not any keep command.
2.my minifyEnabled and shrinkResources are true in debug or release channel.
3.there are no error info when building project.
4.R8 and Gradle tools verion are latest.

I checked the configuration.txt, it’s content seem no different from usual. But in mapping.txt, the content is strange, such as “com.xxx.SampleClass → com.xxx.SampleClass” and “testFun(android.content.Context) → testFun” (It should have been like this:“com.xxx.SampleClass → a” and “testFun(android.content.Context) → b”)

What’s wrong? pls help, thx.

Hi @GZDong,

To help us with your issue, could you send the output of -printconfiguration, as well as some full class paths that didn’t get obfuscated when they should have.

Best,
Jared

configuration.txt (150.9 KB)

Hi, all class didn’t get obfuscated in my project. Please check the configuration file information, thank you.

like ‘com.byte.flyer.view.activity.host.HostActivity’, it’s field, class name and method keep it as it is.

@Jared_Yellen Hi, are there any new developments?

@GZDong did you manage to solve this? I am having the same issue

Hello, it appears that there is likely a keep rule from a library that is unintentionally keeping everything. I would recommend using the ProGuard Playground, and using that to isolate which keep rules are keeping your classes.

That would make sense, but I currently have no keep rules - the proguard file is empty in fact. I’m not sure what could be causing it.

Hi @GZDong and @Andrey_Starenky,

It looks like you are using R8 instead of ProGuard, can you therefore maybe ask this question on the R8 Issue tracker? Google Issue Tracker

In addition to the above, I double checked the configuration file you had shared, it looks like dontobfuscate is mentioned 6 times. This is most likely the reason for the problem (it seems to come from certain consumer rule files). The solution could therefore be filtering out those rules / update the dependencies.

Kind regards,

Ewout

1 Like