Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道这在 android API 版本 21 中是可能的,但我想在 API 版本 19 或更早版本中做到这一点。为了完成这个任务,我必须获得 root 权限。我不知道如何获得root权限。如何做到这一点?
您需要做的是:
Process root = Runtime.getRuntime().exec("su");
这会导致 SuperUser 显示,这使您可以允许或阻止它的 root 访问。如果用户没有root,这种方法可能不起作用。这是一种可以测试它的方法。
礼貌