How do I request root access in Android?

后端 未结 2 1077
夕颜
夕颜 2020-11-28 23:08

I need to get root access for rooted devices, and I was wondering how I can request root access. I need the access for the file system. Thanks a lot.

2条回答
  •  一整个雨季
    2020-11-28 23:42

    Just exec the command su and within that Process you have root priviliges:

    Process p = Runtime.getRuntime().exec("su");
    

    See this blog post for full example.

提交回复
热议问题