Check also WiFi hotspot interface name
This commit is contained in:
@@ -434,6 +434,7 @@ object Utils {
|
|||||||
val iface: NetworkInterface = interfaces.nextElement()
|
val iface: NetworkInterface = interfaces.nextElement()
|
||||||
val ifName = iface.name
|
val ifName = iface.name
|
||||||
Log.d(TAG, "Found interface with name $ifName")
|
Log.d(TAG, "Found interface with name $ifName")
|
||||||
|
if (ifName.startsWith("ap") || ifName.contains("wlan")) {
|
||||||
val addresses: Enumeration<InetAddress> = iface.inetAddresses
|
val addresses: Enumeration<InetAddress> = iface.inetAddresses
|
||||||
while (addresses.hasMoreElements()) {
|
while (addresses.hasMoreElements()) {
|
||||||
val inetAddress: InetAddress = addresses.nextElement()
|
val inetAddress: InetAddress = addresses.nextElement()
|
||||||
@@ -442,6 +443,7 @@ object Utils {
|
|||||||
}
|
}
|
||||||
if (result.isNotEmpty()) return result
|
if (result.isNotEmpty()) return result
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (ex: SocketException) {
|
} catch (ex: SocketException) {
|
||||||
Log.e(TAG, ex.toString())
|
Log.e(TAG, ex.toString())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user