Is it possible do not change method name in Obfuscator if keepclassnamembers seted
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
I use EventBus in my project, and I found an bug like this
Illegal onEvent method onEventAsync$xxxxx(fx f)
and in EventBus
ThreadMode threadMode; if (modifierString.length() == 0) { threadMode = ThreadMode.PostThread; } else if (modifierString.equals("MainThread")) { threadMode = ThreadMode.MainThread; } else if (modifierString.equals("BackgroundThread")) { threadMode = ThreadMode.BackgroundThread; } else if (modifierString.equals("Async")) { threadMode = ThreadMode.Async; } else { if (skipMethodVerificationForClasses.containsKey(clazz)) { continue; } else { throw new EventBusException("Illegal onEvent method, check for typos: " + method); } }
so....an exception happend.
yes, I find a happy medium
-keepclassmembers,includedescriptorclasses class ** { public void onEvent*(**); }
but , I compared the obfuscated code, the method name and the param's param are not obfuscated.
If Proguard can improve this, let the methodname just stay what just it is will be great pleasure if keepclassmembers set.
My code is
after proGuard
in My Proguard-project.text
One of ProGuard's optimizations is probably changing the access flags, parameters, or return type of the method, at which point it also changes the name, to make sure there are no name clashes. Admittedly, this is not respecting the -keepclassmembers setting. I can't see what is happening exactly, but you can check if the following option avoids the problem:
Thanks for your answer!
In my code
after proguard
what I want after proguard
Any suggest?
Last edit: jayzhou 2015-11-04