<?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="com.topjohnwu.magisk">

    <uses-sdk tools:overrideLibrary="com.kcoppock.broadcatsttilesupport" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission
        android:name="android.permission.PACKAGE_USAGE_STATS"
        tools:ignore="ProtectedPermissions" />

    <application

        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="AllowBackup,GoogleAppIndexingWarning">
        <service
            android:name=".services.MonitorService"
            android:label="@string/accessibility_service_name"
            android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
            <intent-filter>
                <action android:name="android.accessibilityservice.AccessibilityService" />
            </intent-filter>
            <meta-data
                android:name="android.accessibilityservice"
                android:resource="@xml/accessibilityservice" />
        </service>
        <service
            android:name=".services.TileServiceNewApi"
            android:icon="@drawable/ic_autoroot"
            android:label="@string/app_name"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>
        <service
            android:name=".services.TileServiceCompat"
            android:enabled="true"
            android:exported="true" />

        <receiver
            android:name=".receivers.PrivateBroadcastReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="com.topjohnwu.magisk.CUSTOMTILE_ACTION_AUTOROOT" />
                <action android:name="com.topjohnwu.magisk.CUSTOMTILE_ACTION_DISABLEROOT" />
                <action android:name="com.topjohnwu.magisk.CUSTOMTILE_ACTION_ENABLEROOT" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|screenSize"
            android:exported="true">

        </activity>
        <activity
            android:name=".SplashActivity"
            android:theme="@style/SplashTheme"
            android:configChanges="orientation|screenSize"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.ipaulpro.afilechooser.FileChooserActivity"
            android:enabled="true"
            android:exported="true"
            android:icon="@drawable/ic_chooser"
            android:label="@string/choose_file">
            <intent-filter>
                <action android:name="android.intent.action.GET_CONTENT" />

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

                <data android:mimeType="*/*" />
            </intent-filter>
        </activity>

        <provider
            android:name="com.ianhanniballake.localstorage.LocalStorageProvider"
            android:authorities="com.topjohnwu.magisk.documents"
            android:enabled="@bool/use_provider"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
        </provider>
        <activity
            android:name=".AboutActivity"
            android:theme="@style/AppTheme.Transparent" />

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="com.topjohnwu.magisk.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
        <receiver android:name=".receivers.AutoStartReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>


    </application>


</manifest>