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

我怕爱的太早我们不能终老 提交于 2019-12-12 05:09:10

问题


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

I used method reboot in PowerManager with permission

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

so occur error "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.


回答1:


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,

Programmatically switching off Android phone

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

How to compile Android Application with system permissions

Reference and original answer here



来源:https://stackoverflow.com/questions/40646234/how-to-create-application-to-reboot-device-with-not-rooted-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!