Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Pro-Guard from adding "compiled from:" to the classes

Tags:

So iv'e been enabling Pro-Guard to a project and after building the apk i decompiled it to make sure Pro-Guard did he's job and notices that it adds, for example, to the BaseAdapter class -

/* compiled from: BaseAdapter */

See picture -

enter image description here

Now I'm asking, doesn't it lose the point of the Pro-Guard if it says what class that was?

Is there any way to tell the Pro-Guard not to add this info line at all the classes?

My code where i added Pro-Guard -

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

Thanks.

like image 388
Itay Feldman Avatar asked May 03 '18 07:05

Itay Feldman


1 Answers

Proguard is not adding this line.

/* compiled from: BaseAdapter */

The decompiler is doing mapping of obfuscated name with original name. You are seeing it as you might be using jadx or online service like this

You can try using dex2jar and jd-gui to look at decompiled code. This line will not be present there.

Make sure that 'proguard-rules.pro' file does not have following attributes in it.

-keepattributes SourceFile

If you add this statement no decompiler will be able make this mapping.

like image 99
akkas Avatar answered Sep 30 '22 01:09

akkas