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.

2.33.0: ignored network names match where a word starts and never hide police names; P25 follow/record end on stalls in a row; DSD/mbelib ISC notice in About and assets

CIS-C0098431d74d8c
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 87b6693..f773b07 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -7,8 +7,8 @@ plugins {
}
// Bump both for every release. versionName ends up in the APK file name.
-val appVersionCode = 64
-val appVersionName = "2.32.0"
+val appVersionCode = 65
+val appVersionName = "2.33.0"
// Release signing credentials live in keystore.properties (git-ignored).
// Without that file, release builds are produced unsigned.
diff --git a/app/src/main/assets/licenses/ISC-DSD-mbelib.txt b/app/src/main/assets/licenses/ISC-DSD-mbelib.txt
new file mode 100644
index 0000000..4f4d26d
--- /dev/null
+++ b/app/src/main/assets/licenses/ISC-DSD-mbelib.txt
@@ -0,0 +1,19 @@
+DSD - Copyright (C) 2010 DSD Author
+mbelib - Copyright (C) 2010 mbelib Author
+
+RF Sentinel's P25 voice decoding (sdr/P25Voice.kt, sdr/ImbeDecoder.kt) is ported from DSD
+(https://github.com/szechyjs/dsd) and mbelib (https://github.com/szechyjs/mbelib), under this license:
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+IMBE is a voice coding method of Digital Voice Systems, Inc. (DVSI).
diff --git a/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt b/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt
index 6905729..ebb9d5b 100644
--- a/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt
+++ b/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt
@@ -443,7 +443,7 @@ object SignatureEngine {
"WiFi network \"$ssid\" is a Cradlepoint in-vehicle router's default name (model + last 3 address digits). " +
"Police cars, but also ambulances, buses, utility fleets and traffic-signal cabinets", "Cradlepoint default SSID (product label); $IEEE")
// Weak alone; on a vehicle router it backs the router match, so a familiar one still alerts (FixedRouter).
- ssid.lowercase().split(NON_ALNUM).any { w -> w in EMERGENCY_WORDS || w.split(LETTER_DIGIT).any { it in EMERGENCY_WORDS } } -> Hit(Category.PUBLIC_SAFETY,
+ namesPolice(ssid) -> Hit(Category.PUBLIC_SAFETY,
"Police network name", 45, "WiFi network \"$ssid\" names a police service. Stronger on a " +
"Cradlepoint or Sierra Wireless router", "Network-name keywords, after Wardrive Go's emergency-router filter")
else -> null
@@ -454,6 +454,25 @@ object SignatureEngine {
private val NON_ALNUM = Regex("[^a-z0-9]+")
private val LETTER_DIGIT = Regex("(?<=[a-z])(?=[0-9])|(?<=[0-9])(?=[a-z])")
+ /** [ssid] names a police service as a whole word ("SHERIFF-12", "PD_Unit4"). */
+ internal fun namesPolice(ssid: String) =
+ ssid.lowercase().split(NON_ALNUM).any { w -> w in EMERGENCY_WORDS || w.split(LETTER_DIGIT).any { it in EMERGENCY_WORDS } }
+
+ /**
+ * Settings › Ignored network names: [ssid] has one of [words] where a word starts, any case ("Rogers-5G", "MyRogers";
+ * not "Seattle" for ATT). A name that also names the police is never ignored.
+ */
+ fun ignoredSsid(ssid: String, words: List<String>): Boolean = words.any { startsWord(ssid, it) } && !namesPolice(ssid)
+
+ private fun startsWord(name: String, word: String): Boolean {
+ var i = name.indexOf(word, ignoreCase = true)
+ while (i >= 0) {
+ if (i == 0 || !name[i - 1].isLetter() || (name[i - 1].isLowerCase() && name[i].isUpperCase())) return true
+ i = name.indexOf(word, i + 1, ignoreCase = true)
+ }
+ return false
+ }
+
/** The network an Axon body camera or device opens while pairing ("AB3-...", "AXON-..."). */
internal fun axonPairingSsid(ssid: String): Hit? {
if (AXON_FLEET_SSID.matches(ssid)) return null // an in-car network: policeVehicleSsid
diff --git a/app/src/main/java/com/rfsentinel/app/sdr/SdrRadio.kt b/app/src/main/java/com/rfsentinel/app/sdr/SdrRadio.kt
index f508b5f..0c8fee3 100644
--- a/app/src/main/java/com/rfsentinel/app/sdr/SdrRadio.kt
+++ b/app/src/main/java/com/rfsentinel/app/sdr/SdrRadio.kt
@@ -528,6 +528,7 @@ object SdrRadio {
follow.quietS < (if (follow.frames == 0) FOLLOW_START_S else FOLLOW_QUIET_S) && System.currentTimeMillis() - start < FOLLOW_MAX_MS) {
val n = sdr.read(buf)
if (n <= 0) { fails++; continue }
+ fails = 0 // stalls in a row end it, not stalls over a long call
follow.feed(buf, n / 2)
}
} finally { p25Playing = null; out.stop() } // stop: what's buffered still plays
@@ -558,6 +559,7 @@ object SdrRadio {
while (rec.samples < P25Record.SECONDS * P25Record.RATE && !halted && fails < STALL_CHUNKS) {
val n = sdr.read(buf)
if (n <= 0) { fails++; continue }
+ fails = 0
rec.feed(buf, n / 2)
}
if (rec.samples < P25Record.RATE) return false
diff --git a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt
index 3ede72f..33cc2f5 100644
--- a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt
+++ b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt
@@ -1050,7 +1050,7 @@ class ScanForegroundService : Service() {
// patrol-vehicle cluster, then fused into one calibrated score.
// A network whose name has one of your ignored words (Settings › Ignored network names): listed, never flagged.
val ignored = a.source == Advert.Source.WIFI && a.wifi?.client != true &&
- a.name?.let { n -> Prefs.ignoredSsidAll(this).any { n.contains(it, ignoreCase = true) } } == true
+ a.name?.let { SignatureEngine.ignoredSsid(it, Prefs.ignoredSsidAll(this)) } == true
val raw = if (ignored) emptyList() else SignatureEngine.classify(a) +
OuiWatchlist.hits(a.mac, a.name, listOfNotNull(macVendor) + companyVendors) +
OuiWatchlist.advertHits(a) +
diff --git a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt
index 00026c8..348be34 100644
--- a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt
+++ b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt
@@ -1080,7 +1080,8 @@ class SettingsActivity : AppCompatActivity() {
info(binding.forgetHistoryButton, "New / returning status, detect counts and the remembered cell towers start over. Favorites are kept.")
info(binding.openWhitelistButton, "Trusted devices: never flagged, and hidden from the list when you choose.")
info(binding.ignoredSsidsButton, "WiFi networks whose name contains one of these words are never flagged, " +
- "for example carriers' home routers (Rogers, Bell) that look like vehicle routers. Matches part of a name, any case.\n\n" +
+ "for example carriers' home routers (Rogers, Bell) that look like vehicle routers. Matches where a word starts in the name (Rogers-5G, MyRogers), any case. " +
+ "A name that also says police (PD, Sheriff...) is still flagged.\n\n" +
"Tick Canada or United States telecoms to add their usual router names in one go (off by default). " +
"Carrier hotspots in patrol cars can carry these names too, so they won't be flagged either.")
}
diff --git a/app/src/main/java/com/rfsentinel/app/ui/AboutDialog.kt b/app/src/main/java/com/rfsentinel/app/ui/AboutDialog.kt
index d442496..05e8789 100644
--- a/app/src/main/java/com/rfsentinel/app/ui/AboutDialog.kt
+++ b/app/src/main/java/com/rfsentinel/app/ui/AboutDialog.kt
@@ -41,6 +41,7 @@ object AboutDialog {
&bull; Google Find Hub Network accessory spec; arXiv 2501.17452; AirGuard, SEEMOO / TU Darmstadt (Apache-2.0) (trackers)<br/>
&bull; European V2X (ITS-G5) frame layout after V2X2MAP by Peter Holzhauser (MIT); CAM / DENM decoded per ETSI EN 302 637-2 / -3<br/>
&bull; MT7921AU (WiFi 6E) USB driver after mt76-usb-macos by Network Weather and the Linux mt76 driver (MediaTek, Lorenzo Bianconi, Felix Fietkau; BSD-3-Clause-Clear); MediaTek firmware under its own licence<br/>
+ &bull; P25 voice (experimental): voice frame layout and IMBE vocoder ported from DSD (Copyright (C) 2010 DSD Author) and mbelib (Copyright (C) 2010 mbelib Author), ISC License (assets/licenses)<br/>
&bull; Research by ryanohoro and GainSec (Flock); Alan Meekins' DEF CON 31 talk (Axon)<br/><br/>
DedSec, fsociety and Night Vision theme font: Share Tech Mono &copy; Carrois Type Design, SIL Open Font
diff --git a/app/src/test/java/com/rfsentinel/app/detect/PoliceSsidTest.kt b/app/src/test/java/com/rfsentinel/app/detect/PoliceSsidTest.kt
index 172d3e4..1ecc9c3 100644
--- a/app/src/test/java/com/rfsentinel/app/detect/PoliceSsidTest.kt
+++ b/app/src/test/java/com/rfsentinel/app/detect/PoliceSsidTest.kt
@@ -41,4 +41,17 @@ class PoliceSsidTest {
"Firefly", "Spdnet", "Remedics", "Patrolla"))
assertNull(name, SignatureEngine.policeVehicleSsid(name))
}
+
+ @Test
+ fun ignoredNamesMatchWhereAWordStartsAndNeverHidePolice() {
+ val words = listOf("ATT", "Rogers", "Virgin")
+ for (name in listOf("ATT4ia9c2", "Rogers-5G", "MyRogers", "rogers home", "Virgin Hub 7"))
+ assertTrue(name, SignatureEngine.ignoredSsid(name, words))
+ // Inside another word: not ignored, as a plain contains would.
+ for (name in listOf("SEATTLE-FLEET", "Seattle12", "Matt's iPhone", "PATTERSON"))
+ assertTrue(name, !SignatureEngine.ignoredSsid(name, words))
+ // A name that also says police stays flagged.
+ for (name in listOf("SEATTLE-PD", "ATT-PD-12", "Virginia State Police", "Rogers Sheriff 3"))
+ assertTrue(name, !SignatureEngine.ignoredSsid(name, words))
+ }
}