10
10
import android .provider .Settings ;
11
11
import android .support .annotation .RequiresApi ;
12
12
import android .support .annotation .RequiresPermission ;
13
- import android .telecom .TelecomManager ;
14
- import android .telephony .TelephonyManager ;
15
13
import android .text .TextUtils ;
16
14
17
15
import java .io .File ;
22
20
23
21
import static android .Manifest .permission .ACCESS_WIFI_STATE ;
24
22
import static android .Manifest .permission .INTERNET ;
25
- import static android .Manifest .permission .READ_PHONE_STATE ;
26
23
27
24
/**
28
25
* <pre>
@@ -46,8 +43,7 @@ private DeviceUtils() {
46
43
public static boolean isDeviceRooted () {
47
44
String su = "su" ;
48
45
String [] locations = {"/system/bin/" , "/system/xbin/" , "/sbin/" , "/system/sd/xbin/" ,
49
- "/system/bin/failsafe/" , "/data/local/xbin/" , "/data/local/bin/" , "/data/local/" ,
50
- "/system/sbin/" , "/usr/bin/" , "/vendor/bin/" };
46
+ "/system/bin/failsafe/" , "/data/local/xbin/" , "/data/local/bin/" , "/data/local/" };
51
47
for (String location : locations ) {
52
48
if (new File (location + su ).exists ()) {
53
49
return true ;
@@ -69,48 +65,6 @@ public static boolean isAdbEnabled() {
69
65
) > 0 ;
70
66
}
71
67
72
- /**
73
- * Return the imei of device.
74
- *
75
- * @return the imei of device
76
- */
77
- @ SuppressLint ("HardwareIds" )
78
- @ RequiresPermission (value = READ_PHONE_STATE )
79
- public static String getImei () {
80
- String imei = "" ;
81
- try {
82
- TelephonyManager telephonyMgr = (TelephonyManager ) Utils .getApp ()
83
- .getApplicationContext ().getSystemService (Context .TELEPHONY_SERVICE );
84
- if (telephonyMgr != null ) {
85
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
86
- imei = telephonyMgr .getImei ();
87
- } else {
88
- imei = telephonyMgr .getDeviceId ();
89
- }
90
- }
91
- } catch (Exception e ) {
92
- e .printStackTrace ();
93
- }
94
- return imei ;
95
- }
96
-
97
- /**
98
- * Return the serial of device.
99
- *
100
- * @return the serial of device
101
- */
102
- @ SuppressLint ("HardwareIds" )
103
- @ RequiresPermission (value = READ_PHONE_STATE )
104
- public static String getSerial () {
105
- String serial = "" ;
106
- if (Build .VERSION .SDK_INT > Build .VERSION_CODES .O ) {
107
- serial = Build .getSerial ();
108
- } else {
109
- serial = Build .SERIAL ;
110
- }
111
- return serial ;
112
- }
113
-
114
68
/**
115
69
* Return the version name of device's system.
116
70
*
0 commit comments