File tree Expand file tree Collapse file tree
utilcode/src/main/java/com/blankj/utilcode/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ android:
1919 licenses :
2020 - android-sdk-license-.+
2121 - ' .+'
22+
2223 notifications :
2324 email : false
2425
Original file line number Diff line number Diff line change 1414# class:
1515#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616# 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() {
9797 @ SuppressLint ("HardwareIds" )
9898 private static String getMacAddressByWifiInfo () {
9999 try {
100+ @ SuppressLint ("WifiManagerLeak" )
100101 WifiManager wifi = (WifiManager ) Utils .getContext ().getSystemService (Context .WIFI_SERVICE );
101102 if (wifi != null ) {
102103 WifiInfo info = wifi .getConnectionInfo ();
Original file line number Diff line number Diff line change 11package com .blankj .utilcode .util ;
22
3+ import android .annotation .SuppressLint ;
34import android .content .Context ;
45import android .content .Intent ;
56import android .net .ConnectivityManager ;
@@ -147,6 +148,7 @@ public static boolean is4G() {
147148 * @return {@code true}: 是<br>{@code false}: 否
148149 */
149150 public static boolean getWifiEnabled () {
151+ @ SuppressLint ("WifiManagerLeak" )
150152 WifiManager wifiManager = (WifiManager ) Utils .getContext ().getSystemService (Context .WIFI_SERVICE );
151153 return wifiManager .isWifiEnabled ();
152154 }
@@ -158,6 +160,7 @@ public static boolean getWifiEnabled() {
158160 * @param enabled {@code true}: 打开<br>{@code false}: 关闭
159161 */
160162 public static void setWifiEnabled (boolean enabled ) {
163+ @ SuppressLint ("WifiManagerLeak" )
161164 WifiManager wifiManager = (WifiManager ) Utils .getContext ().getSystemService (Context .WIFI_SERVICE );
162165 if (enabled ) {
163166 if (!wifiManager .isWifiEnabled ()) {
You can’t perform that action at this time.
0 commit comments