Reputation: 11529
I'm considering using Proguard as my app comes closer to production to make it lighter.
On Android, there's the 65K method limit in addition to low storage devices. I know that Proguard removes unused methods, but does it remove methods which are used only in one place? I mean, I'm writing some methods just to make the code cleaner, but it would save a method call (one of the most expensive operation with return for the CPU and RAM, I studied microcode) and a method in the 65K max count as well as some bytes in the final package.
Does Proguard detect such cases and remove methods? Do I have to configure it myself? What about stacktrace deobfuscation if so?
Upvotes: 2
Views: 950
Reputation: 152817
It does not remove them since the code is used.
If you have the method/inlining/unique
optimization enabled, it will inline such methods: the method call is removed and the method code is inserted in the place where the method call was.
What about stacktrace deobfuscation if so?
If there's an exception in the inlined method, it will show up in the stacktrace at the method call site (where the call was removed).
Upvotes: 3
Reputation: 33408
If used proguard will not remove the method.
And, If you already know one such method, why don't you just build an apk with proguard enabled and test out the functionality in the app which makes the method call and check for yourself?
Upvotes: 0