11

When I upgraded to the latest Gradle version, my class names are not being obfuscated anymore. The current studio version is 3.4.2

As the latest version uses R8 obfuscation instead of Proguard, I have removed the previous configuration of proguard-rules.pro as it does almost nothing at all.

I still use

buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

and inside proguard-rules.pro i left only this:

-allowaccessmodification
-repackageclasses

The result is somehow obfuscated java code inside classes, but preserved class names and when apply some reverse engineering all original class names are visible. Need some help with this R8 to make it work as desired. Thank you in advance!

niks
  • 173
  • 10
  • 2
    Same problem here, R8 do not obfuscate class name, there is really no solution? :/ – GMX Oct 07 '19 at 13:15
  • I have used the gradle plugin version 3.5.1 with gradle wrapper version 5.4.1, with Android Studiio version 3.5.1, and in my release builds the class names are obfuscated without any problem using R8. Maybe it was an issue in 3.4.x and was fixed in 3.5.x. Can you try switching to 3.5.x ? – Elican Doenyas Oct 31 '19 at 15:24
  • 2
    I have the same problem, using R8, Gradle Plugin 4.0.0 and Gradle 6.1.1. – c0dehunter Jun 16 '20 at 03:06
  • Similar problem using Android Studio 4.2, Gradle Plugin 4.2.0 and Gradle 6.7.1. In this case, R8 doesn't even obfuscate the code. – Óscar May 13 '21 at 14:34
  • 1
    It's happening in AGP 7.2.0 for debug builds. Release builds obfuscate fine. Compared the configuration.txt files generated for both builds and there's no difference in the rules. – Pratzz Oct 29 '22 at 19:12

0 Answers0