如何用代码判断现在的android是否已经root了啊 java代码执行cmd你会不,用Runtime类或Process类 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Process ps=Runtime.getRuntime().exec("su");如何获取其输出 Process ps=Runtime.getRuntime().exec("ls"); byte[] b=new byte[50]; ps.getErrorStream().read(b,0,50); String test=new String(b,0,50); ps.waitFor(); if( test.indexOf("su")>=0){ isroot="not root"; } else{ isroot="is root"; } 如果非root运行正常,如果是root程序就卡死了死机了 Process ps=Runtime.getRuntime().exec("su");byte[] b=new byte[50];ps.getErrorStream().read(b,0,50); String test=new String(b,0,50); ps.waitFor(); if( test.indexOf("su")>=0){isroot="not root";}else{isroot="is root";}如果非root运行正常,如果是root程序就卡死了死机了 我晕晕晕,我只想判断一下是不是root弄的程序那么复杂 process = Runtime.getRuntime().exec("su"); process.waitFor(); i = process.exitValue(); 根据i的值判断是否是root权限 java代码貌似没有root执行的,最多也就是system 自己找到答案了File su = new File("/system/bin/su");if (su.exists() 蓝牙socket通信 数据怎么接收不全呢? Android MediaRecorder 录音setAudioSource failed 像来电通的这个功能怎么实现,有图 请问如何查看Android系统的源代码 android framework 这些本地方法的库文件在什么目录下? 关于Email同步,请高手指教 获取手机好???急、、 android在thread里面构造socket需要死循环 ?? 走过路过的大神们,Android上传图片大小怎么设置的,跪接口水 Android调试环境,为何做得这么差? 关于button的透明问题
如何获取其输出
byte[] b=new byte[50];
ps.getErrorStream().read(b,0,50);
String test=new String(b,0,50);
ps.waitFor();
if( test.indexOf("su")>=0){
isroot="not root";
}
else{
isroot="is root";
}
如果非root运行正常,如果是root程序就卡死了死机了
byte[] b=new byte[50];
ps.getErrorStream().read(b,0,50);
String test=new String(b,0,50);
ps.waitFor();
if( test.indexOf("su")>=0){
isroot="not root";
}
else{
isroot="is root";
}如果非root运行正常,如果是root程序就卡死了死机了
我晕晕晕
,我只想判断一下是不是root弄的程序那么复杂
process = Runtime.getRuntime().exec("su");
process.waitFor();
i = process.exitValue();
根据i的值判断是否是root权限
File su = new File("/system/bin/su");
if (su.exists()