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
Device distances: pinpoint radius and drone distance / height / speed follow the unit too; choices named Metric · m and Imperial · ft / mi
CIS-C07fbf7cf700b5
diff --git a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.ktindex 34ded30..f0c31cb 100644--- a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt@@ -330,6 +330,15 @@ object DeviceIntel {fun formatDistance(m: Double): String = formatDistance(m, imperial)+ /** A plain length in the Device distances unit: "40 m", or "130 ft" / "0.4 mi" (no "~": for figures that are not a guess from signal strength). */+ fun length(m: Double, feet: Boolean = imperial): String = if (!feet) "${m.roundToInt()} m" else {+ val ft = m * 3.28084+ if (ft < 1000) "${ft.roundToInt()} ft" else String.format(java.util.Locale.US, "%.1f mi", m / 1609.344)+ }++ /** A speed to go with [length]: km/h, or mph with feet. */+ fun speed(ms: Double, feet: Boolean = imperial): String = if (feet) "${(ms * 2.236936).roundToInt()} mph" else "${(ms * 3.6).roundToInt()} km/h"+fun formatDistance(m: Double, feet: Boolean): String = if (!feet) when {m < 1 -> "< 1 m"m < 10 -> "~${m.roundToInt()} m"diff --git a/app/src/main/java/com/rfsentinel/app/detect/DroneProximity.kt b/app/src/main/java/com/rfsentinel/app/detect/DroneProximity.ktindex e164caf..4b029db 100644--- a/app/src/main/java/com/rfsentinel/app/detect/DroneProximity.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/DroneProximity.kt@@ -20,9 +20,9 @@ object DroneProximity {if (d > RADIUS_M) return nullval height = info.heightM ?: info.altitudeGeoMval detail = buildString {- append("Remote ID position ~${d.roundToInt()} m from you")- height?.let { append(", ${it.roundToInt()} m up") }- info.speedMs?.let { append(", ${(it * 3.6).roundToInt()} km/h") }+ append("Remote ID position ~${DeviceIntel.length(d)} from you")+ height?.let { append(", ${DeviceIntel.length(it)} up") }+ info.speedMs?.let { append(", ${DeviceIntel.speed(it)}") }info.uasId?.let { append(" (ID $it)") }}return Hit(Category.DRONE, "Drone overhead", 95, detail, "ASTM F3411 Remote ID (the drone's own GPS position)")diff --git a/app/src/main/java/com/rfsentinel/app/detect/Locator.kt b/app/src/main/java/com/rfsentinel/app/detect/Locator.ktindex 89cae07..6efae3c 100644--- a/app/src/main/java/com/rfsentinel/app/detect/Locator.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/Locator.kt@@ -187,5 +187,5 @@ object Locator {}/** "±12 m from 18 spots" */- fun describe(e: Estimate): String = "±${e.radiusM.roundToInt()} m from ${e.spots} spots you passed"+ fun describe(e: Estimate): String = "±${DeviceIntel.length(e.radiusM)} from ${e.spots} spots you passed"}diff --git a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.ktindex 4ef2096..833f7c9 100644--- a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt@@ -1251,7 +1251,7 @@ class SettingsActivity : AppCompatActivity() {"(US, UK...) and metres elsewhere; feet turn into miles past 1000 ft. Only a rough guess either way: walls and " +"bodies weaken a signal."))val group = android.widget.RadioGroup(this)- for ((key, text) in listOf("auto" to "Automatic", "m" to "Metres", "ft" to "Feet and miles")) {+ for ((key, text) in listOf("auto" to "Automatic", "m" to "Metric · m", "ft" to "Imperial · ft / mi")) {group.addView(android.widget.RadioButton(this).apply {id = View.generateViewId(); this.text = text; tag = keyisChecked = Prefs.deviceUnits(this@SettingsActivity) == keydiff --git a/app/src/test/java/com/rfsentinel/app/detect/DeviceDistanceUnitsTest.kt b/app/src/test/java/com/rfsentinel/app/detect/DeviceDistanceUnitsTest.ktindex abbcb89..f92968d 100644--- a/app/src/test/java/com/rfsentinel/app/detect/DeviceDistanceUnitsTest.kt+++ b/app/src/test/java/com/rfsentinel/app/detect/DeviceDistanceUnitsTest.kt@@ -40,4 +40,13 @@ class DeviceDistanceUnitsTest {DeviceIntel.applyUnits(ctx, Locale.US); assertTrue(DeviceIntel.imperial)DeviceIntel.applyUnits(ctx, Locale.GERMANY); assertFalse(DeviceIntel.imperial)}++ @Test+ fun pinpointAndDroneFiguresFollowTheSettingToo() {+ assertEquals("40 m", DeviceIntel.length(40.0, false)); assertEquals("131 ft", DeviceIntel.length(40.0, true))+ assertEquals("0.6 mi", DeviceIntel.length(1000.0, true))+ assertEquals("36 km/h", DeviceIntel.speed(10.0, false)); assertEquals("22 mph", DeviceIntel.speed(10.0, true))+ DeviceIntel.imperial = true+ assertEquals("±39 ft from 18 spots you passed", Locator.describe(Locator.Estimate(0.0, 0.0, 12.0, 18, 40, 100.0, 0L)))+ }}