Skip to content

RF Sentinel (RFSentinel): free, open-source police detector app for Android. Spots police body cams, Flock ALPR cameras, AirTag trackers, Remote ID drones, smart glasses and fake cell towers from Bluetooth LE and WiFi. No root.

Saved snapshots, traces and history show car WiFi as Vehicle WiFi - <maker>

CIS-C0903a49d82d36
diff --git a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt
index 7611414..d578413 100644
--- a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt
+++ b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt
@@ -137,6 +137,22 @@ object DeviceIntel {
fun automotiveMaker(vendor: String?): String? =
vendor?.let { v -> AUTOMOTIVE.firstOrNull { it.first.containsMatchIn(v.trim()) }?.second }
+ /** WiFi types older versions gave a car's own network, before it was named by its maker's address. */
+ private val OLD_CAR_WIFI_TYPES = setOf("Hidden WiFi network", "Phone hotspot", "WiFi Direct / printer", "Vehicle WiFi", "WiFi access point")
+
+ /** A saved record's type as this version names it: snapshots, traces and history saved before car WiFi
+ * was named by maker read "Vehicle WiFi - <maker>" too. The saved data itself is left as it was. */
+ fun savedType(type: String?, vendor: String?, mac: String): String? {
+ if (type == null || !(type in OLD_CAR_WIFI_TYPES || type.startsWith("WiFi access point - ") || type.startsWith("Vehicle system (WiFi)"))) return type
+ val car = automotiveMaker(vendor ?: VendorDb.macVendor(mac)) ?: return type
+ val model = type.substringAfter("Vehicle system (WiFi) - ", "").takeIf { it.isNotEmpty() }
+ return "Vehicle WiFi - $car" + (model?.let { " - $it" } ?: "")
+ }
+
+ /** A saved label that was only the old type reads as the new one; a network or device name stays. */
+ fun savedLabel(label: String, type: String?, vendor: String?, mac: String): String =
+ if (label == type) savedType(type, vendor, mac) ?: label else label
+
/** Device kind implied by the IEEE registrant of a fixed address. */
private val VENDOR_CLASSES = listOf(
Regex("cradlepoint|sierra wireless|peplink|inseego|digi international", RegexOption.IGNORE_CASE) to "Vehicle / cellular router",
diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.kt
index 7a35809..acda118 100644
--- a/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.kt
+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.kt
@@ -67,6 +67,8 @@ class DeviceDetailActivity : AppCompatActivity() {
private lateinit var mac: String
private var sectionsKey = ""
private var known: KnownDeviceEntity? = null
+ /** The saved record's type as this version names it. */
+ private val knownType get() = known?.let { DeviceIntel.savedType(it.deviceType, it.vendor, it.mac) }
private var pastMatches: List<DetectionEntity> = emptyList()
private var locateJob: Job? = null
private var tone: ToneGenerator? = null
@@ -188,7 +190,7 @@ class DeviceDetailActivity : AppCompatActivity() {
} else {
binding.tagText.visibility = View.GONE
}
- val heardAs = best?.label ?: s?.name ?: known?.name ?: s?.deviceType ?: known?.deviceType ?: "Device"
+ val heardAs = best?.label ?: s?.name ?: known?.name ?: s?.deviceType ?: knownType ?: "Device"
val alias = DeviceNames.of(mac)
// Your own name in place of what it's heard as; that stays on the line below.
binding.titleText.text = alias ?: heardAs
@@ -293,7 +295,7 @@ class DeviceDetailActivity : AppCompatActivity() {
// Identity
val id = mutableListOf<Pair<String, String>>()
- (s?.deviceType ?: known?.deviceType)?.let { id += "Device type" to it }
+ (s?.deviceType ?: knownType)?.let { id += "Device type" to it }
(s?.name ?: known?.name)?.let { id += (if (a?.isWifi == true) "Network name (SSID)" else "Advertised name") to it }
VendorDb.macVendor(mac)?.let { id += "Address registrant (IEEE)" to it }
a?.manufacturerData?.keys?.forEach { cid ->
@@ -529,7 +531,7 @@ class DeviceDetailActivity : AppCompatActivity() {
/** Your own name for the device, shown in place of the name it broadcasts. */
private fun rename() {
val s = DeviceRegistry.get(mac)
- val heardAs = s?.best?.label ?: s?.name ?: known?.name ?: s?.deviceType ?: known?.deviceType
+ val heardAs = s?.best?.label ?: s?.name ?: known?.name ?: s?.deviceType ?: knownType
ask("Name this device", DeviceNames.of(mac).orEmpty(), heardAs ?: "Name", multiLine = false,
clear = DeviceNames.of(mac)?.let { "Use its own name" }) { text ->
lifecycleScope.launch {
diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceHistoryActivity.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceHistoryActivity.kt
index 734be89..e72f993 100644
--- a/app/src/main/java/com/rfsentinel/app/ui/DeviceHistoryActivity.kt
+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceHistoryActivity.kt
@@ -21,6 +21,7 @@ import com.rfsentinel.app.data.AppDatabase
import com.rfsentinel.app.data.KnownDeviceDao
import com.rfsentinel.app.data.KnownDeviceEntity
import com.rfsentinel.app.databinding.ActivityDeviceHistoryBinding
+import com.rfsentinel.app.detect.DeviceIntel
import com.rfsentinel.app.util.Prefs
import com.rfsentinel.app.util.applySystemBarInsets
import kotlinx.coroutines.Job
@@ -199,7 +200,7 @@ class DeviceHistoryActivity : AppCompatActivity() {
val k = getItem(position)
val c = h.root.context
h.title.text = (if (k.favorite) "★ " else "") + (k.alias?.takeIf { it.isNotBlank() } ?: k.name?.takeIf { it.isNotBlank() } ?: k.mac) +
- (k.deviceType?.takeIf { it.isNotBlank() }?.let { " · $it" } ?: "")
+ (DeviceIntel.savedType(k.deviceType, k.vendor, k.mac)?.takeIf { it.isNotBlank() }?.let { " · $it" } ?: "")
h.line.text = listOfNotNull(k.name?.takeIf { it.isNotBlank() && !k.alias.isNullOrBlank() }?.let { "\"$it\"" },
k.vendor?.takeIf { it.isNotBlank() }, k.mac.takeIf { k.name?.isNotBlank() == true || !k.alias.isNullOrBlank() },
k.note?.takeIf { it.isNotBlank() }?.let { "Note: $it" }).joinToString(" · ").ifEmpty { "Unknown vendor" }
diff --git a/app/src/main/java/com/rfsentinel/app/ui/MapFragment.kt b/app/src/main/java/com/rfsentinel/app/ui/MapFragment.kt
index 42b000b..4ff0215 100644
--- a/app/src/main/java/com/rfsentinel/app/ui/MapFragment.kt
+++ b/app/src/main/java/com/rfsentinel/app/ui/MapFragment.kt
@@ -29,6 +29,7 @@ import com.rfsentinel.app.data.AppDatabase
import com.rfsentinel.app.data.TripDeviceEntity
import com.rfsentinel.app.data.TripEntity
import com.rfsentinel.app.databinding.ActivityMapBinding
+import com.rfsentinel.app.detect.DeviceIntel
import com.rfsentinel.app.nav.NavCamera
import com.rfsentinel.app.nav.NavSearchActivity
import com.rfsentinel.app.nav.Navigator
@@ -1492,11 +1493,12 @@ class MapFragment : Fragment() {
private fun TripDeviceEntity.toPin(): MapPin {
val cat = Category.parse(category)
return MapPin(
- mac, lat!!, lon!!, label, flagged,
+ mac, lat!!, lon!!, DeviceIntel.savedLabel(label, deviceType, vendor, mac), flagged,
DeviceColors.forMatch(act, if (flagged) cat else null, confidence),
buildString {
append(mac)
vendor?.let { append("\n").append(it) }
+ DeviceIntel.savedType(deviceType, vendor, mac)?.takeIf { it != deviceType }?.let { append("\n").append(it) }
if (cat != null) append("\n${cat.title} · ${Tier.of(confidence).label} $confidence%")
evidence?.let { append("\n").append(it) }
probedList.takeIf { it.isNotEmpty() }?.let { append("\nAsked for networks: ").append(it.joinToString(", ")) }
diff --git a/app/src/main/java/com/rfsentinel/app/ui/SnapshotActivity.kt b/app/src/main/java/com/rfsentinel/app/ui/SnapshotActivity.kt
index b4c193c..a589b47 100644
--- a/app/src/main/java/com/rfsentinel/app/ui/SnapshotActivity.kt
+++ b/app/src/main/java/com/rfsentinel/app/ui/SnapshotActivity.kt
@@ -21,6 +21,7 @@ import com.rfsentinel.app.data.TripEntity
import com.rfsentinel.app.databinding.ActivityLogBinding
import com.rfsentinel.app.databinding.ItemDetectionBinding
import com.rfsentinel.app.detect.Category
+import com.rfsentinel.app.detect.DeviceIntel
import com.rfsentinel.app.detect.Tier
import com.rfsentinel.app.util.Exporter
import com.rfsentinel.app.util.ProximityUtil
@@ -56,7 +57,9 @@ class SnapshotActivity : AppCompatActivity() {
val d = items[position]
val b = ItemDetectionBinding.bind(holder.itemView)
val category = Category.parse(d.category)
- b.labelText.text = d.label
+ val type = DeviceIntel.savedType(d.deviceType, d.vendor, d.mac)
+ val label = DeviceIntel.savedLabel(d.label, d.deviceType, d.vendor, d.mac)
+ b.labelText.text = label
b.labelText.setTextColor(
if (category != null) ThemeManager.ink(this@SnapshotActivity, category.colorArgb) else b.macText.currentTextColor
)
@@ -65,6 +68,7 @@ class SnapshotActivity : AppCompatActivity() {
category?.let { parts += it.shortTag }
if (d.confidence > 0) parts += "${Tier.of(d.confidence).label} ${d.confidence}%"
d.name?.takeIf { it != d.label }?.let { parts += it }
+ type?.takeIf { it != d.deviceType && it != label }?.let { parts += it }
parts += "${if (d.source == "WIFI") "WiFi" else "Bluetooth"} ${ProximityUtil.band(d.bestRssi)} ${d.bestRssi} dBm"
parts += timeFmt.format(Date(d.firstSeen)) + "–" + timeFmt.format(Date(d.lastSeen))
b.metaText.text = parts.joinToString(" · ")
@@ -115,7 +119,7 @@ class SnapshotActivity : AppCompatActivity() {
val q = binding.searchInput.text?.toString()?.trim().orEmpty()
val list = devices.filter { d ->
(!onlyFlagged || d.flagged) && (q.isEmpty() ||
- listOfNotNull(d.mac, d.label, d.name, d.vendor, d.deviceType, d.evidence).any { it.contains(q, ignoreCase = true) })
+ listOfNotNull(d.mac, d.label, d.name, d.vendor, d.deviceType, DeviceIntel.savedType(d.deviceType, d.vendor, d.mac), d.evidence).any { it.contains(q, ignoreCase = true) })
}
adapter.items = list
@Suppress("NotifyDataSetChanged") adapter.notifyDataSetChanged()
diff --git a/app/src/main/java/com/rfsentinel/app/util/DeviceExport.kt b/app/src/main/java/com/rfsentinel/app/util/DeviceExport.kt
index 3559ed8..f22d75a 100644
--- a/app/src/main/java/com/rfsentinel/app/util/DeviceExport.kt
+++ b/app/src/main/java/com/rfsentinel/app/util/DeviceExport.kt
@@ -8,6 +8,7 @@ import com.rfsentinel.app.data.KnownDeviceEntity
import com.rfsentinel.app.detect.Advert
import com.rfsentinel.app.detect.AdStructure
import com.rfsentinel.app.detect.Bytes
+import com.rfsentinel.app.detect.DeviceIntel
import com.rfsentinel.app.detect.VendorDb
import com.rfsentinel.app.oui.OuiEntry
import com.rfsentinel.app.service.DeviceRegistry
@@ -192,7 +193,7 @@ object DeviceExport {
private fun historyCsvLine(sb: StringBuilder, r: KnownDeviceEntity) {
sb.append(r.mac).append(',').append(q(r.name)).append(',').append(q(r.vendor)).append(',')
- .append(q(r.deviceType)).append(',').append(local(r.firstSeen)).append(',').append(local(r.lastSeen)).append(',')
+ .append(q(DeviceIntel.savedType(r.deviceType, r.vendor, r.mac))).append(',').append(local(r.firstSeen)).append(',').append(local(r.lastSeen)).append(',')
.append(r.sessions).append(',').append(r.detectCount).append(',').append(r.favorite).append(',')
.append(q(r.note)).append(',').append(q(r.alias)).append('\n')
}
@@ -223,7 +224,7 @@ object DeviceExport {
private fun historyItem(r: KnownDeviceEntity) = JsonObject().apply {
addProperty("mac", r.mac); addProperty("name", r.name); addProperty("vendor", r.vendor)
- addProperty("deviceType", r.deviceType); addProperty("firstSeen", iso(r.firstSeen))
+ addProperty("deviceType", DeviceIntel.savedType(r.deviceType, r.vendor, r.mac)); addProperty("firstSeen", iso(r.firstSeen))
addProperty("lastSeen", iso(r.lastSeen)); addProperty("sessions", r.sessions)
addProperty("detectCount", r.detectCount); addProperty("favorite", r.favorite); addProperty("note", r.note)
addProperty("customName", r.alias)
diff --git a/app/src/main/java/com/rfsentinel/app/util/TripExport.kt b/app/src/main/java/com/rfsentinel/app/util/TripExport.kt
index 75b6a43..47d5c45 100644
--- a/app/src/main/java/com/rfsentinel/app/util/TripExport.kt
+++ b/app/src/main/java/com/rfsentinel/app/util/TripExport.kt
@@ -6,6 +6,7 @@ import com.google.gson.JsonObject
import com.rfsentinel.app.data.TripDeviceEntity
import com.rfsentinel.app.data.TripEntity
import com.rfsentinel.app.data.TripPointEntity
+import com.rfsentinel.app.detect.DeviceIntel
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
@@ -105,8 +106,8 @@ object TripExport {
add("coordinates", JsonArray().apply { add(d.lon); add(d.lat) })
})
add("properties", JsonObject().apply {
- addProperty("kind", "device"); addProperty("mac", d.mac); addProperty("label", d.label)
- addProperty("name", d.name); addProperty("vendor", d.vendor); addProperty("deviceType", d.deviceType)
+ addProperty("kind", "device"); addProperty("mac", d.mac); addProperty("label", DeviceIntel.savedLabel(d.label, d.deviceType, d.vendor, d.mac))
+ addProperty("name", d.name); addProperty("vendor", d.vendor); addProperty("deviceType", DeviceIntel.savedType(d.deviceType, d.vendor, d.mac))
addProperty("source", d.source); addProperty("category", d.category); addProperty("confidence", d.confidence)
addProperty("evidence", d.evidence); addProperty("bestRssi", d.bestRssi)
add("requestedNetworks", JsonArray().apply { d.probedList.forEach { add(it) } })
@@ -125,8 +126,8 @@ object TripExport {
fun devicesCsv(devices: List<TripDeviceEntity>): String {
val sb = StringBuilder("mac,label,name,vendor,device_type,source,flagged,category,confidence,evidence,first_seen,last_seen,best_rssi,latitude,longitude,requested_networks\n")
devices.forEach { d ->
- sb.append(d.mac).append(',').append(q(d.label)).append(',').append(q(d.name)).append(',')
- .append(q(d.vendor)).append(',').append(q(d.deviceType)).append(',').append(d.source).append(',')
+ sb.append(d.mac).append(',').append(q(DeviceIntel.savedLabel(d.label, d.deviceType, d.vendor, d.mac))).append(',').append(q(d.name)).append(',')
+ .append(q(d.vendor)).append(',').append(q(DeviceIntel.savedType(d.deviceType, d.vendor, d.mac))).append(',').append(d.source).append(',')
.append(d.flagged).append(',').append(d.category ?: "").append(',').append(d.confidence).append(',')
.append(q(d.evidence)).append(',').append(local(d.firstSeen)).append(',').append(local(d.lastSeen)).append(',')
.append(d.bestRssi).append(',').append(d.lat ?: "").append(',').append(d.lon ?: "").append(',')
diff --git a/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.kt b/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.kt
index 85e0f5e..edc6687 100644
--- a/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.kt
+++ b/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.kt
@@ -290,6 +290,24 @@ class IdentificationTest {
Advert(mac, Advert.Source.WIFI, -60, ssid, wifi = Advert.WifiInfo(2437, "[WPA2-PSK-CCMP]", null, emptyList())),
VendorDb.macVendor(mac))
+ @Test
+ fun savedRecordsOfCarWifiReadAsVehicleWifi() {
+ // Types saved by older versions, upgraded at view time from the saved registrant or the address.
+ assertEquals("Vehicle WiFi - Tesla", DeviceIntel.savedType("Phone hotspot", "Tesla,Inc.", "0C:29:8F:00:00:01"))
+ assertEquals("Vehicle WiFi - Harman", DeviceIntel.savedType("Hidden WiFi network", null, "00:1C:D7:00:00:01"))
+ assertEquals("Vehicle WiFi - Visteon - MIB3", DeviceIntel.savedType("Vehicle system (WiFi) - MIB3", null, "00:09:93:00:00:01"))
+ assertEquals("Vehicle WiFi - Tesla", DeviceIntel.savedType("WiFi access point - Tesla", "Tesla,Inc.", "0C:29:8F:00:00:01"))
+ // Clients, other makers and already-current types stay as saved.
+ assertEquals("WiFi device (laptop, phone or camera on a network)",
+ DeviceIntel.savedType("WiFi device (laptop, phone or camera on a network)", "Tesla,Inc.", "0C:29:8F:00:00:01"))
+ assertEquals("Phone hotspot", DeviceIntel.savedType("Phone hotspot", "Apple, Inc.", "00:00:00:00:00:01"))
+ assertEquals("Vehicle WiFi - Tesla", DeviceIntel.savedType("Vehicle WiFi - Tesla", "Tesla,Inc.", "0C:29:8F:00:00:01"))
+ assertNull(DeviceIntel.savedType(null, "Tesla,Inc.", "0C:29:8F:00:00:01"))
+ // A label that was the old type follows it; a network name stays.
+ assertEquals("Vehicle WiFi - Tesla", DeviceIntel.savedLabel("Hidden WiFi network", "Hidden WiFi network", "Tesla,Inc.", "0C:29:8F:00:00:01"))
+ assertEquals("My Model 3", DeviceIntel.savedLabel("My Model 3", "WiFi access point", "Tesla,Inc.", "0C:29:8F:00:00:01"))
+ }
+
@Test
fun aCarMakersAddressMakesAnyNetworkVehicleWifi() {
// Registry prefixes (IEEE): Tesla, Inc. / Harman-Becker Automotive / Visteon.