Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProGuard doesn't performs obfuscation of Object's methods

In purpose of learning how ProGuard works I have created tiny Android example, added some jar to it, wrote couple lines of code, enabled ProGuard and so on.

my ProGuard options are next

-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
-optimizationpasses 5
-optimizations !class/unboxing/enum

So after reverse engeneering of my APK names to all Object's methods, such as toString(), hashCode(), equals() remains the same. Apart from Object's methods, names of Externalizable methods remains too

So have you any idea why it happens, could it be fixed at all?

like image 277
hotHead Avatar asked May 17 '26 02:05

hotHead


1 Answers

ProGuard cannot obfuscate methods that do not originate in your classes (where "your" includes JAR/AARs that you compile in).

Anything you override from framework-supplied classes needs to stay intact. Otherwise, the framework cannot call those methods, since ProGuard is not obfuscating the firmware-installed framework classes on ~1.5 billion Android devices.

like image 153
CommonsWare Avatar answered May 19 '26 16:05

CommonsWare