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.

Filter chips for device kinds: Vehicles, Phones, Audio, Cameras, Routers, Hotspots, TVs & consoles, Smart home

CIS-C00cc2238049ec
diff --git a/app/src/main/java/com/rfsentinel/app/car/DeviceListScreen.kt b/app/src/main/java/com/rfsentinel/app/car/DeviceListScreen.kt
index 3a87fe3..9dc1671 100644
--- a/app/src/main/java/com/rfsentinel/app/car/DeviceListScreen.kt
+++ b/app/src/main/java/com/rfsentinel/app/car/DeviceListScreen.kt
@@ -63,7 +63,8 @@ class DeviceListScreen(carContext: CarContext, private val filter: DeviceFilter)
companion object {
/** The filters offered in the car (cell towers have their own screen). */
- val CAR_FILTERS = DeviceFilter.entries.filter { it != DeviceFilter.CELLS && it != DeviceFilter.WAZE && it != DeviceFilter.RADIO && it != DeviceFilter.AIRCRAFT }
+ val CAR_FILTERS = DeviceFilter.entries.filter { it != DeviceFilter.CELLS && it != DeviceFilter.WAZE && it != DeviceFilter.RADIO && it != DeviceFilter.AIRCRAFT &&
+ it !in DeviceFilter.KINDS }
fun titleOf(f: DeviceFilter) = when (f) {
DeviceFilter.ALL -> "All nearby"
diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt
index a6d0712..d107cf5 100644
--- a/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt
+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt
@@ -4,6 +4,7 @@ import com.rfsentinel.app.data.Favorites
import com.rfsentinel.app.data.WhitelistCache
import com.rfsentinel.app.detect.Advert
import com.rfsentinel.app.detect.Category
+import com.rfsentinel.app.detect.DeviceIntel
import com.rfsentinel.app.service.DeviceRegistry
/** The device filters shared by the list and the map, so both pick the same devices. */
@@ -28,14 +29,23 @@ enum class DeviceFilter(val label: String) {
/** Heard by external hardware: an ESP32 board (USB or OUI-SPY over Bluetooth) or a USB WiFi adapter. */
EXTERNAL("External"),
/** Heard by a linked Sentinel (Sentinel Link). */
- SENTINELS("Sentinels");
+ SENTINELS("Sentinels"),
+ // Kinds of device, from what identified them (see DeviceIntel).
+ VEHICLES("Vehicles"),
+ PHONES("Phones"),
+ AUDIO("Audio"),
+ CAMERAS("Cameras"),
+ ROUTERS("Routers"),
+ HOTSPOTS("Hotspots"),
+ TVS("TVs & consoles"),
+ SMART_HOME("Smart home");
fun matches(s: DeviceRegistry.Snapshot): Boolean = when (this) {
ALL -> true
FLAGGED -> s.best != null && !WhitelistCache.contains(s.mac)
TRACKERS -> !(excludeAirTags && isAppleFindMy(s)) && (s.hits.any { it.category == Category.TRACKER } ||
s.deviceType.contains("tracker", true) || s.deviceType.contains("Find My", true))
- DRONES -> s.hits.any { it.category == Category.DRONE } || s.remoteId != null
+ DRONES -> s.hits.any { it.category == Category.DRONE } || s.remoteId != null || s.deviceType.startsWith("Drone")
NEW -> s.isNew
CELLS, WAZE, RADIO, AIRCRAFT -> false
EXTERNAL -> com.rfsentinel.app.esp.HeardBy.esp.recent(s.mac) || com.rfsentinel.app.esp.HeardBy.usb.recent(s.mac)
@@ -43,12 +53,29 @@ enum class DeviceFilter(val label: String) {
FAVORITES -> Favorites.contains(s.mac)
BLE -> Advert.Source.BLE in s.sources
WIFI -> Advert.Source.WIFI in s.sources
+ VEHICLES -> s.deviceType.startsWith("Vehicle")
+ PHONES -> DeviceIntel.isPhone(s.deviceType, s.name)
+ AUDIO -> AUDIO_TYPE.containsMatchIn(s.deviceType) || s.facts.contains("Identified by" to "Fast Pair model ID")
+ CAMERAS -> CAMERA_TYPE.containsMatchIn(s.deviceType)
+ ROUTERS -> s.deviceType.startsWith("Home router")
+ HOTSPOTS -> HOTSPOT_TYPE.containsMatchIn(s.deviceType)
+ TVS -> TV_TYPE.containsMatchIn(s.deviceType)
+ SMART_HOME -> SMART_HOME_TYPE.containsMatchIn(s.deviceType)
}
companion object {
/** Settings > Exclude Apple AirTags: kept here so the list and map filters needn't read prefs per device. */
@Volatile var excludeAirTags = false
+ /** The device-kind filters (from the device's type), after the main ones. */
+ val KINDS = listOf(VEHICLES, PHONES, AUDIO, CAMERAS, ROUTERS, HOTSPOTS, TVS, SMART_HOME)
+
+ private val AUDIO_TYPE = Regex("headphone|earbud|airpods|beats|speaker|soundbar|\\bbuds\\b|audio", RegexOption.IGNORE_CASE)
+ private val CAMERA_TYPE = Regex("^(dashcam|action camera|security camera|smart-home / camera)", RegexOption.IGNORE_CASE)
+ private val HOTSPOT_TYPE = Regex("^(public wifi hotspot|mobile hotspot box|phone hotspot)", RegexOption.IGNORE_CASE)
+ private val TV_TYPE = Regex("^(smart tv|tv / streaming|game console|apple tv)", RegexOption.IGNORE_CASE)
+ private val SMART_HOME_TYPE = Regex("^(iot board|iot / smart-home|smart plug|smart-home device)", RegexOption.IGNORE_CASE)
+
private fun isAppleFindMy(s: DeviceRegistry.Snapshot) =
s.deviceType.contains("Find My", true) || s.deviceType.contains("AirTag", true) ||
s.hits.any { com.rfsentinel.app.detect.SignatureEngine.isAppleFindMy(it) }
@@ -59,6 +86,6 @@ enum class DeviceFilter(val label: String) {
* The main screen's chip order: the counts worth a glance first (flagged, then what's heard on each
* radio), so they fit without scrolling; the narrower filters after them.
*/
- val MAIN_ORDER = listOf(ALL, FLAGGED, BLE, WIFI, CELLS, TRACKERS, DRONES, AIRCRAFT, RADIO, WAZE, EXTERNAL, SENTINELS, FAVORITES, NEW)
+ val MAIN_ORDER = listOf(ALL, FLAGGED, BLE, WIFI, CELLS, TRACKERS, DRONES, AIRCRAFT, RADIO, WAZE, EXTERNAL, SENTINELS, FAVORITES, NEW) + KINDS
}
}
diff --git a/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt b/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt
index 10ac8bd..96a0a4c 100644
--- a/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt
+++ b/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt
@@ -114,6 +114,27 @@ class IdentifyMoreTest {
DeviceRegistry.clear()
}
+ @Test
+ fun kindFiltersPickTheirDevices() {
+ DeviceRegistry.clear(); DeviceRegistry.startSession()
+ val kinds = mapOf(
+ "BELL123" to com.rfsentinel.app.ui.DeviceFilter.ROUTERS, "xfinitywifi" to com.rfsentinel.app.ui.DeviceFilter.HOTSPOTS,
+ "70mai_D06_1234" to com.rfsentinel.app.ui.DeviceFilter.CAMERAS, "TELLO-5A1B2C" to com.rfsentinel.app.ui.DeviceFilter.DRONES,
+ "DIRECT-1F-[TV] Samsung Q60" to com.rfsentinel.app.ui.DeviceFilter.TVS, "ESP_1A2B3C" to com.rfsentinel.app.ui.DeviceFilter.SMART_HOME
+ )
+ kinds.keys.forEachIndexed { i, ssid ->
+ val a = Advert("02:00:00:00:00:1$i", Advert.Source.WIFI, -60, ssid, wifi = Advert.WifiInfo(2437, "[WPA2-PSK-CCMP]", null, emptyList()))
+ DeviceRegistry.report(a, emptyList(), DeviceIntel.identify(a), null, null, null)
+ }
+ val buds = ble(data = mapOf(Advert.uuid16(0xFE2C) to bytes(0xCD, 0x82, 0x56)))
+ DeviceRegistry.report(buds, emptyList(), DeviceIntel.identify(buds), null, null, null)
+ val snaps = DeviceRegistry.snapshot()
+ kinds.forEach { (ssid, f) -> assertEquals(ssid, listOf(ssid), snaps.filter { f.matches(it) }.map { it.name }) }
+ assertEquals(listOf(buds.mac), snaps.filter { com.rfsentinel.app.ui.DeviceFilter.AUDIO.matches(it) }.map { it.mac })
+ assertTrue(snaps.none { com.rfsentinel.app.ui.DeviceFilter.VEHICLES.matches(it) || com.rfsentinel.app.ui.DeviceFilter.PHONES.matches(it) })
+ DeviceRegistry.clear()
+ }
+
@Test
fun advertHashIsStable() {
assertEquals(AdvertFingerprint.hash("n=Buds|u=|d=|m=|t=|c="), AdvertFingerprint.hash("n=Buds|u=|d=|m=|t=|c="))