<?xml version="1.0" encoding="utf-8"?><!--
    Copyright 2017 Thomas Schneider

    This file is a part of Fedilab

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation; either version 3 of the
    License, or (at your option) any later version.

    Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
    the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    Public License for more details.

    You should have received a copy of the GNU General Public License along with Fedilab; if not,
    see <http://www.gnu.org/licenses>
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="app.fedilab.android"
    android:installLocation="auto">


    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission
        android:name="android.permission.ACCESS_COARSE_LOCATION"
        tools:node="remove" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <application
        android:name="app.fedilab.android.activities.MainApplication"
        android:requestLegacyExternalStorage="true"
        android:allowBackup="false"
        android:hardwareAccelerated="true"
        android:icon="@mipmap/ic_launcher_bubbles"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:roundIcon="@mipmap/ic_launcher_bubbles_round"
        android:supportsRtl="true"
        android:theme="@style/AppThemeDark"
        android:usesCleartextTraffic="true"
        tools:replace="android:allowBackup">

        <service
            android:name="app.fedilab.android.services.LiveNotificationDelayedService"
            android:exported="false" />
        <service
            android:name="app.fedilab.android.services.LiveNotificationService"
            android:exported="false" />
        <service
            android:name="app.fedilab.android.services.BackupStatusService"
            android:exported="false" />
        <service
            android:name="app.fedilab.android.services.BackupStatusInDataBaseService"
            android:exported="false" />
        <service
            android:name="app.fedilab.android.services.BackupNotificationInDataBaseService"
            android:exported="false" />

        <receiver android:name=".services.UpgradeReceiver">
            <intent-filter>
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="app.fedilab.android.services.RestartLiveNotificationReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="app.fedilab.android.services.PeertubeUploadReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="app.fedilab.android.uploadservice.broadcast.status" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="app.fedilab.android.services.StopLiveNotificationReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="StopLiveNotificationReceiver" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="app.fedilab.android.services.StopDelayedNotificationReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="StopDelayedNotificationReceiver" />
            </intent-filter>
        </receiver>
        <service
            android:name="app.fedilab.android.services.StreamingHomeTimelineService"
            android:exported="false" />
        <service
            android:name="app.fedilab.android.services.StreamingFederatedTimelineService"
            android:exported="false" />
        <service
            android:name="app.fedilab.android.services.StreamingLocalTimelineService"
            android:exported="false" />
        <service
            android:name="app.fedilab.android.services.DownloadTrackingDBScriptsService"
            android:exported="false" />
        <activity
            android:name="app.fedilab.android.activities.MainActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:launchMode="singleTask"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
                <data android:mimeType="video/*" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
                <data android:mimeType="video/*" />
            </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" />
                <!-- The app is a good candidate for URL in https://domain.name/@xxxxxx-->
                <!-- It should cover every URLs for statuses but some others not related to mastodon matching this scheme -->
                <data
                    android:host="*"
                    android:pathPrefix="/@"
                    android:scheme="https" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="file" />
                <data android:mimeType="*/*" />
                <data android:host="*" />
                <data android:pathPattern=".*\\.fedilab" />
            </intent-filter>
        </activity>



        <activity-alias
            android:name=".activities.MainActivity.Fediverse"
            android:enabled="false"
            android:icon="@mipmap/ic_launcher_fediverse"
            android:roundIcon="@mipmap/ic_launcher_fediverse_round"
            android:targetActivity=".activities.MainActivity">
            <meta-data
                android:name="icon"
                android:value="fediverse" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>

        <activity-alias
            android:name=".activities.MainActivity.Hero"
            android:enabled="false"
            android:icon="@mipmap/ic_launcher_hero"
            android:roundIcon="@mipmap/ic_launcher_hero_round"
            android:targetActivity=".activities.MainActivity">
            <meta-data
                android:name="icon"
                android:value="hero" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>

        <activity-alias
            android:name=".activities.MainActivity.Atom"
            android:enabled="false"
            android:icon="@mipmap/ic_launcher_atom"
            android:roundIcon="@mipmap/ic_launcher_atom_round"
            android:targetActivity=".activities.MainActivity">
            <meta-data
                android:name="icon"
                android:value="atom" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>

        <activity-alias
            android:name=".activities.MainActivity.BrainCrash"
            android:enabled="false"
            android:icon="@mipmap/ic_launcher_crash"
            android:roundIcon="@mipmap/ic_launcher_crash_round"
            android:targetActivity=".activities.MainActivity">
            <meta-data
                android:name="icon"
                android:value="braincrash" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>

        <activity-alias
            android:name=".activities.MainActivity.Mastalab"
            android:enabled="false"
            android:icon="@mipmap/ic_launcher_mastalab"
            android:roundIcon="@mipmap/ic_launcher_mastalab_round"
            android:targetActivity=".activities.MainActivity">
            <meta-data
                android:name="icon"
                android:value="mastalab" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>


        <activity
            android:name="app.fedilab.android.activities.MastodonRegisterActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.PeertubeRegisterActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.MastodonShareRegisterActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden">
            <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:host="fedilab.app"
                    android:pathPattern="/registration_helper/.*"
                    android:scheme="https" />
            </intent-filter>
        </activity>
        <activity
            android:name="app.fedilab.android.activities.LoginActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden">
            <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:host="backtomastalab"
                    android:scheme="mastalab" />
            </intent-filter>
        </activity>
        <activity
            android:name="app.fedilab.android.activities.ShowAccountActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.TootInfoActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.HashTagActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.WebviewConnectActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
          />
        <activity
            android:name="app.fedilab.android.activities.PeertubeActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
             />
        <activity
            android:name="app.fedilab.android.activities.PlaylistsActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"

            android:theme="@style/AppThemeDark_NoActionBar" />
        <activity
            android:name=".activities.WebviewActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
          />
        <activity
            android:name="app.fedilab.android.activities.SlideMediaActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:launchMode="singleTask"
            android:noHistory="true"
            android:theme="@style/TransparentDark" />
        <activity
            android:name="app.fedilab.android.activities.SearchResultActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.SearchResultTabActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.ListActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.WhoToFollowActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.ShowConversationActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.AboutActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.BookmarkActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.SettingsActivity"
            android:configChanges="orientation|screenSize"
            android:launchMode="singleTop"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.AdminActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.AccountReportActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.ReorderTimelinesActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.PartnerShipActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.InstanceActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.PrivacyActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.TootActivity"
            android:configChanges="orientation|screenSize"
            android:fitsSystemWindows="true"
            android:launchMode="singleTop"
            android:theme="@style/AppThemeDark"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name="app.fedilab.android.activities.PixelfedComposeActivity"
            android:configChanges="orientation|screenSize"
            android:fitsSystemWindows="true"
            android:launchMode="singleTop"
            android:theme="@style/AppThemeDark"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.EditProfileActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.CustomSharingActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.InstanceHealthActivity"
            android:excludeFromRecents="true"
            android:theme="@style/Base.V7.Theme.AppCompat.Dialog" />
        <activity
            android:name="app.fedilab.android.activities.InstanceProfileActivity"
            android:excludeFromRecents="true"
            android:theme="@style/Base.V7.Theme.AppCompat.Dialog" />
        <activity
            android:name="app.fedilab.android.activities.ProxyActivity"
            android:excludeFromRecents="true"
            android:theme="@style/Base.V7.Theme.AppCompat.Dialog" />
        <activity
            android:name="app.fedilab.android.activities.ManageAccountsInListActivity"
            android:excludeFromRecents="true"
            android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name="app.fedilab.android.activities.TagCacheActivity"
            android:excludeFromRecents="true"
            android:theme="@style/Base.V7.Theme.AppCompat.Dialog" />
        <activity
            android:name="app.fedilab.android.activities.PeertubeUploadActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.LiveNotificationSettingsAccountsActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.MutedInstanceActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.PeertubeEditUploadActivity"
            android:configChanges="orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden" />
        <activity
            android:name="app.fedilab.android.activities.GroupActivity"
            android:configChanges="orientation|screenSize"
            android:theme="@style/AppThemeDark_NoActionBar"
            android:windowSoftInputMode="stateAlwaysHidden" />

        <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>