From 2895e0905dd95e8709c3e1e95b7397aa63cac0d3 Mon Sep 17 00:00:00 2001 From: Michatec Date: Mon, 16 Nov 2026 13:39:31 +0100 Subject: [PATCH] feat: require custom CONTROL_RADIO permission for RadioApiService - Define `com.michatec.radio.permission.CONTROL_RADIO` permission in `AndroidManifest.xml` and protect `RadioApiService`. - Add localized string resources for the new IPC permission label and description. - Update AIDL and REST API documentation with permission requirements and WebSocket schemas. - Update bug report template and README links. --- .github/ISSUE_TEMPLATE/bug_report.md | 16 ++++----- README.md | 17 +++++----- app/src/main/AndroidManifest.xml | 9 ++++- app/src/main/res/values-da/strings.xml | 3 ++ app/src/main/res/values-de/strings.xml | 4 +++ app/src/main/res/values-el/strings.xml | 3 ++ app/src/main/res/values-fr/strings.xml | 3 ++ app/src/main/res/values-ja/strings.xml | 3 ++ app/src/main/res/values-nl/strings.xml | 3 ++ app/src/main/res/values-pl/strings.xml | 3 ++ app/src/main/res/values-ru/strings.xml | 3 ++ app/src/main/res/values-uk/strings.xml | 3 ++ app/src/main/res/values/strings.xml | 4 +++ docs/AIDL_API.md | 38 +++++++++++---------- docs/API_DOC.md | 2 ++ docs/REST_API.md | 47 ++++++++++++++++++++++---- 16 files changed, 119 insertions(+), 42 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea7..dbd4b97 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -23,16 +23,14 @@ A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] +**Device & OS:** + - Device: [e.g. Google Pixel 8, Android TV, Chromecast with Google TV] + - OS / Android Version: [e.g. Android 14, Android TV 12] + - Radio App Version: [e.g. 15.2] -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] +**Web Remote Control (if applicable):** + - OS: [e.g. Windows 11, macOS, Linux] + - Browser: [e.g. Chrome 122, Firefox 123] **Additional context** Add any other context about the problem here. diff --git a/README.md b/README.md index 568bd30..95bdb2d 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ ### ℹ️ About Radio **Radio is an application with a minimalist approach to listening to radio over the Internet.**
**Radio only offers a basic search option, and it imports audio streaming links when you tap them in a web browser.**
-**Radio 15.1+ features support for Android TV and Google Cast, along with a Web Control interface and a developer API.**
-**Pull request are welcome at any time.**
+**Radio 15.1+ features support for Android TV and Google Cast, along with a Web Control interface and a developer API.**
+**Pull requests are welcome at any time.**
**Radio is free software. It is released under the [GPLv3 open source license](https://opensource.org/licenses/GPL-3.0).** @@ -49,8 +49,8 @@ Since the developers of this app do not agree to this requirement, this app will
💡 Frequent Questions
-Q: How can I add a radio station -A: There are three ways to add a radio station to Radio: Use Search, add playlist file address (M3U, PLS), enter a raw stream address. The last way will not support the update feature. +Q: How can I add a radio station? +A: There are three ways to add a radio station to Radio: Use Search, add a playlist file address (M3U, PLS), or enter a raw stream address. The last way will not support the update feature. ------------------------------------------------------------------------- @@ -60,8 +60,8 @@ A: The update feature will try to fetch the current stream address of a station ------------------------------------------------------------------------- Q: Where do the radio station search results come from? -A: Radio searches the [radio-browser.info](http://www.radio-browser.info/) online database. -You can help out the radio-browser.info community by [adding the missing station](http://www.radio-browser.info/gui/#!/add) to their database. +A: Radio searches the [radio-browser.info](https://www.radio-browser.info/) online database. +You can help out the radio-browser.info community by [adding the missing station](https://www.radio-browser.info/add) to their database.
---------------------------------------- @@ -115,6 +115,7 @@ Starting with version **15.2**, Radio exposes an AIDL-based API (`com.michatec.r - **Package:** `com.michatec.radio` - **Service:** `com.michatec.radio.api.RadioApiService` - **AIDL Interface:** `com.michatec.radio.api.IRadioApi` +- **Permission:** `com.michatec.radio.permission.CONTROL_RADIO` **Available features:** - Play, pause, stop and check playback state @@ -157,7 +158,7 @@ When **Edit Stations** is enabled: **General TV** Controls: - Press **0** or **DEL** to remove the selected radio station -- Press **1** or **SPACE** to make the selected radio station favourite +- Press **1** or **SPACE** to make the selected radio station favorite - Press **2** or **PLUS** to reorder the selected radio station @@ -167,7 +168,7 @@ When **Edit Stations** is enabled:
📜️ Credit -- [Radio Browser](http://www.radio-browser.info/) for providing the radio station database +- [Radio Browser](https://www.radio-browser.info/) for providing the radio station database - [AndroidX Leanback](https://developer.android.com/jetpack/androidx/releases/leanback) for providing the Android TV UI components - Michatec for developing the app and maintaining the project diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 228751b..00519d9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,6 +23,13 @@ + + + @@ -168,7 +175,7 @@ android:name=".api.RadioApiService" android:enabled="true" android:exported="true" - tools:ignore="ExportedService"> + android:permission="com.michatec.radio.permission.CONTROL_RADIO"> diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 328e610..e9a6ccd 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -1,5 +1,8 @@ + + Styr Radio-afspilning + Tillader programmer at styre Radio-afspilning, læse stationslister og modtage afspilningsstatus via IPC. App-ikon i form af en gammel radio diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 3575437..9bf0d68 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -1,6 +1,10 @@ + + Radio-Wiedergabe steuern + Ermöglicht Apps die Steuerung der Radio-Wiedergabe, das Auslesen von Senderlisten und den Empfang des Wiedergabestatus über IPC. + App-Symbol in der Form eines alten Radios Start/Stopp diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 215ad2e..857f923 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -1,5 +1,8 @@ + + Έλεγχος αναπαραγωγής Radio + Επιτρέπει σε εφαρμογές να ελέγχουν την αναπαραγωγή, να διαβάζουν λίστες σταθμών και να λαμβάνουν κατάσταση αναπαραγωγής μέσω IPC. Εικονίδιο εφαρμογής που απεικονίζει παλιό ραδιόφωνο diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index aadb2b7..7115a51 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1,5 +1,8 @@ + + Contrôler la lecture Radio + Permet aux applications de contrôler la lecture Radio, de lire la liste des stations et de recevoir l\état de lecture via IPC. Icône de lapplication en forme dancienne radio diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index d2afbf9..1078a96 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -1,5 +1,8 @@ + + Radioの再生を制御 + アプリがIPCを介してRadioの再生を制御し、局リストを読み取り、再生状態を受信できるようにします。 昔のラジオの形をしたアプリアイコン diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 2d1d76d..e09bc1f 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -1,5 +1,8 @@ + + Radio-afspelen bedienen + Stelt apps in staat om het afspelen van Radio te bedienen, zenderlijsten te lezen en de afspeelstatus via IPC te ontvangen. App icoon die een oude radio afbeeld diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 91dbf08..1b94949 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -1,5 +1,8 @@ + + Sterowanie odtwarzaniem Radio + Zezwala aplikacjom na sterowanie odtwarzaniem Radio, odczytywanie list stacji i odbieranie stanu odtwarzania przez IPC. Ikona aplikacji przedstawiająca stare radio diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 5b361a0..1f7fb0f 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -1,5 +1,8 @@ + + Управление воспроизведением Radio + Позволяет приложениям управлять воспроизведением Radio, читать списки станций и получать статус воспроизведения через IPC. Значок приложения с изображением старого радио diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 58d65bc..14cef26 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -1,5 +1,8 @@ + + Керування відтворенням Radio + Дозволяє програмам керувати відтворенням Radio, читати списки станцій та отримувати статус відтворення через IPC. Значок застосунку із зображенням старого радіо diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5f68686..87d1a3c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -4,6 +4,10 @@ \"Blue\" Radio + + Control Radio playback + Allows applications to control Radio playback, read station lists, and receive playback status via IPC. + App icon depicting an old radio Play/stop diff --git a/docs/AIDL_API.md b/docs/AIDL_API.md index 9c78eff..f47fb42 100644 --- a/docs/AIDL_API.md +++ b/docs/AIDL_API.md @@ -9,6 +9,7 @@ This documentation describes the Android Interface Definition Language (AIDL) AP - **Package Name:** `com.michatec.radio` - **Service Class:** `com.michatec.radio.api.RadioApiService` - **AIDL Interface:** `com.michatec.radio.api.IRadioApi` +- **Permission:** `com.michatec.radio.permission.CONTROL_RADIO` --- @@ -34,19 +35,19 @@ interface IRadioApi { ### Method Summary -| Method | Return Type | Description | -|:---------------------------------|:------------|:----------------------------------------------------------------------| -| `play()` | `void` | Resumes or starts audio playback. | -| `pause()` | `void` | Pauses audio playback. | -| `stop()` | `void` | Stops audio playback and releases player resources. | -| `isPlaying()` | `boolean` | Returns `true` if audio is currently playing, `false` otherwise. | -| `getCurrentStationName()` | `String` | Returns the display name of the currently active radio station. | -| `getCurrentMetadata()` | `String` | Returns current track metadata/artist info (if available). | -| `playStationByUuid(String uuid)` | `void` | Switches to and plays the radio station matching the specified UUID. | -| `getSavedStationsJson()` | `String` | Returns a JSON array string containing all saved radio stations. | -| `getFavoriteStationsJson()` | `String` | Returns a JSON array string containing all starred/favorite stations. | -| `getCurrentStationImage()` | `byte[]` | Returns raw image bytes of the currently active station cover art. | -| `getStationImageByUuid(String)` | `byte[]` | Returns raw image bytes for the station cover art matching the UUID. | +| Method | Return Type | Description | +|:-------------------------------------|:------------|:----------------------------------------------------------------------| +| `play()` | `void` | Resumes or starts audio playback. | +| `pause()` | `void` | Pauses audio playback. | +| `stop()` | `void` | Stops audio playback and releases player resources. | +| `isPlaying()` | `boolean` | Returns `true` if audio is currently playing, `false` otherwise. | +| `getCurrentStationName()` | `String` | Returns the display name of the currently active radio station. | +| `getCurrentMetadata()` | `String` | Returns current track metadata/artist info (if available). | +| `playStationByUuid(String uuid)` | `void` | Switches to and plays the radio station matching the specified UUID. | +| `getSavedStationsJson()` | `String` | Returns a JSON array string containing all saved radio stations. | +| `getFavoriteStationsJson()` | `String` | Returns a JSON array string containing all starred/favorite stations. | +| `getCurrentStationImage()` | `byte[]` | Returns raw image bytes of the currently active station cover art. | +| `getStationImageByUuid(String uuid)` | `byte[]` | Returns raw image bytes for the station cover art matching the UUID. | --- @@ -55,16 +56,19 @@ interface IRadioApi { To control the Radio app from another Android application, follow these steps: ### 1. Declare Required Permission & Queries in `AndroidManifest.xml` -In your client application's `src/main/AndroidManifest.xml`, declare the custom permission required to bind to `RadioApiService`. If targeting Android 11 (API 30) or higher, also include a `` declaration to ensure package visibility: +In your client application's `src/main/AndroidManifest.xml`, declare the custom permission `com.michatec.radio.permission.CONTROL_RADIO`. If targeting Android 11 (API 30) or higher, also include a `` declaration to ensure package visibility: ```xml + + + - + @@ -251,12 +255,12 @@ class MyActivity : AppCompatActivity() { radioController.connect() // Example: Play button click - findViewById