saeed_g21
یک شنبه 20 بهمن 1392, 21:03 عصر
سلام دوستان من یک کد پیدا کردم نمی دونم کد درست واجب میده یا نه
چطوری می تونم چد کنم دستگاه رووت است یا نه ؟
ایا کد زیر جواب گو است ؟
اخه دستگاه واقعی من رووت شدس و تو VMware هم که چک می کنم انگار اونم رووت است نمیدونم
try {
// Perform SU to get root privledges
p = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(p.getOutputStream());
os.writeBytes("remount rw");
os.writeBytes("echo Root Test > /system/rootcheck.txt");
os.writeBytes("exit\n");
os.flush();
try {
p.waitFor();
if (p.exitValue() != 255){
//Phone is rooted
Log.d(tag, "Phone is Rooted");
}
else {
//Phone is not rooted
Log.d(tag, "Phone Not Rooted");
}
} catch (InterruptedException e) {
}
} catch (IOException e) {
}
چطوری می تونم چد کنم دستگاه رووت است یا نه ؟
ایا کد زیر جواب گو است ؟
اخه دستگاه واقعی من رووت شدس و تو VMware هم که چک می کنم انگار اونم رووت است نمیدونم
try {
// Perform SU to get root privledges
p = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(p.getOutputStream());
os.writeBytes("remount rw");
os.writeBytes("echo Root Test > /system/rootcheck.txt");
os.writeBytes("exit\n");
os.flush();
try {
p.waitFor();
if (p.exitValue() != 255){
//Phone is rooted
Log.d(tag, "Phone is Rooted");
}
else {
//Phone is not rooted
Log.d(tag, "Phone Not Rooted");
}
} catch (InterruptedException e) {
}
} catch (IOException e) {
}