In order to ease users' stacktraces analysis, I'd like to disable "aggressive overloading" when ProGuard is obfuscating my Android app. In my obfuscated APK, I often have classes containing several methods/fields named a()
in the same class, which is quite difficult to analyze a stacktrace, since it doesn't include method parameters or line number.
According to the ProGuard documentation, using option -overloadaggressively
forces this overloading. The problem is that ProGuard seems to use this option when obfuscating my app even if my ProGuard configuration file doesn't contain this option:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembers class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
How can I disable this aggressive overloading?
My target is Android 3.2 / API level 13.
The option -overloadaggressively
only pertains to the return types of methods.
As a result, even -useuniqueclassmembernames
can't guarantee unique names, since the names may be overloaded to start with. To get unambiguous stack traces, you should preserve line numbers:
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute ''
See the ProGuard manual > Examples > Producing useful stack traces.
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