1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| using System;
| using Android.OS;
| using Java.IO;
|
| namespace Shared.JailBreak
| {
| public class JailBreak
| {
| public static bool ISJailBreak () {
|
| String su = "su";
| String [] locations = {"/system/bin/", "/system/xbin/", "/sbin/", "/system/sd/xbin/",
| "/system/bin/failsafe/", "/data/local/xbin/", "/data/local/bin/", "/data/local/",
| "/system/sbin/", "/usr/bin/", "/vendor/bin/"};
|
| try {
| foreach (String location in locations) {
| if (new File (location + su).Exists ()) {
| return true;
| }
| }
| } catch(Exception ex) {
| System.Console.WriteLine (ex.ToString());
| }
| return false;
|
| }
|
|
| public static void ExitApplication ()
| {
| Process.KillProcess (Android.OS.Process.MyPid ());
| }
|
|
|
| }
| }
|
|