Remove Verbose Log In Production

android.util.Log is a very useful class to help developer debug their application. But when in production release. Any verbose log (Log.v) should be removed properly to prevent annoying user or leak some information.

You can simply commented those Log.v out or Using a ProGuard to remove any verbose log statements directly from the bytecode of your compiled JAR executable. This method is described in Christopher’s answer in the StackOverflow post

The easiest way is to run your compiled JAR through ProGuard before deployment, with a config like:

1
2
3
-assumenosideeffects class android.util.Log {
public static int v(...);
}

That will – aside from all the other ProGuard optimisations – remove any verbose log statements directly from the bytecode.