当上传到市场中的应用程序的Andr​​oid隐藏日志 [英] Android hide logs in the application when upload to market

查看:130
本文介绍了当上传到市场中的应用程序的Andr​​oid隐藏日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有很多Log.i的();报表调试增加。现在,如果这样的应用需要被上传到市场

My application has lots of Log.i(); statements added for debugging. Now if such an application need to be uploaded to market

  1. 如果这些日志被删除,如果是有一种简单的方式比人工拆除

  1. Should these logs be removed, and if yes is there an easy way than manual removal

如果不删除,将这些日志是未来如果应用程序是从市场安装后运行用户

If not removed, will those logs be coming if the application is run by the user after installing from the market

(我想看到的日志,对于某些应用程序,我不可能看到任何日志,从应用程序。我能看到的只有Android的日志就像从活动管理。但我不明白为什么,如果他们不删除日志将不显示从code)

( i tried to see the logs for some applications and i couldnt see any logs from the applications. I could see only android logs like from activity manager . But i dont see why the logs will not be displayed if they are not removed from the code)

推荐答案

preetha,日志将被保存在手机上的任何用户/开发人员可以检查出来,通过安装喜欢的应用程序<一href="https://market.android.com/details?id=com.nolanlawson.logcat&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5ub2xhbmxhd3Nvbi5sb2djYXQiXQ.."相对=nofollow> 的目录下载,即使没有使用亚行!这是因为你的立场给予不必要的,有时,机密数据给用户/其他开发人员的一个问题。

Preetha, the logs will be kept on the phone and any user/developer can check them out by installing apps like Catlog even without using adb! This is a problem as you stand to give unnecessary and at times, confidential data to users/other developers.

简单的方法来解决这个问题?

Simple way to solve this?

一个。使用 Proguard的自动拦截所有日志的详细信息,在<一个href="http://stackoverflow.com/questions/5553146/disable-logcat-output-completely-in-release-android-app">this计算器线程

a. Use Proguard to automatically block all logs, more information in this stackoverflow thread

在这里,您可以自动拦截所有日志在Proguard的字节code级

Here you can automatically block all logs at the bytecode level in Proguard

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

以上,例如将消除任何详细的日志记录,更在此线程

乙。我使用的是如果(调试)Log.i我所有的日志,使之与布尔DEBUG的一个变化,我可以打开/关闭所有日志

b. I use a if(DEBUG) Log.i for all my logs, so that with one change of the boolean DEBUG i can switch on/off all logs

℃。一个平凡的解决方案:更换所有Log.i与//Log.i:)

c. A trivial solution: replace all Log.i with //Log.i :)

这篇关于当上传到市场中的应用程序的Andr​​oid隐藏日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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