是否可以在没有 root 的情况下以编程方式重启设备?

问题描述 投票:0回答:1

我想用我的应用程序重启我的手机,但它需要 root 权限。

有没有不用 root 的方法?

我的代码:

 try {
        Runtime.getRuntime().exec(new String[]{"su","-c","reboot now"});
    } catch (IOException e) {
        e.printStackTrace();
    }

编辑:我听说我们可以不用root重启手机
'设备策略管理器'。 但是我看不懂官方文档🙁,如果有人知道请留下演示代码。

android reboot
1个回答
1
投票

据我所知,您需要 root 权限才能实现此行为。

© www.soinside.com 2019 - 2024. All rights reserved.