|
|
@@ -91,13 +91,29 @@ class InternetConnectionHelper {
|
|
|
if (!await PermissionUtil.checkLocationPermission()) {
|
|
|
return null;
|
|
|
}
|
|
|
- final wifiName = await wifiInfo.getWifiName();
|
|
|
+ String? wifiName = await wifiInfo.getWifiName();
|
|
|
+ wifiName = clean(wifiName);
|
|
|
AtmobLog.d(tag, 'wifi名称:$wifiName');
|
|
|
+
|
|
|
_networkName = wifiName;
|
|
|
atmobPlatformInfo.setWifiName(wifiName);
|
|
|
return wifiName;
|
|
|
}
|
|
|
|
|
|
+ static String? clean(String? ssid) {
|
|
|
+ if (ssid == null || ssid.trim().isEmpty) return null;
|
|
|
+
|
|
|
+ String trimmed = ssid.trim();
|
|
|
+
|
|
|
+ if (trimmed.startsWith('"') &&
|
|
|
+ trimmed.endsWith('"') &&
|
|
|
+ trimmed.length >= 2) {
|
|
|
+ return trimmed.substring(1, trimmed.length - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ return trimmed;
|
|
|
+ }
|
|
|
+
|
|
|
void _setMobileNetworkName() {
|
|
|
_networkName = Constants.kMobileNetworkTag;
|
|
|
}
|