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.

Device list: a flagged router's SSID next to its address

CIS-C0c711f493b607
diff --git a/app/src/main/java/com/rfsentinel/app/MainActivity.kt b/app/src/main/java/com/rfsentinel/app/MainActivity.kt
index 5e38c76..76470b0 100644
--- a/app/src/main/java/com/rfsentinel/app/MainActivity.kt
+++ b/app/src/main/java/com/rfsentinel/app/MainActivity.kt
@@ -1327,13 +1327,15 @@ class MainActivity : AppCompatActivity() {
}
val alias = com.rfsentinel.app.data.DeviceNames.of(s.mac)
val lookalike = com.rfsentinel.app.data.DeviceNames.lookalike(s.mac, DeviceRegistry.fingerprintOf(s.mac))
+ val ssid = com.rfsentinel.app.ui.DeviceRows.routerSsid(best != null, s.sources, s.name, s.deviceType)
return DeviceRow(
mac = s.mac,
title = alias ?: best?.label ?: s.name ?: s.deviceType,
- subtitle = s.mac + " · " + (s.vendor ?: s.addressType.label),
+ subtitle = com.rfsentinel.app.ui.DeviceRows.subtitle(s.mac, ssid, s.vendor ?: s.addressType.label),
meta = (listOf(
// Under your own name, what it's heard as comes first.
if (alias != null) best?.label ?: s.name?.let { "\"$it\"" } ?: s.deviceType
+ else if (ssid != null) null
else if (best != null && s.name != null) "\"${s.name}\"" else s.deviceType,
lookalike?.let { "like your \"$it\"" },
// Ordinary rows name the radio in their tag; flagged ones keep it here.
diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceRows.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceRows.kt
index 54d4d1b..b5ffc53 100644
--- a/app/src/main/java/com/rfsentinel/app/ui/DeviceRows.kt
+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceRows.kt
@@ -23,6 +23,14 @@ object DeviceRows {
/** A match's tag, the same on every kind of row: "BODY CAM · strong 90%". */
fun matchTag(name: String, confidence: Int) = "$name · ${Tier.of(confidence).label} $confidence%"
+ /** The network name a flagged router's row shows next to its address, or null for every other row. */
+ fun routerSsid(flagged: Boolean, sources: Set<Advert.Source>, name: String?, type: String?): String? =
+ name?.takeIf { flagged && Advert.Source.WIFI in sources && type != null && DeviceIntel.isRouter(type) }
+
+ /** A row's second line: the address, then [ssid] when it has one, then [vendor]. */
+ fun subtitle(mac: String, ssid: String?, vendor: String?) =
+ listOfNotNull(mac, ssid?.let { "\"$it\"" }, vendor).joinToString(" · ")
+
/** How long ago, the same on every row. */
fun ago(sec: Long) = when {
sec < 2 -> "now"
@@ -61,12 +69,14 @@ object DeviceRows {
else -> radioTag(sources)
}
val badges = buildList { if (Favorites.contains(d.mac)) add("★") }
+ val ssid = routerSsid(category != null, sources, d.name, type)
return DeviceRow(
mac = d.mac,
title = alias ?: label,
- subtitle = d.mac + (d.vendor?.let { " · $it" } ?: ""),
+ subtitle = subtitle(d.mac, ssid, d.vendor),
meta = (listOfNotNull(
if (alias != null) label
+ else if (ssid != null) null
else if (category != null && d.name != null && d.name != label) "\"${d.name}\"" else type?.takeIf { it != label },
if (category != null) sources.joinToString("+") { if (it == Advert.Source.BLE) "BLE" else "WiFi" }.ifEmpty { null } else null,
"${ProximityUtil.band(d.bestRssi)} ${d.bestRssi} dBm",
diff --git a/app/src/test/java/com/rfsentinel/app/ui/DeviceRowsSsidTest.kt b/app/src/test/java/com/rfsentinel/app/ui/DeviceRowsSsidTest.kt
new file mode 100644
index 0000000..4049867
--- /dev/null
+++ b/app/src/test/java/com/rfsentinel/app/ui/DeviceRowsSsidTest.kt
@@ -0,0 +1,26 @@
+package com.rfsentinel.app.ui
+
+import com.rfsentinel.app.detect.Advert
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertNull
+import org.junit.Test
+
+class DeviceRowsSsidTest {
+ private val wifi = setOf(Advert.Source.WIFI)
+ private val router = "Vehicle / cellular router"
+
+ @Test fun `a flagged wifi router shows its network name before the vendor`() {
+ val ssid = DeviceRows.routerSsid(true, wifi, "IBR900-abc", router)
+ assertEquals("IBR900-abc", ssid)
+ assertEquals("00:11:22:33:44:55 · \"IBR900-abc\" · Cradlepoint", DeviceRows.subtitle("00:11:22:33:44:55", ssid, "Cradlepoint"))
+ }
+
+ @Test fun `other rows keep the address and vendor`() {
+ assertNull(DeviceRows.routerSsid(false, wifi, "IBR900-abc", router))
+ assertNull(DeviceRows.routerSsid(true, setOf(Advert.Source.BLE), "IBR900-abc", router))
+ assertNull(DeviceRows.routerSsid(true, wifi, "Pixel", "Phone"))
+ assertNull(DeviceRows.routerSsid(true, wifi, null, router))
+ assertEquals("00:11:22:33:44:55 · Cradlepoint", DeviceRows.subtitle("00:11:22:33:44:55", null, "Cradlepoint"))
+ assertEquals("00:11:22:33:44:55", DeviceRows.subtitle("00:11:22:33:44:55", null, null))
+ }
+}