Skip to content

Commit

Permalink
用例添加
Browse files Browse the repository at this point in the history
  • Loading branch information
Peakmain committed May 24, 2022
2 parents 6231aa7 + dd73ab4 commit 007869f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 41 additions & 8 deletions app/src/main/java/com/peakmain/asmactualcombat/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.text.TextUtils;
import android.util.Log;

import com.peakmain.sdk.constants.SensorsDataConstants;
import com.peakmain.ui.utils.LogUtils;

import java.util.List;
Expand Down Expand Up @@ -111,7 +112,7 @@ public final boolean a(ConnectivityManager var1) {
boolean var3 = false;

try {
if (var2.getConnectionInfo()!=null) {
if (var2.getConnectionInfo() != null) {
var3 = true;
}
} catch (Throwable var4) {
Expand All @@ -121,16 +122,48 @@ public final boolean a(ConnectivityManager var1) {
}
}

public static int getIpAddress(Context context) {
WifiManager wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo info = null;
try {
info = wifi.getConnectionInfo();
} catch (Exception e) {
e.printStackTrace();
}
return info.getIpAddress();
}

public static String getBSSID(Context context) {
WifiManager wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo info = null;
try {
info = wifi.getConnectionInfo();
} catch (Exception e) {
e.printStackTrace();
}
return info.getBSSID();
}
public static String getSSID(Context context) {
WifiManager wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo info = null;
try {
info = wifi.getConnectionInfo();
} catch (Exception e) {
e.printStackTrace();
}
return info.getSSID();
}
public List<ScanResult> getScanResults() {
if(this.mWifiManager!=null){
List<ScanResult> var1 = this.mWifiManager.getScanResults();
for (ScanResult scanResult : var1) {
LogUtils.e(scanResult.BSSID);
}
return var1;
}
if (this.mWifiManager != null) {
List<ScanResult> var1 = this.mWifiManager.getScanResults();
for (ScanResult scanResult : var1) {
LogUtils.e(scanResult.BSSID);
}
return var1;
}
return null;
}

public static String getAndroidId(Context context) {
return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
}
Expand Down

0 comments on commit 007869f

Please sign in to comment.