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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
    <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
        tools:ignore="QueryAllPackagesPermission" />
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
    <uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" />

    <application
        android:name=".MainApplication"
        android:allowBackup="false"
        android:icon="${appIcon}"
        android:label="@string/application_name"
        android:roundIcon="${appIconRound}"
        android:supportsRtl="true"
        android:theme="@style/MainTheme"
        tools:ignore="GoogleAppIndexingWarning">

        <receiver
            android:name=".MainApplication$BootReceiver"
            android:exported="true">

            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>

        </receiver>

        <activity
            android:name=".ui.activities.MainActivityX"
            android:exported="true"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustResize">

            <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.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="fdroid.app" />
            </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:host="details"
                    android:scheme="market" />
            </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="http" />
                <data android:scheme="https" />
                <data android:host="f-droid.org" />
                <data android:host="www.f-droid.org" />
                <data android:host="staging.f-droid.org" />
                <data android:pathPattern="/app/.*" />
                <data android:pathPattern="/packages/.*" />
                <data android:pathPattern="/.*/packages/.*" />
            </intent-filter>

        </activity>

        <activity
            android:name=".ui.activities.PrefsActivityX"
            android:exported="true"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustResize" />

        <service android:name=".service.SyncService" />

        <service
            android:name=".service.SyncService$Job"
            android:exported="true"
            android:permission="android.permission.BIND_JOB_SERVICE" />

        <service android:name=".service.DownloadService" />

        <service
            android:name=".installer.InstallerService"
            android:exported="false" />

        <provider
            android:name=".content.Cache$Provider"
            android:authorities="${applicationId}.provider.cache"
            android:exported="false"
            android:grantUriPermissions="true" />

    </application>

</manifest>
