Question

I have several function in different "namespaces" (packages, classes or so) i.e.:

com.example.class1.foo1()
com.example.class1.foo2(string);
com.example.class1.foo3();
com.example.sth.class1.foo1();
com.example.sth.class2.foo1();

After obfuscation, with my current settings, I'm getting sth like:

com.example.a.a()
com.example.a.a(string) 
com.example.a.b()
com.example.sth.a.a()
com.example.sth.b.a()

It is all good except one thing: two a methods in com.example.a. Is there any way to tell proguard to give different names to different function inside one class?

Était-ce utile?

La solution

The proper solution is to preserve debug information about line numbers:

-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile

You could also let ProGuard use different names:

-useuniqueclassmembernames

but that doesn't avoid preexisting name overloading.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top