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
Release 2.13.1: in-app update download no longer stalls
CIS-C05846da7bcd27
diff --git a/app/build.gradle.kts b/app/build.gradle.ktsindex 2d204c4..977fc7f 100644--- a/app/build.gradle.kts+++ b/app/build.gradle.kts@@ -6,8 +6,8 @@ plugins {}// Bump both for every release. versionName ends up in the APK file name.-val appVersionCode = 32-val appVersionName = "2.13.0"+val appVersionCode = 33+val appVersionName = "2.13.1"// Release signing credentials live in keystore.properties (git-ignored).// Without that file, release builds are produced unsigned.diff --git a/app/src/main/java/com/rfsentinel/app/util/UpdateChecker.kt b/app/src/main/java/com/rfsentinel/app/util/UpdateChecker.ktindex 39abf73..9d9fffc 100644--- a/app/src/main/java/com/rfsentinel/app/util/UpdateChecker.kt+++ b/app/src/main/java/com/rfsentinel/app/util/UpdateChecker.kt@@ -76,7 +76,7 @@ object UpdateChecker {AlertDialog.Builder(activity).setTitle("RF Sentinel ${latest.version} is available").setMessage("You have $current. Download the new APK and install it over this one - your history and settings are kept.")- .setPositiveButton("Download") { _, _ -> open(activity, latest.apkUrl ?: latest.notesUrl) }+ .setPositiveButton("Download") { _, _ -> download(activity, latest) }.setNeutralButton("What's new") { _, _ -> open(activity, latest.notesUrl) }.setNegativeButton("Later", null).show()@@ -90,6 +90,27 @@ object UpdateChecker {}}+ /**+ * Downloads the APK with Android's download manager into Downloads. Handing the APK link+ * to the browser instead stalls at 100% in Chrome: a download started by another app+ * waits on Chrome's "this file can be harmful" check, whose prompt never shows. Tapping+ * the finished-download notification opens the installer. Falls back to the browser.+ */+ private fun download(activity: AppCompatActivity, latest: Latest) {+ val url = latest.apkUrl ?: return open(activity, latest.notesUrl)+ val queued = runCatching {+ val dm = activity.getSystemService(android.app.DownloadManager::class.java)!!+ dm.enqueue(android.app.DownloadManager.Request(Uri.parse(url))+ .setTitle("RF Sentinel ${latest.version}")+ .setDescription("Update - tap when done to install")+ .setMimeType("application/vnd.android.package-archive")+ .setNotificationVisibility(android.app.DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)+ .setDestinationInExternalPublicDir(android.os.Environment.DIRECTORY_DOWNLOADS, url.substringAfterLast('/')))+ }.isSuccess+ if (queued) Toast.makeText(activity, "Downloading RF Sentinel ${latest.version}… when it's done, tap its notification (or the file in Downloads) to install", Toast.LENGTH_LONG).show()+ else open(activity, url)+ }+private fun open(activity: AppCompatActivity, url: String) {runCatching { activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url))) }}