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
Test voice follows the short-alerts switch, Exclude AirTags option for Trackers, map hides cell towers unless on All or Cells
CIS-C0b2702a8d75ed
diff --git a/app/src/main/java/com/rfsentinel/app/RFSentinelApp.kt b/app/src/main/java/com/rfsentinel/app/RFSentinelApp.ktindex b5e45ab..a7b63de 100644--- a/app/src/main/java/com/rfsentinel/app/RFSentinelApp.kt+++ b/app/src/main/java/com/rfsentinel/app/RFSentinelApp.kt@@ -25,6 +25,7 @@ class RFSentinelApp : Application() {override fun onCreate() {super.onCreate()+ com.rfsentinel.app.ui.DeviceFilter.excludeAirTags = com.rfsentinel.app.util.Prefs.excludeAirTags(this)com.rfsentinel.app.ui.ThemeManager.install(this)com.rfsentinel.app.ui.ScreenAwake.install(this)registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {diff --git a/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt b/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.ktindex 88b6c9b..f68a541 100644--- a/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt@@ -19,6 +19,12 @@ import java.util.UUID*/object SignatureEngine {+ const val APPLE_FIND_MY_LABEL = "Apple Find My tracker away from its owner (AirTag or compatible)"++ /** An Apple Find My tag match (AirTag or compatible), for Settings > Exclude AirTags. */+ fun isAppleFindMy(hit: Hit) = hit.category == Category.TRACKER && hit.label.startsWith("Apple Find My")++private const val ACAB = "all-cameras-are-beacons signature reference (Apache-2.0)"private const val SIG = "Bluetooth SIG assigned numbers"private const val IEEE = "IEEE registry"@@ -218,7 +224,7 @@ object SignatureEngine {// ---- Trackers separated from their owner ----------------------------a.manufacturerData[CID_APPLE]?.let { d ->if (d.size >= 2 && Bytes.u8(d, 0) == 0x12 && Bytes.u8(d, 1) == 0x19) {- hits += Hit(Category.TRACKER, "Apple Find My tracker away from its owner (AirTag or compatible)", 70,+ hits += Hit(Category.TRACKER, APPLE_FIND_MY_LABEL, 70,"Apple Find My offline-finding frame (type 0x12, length 0x19 = separated state)","$ACAB; arXiv 2501.17452")}diff --git a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.ktindex 36f72ce..a10bbd4 100644--- a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt+++ b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt@@ -523,7 +523,10 @@ class ScanForegroundService : Service() {DeviceRegistry.inheritedHits(a.mac) +listOfNotNull(DeviceRegistry.clusterHit(a.mac, now)) +espHits[a.mac]?.takeIf { now - it.first < ESP_HIT_TTL_MS }?.second.orEmpty()- val hits = EvidenceFusion.fuse(raw.filter { Prefs.categoryEnabled(this, it.category) })+ val noAirTags = Prefs.excludeAirTags(this)+ val hits = EvidenceFusion.fuse(raw.filter {+ Prefs.categoryEnabled(this, it.category) && !(noAirTags && SignatureEngine.isAppleFindMy(it))+ })return Classified(now, hits, identity, vendor)}diff --git a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.ktindex 321c740..f1744e9 100644--- a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt@@ -35,6 +35,7 @@ class SettingsActivity : AppCompatActivity() {private var stopObservingPrefetch: (() -> Unit)? = nullprivate var stopObservingDeflock: (() -> Unit)? = nullprivate val categorySwitches = mutableMapOf<Category, SwitchMaterial>()+ private var airTagSwitch: SwitchMaterial? = nullprivate val bannerPicker = registerForActivityResult(androidx.activity.result.contract.ActivityResultContracts.GetContent()@@ -137,7 +138,10 @@ class SettingsActivity : AppCompatActivity() {val current = Prefs.voiceRate(this)binding.voiceRateGroup.check(rates.minByOrNull { kotlin.math.abs(it.value - current) }!!.key)binding.voiceRateGroup.setOnCheckedChangeListener { _, id -> rates[id]?.let { Prefs.setVoiceRate(this, it) } }- binding.voiceTestButton.setOnClickListener { com.rfsentinel.app.util.AlertPlayer.testVoice(this) }+ // Tests what is on screen (Settings save when you leave), so the short switch counts right away.+ binding.voiceTestButton.setOnClickListener {+ com.rfsentinel.app.util.AlertPlayer.testVoice(this, binding.shortVoiceSwitch.isChecked)+ }fun label(v: android.speech.tts.Voice, i: Int) ="${v.locale.getDisplayCountry(java.util.Locale.ENGLISH).ifEmpty { "English" }} · voice ${i + 1}" +@@ -168,7 +172,7 @@ class SettingsActivity : AppCompatActivity() {// Each pick is spoken right away so you can compare.Prefs.setVoiceName(this, if (which == 0) null else list[which - 1].name)voice.voiceChanged(this)- com.rfsentinel.app.util.AlertPlayer.testVoice(this)+ com.rfsentinel.app.util.AlertPlayer.testVoice(this, binding.shortVoiceSwitch.isChecked)showVoice()}.setPositiveButton("Done", null)@@ -355,6 +359,16 @@ class SettingsActivity : AppCompatActivity() {}binding.categoryContainer.addView(sw)categorySwitches[c] = sw+ if (c == Category.TRACKER) {+ airTagSwitch = SwitchMaterial(this).apply {+ text = "Exclude Apple AirTags (Find My tags) from Trackers"+ isChecked = Prefs.excludeAirTags(this@SettingsActivity)+ setPadding((24 * resources.displayMetrics.density).toInt(), 0, 0, 0)+ isEnabled = sw.isChecked+ }+ sw.setOnCheckedChangeListener { _, on -> airTagSwitch?.isEnabled = on }+ binding.categoryContainer.addView(airTagSwitch)+ }}val enabledPresets = OuiWatchlist.getEnabledPresets(this)binding.presetGlobal.isChecked = "global" in enabledPresets@@ -580,6 +594,7 @@ class SettingsActivity : AppCompatActivity() {Prefs.setCarAutoStart(this, binding.carAutoSwitch.isChecked)categorySwitches.forEach { (c, sw) -> Prefs.setCategoryEnabled(this, c, sw.isChecked) }+ airTagSwitch?.let { Prefs.setExcludeAirTags(this, it.isChecked) }val presets = mutableSetOf<String>()if (binding.presetGlobal.isChecked) presets.add("global")if (binding.presetCanada.isChecked) presets.add("canada")diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.ktindex caa8039..a0378a8 100644--- a/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt@@ -24,8 +24,8 @@ enum class DeviceFilter(val label: String) {fun matches(s: DeviceRegistry.Snapshot): Boolean = when (this) {ALL -> trueFLAGGED -> s.best != null && !WhitelistCache.contains(s.mac)- TRACKERS -> s.hits.any { it.category == Category.TRACKER } ||- s.deviceType.contains("tracker", true) || s.deviceType.contains("Find My", true)+ 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 != nullNEW -> s.isNewCELLS -> false@@ -36,6 +36,13 @@ enum class DeviceFilter(val label: String) {}companion object {+ /** Settings > Exclude Apple AirTags: kept here so the list and map filters needn't read prefs per device. */+ @Volatile var excludeAirTags = false++ 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) }+fun parse(name: String?) = entries.firstOrNull { it.name == name } ?: ALL}}diff --git a/app/src/main/java/com/rfsentinel/app/ui/MapActivity.kt b/app/src/main/java/com/rfsentinel/app/ui/MapActivity.ktindex 5074365..e28c46b 100644--- a/app/src/main/java/com/rfsentinel/app/ui/MapActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/ui/MapActivity.kt@@ -652,8 +652,10 @@ class MapActivity : AppCompatActivity() {private fun drawTowers() {towerCount = com.rfsentinel.app.service.CellTowerStore.all(this).count { it.bestLat != null }- // The Cells chip shows the towers (only them); otherwise the map menu's switch decides.- val show = filter == DeviceFilter.CELLS || com.rfsentinel.app.util.Prefs.showCellTowers(this)+ // The Cells chip shows the towers (only them); All adds them when the map menu's switch is on;+ // every other chip hides them.+ val show = filter == DeviceFilter.CELLS ||+ (filter == DeviceFilter.ALL && com.rfsentinel.app.util.Prefs.showCellTowers(this))towers.points = if (tripId != null || !show) emptyList()else com.rfsentinel.app.service.CellTowerStore.all(this).filter { it.bestLat != null }.map {PointsOverlay.Point(it.bestLat!!, it.bestLon!!, it, icon = towerIcon)diff --git a/app/src/main/java/com/rfsentinel/app/util/AlertPlayer.kt b/app/src/main/java/com/rfsentinel/app/util/AlertPlayer.ktindex 24e0ee3..c0f9e95 100644--- a/app/src/main/java/com/rfsentinel/app/util/AlertPlayer.kt+++ b/app/src/main/java/com/rfsentinel/app/util/AlertPlayer.kt@@ -99,8 +99,8 @@ object AlertPlayer {}/** The Settings "Test voice" button: speaks right away with the chosen voice and speed. */- fun testVoice(context: Context) {- Voice.test(context.applicationContext, "RF Sentinel voice alerts. Axon body camera nearby.",+ fun testVoice(context: Context, short: Boolean = Prefs.shortVoice(context)) {+ Voice.test(context.applicationContext, if (short) "Body cam" else "RF Sentinel voice alerts. Axon body camera nearby.",if (CarState.connected) carSpeechAttributes else phoneSpeechAttributes)}diff --git a/app/src/main/java/com/rfsentinel/app/util/Prefs.kt b/app/src/main/java/com/rfsentinel/app/util/Prefs.ktindex db91ed8..f584a16 100644--- a/app/src/main/java/com/rfsentinel/app/util/Prefs.kt+++ b/app/src/main/java/com/rfsentinel/app/util/Prefs.kt@@ -149,6 +149,13 @@ object Prefs {fun shortVoice(context: Context): Boolean = bool(context, "short_voice", false)fun setShortVoice(context: Context, value: Boolean) = setBool(context, "short_voice", value)+ /** Leave Apple Find My tags (AirTags and compatible) out of the Trackers category. */+ fun excludeAirTags(context: Context): Boolean = bool(context, "exclude_airtags", false)+ fun setExcludeAirTags(context: Context, value: Boolean) {+ setBool(context, "exclude_airtags", value)+ com.rfsentinel.app.ui.DeviceFilter.excludeAirTags = value+ }+/** Alert each time the phone switches to another serving cell tower (off by default: frequent while driving). */fun cellChangeAlerts(context: Context): Boolean = bool(context, "cell_change_alerts", false)fun setCellChangeAlerts(context: Context, value: Boolean) = setBool(context, "cell_change_alerts", value)