I read through http://proguard.sourceforge.net/index.html#manual/usage.html but cannot get their differences.
I tested with 2 different options and decompiled the outcome. Both seems to produce the same result.
-keep class * implements android.os.Parcelable { *; }
-keepclassmembers class * implements android.os.Parcelable { *; }
R8 is having a faster processing time than Proguard which reduces build time. R8 gives better output results than Proguard. R8 reduces the app size by 10 % whereas Proguard reduces app size by 8.5 %. The android app having a Gradle plugin above 3.4.
ProGuard is a tool to help minify, obfuscate, and optimize your code. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications.
ProGuard is a command-line tool that reduces app size by shrinking bytecode and obfuscates the names of classes, fields and methods. It's an ideal fit for developers working with Java or Kotlin who are primarily interested in an Android optimizer.
ProGuard is an open source command-line tool that detects and removes unused classes, fields, methods, and attributes. It helps in creating a production-ready application in the Android Platform.
The first (-keep
) will keep classes and class members that implement android.os.Parcelable
from being removed or renamed.
The latter (-keepclassmembers
) will keep class members only of classes that implement android.os.Parcelable
from being removed or renamed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With