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.
Kotlin airtagalprandroidandroid-autoanti-surveillancebluetooth-low-energybody-cameracounter-surveillancedrone-detectionflock-safetyimsi-catcher-detectorpolice-detectorpolice-scannerprivacyremote-idrtl-sdrsdrsurveillance-detectiontracker-detectionwifi
Patrol grouping: label printers only add to a group; a radio or a router needs the other or a police-specific role (stockroom printer + router no longer reads as a patrol car)
CIS-C046ee16b52949
diff --git a/README.md b/README.mdindex decbcd1..f9119d2 100644--- a/README.md+++ b/README.md@@ -302,7 +302,7 @@ ESP32 boards ─┘ tags, IEEE prefixes) cap 90) r ≥ 0.6,- **Confidence tiers:** weak < 50 (amber, silent by default), probable 50-79 (alerts at the default threshold), strong 80+.- **Fusion:** `1 - (1 - top) × Π(1 - 0.5 × support)`; e.g. watchlisted address 70 + Zebra serial name 50 → 78.-- **Patrol vehicle:** at least two different roles whose RSSI correlates (Pearson r ≥ 0.6 over ≥ 8 s), or both parked and seen within 30 s; scored 24 + 12 × roles, +10 if moving together, cap 88.+- **Patrol vehicle:** at least two different roles whose RSSI correlates (Pearson r ≥ 0.6 over ≥ 8 s), or both parked and seen within 30 s, including a police-specific role or both a radio and a vehicle router (printers, breath screening and interface modules only add to a group); scored 24 + 12 × roles, +10 if moving together, cap 88.- **Rotation linking:** same advert fingerprint (names, UUIDs, payload sizes, TX power, connectable) as exactly one device that went silent 1.5-30 s earlier.Details: [How it works](https://cis-c0.github.io/RFSentinel/how-it-works.html) and [docs/SIGNATURES.md](docs/SIGNATURES.md).diff --git a/app/src/main/java/com/rfsentinel/app/detect/PatrolCluster.kt b/app/src/main/java/com/rfsentinel/app/detect/PatrolCluster.ktindex 23b7749..ea1c13f 100644--- a/app/src/main/java/com/rfsentinel/app/detect/PatrolCluster.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/PatrolCluster.kt@@ -40,18 +40,26 @@ object PatrolCluster {private const val ROLE_SCREENING = "impairment-screening device"private const val ROLE_INTERFACE = "vehicle interface module"+ private const val ROLE_PRINTER = "mobile printer"+ private const val ROLE_RADIO = "two-way radio"+ private const val ROLE_ROUTER = "vehicle cellular router"/*** Roles from makers whose products are mostly civilian (remote starters, medical and- * gas-detection gear): they add to a group but can't make one on their own, so an office or a- * driveway full of them never reads as a police vehicle.+ * gas-detection gear, label printers): they add to a group but can't make one on their own, so an+ * office, a stockroom or a driveway full of them never reads as a police vehicle.*/- private val SUPPORT_ROLES = setOf(ROLE_SCREENING, ROLE_INTERFACE)+ private val SUPPORT_ROLES = setOf(ROLE_SCREENING, ROLE_INTERFACE, ROLE_PRINTER)+ /**+ * Gear that police cars carry but so do guards, utility trucks and shops: one of these needs a+ * second, different one (a radio and a router) or a police-specific role to make a group.+ */+ private val DUAL_USE_ROLES = setOf(ROLE_RADIO, ROLE_ROUTER)private val ROLE_BY_VENDOR = listOf(Regex("axon|taser", RegexOption.IGNORE_CASE) to "Axon / TASER gear",- Regex("motorola solutions|harris corp|l3harris", RegexOption.IGNORE_CASE) to "two-way radio",- Regex("cradlepoint|sierra wireless|peplink|inseego", RegexOption.IGNORE_CASE) to "vehicle cellular router",- Regex("zebra|ruggedjet|pocketjet", RegexOption.IGNORE_CASE) to "mobile printer",+ Regex("motorola solutions|harris corp|l3harris", RegexOption.IGNORE_CASE) to ROLE_RADIO,+ Regex("cradlepoint|sierra wireless|peplink|inseego", RegexOption.IGNORE_CASE) to ROLE_ROUTER,+ Regex("zebra|ruggedjet|pocketjet", RegexOption.IGNORE_CASE) to ROLE_PRINTER,Regex("dräger|draeger", RegexOption.IGNORE_CASE) to ROLE_SCREENING,Regex("fortin vehicle|fortin electronic", RegexOption.IGNORE_CASE) to ROLE_INTERFACE,Regex("cyberkar", RegexOption.IGNORE_CASE) to "in-car computer / console",@@ -63,7 +71,7 @@ object PatrolCluster {)private val ROLE_BY_NAME = listOf(- Regex("^(RJ-4|PJ-[78])", RegexOption.IGNORE_CASE) to "mobile printer",+ Regex("^(RJ-4|PJ-[78])", RegexOption.IGNORE_CASE) to ROLE_PRINTER,Regex("^(BC-0\\d|HS-01)", RegexOption.IGNORE_CASE) to "rugged laptop / body cam")@@ -78,6 +86,16 @@ object PatrolCluster {return null}+ /**+ * Whether these roles together are worth calling a vehicle: a police-specific role, or two different+ * dual-use ones (a radio and a router). Support roles only add to the score.+ */+ fun isVehicle(roles: Set<String>): Boolean {+ if (roles.size < 2) return false+ val core = roles - SUPPORT_ROLES+ return (core - DUAL_USE_ROLES).isNotEmpty() || core.size >= 2+ }+/** Groups of at least two different roles that are travelling / parked together. */fun groups(members: List<Member>, now: Long): List<Group> {val live = members.filter { now - it.lastSeen <= RECENT_MS }@@ -104,7 +122,7 @@ object PatrolCluster {}return live.indices.groupBy { find(it) }.values.map { idx -> Group(idx.map { live[it] }, idx.map { live[it].role }.toSet(), idx.any { it in correlatedPairs }) }- .filter { it.roles.size >= 2 && (it.roles - SUPPORT_ROLES).isNotEmpty() }+ .filter { isVehicle(it.roles) }}/** The cluster hit for [mac], if it belongs to a group. */diff --git a/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.kt b/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.ktindex 3141598..5fbaeb3 100644--- a/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.kt+++ b/app/src/test/java/com/rfsentinel/app/detect/IdentificationTest.kt@@ -2,6 +2,7 @@ package com.rfsentinel.app.detectimport com.rfsentinel.app.service.DeviceRegistryimport org.junit.Assert.assertEquals+import org.junit.Assert.assertFalseimport org.junit.Assert.assertNotNullimport org.junit.Assert.assertNullimport org.junit.Assert.assertTrue@@ -79,13 +80,13 @@ class IdentificationTest {fun devicesMovingTogetherFormAVehicle() {val now = 60_000Lval members = listOf(- PatrolCluster.Member("AA:00:00:00:00:01", "mobile printer", 0, now, wave(0)),+ PatrolCluster.Member("AA:00:00:00:00:01", "police camera", 0, now, wave(0)),PatrolCluster.Member("AA:00:00:00:00:02", "two-way radio", 0, now, wave(0, offset = -80)),PatrolCluster.Member("AA:00:00:00:00:03", "vehicle cellular router", 0, now, wave(0, phase = 3.1)) // opposite motion)val groups = PatrolCluster.groups(members, now)assertEquals(1, groups.size)- assertEquals(setOf("mobile printer", "two-way radio"), groups[0].roles)+ assertEquals(setOf("police camera", "two-way radio"), groups[0].roles)assertTrue(groups[0].correlated)val h = PatrolCluster.hitFor("AA:00:00:00:00:01", groups)!!assertEquals(58, h.confidence) // 24 + 12*2 + 10@@ -136,9 +137,31 @@ class IdentificationTest {PatrolCluster.Member("AA:00:00:00:00:02", "impairment-screening device", 0, now, wave(0, offset = -80)))assertTrue(PatrolCluster.groups(supportOnly, now).isEmpty())- // ...but they add to a group with a core role.+ // A radio alone is dual-use: support gear doesn't make it a vehicle...val withRadio = supportOnly + PatrolCluster.Member("AA:00:00:00:00:03", "two-way radio", 0, now, wave(0, offset = -75))- assertEquals(3, PatrolCluster.groups(withRadio, now).single().roles.size)+ assertTrue(PatrolCluster.groups(withRadio, now).isEmpty())+ // ...but it adds to a group with a police-specific role.+ val withCamera = withRadio + PatrolCluster.Member("AA:00:00:00:00:04", "police camera", 0, now, wave(0, offset = -85))+ assertEquals(4, PatrolCluster.groups(withCamera, now).single().roles.size)+ }++ @Test+ fun civilianKitsAreNotAVehicle() {+ val now = 60_000L+ fun kit(vararg roles: String) = roles.mapIndexed { i, r ->+ PatrolCluster.Member("AA:00:00:00:00:0$i", r, 0, now, wave(0, offset = -70 - 5 * i))+ }+ fun vehicle(vararg roles: String) = PatrolCluster.groups(kit(*roles), now).isNotEmpty()+ // A stockroom: label printer and cellular router moving together (GitHub issue #3), or a printer and a radio.+ assertFalse(vehicle("mobile printer", "vehicle cellular router"))+ assertFalse(vehicle("mobile printer", "two-way radio"))+ assertFalse(vehicle("impairment-screening device", "vehicle cellular router"))+ // Two different dual-use roles, or one police-specific role, still make one; the printer adds to it.+ assertTrue(vehicle("two-way radio", "vehicle cellular router"))+ assertEquals(3, PatrolCluster.groups(kit("two-way radio", "vehicle cellular router", "mobile printer"), now).single().roles.size)+ assertTrue(vehicle("body camera", "mobile printer"))+ assertTrue(vehicle("plate reader", "vehicle cellular router"))+ assertFalse(PatrolCluster.isVehicle(setOf("body camera")))}@Test@@ -183,7 +206,7 @@ class IdentificationTest {val now = 30_000Lval together = listOf(PatrolCluster.Member("AA:00:00:00:00:01", "two-way radio", 0, now, flat),- PatrolCluster.Member("AA:00:00:00:00:02", "mobile printer", 10_000, now, flat)+ PatrolCluster.Member("AA:00:00:00:00:02", "vehicle cellular router", 10_000, now, flat))val g = PatrolCluster.groups(together, now)assertEquals(1, g.size)diff --git a/docs/how-it-works.html b/docs/how-it-works.htmlindex ca8bddc..2bfba81 100644--- a/docs/how-it-works.html+++ b/docs/how-it-works.html@@ -72,7 +72,7 @@<p>Example: watchlisted address 70 + Zebra serial name 50 → 78. The patrol-vehicle hit is never fused, because it is derived from the device's own matches.</p><h2 id="patrol">4. Patrol-vehicle grouping</h2>-<p><code>detect/PatrolCluster.kt</code>. Each device gets a role (body camera, plate reader, two-way radio, vehicle cellular router, mobile printer, in-car computer, rugged laptop, police camera) from its matches or IEEE registrant. Two or more different roles form a vehicle when their RSSI correlates (Pearson r ≥ 0.6 over ≥ 8 aligned seconds) or both are parked (flat) and appeared within 30 s of each other. Score: 24 + 12 × roles, +10 if moving together, cap 88. A device's own match is held 2 minutes after its evidence was last seen.</p>+<p><code>detect/PatrolCluster.kt</code>. Each device gets a role (body camera, plate reader, two-way radio, vehicle cellular router, mobile printer, in-car computer, rugged laptop, police camera) from its matches or IEEE registrant. Two or more different roles form a vehicle when their RSSI correlates (Pearson r ≥ 0.6 over ≥ 8 aligned seconds) or both are parked (flat) and appeared within 30 s of each other. The group needs a police-specific role, or both a two-way radio and a vehicle router: printers, breath-screening devices and vehicle interface modules only add to a group. Score: 24 + 12 × roles, +10 if moving together, cap 88. A device's own match is held 2 minutes after its evidence was last seen.</p><h2 id="linking">5. Address-rotation linking</h2><p><code>detect/AdvertFingerprint.kt</code>. Fingerprint = names, service UUIDs, service-data and company-ID payload sizes, TX power, connectable flag. A new private address with the same fingerprint as exactly one device that went silent 1.5-30 s earlier inherits its matches (−5), follow history (time with you, GPS path) and ignore state. Apple-Continuity-only adverts are never linked.</p>diff --git a/docs/police-detector.html b/docs/police-detector.htmlindex c6cca56..5ec40fd 100644--- a/docs/police-detector.html+++ b/docs/police-detector.html@@ -75,6 +75,7 @@2 roles, moving together .. 58 <span class="w">probable</span>3 roles, moving together .. 70 <span class="w">probable</span>5 roles, moving together .. 88 <span class="b">strong</span></div>+<p>Gear that shops, guards and utility trucks carry too can't make a group without help: a label printer, a breath-screening device or a remote-starter module only adds to one, and a radio or a vehicle router needs the other (or a police-specific role such as a body camera, plate reader or lightbar). A stockroom with a Zebra printer and a cellular router is not a patrol car.</p><p>Consumer brands that also make car audio or office gear (Kenwood, Panasonic Connect, Havis) get no role from their vendor name alone, and whitelisted devices never count. The group is recomputed every 2 s, so it disappears when the vehicle leaves.</p><h2 id="setup">Setup for driving</h2>diff --git a/docs/sitemap.xml b/docs/sitemap.xmlindex 1d8b767..db2b414 100644--- a/docs/sitemap.xml+++ b/docs/sitemap.xml@@ -5,11 +5,11 @@<url><loc>https://cis-c0.github.io/RFSentinel/drone-detector.html</loc><lastmod>2026-10-17</lastmod><priority>0.8</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/esp32.html</loc><lastmod>2026-10-10</lastmod><priority>0.8</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/flock-camera-detector.html</loc><lastmod>2026-10-17</lastmod><priority>0.8</priority></url>- <url><loc>https://cis-c0.github.io/RFSentinel/how-it-works.html</loc><lastmod>2026-10-17</lastmod><priority>0.8</priority></url>+ <url><loc>https://cis-c0.github.io/RFSentinel/how-it-works.html</loc><lastmod>2026-10-18</lastmod><priority>0.8</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/imsi-catcher-detector.html</loc><lastmod>2026-10-17</lastmod><priority>0.8</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/</loc><lastmod>2026-10-18</lastmod><priority>1.0</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/install.html</loc><lastmod>2026-10-18</lastmod><priority>0.8</priority></url>- <url><loc>https://cis-c0.github.io/RFSentinel/police-detector.html</loc><lastmod>2026-10-07</lastmod><priority>0.8</priority></url>+ <url><loc>https://cis-c0.github.io/RFSentinel/police-detector.html</loc><lastmod>2026-10-18</lastmod><priority>0.8</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/qa.html</loc><lastmod>2026-10-18</lastmod><priority>0.9</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/smart-glasses-detector.html</loc><lastmod>2026-10-05</lastmod><priority>0.8</priority></url><url><loc>https://cis-c0.github.io/RFSentinel/sophia-alternative.html</loc><lastmod>2026-10-05</lastmod><priority>0.8</priority></url>diff --git a/site/pages/how-it-works.html b/site/pages/how-it-works.htmlindex b3fbfa4..74e2dec 100644--- a/site/pages/how-it-works.html+++ b/site/pages/how-it-works.html@@ -32,7 +32,7 @@<p>Example: watchlisted address 70 + Zebra serial name 50 → 78. The patrol-vehicle hit is never fused, because it is derived from the device's own matches.</p><h2 id="patrol">4. Patrol-vehicle grouping</h2>-<p><code>detect/PatrolCluster.kt</code>. Each device gets a role (body camera, plate reader, two-way radio, vehicle cellular router, mobile printer, in-car computer, rugged laptop, police camera) from its matches or IEEE registrant. Two or more different roles form a vehicle when their RSSI correlates (Pearson r ≥ 0.6 over ≥ 8 aligned seconds) or both are parked (flat) and appeared within 30 s of each other. Score: 24 + 12 × roles, +10 if moving together, cap 88. A device's own match is held 2 minutes after its evidence was last seen.</p>+<p><code>detect/PatrolCluster.kt</code>. Each device gets a role (body camera, plate reader, two-way radio, vehicle cellular router, mobile printer, in-car computer, rugged laptop, police camera) from its matches or IEEE registrant. Two or more different roles form a vehicle when their RSSI correlates (Pearson r ≥ 0.6 over ≥ 8 aligned seconds) or both are parked (flat) and appeared within 30 s of each other. The group needs a police-specific role, or both a two-way radio and a vehicle router: printers, breath-screening devices and vehicle interface modules only add to a group. Score: 24 + 12 × roles, +10 if moving together, cap 88. A device's own match is held 2 minutes after its evidence was last seen.</p><h2 id="linking">5. Address-rotation linking</h2><p><code>detect/AdvertFingerprint.kt</code>. Fingerprint = names, service UUIDs, service-data and company-ID payload sizes, TX power, connectable flag. A new private address with the same fingerprint as exactly one device that went silent 1.5-30 s earlier inherits its matches (−5), follow history (time with you, GPS path) and ignore state. Apple-Continuity-only adverts are never linked.</p>diff --git a/site/pages/police-detector.html b/site/pages/police-detector.htmlindex 2391c2e..9fa64b8 100644--- a/site/pages/police-detector.html+++ b/site/pages/police-detector.html@@ -35,6 +35,7 @@2 roles, moving together .. 58 <span class="w">probable</span>3 roles, moving together .. 70 <span class="w">probable</span>5 roles, moving together .. 88 <span class="b">strong</span></div>+<p>Gear that shops, guards and utility trucks carry too can't make a group without help: a label printer, a breath-screening device or a remote-starter module only adds to one, and a radio or a vehicle router needs the other (or a police-specific role such as a body camera, plate reader or lightbar). A stockroom with a Zebra printer and a cellular router is not a patrol car.</p><p>Consumer brands that also make car audio or office gear (Kenwood, Panasonic Connect, Havis) get no role from their vendor name alone, and whitelisted devices never count. The group is recomputed every 2 s, so it disappears when the vehicle leaves.</p><h2 id="setup">Setup for driving</h2>