Loading play-services-core/src/main/res/xml/network_security_config.xml +1 −0 Original line number Diff line number Diff line Loading @@ -8,5 +8,6 @@ <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">portal.mav.hu</domain> <domain includeSubdomains="true">cdwifi.cz</domain> <domain includeSubdomains="true">hsp.hotsplots.net</domain> </domain-config> </network-security-config> No newline at end of file play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/wifi/MovingWifiHelper.kt +32 −16 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ private val MOVING_WIFI_HOTSPOTS = setOf( "FlyNet", "Telekom_FlyNet", "Vestische WLAN", "agilis-Wifi", // Greece "AegeanWiFi", // Hong Kong Loading Loading @@ -275,6 +276,19 @@ class MovingWifiHelper(private val context: Context) { return location } private fun parseHotsplots(location: Location, data: ByteArray): Location { val json = JSONObject(data.decodeToString()) location.accuracy = 100f location.latitude = json.getDouble("lat") location.longitude = json.getDouble("lng") json.optLong("ts").takeIf { it != 0L }?.let { location.time = it * 1000 } json.optDouble("speed").takeIf { !it.isNaN() }?.let { location.speed = it.toFloat() LocationCompat.setSpeedAccuracyMetersPerSecond(location, location.speed * 0.1f) } return location } private fun parseInput(ssid: String, data: ByteArray): Location { val location = Location(ssid) return when (ssid) { Loading @@ -291,6 +305,7 @@ class MovingWifiHelper(private val context: Context) { "_SNCF_WIFI_INTERCITES" -> parseSncf(location, data) "_WIFI_LYRIA" -> parseSncf(location, data) "NormandieTrainConnecte" -> parseSncf(location, data) "agilis-Wifi" -> parseHotsplots(location, data) else -> throw UnsupportedOperationException() } } Loading Loading @@ -319,7 +334,8 @@ class MovingWifiHelper(private val context: Context) { "_SNCF_WIFI_INOUI" to "https://wifi.sncf/router/api/train/gps", "_SNCF_WIFI_INTERCITES" to "https://wifi.intercites.sncf/router/api/train/gps", "_WIFI_LYRIA" to "https://wifi.tgv-lyria.com/router/api/train/gps", "NormandieTrainConnecte" to "https://wifi.normandie.fr/router/api/train/gps" "NormandieTrainConnecte" to "https://wifi.normandie.fr/router/api/train/gps", "agilis-Wifi" to "http://hsp.hotsplots.net/status.json", ) } } Loading Loading
play-services-core/src/main/res/xml/network_security_config.xml +1 −0 Original line number Diff line number Diff line Loading @@ -8,5 +8,6 @@ <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">portal.mav.hu</domain> <domain includeSubdomains="true">cdwifi.cz</domain> <domain includeSubdomains="true">hsp.hotsplots.net</domain> </domain-config> </network-security-config> No newline at end of file
play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/wifi/MovingWifiHelper.kt +32 −16 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ private val MOVING_WIFI_HOTSPOTS = setOf( "FlyNet", "Telekom_FlyNet", "Vestische WLAN", "agilis-Wifi", // Greece "AegeanWiFi", // Hong Kong Loading Loading @@ -275,6 +276,19 @@ class MovingWifiHelper(private val context: Context) { return location } private fun parseHotsplots(location: Location, data: ByteArray): Location { val json = JSONObject(data.decodeToString()) location.accuracy = 100f location.latitude = json.getDouble("lat") location.longitude = json.getDouble("lng") json.optLong("ts").takeIf { it != 0L }?.let { location.time = it * 1000 } json.optDouble("speed").takeIf { !it.isNaN() }?.let { location.speed = it.toFloat() LocationCompat.setSpeedAccuracyMetersPerSecond(location, location.speed * 0.1f) } return location } private fun parseInput(ssid: String, data: ByteArray): Location { val location = Location(ssid) return when (ssid) { Loading @@ -291,6 +305,7 @@ class MovingWifiHelper(private val context: Context) { "_SNCF_WIFI_INTERCITES" -> parseSncf(location, data) "_WIFI_LYRIA" -> parseSncf(location, data) "NormandieTrainConnecte" -> parseSncf(location, data) "agilis-Wifi" -> parseHotsplots(location, data) else -> throw UnsupportedOperationException() } } Loading Loading @@ -319,7 +334,8 @@ class MovingWifiHelper(private val context: Context) { "_SNCF_WIFI_INOUI" to "https://wifi.sncf/router/api/train/gps", "_SNCF_WIFI_INTERCITES" to "https://wifi.intercites.sncf/router/api/train/gps", "_WIFI_LYRIA" to "https://wifi.tgv-lyria.com/router/api/train/gps", "NormandieTrainConnecte" to "https://wifi.normandie.fr/router/api/train/gps" "NormandieTrainConnecte" to "https://wifi.normandie.fr/router/api/train/gps", "agilis-Wifi" to "http://hsp.hotsplots.net/status.json", ) } } Loading