Recently Written · git

subread-overlay

Shows the lines of an .srt over any Android media player, in time with it. Tap a word to look it up.

git clone https://github.com/equwal/subread-overlay

Log | Files | Refs


commit 68dbeb567c7baf3e75d26221f44c22f10d196998
equwal <truex@equwal.com>
2026-09-21 16:48:55 -0700

Let a debug build install next to the release

The authority of the provider follows the application id. The debug
build had the same authority as the release, so Android refused to
install it while the release was on the device, and the device tests
could not run. The exported provider is by design: lint is told so.

 app/src/main/AndroidManifest.xml                            | 8 +++++---
 app/src/main/kotlin/space/subread/overlay/PlayerProvider.kt | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 5f8f6f6..7ac6975 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools">
 
     <!-- The subtitle line is drawn over the media player. No network permission: nothing leaves the device. -->
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
@@ -40,8 +41,9 @@
         -->
         <provider
             android:name=".PlayerProvider"
-            android:authorities="space.subread.overlay.player"
-            android:exported="true" />
+            android:authorities="${applicationId}.player"
+            android:exported="true"
+            tools:ignore="ExportedContentProvider" />
 
         <service
             android:name=".MediaListener"
diff --git a/app/src/main/kotlin/space/subread/overlay/PlayerProvider.kt b/app/src/main/kotlin/space/subread/overlay/PlayerProvider.kt
index 26e8fdc..5769cfd 100644
--- a/app/src/main/kotlin/space/subread/overlay/PlayerProvider.kt
+++ b/app/src/main/kotlin/space/subread/overlay/PlayerProvider.kt
@@ -83,7 +83,8 @@ class PlayerProvider : ContentProvider() {
     override fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?): Int = 0
 
     companion object {
-        const val AUTHORITY = "space.subread.overlay.player"
+        // The debug build has its own authority, so it installs next to the release.
+        const val AUTHORITY = BuildConfig.APPLICATION_ID + ".player"
         const val COLUMN_STATE = "state"
         const val METHOD_PLAY = "play"
         const val METHOD_PAUSE = "pause"