Skip to content

Comparing R8 and ProGaurd functionality for removing logging code in Android.

License

Notifications You must be signed in to change notification settings

Thorbear/R8LoggerRemoval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R8 / ProGuard logger removal comparison

This problem is fixed in Android Gradle Plugin 3.6.0-beta01 and later

Decompiled class obfuscated by ProGuard

Decompiled class obfuscated by R8

Using the default version of R8 that comes with Android Gradle Plugin 3.6.0-alpha10 and earlier

It appears that R8 does not remove logging code the same way that ProGuard does when the assumenosideeffects rule is used.

proguard-rules.pro

-assumenosideeffects class android.util.Log {
    public static *** v(...);
    public static *** d(...);
    public static *** i(...);
    public static *** w(...);
}
-assumenosideeffects class * implements org.slf4j.Logger {
    public *** trace(...);
    public *** debug(...);
    public *** info(...);
    public *** warn(...);
}

Decompiled class obfuscated by ProGuard

Decompiled class obfuscated by ProGuard

Decompiled class obfuscated by R8

Decompiled class obfuscated by R8

About

Comparing R8 and ProGaurd functionality for removing logging code in Android.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages