71cb3ace91
Readest now shows up in the Android Auto launcher as a media app and projects the TTS media session so playback can be controlled from the car display (play/pause, previous/next sentence). - Declare the com.google.android.gms.car.application meta-data and the automotive_app_desc media capability that Android Auto requires to list the app - Make MediaPlaybackService safe to bind for browsing: audio focus, the silent keep-alive player, and the foreground notification no longer start in onCreate but on an explicit ACTIVATE_SESSION command, so a car client connecting to browse does not steal audio focus or post a phantom playing notification - Deactivate the session with an in-process call instead of stopService, which would neither run onDestroy nor clear the foreground state while a media browser keeps the service bound - Serve the current book as a playable browse item (cover downscaled to stay under the binder transaction limit) and handle onPlayFromMediaId/onPlayFromSearch - Honor the foreground service contract when MediaButtonReceiver cold-starts the service with no active session Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
258 lines
13 KiB
XML
258 lines
13 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
<uses-permission android:name="android.permission.INTERNET"/>
|
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
|
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
|
|
<uses-permission android:name="com.android.vending.BILLING" />
|
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
|
|
|
|
<!-- AndroidTV support -->
|
|
<uses-feature android:name="android.software.leanback" android:required="false" />
|
|
|
|
<application
|
|
android:icon="@mipmap/ic_launcher"
|
|
android:roundIcon="@mipmap/ic_launcher"
|
|
android:largeHeap="true"
|
|
android:enableOnBackInvokedCallback="false"
|
|
android:label="@string/app_name"
|
|
android:theme="@style/Theme.readest"
|
|
android:hardwareAccelerated="true"
|
|
android:usesCleartextTraffic="${usesCleartextTraffic}">
|
|
|
|
<!-- Android Auto: advertise the media capability so the Readest icon
|
|
shows up in the car launcher and projects the TTS media session. -->
|
|
<meta-data
|
|
android:name="com.google.android.gms.car.application"
|
|
android:resource="@xml/automotive_app_desc" />
|
|
|
|
<activity
|
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
|
android:launchMode="singleTask"
|
|
android:label="@string/main_activity_title"
|
|
android:hardwareAccelerated="true"
|
|
android:name=".MainActivity"
|
|
android:exported="true">
|
|
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
|
|
<data android:scheme="content" />
|
|
<data android:scheme="file" />
|
|
<data android:mimeType="application/epub+zip" />
|
|
<data android:mimeType="application/pdf" />
|
|
<data android:mimeType="application/fb2" />
|
|
<data android:mimeType="application/x-fb2" />
|
|
<data android:mimeType="application/mobi"/>
|
|
<data android:mimeType="application/azw"/>
|
|
<data android:mimeType="application/azw3"/>
|
|
<data android:mimeType="application/x-mobipocket-ebook" />
|
|
<data android:mimeType="application/vnd.amazon.ebook" />
|
|
<data android:mimeType="application/vnd.amazon.mobi8-ebook" />
|
|
<data android:mimeType="application/vnd.comicbook+zip" />
|
|
<data android:mimeType="application/x-cbz" />
|
|
<data android:mimeType="application/zip" />
|
|
<data android:mimeType="text/plain" />
|
|
<data android:mimeType="application/octet-stream"/>
|
|
<data android:mimeType="application/x-font-ttf"/>
|
|
<data android:mimeType="application/x-font-otf"/>
|
|
</intent-filter>
|
|
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
|
|
<data android:scheme="content" />
|
|
<data android:scheme="file" />
|
|
<data android:mimeType="*/*" />
|
|
<data android:pathPattern=".*\\.epub" />
|
|
<data android:pathPattern=".*\\.pdf" />
|
|
<data android:pathPattern=".*\\.fb2" />
|
|
<data android:pathPattern=".*\\.fb2.zip" />
|
|
<data android:pathPattern=".*\\.mobi" />
|
|
<data android:pathPattern=".*\\.azw" />
|
|
<data android:pathPattern=".*\\.azw3" />
|
|
<data android:pathPattern=".*\\.cbz" />
|
|
<data android:pathPattern=".*\\.zip" />
|
|
<data android:pathPattern=".*\\.txt" />
|
|
</intent-filter>
|
|
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND"/>
|
|
<category android:name="android.intent.category.DEFAULT"/>
|
|
<data android:mimeType="*/*"/>
|
|
</intent-filter>
|
|
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND_MULTIPLE"/>
|
|
<category android:name="android.intent.category.DEFAULT"/>
|
|
<data android:mimeType="*/*"/>
|
|
</intent-filter>
|
|
|
|
<intent-filter android:label="oauth">
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:scheme="readest" android:host="auth-callback" />
|
|
</intent-filter>
|
|
|
|
<!-- Google Drive OAuth reverse-DNS redirect (iOS-type client). Mirrors
|
|
the deep-link.mobile scheme in tauri.conf.json so the redirect
|
|
routes back even if the auto-generated section is regenerated. -->
|
|
<intent-filter android:label="gdrive-oauth">
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:scheme="com.googleusercontent.apps.209390247301-ctpmep68ppfa56r1b8tr35e4qi4p60kq" />
|
|
</intent-filter>
|
|
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN" />
|
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
<!-- AndroidTV support -->
|
|
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
|
|
</intent-filter>
|
|
<!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
|
|
<intent-filter android:autoVerify="true" >
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<!-- ChromeOS ARC++ uses a different action for deep links -->
|
|
<action android:name="org.chromium.arc.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:scheme="https" />
|
|
<data android:host="web.readest.com" />
|
|
|
|
|
|
|
|
|
|
</intent-filter>
|
|
<intent-filter >
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<!-- ChromeOS ARC++ uses a different action for deep links -->
|
|
<action android:name="org.chromium.arc.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:scheme="readest" />
|
|
|
|
|
|
|
|
|
|
|
|
</intent-filter>
|
|
<intent-filter >
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<!-- ChromeOS ARC++ uses a different action for deep links -->
|
|
<action android:name="org.chromium.arc.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:scheme="com.googleusercontent.apps.209390247301-ctpmep68ppfa56r1b8tr35e4qi4p60kq" />
|
|
|
|
|
|
|
|
|
|
|
|
</intent-filter>
|
|
<!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
|
|
<!-- tauri-file-associations. AUTO-GENERATED. DO NOT REMOVE. -->
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND" />
|
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:mimeType="application/epub+zip" />
|
|
<data android:pathPattern=".*\\.epub" />
|
|
</intent-filter>
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND" />
|
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:mimeType="application/x-mobipocket-ebook" />
|
|
<data android:pathPattern=".*\\.mobi" />
|
|
</intent-filter>
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND" />
|
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:mimeType="application/vnd.amazon.ebook" />
|
|
<data android:pathPattern=".*\\.azw" />
|
|
</intent-filter>
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND" />
|
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:mimeType="application/vnd.amazon.mobi8-ebook" />
|
|
<data android:pathPattern=".*\\.azw3" />
|
|
</intent-filter>
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND" />
|
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:mimeType="application/x-fictionbook+xml" />
|
|
<data android:pathPattern=".*\\.fb2" />
|
|
</intent-filter>
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND" />
|
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:mimeType="application/vnd.comicbook+zip" />
|
|
<data android:pathPattern=".*\\.cbz" />
|
|
</intent-filter>
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.SEND" />
|
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
|
<action android:name="android.intent.action.VIEW" />
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
<data android:mimeType="application/pdf" />
|
|
<data android:pathPattern=".*\\.pdf" />
|
|
</intent-filter>
|
|
|
|
<!-- tauri-file-associations. AUTO-GENERATED. DO NOT REMOVE. -->
|
|
</activity>
|
|
|
|
<receiver
|
|
android:name="androidx.media.session.MediaButtonReceiver"
|
|
android:exported="true">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<service
|
|
android:name="com.readest.native_tts.MediaPlaybackService"
|
|
android:foregroundServiceType="mediaPlayback"
|
|
android:exported="true">
|
|
<intent-filter>
|
|
<action android:name="android.media.browse.MediaBrowserService"/>
|
|
</intent-filter>
|
|
</service>
|
|
|
|
<provider
|
|
android:name="androidx.core.content.FileProvider"
|
|
android:authorities="${applicationId}.fileprovider"
|
|
android:exported="false"
|
|
android:grantUriPermissions="true">
|
|
<meta-data
|
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
android:resource="@xml/file_paths" />
|
|
</provider>
|
|
</application>
|
|
</manifest>
|