<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="app.fedilab.android">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

    <application
        android:name=".MainApplication"
        android:allowBackup="false"
        android:configChanges="orientation|screenSize"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppThemeDark"
        android:usesCleartextTraffic="true"
        tools:replace="android:allowBackup">
        <activity
            android:name=".activities.MainActivity"
            android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <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>
        </activity>

        <activity
            android:name=".activities.LoginActivity"
            android:configChanges="orientation|screenSize"
            android:exported="true"
            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="backtofedilab"
                    android:scheme="fedilab" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.WebviewConnectActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.ContextActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.DraftActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".imageeditor.EditImageActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.ComposeActivity"
            android:configChanges="orientation|screenSize"
            android:label="@string/compose" />
        <activity
            android:name=".activities.StatusInfoActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.FollowRequestActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.WebviewActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.ProfileActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/account" />
        <activity
            android:name=".activities.AdminAccountActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/account" />
        <activity
            android:name=".activities.ScheduledActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/scheduled" />
        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat" />


        <activity
            android:name=".activities.SearchResultTabActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/search"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.TrendsActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/trending"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.ReorderTimelinesActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/reorder_timelines"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.AboutActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/action_about"
            android:theme="@style/AppThemeBar" />

        <activity
            android:name=".activities.PartnerShipActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/action_about"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.ActionActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/interactions"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.AdminActionActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/administration"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.MastodonListActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/action_lists"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.SettingsActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/settings"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.InstanceActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/action_about_instance"
            android:theme="@style/DialogDark" />
        <activity
            android:name=".activities.InstanceProfileActivity"
            android:excludeFromRecents="true"
            android:theme="@style/DialogDark" />
        <activity
            android:name=".activities.ProxyActivity"
            android:excludeFromRecents="true"
            android:theme="@style/DialogDark" />
        <activity
            android:name=".activities.HashTagActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.AnnouncementActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
        <activity
            android:name=".activities.MediaActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/TransparentDark" />

        <activity
            android:name=".activities.InstanceHealthActivity"
            android:excludeFromRecents="true"
            android:theme="@style/DialogDark" />

        <activity
            android:name=".activities.ReportActivity"
            android:theme="@style/AppThemeBarDark"
            android:windowSoftInputMode="stateVisible" />

        <activity
            android:name=".activities.CustomSharingActivity"
            android:label="@string/settings_title_custom_sharing"
            android:theme="@style/AppThemeBarDark"
            android:windowSoftInputMode="stateVisible" />
        <activity
            android:name=".activities.FilterActivity"
            android:label="@string/filters"
            android:theme="@style/AppThemeBarDark"
            android:windowSoftInputMode="stateVisible" />
        <activity
            android:name=".activities.EditProfileActivity"
            android:label="@string/edit_profile"
            android:theme="@style/AppThemeBarDark"
            android:windowSoftInputMode="stateVisible" />

        <activity
            android:name=".activities.CacheActivity"
            android:label="@string/action_cache"
            android:theme="@style/AppThemeBarDark" />

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

        <receiver
            android:name=".broadcastreceiver.ToastMessage"
            android:exported="false">
            <intent-filter>
                <action android:name="RECEIVE_TOAST_MESSAGE" />
            </intent-filter>
        </receiver>

        <receiver
            android:name=".services.CustomReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="org.unifiedpush.android.connector.MESSAGE" />
                <action android:name="org.unifiedpush.android.connector.UNREGISTERED" />
                <action android:name="org.unifiedpush.android.connector.NEW_ENDPOINT" />
                <action android:name="org.unifiedpush.android.connector.REGISTRATION_FAILED" />
                <action android:name="org.unifiedpush.android.connector.REGISTRATION_REFUSED" />
            </intent-filter>
        </receiver>
    </application>
</manifest>