将 Log.i 保持在生产环境中是否安全? [英] Is it safe to keep Log.i on production?

查看:44
本文介绍了将 Log.i 保持在生产环境中是否安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 android 应用程序中,我广泛使用 Log.iLog.e.

In my android application i extensively use Log.i, Log.e.

在这些命令中,我通常会传递与我的应用程序通信的 SQLite 查询或 http 休息 url.

On these commands I usually pass SQLite queries or http rest urls that communicate with my application.

我的问题是:当应用程序到达 Play 商店时,保留这些日志是否安全?如果用户在他的计算机上连接了设备的情况下运行该应用程序,他是否能够在他的 LogCat 上查看日志消息?

My question is: Is it safe to keep these logs when the application reaches the Play store ? If a user runs the application with his device connected on his computer will he be able to view the Log messages on his LogCat ?

推荐答案

如果用户将设备连接到计算机并阅读 logcat,他们可以看到您的应用生成的所有日志消息.

If the users connect the device to a computer and read the logcat, they can see all the log messages that your app generates.

一个可能的解决方案是使用 Proguard 来(自动)删除所有记录消息.

A possible solution is use Proguard to remove (automatically) all the log messages.

有关此答案的更多信息:如何配置proguard 仅删除 android 日志记录调用

More info on this answer: How to configure proguard to ONLY remove android logging calls

希望有帮助.

这篇关于将 Log.i 保持在生产环境中是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆