Marcin,
You have an interesting problem.
ProGuard analyses the calls you have specified and only if it can
determine that there is no return value, then the call gets removed.
It is hard to speculate, what each call to Log.d("foo") can cause, and
whether ProGuard can actually trace that there are no side effects.
You can help ProGuard by having a central singleton Logger and each
class requesting child Logger from this one. Then, when you release,
setting the logger level to OFF on that master logger should give
ProGuard enough to establish that none of the Log calls will ever take
place therefore removing them.
If that does not work, static final boolean IF switch around each call
to Log is your only help.
Hope it helps somehow.
Daniel
On Wed, Mar 9, 2011 at 1:29 PM, Marcin Orlowski
<[email protected]> wrote:
> Hi,
>
> I try to strip all log calls from release app using proguard
> (-assumenosideeffects) i noticed not all is removed. Some cases are
> clearly understandable to left some traces i.e. Log.i("foo" + bar());
> one, but I wonder what I can do (except manually comenting it out)
> this:
>
> if( ... )
> {
> ... some code ...
> } else {
> Log.d("foo");
> }
>
> To my understanding there's no reason to not remove Log call, but it
> remains there. My first thought was PG got some sort of problems
> stripping the only code from the else cause, but I spotted it happened
> sometimes when I got some code (method call) around too. For smaller
> apps I can track these left-overs down by hand but for bigger is pure
> time consuming process to reverse own app and go thru smali code.
> Anyone got idea what could I can do to get above sorted
>
> --
> Regards,
> Marcin Orlowski
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
Daniel Drozdzewski
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en