在发布Android应用程序完全禁用LogCat中输出?
关闭掉的我的的释放一个应用程序推向市场之前,应用程序的LogCat中输出很简单。我也知道该如何选择地过滤LogCat中的信息通过标签和/或ID为我自己调试方便。
Shutting off my own app's LogCat output before releasing an app to the market is straightforward. I also know how to selectively filter LogCat message by tag and/or id for my own debug convenience.
但现在我感兴趣的东西,可能要困难得多:禁用所有LogCat中输出,其中包括与放大器;尤其是来自第三方的服务,如TtsService,GoogleLoginService等来了
But now I am interested in something that may be much more difficult (perhaps impossible?): Disable all LogCat output, including & especially those coming from 3rd-party services like TtsService, GoogleLoginService, etc.
这可能吗?
要进一步澄清:我的没有的兴趣筛选出的消息为自己。我在禁用第三方消息谁下载从Android Market我的应用程序,而感兴趣。这可能吗?
To further clarify: I am not interested in filtering out messages for myself. I am rather interested in disabling 3rd-party messages for whoever downloads my app from the Android Market. Is this possible?
您可以使用 ProGuard的以完全除去其中一个返回值不使用时,通过告诉ProGuard的任何行假设不会有问题。
You can use ProGuard to remove completely any lines where a return value is not used, by telling ProGuard to assume that there will be no problems.
下面proguard.cfg块指示删除Log.d,Log.v和Log.i调用。
The following proguard.cfg chunk instructs to remove Log.d, Log.v and Log.i calls.
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** w(...);
public static *** v(...);
public static *** i(...);
}
最终的结果是,这些日志线不是在释放的apk,并因此与的logcat任何用户将看不到D / V / I日志。
The end result is that these log lines are not in your release apk, and therefore any user with logcat won't see d/v/i logs.