我在互联网上发现了几个地方,他们提到使用该方法
Throwable.printStackTrace()
您的 Android 应用程序会带来安全风险(这也是不好的编码实践。)我想了解为什么它会带来安全风险?攻击者可以使用以下提供的信息做什么
e.printStackTrace();
例如,其中 e 是 Exception 类型?
最佳答案
好吧,作为开发人员,您永远不会希望最终用户了解应用程序后面发生的情况。我现在能想到的有以下几点。
A stack trace should never be visibile to end users
Generating a stack trace is a relatively tedious process
Many logging frameworks are available for that
Printing the stack trace does not constitute error handling. It should be combined with other information logging and exception handling.
我使用相同的链接来回答您的问题,因为两者都是相关的!
关于android - 为什么 printStackTrace() 对移动 (Android) 应用程序存在安全风险?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29546496/