Question

I am trying to use proguard to obfuscate the code of my Android app.

My problem is that some screen of my app work fine, some others show a blank screen (not entirely blank though, for example my top title bar display correctly, but the rest of the content is blank).

I have started with the basic settings:

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

Then, in proguard-project.txt, I have tried to add:

-keep class {my.package.name}.** { *; }

No change

Then

-dontskipnonpubliclibraryclassmembers

No change

Then

-dontobfuscate

which obviously solved the problem but then there is no point since I want to obfuscate my code.

Any idea?

Was it helpful?

Solution

Look at the output ProGuard creates; it will tell you what classes got renamed and what classes got deleted (because they appear to be unused). You will need to modify your config to nether rename nor delete these classes of course. Typically, you can find an interaction between your AndroidManifest.xml and the pieces that are missing after obfuscation (and your logcat might even tell you what is missing). Less likely is that use of reflection led ProGuard to not realize the importance of keeping these things in tact.

If you decide you need full obfuscation for the things that are being altered yet are necessary, you'll need to create thin object proxys that are safe from obfuscation and know how to get to the real classes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top