File tree 4 files changed +6
-5
lines changed
utilcode/src/main/java/com/blankj/utilcode/util
4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ android:
19
19
licenses :
20
20
- android-sdk-license-.+
21
21
- ' .+'
22
+
22
23
notifications :
23
24
email : false
24
25
Original file line number Diff line number Diff line change 14
14
# class:
15
15
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16
16
# public *;
17
- #}
18
-
19
- -keep class com.blankj.utilcode.** { *; }
20
- -keep classmembers class com.blankj.utilcode.** { *; }
21
- -dontwarn com.blankj.utilcode.**
17
+ #}
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ public static String getMacAddress() {
97
97
@ SuppressLint ("HardwareIds" )
98
98
private static String getMacAddressByWifiInfo () {
99
99
try {
100
+ @ SuppressLint ("WifiManagerLeak" )
100
101
WifiManager wifi = (WifiManager ) Utils .getContext ().getSystemService (Context .WIFI_SERVICE );
101
102
if (wifi != null ) {
102
103
WifiInfo info = wifi .getConnectionInfo ();
Original file line number Diff line number Diff line change 1
1
package com .blankj .utilcode .util ;
2
2
3
+ import android .annotation .SuppressLint ;
3
4
import android .content .Context ;
4
5
import android .content .Intent ;
5
6
import android .net .ConnectivityManager ;
@@ -147,6 +148,7 @@ public static boolean is4G() {
147
148
* @return {@code true}: 是<br>{@code false}: 否
148
149
*/
149
150
public static boolean getWifiEnabled () {
151
+ @ SuppressLint ("WifiManagerLeak" )
150
152
WifiManager wifiManager = (WifiManager ) Utils .getContext ().getSystemService (Context .WIFI_SERVICE );
151
153
return wifiManager .isWifiEnabled ();
152
154
}
@@ -158,6 +160,7 @@ public static boolean getWifiEnabled() {
158
160
* @param enabled {@code true}: 打开<br>{@code false}: 关闭
159
161
*/
160
162
public static void setWifiEnabled (boolean enabled ) {
163
+ @ SuppressLint ("WifiManagerLeak" )
161
164
WifiManager wifiManager = (WifiManager ) Utils .getContext ().getSystemService (Context .WIFI_SERVICE );
162
165
if (enabled ) {
163
166
if (!wifiManager .isWifiEnabled ()) {
You can’t perform that action at this time.
0 commit comments