权限仅授予系统应用程序,在清单中 [英] Permission is only granted to system app, in Manifest
问题描述
我想将此权限添加到我的 Android 清单中:
<块引用>
但是在我将此权限粘贴到清单中后,它会测试红色下划线并说:
<块引用>权限仅授予系统应用
我能做什么?
MODIFY_PHONE_STATE
权限仅授予系统应用.
供您参考,Android 应用有 2 种类型:系统和用户
<块引用>用户应用只是您通过 Google Play 商店、亚马逊应用商店或旁加载安装的所有常规应用.这些会进入您的 Android 手机的/data 分区,这是可供用户数据和应用使用的内部存储器的一部分.
系统应用基本上是您的 ROM 中预装的应用.在标准的 Android 用户环境中,用户没有/system 分区的写权限,因此无法直接安装或卸载系统应用.
为了在您的 Android 设备上安装应用作为系统应用,您的设备必须获得 root 权限或安装了自定义恢复(或两者).
话虽如此,该错误实际上是错误的,因为您有一个有效的代码并且编译应该可以工作.如果能给出警告就更好了.在 Eclipse 中,您可以轻松修复它.只需前往:
<块引用>窗口 ->首选项 ->安卓->Lint 错误检查.
从列表中查找 ProtectedPermission
并将严重性设置为错误以外的其他内容(例如信息).这样你的项目仍然可以编译.
I want to add this permission to my Android manifest:
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
But after I paste this permission in my manifest, it tests red underline and says:
permission is only granted to system apps
What can I do?
MODIFY_PHONE_STATE
permission is granted to system apps only.
For your information, there are 2 types of Android apps: system & user
User apps are just all your normal app installations through the Google Play Store, Amazon Appstore or sideloading. These go into the /data partition of your Android phone, which is the part of the internal memory made available for user data and apps.
System apps are basically the apps that come pre-installed with your ROM. In a standard Android user environment, the user doesn’t have write access to the /system partition and thus, installing or uninstalling system apps directly isn’t possible.
In order to install an app as a system app on your Android device, your device must either be rooted or have a custom recovery installed (or both).
That being said, that error is actually wrong because you have a valid code and compilation should work. It would be better if it gave a warning instead. In Eclipse you can easily fix it. Just go to:
Window -> Preferences -> Android -> Lint Error Checking.
Find ProtectedPermission
from the list and set the severity to something other than error(info for example). This way your project will still compile.
这篇关于权限仅授予系统应用程序,在清单中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!