您的位置:首页 > 移动开发 > Android开发

Android判断是否root

2016-05-16 11:35 302 查看
try {  

            if (Runtime.getRuntime().exec("su").getOutputStream() == null) {  

                Toast.makeText(this, "没有root!", Toast.LENGTH_SHORT).show();  

            } else {  

                Toast.makeText(this, "已经root!", Toast.LENGTH_SHORT).show();  

            }  

        } catch (IOException e) {  

            e.printStackTrace();  

        } 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: