[英]How can I use android.permission.SHUTDOWN on a rooted phone?
How can I send Intent to shutdown the phone if I have a rooted phone?如果我有一个根电话,我如何发送意图来关闭手机? I put the app in system/app but this was not good enough.
我把应用程序放在系统/应用程序中,但这还不够好。 What more do I have to do?
我还需要做什么?
It says in docs about public static final String ACTION_SHUTDOWN
:它在关于
public static final String ACTION_SHUTDOWN
文档中说:
This is a protected intent that can only be sent by the system.这是一个受保护的意图,只能由系统发送。
What does it mean only sent by the system?只由系统发送是什么意思? If I get my app to get correct UID, can I do it then?
如果我让我的应用程序获得正确的 UID,那么我可以这样做吗? Or can it absolutely never be done even on a rooted phone?
或者即使在有root权限的手机上也绝对无法完成?
The Android source in GrepCode suggests that before Android 4.0 this was a signature-only permission, but is now signature or system. GrepCode 中的 Android 源表明,在 Android 4.0 之前,这是一个仅签名权限,但现在是签名或系统。 This means that you either have to be signed with the key that was used to sign the platform (usually OEM apps only) or be in the /system/app folder.
这意味着您要么必须使用用于签署平台的密钥(通常仅限 OEM 应用程序)进行签名,要么位于 /system/app 文件夹中。 In more recent versions of Android this folder is /system/priv-app to allow vendors to distribute built-in applications with different levels of trust.
在更新的 Android 版本中,此文件夹是 /system/priv-app,以允许供应商分发具有不同信任级别的内置应用程序。
您可以以 root 身份运行 adb shell 命令来关闭设备。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.