File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
CommonUtil/src/main/java/com/jingewenku/abrahamcaijin/commonutil Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .jingewenku .abrahamcaijin .commonutil ;
2
+
3
+ /**
4
+ * @Description:主要功能:判断手机是否具有root权限工具类
5
+ * @Prject: CommonUtilLibrary
6
+ * @Package: com.jingewenku.abrahamcaijin.commonutil
7
+ * @author: AbrahamCaiJin
8
+ * @date: 2017年05月24日 18:12
9
+ * @Copyright: 个人版权所有
10
+ * @Company:
11
+ * @version: 1.0.0
12
+ */
13
+
14
+ import java .io .File ;
15
+
16
+ public class RootPermissionUtils {
17
+ /**
18
+ * 根据/system/bin/或/system/xbin目录下是否存在su文件判断是否已ROOT
19
+ * @return true:已ROOT
20
+ */
21
+ public static boolean isRoot () {
22
+ try {
23
+ return new File ("/system/bin/su" ).exists () || new File ("/system/xbin/su" ).exists ();
24
+ } catch (Exception e ) {
25
+ return false ;
26
+ }
27
+ }
28
+
29
+ }
You can’t perform that action at this time.
0 commit comments