java - 调用 android.os.Looper.loop() 需要在 AndroidManifest.xml 中指定 android.permission.RECEIVE_BOOT_COMPLETED

标签 java android security

在工作中,我们通过安全扫描工具运行我们的应用程序,该工具对漏洞进行静态分析。有时它会标记与安全无关但可能以其他方式引起问题的事物。在这种情况下,它提示 Improper Handling of Insufficient Privileges .

这是工具的描述:

This application calls the android.os.Looper.loop() API, which requires the following permission(s) that are not specified in AndroidManifest.xml: android.permission.RECEIVE_BOOT_COMPLETED. These calls will not be executed. Depending on implementation, this condition may result in an error message, or the code will fail silently. Underpermission conditions are not exploitable flaws, but they may indicate the presence of unexpected code (e.g. an advertising library attempting to leak the user's GPS location).

但是,API docs完全不提及 android.permission.RECEIVE_BOOT_COMPLETED 值或 AndroidManifest.xml 文件。

Looper.loop() 是否真的需要 android.permission.RECEIVE_BOOT_COMPLETED电话,还是误报?

最佳答案

这不是必需的。 Looper.loop 基本上每个 Android 程序都会调用,无论是在幕后还是公开的。我不明白为什么他们需要获得使用它的许可。即使是最简单的图形也需要显示...我敢肯定这是您使用的工具中的误报。

关于java - 调用 android.os.Looper.loop() 需要在 AndroidManifest.xml 中指定 android.permission.RECEIVE_BOOT_COMPLETED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14570699/

相关文章:

php - 为什么使用 mysql 准备好的语句比使用常见的转义函数更安全?

security - java.lang.SecurityException : class "org.apache.log4j.Logger" does not match trust level of other classes in the same package 错误

java - setOnclicklistener 方法不起作用

java - 为什么 setAlpha() 作用于我的所有按钮,而 setImageResource() 只作用于一个按钮?

android - Android 中特定于密度的布局与特定于尺寸的布局

Android更改来自另一个 fragment 的 ListView 项目

java - 使用 Stream API 复制列表元素 N 次

java - 找不到与 graph.facebook.com 匹配的名称(SSLHandshakeException/CertificateException)

android - 无法导入 google-play-services_lib,因为项目名称正在使用中

security - 编写自定义Shiro领域