问题
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