如何创建应用程序以使用没有root用户权限的设备来重启设备? [英] How to create application to reboot device with not rooted device?

查看:146
本文介绍了如何创建应用程序以使用没有root用户权限的设备来重启设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用没有root用户的设备创建应用程序自动重启设备?

How to create application auto reboot device with not rooted device?

我已使用 PowerManager 中的方法重新启动

I used method reboot in PowerManager with permission

<uses-permission android:name="android.permission.REBOOT" />

因此发生错误"neither user 10039 nor current process has android.permission.REBOOT"

可能是原因,只有系统应用程序和使用与用于签名固件的密钥相同的密钥签名的应用程序才能获得该许可.

May be reason is only system applications and applications signed with the same key that was used to sign the firmware will be able to get that permission.

请向我建议一种更好的方法来创建应用程序自动重启.

Please suggest me a better way to create application auto reboot.

推荐答案

您无法从普通的SDK应用程序重新启动.只有使用系统固件签名密钥签名的应用程序才能执行此操作. 从此答案中复制,

You cannot do a reboot from an ordinary SDK application. Only applications signed with the system firmware signing key can do this. Copied from this answer,

以编程方式关闭Android手机

您需要系统密钥才能对您的应用进行签名.有关详细信息,请参见这篇文章;

You need the system key to sign your app. See this post for details;

如何在具有系统权限的情况下编译Android应用程序

参考和原始答案此处

这篇关于如何创建应用程序以使用没有root用户权限的设备来重启设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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