<?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-feature
        android:name="android.hardware.bluetooth"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.ethernet"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.usb.accessory"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.wifi"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.wifi.direct"
        android:required="false"/>
    <uses-feature
        android:name="android.software.leanback"
        android:required="false"/>

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.LOCAL_MAC_ADDRESS"
                     tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.MANAGE_USB"
                     tools:ignore="ProtectedPermissions"/>
    <uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"
                     android:usesPermissionFlags="neverForLocation"/>
    <uses-permission android:name="android.permission.OVERRIDE_WIFI_CONFIG"
                     tools:ignore="ProtectedPermissions"/>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.READ_WIFI_CREDENTIAL"
                     tools:ignore="ProtectedPermissions"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.TETHER_PRIVILEGED"
                     tools:ignore="ProtectedPermissions"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
                     tools:ignore="ProtectedPermissions"/>
    <uses-permission android:name="android.permission.WRITE_SETTINGS"
                     tools:ignore="ProtectedPermissions"/>
    <uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION"
                            android:maxSdkVersion="32"/>
    <uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION"
                            android:maxSdkVersion="32"/>

    <queries>
        <intent>
            <action android:name="android.net.ITetheringConnector" />
        </intent>
        <intent>
            <action android:name="android.net.ITetheringConnector.InProcess" />
        </intent>
        <intent>
            <action android:name="com.android.server.wifi.intent.action.SERVICE_WIFI_RESOURCES_APK" />
        </intent>
    </queries>

    <application
        android:name=".App"
        android:allowBackup="false"
        android:dataExtractionRules="@xml/no_backup"
        android:label="@string/app_name"
        android:banner="@mipmap/banner"
        android:hasFragileUserData="true"
        android:icon="@mipmap/ic_launcher"
        android:localeConfig="@xml/locales_config"
        android:enableOnBackInvokedCallback="true"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTask"
            android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
            </intent-filter>
        </activity>

        <service
            android:name=".LocalOnlyHotspotService"
            android:directBootAware="true"
            android:foregroundServiceType="location|connectedDevice"
            tools:ignore="ForegroundServicePermission"/>
        <service
            android:name=".RepeaterService"
            android:directBootAware="true"
            android:foregroundServiceType="location|connectedDevice"
            tools:ignore="ForegroundServicePermission"/>
        <service
            android:name=".TetheringService"
            android:directBootAware="true"
            android:foregroundServiceType="connectedDevice"/>

        <service
            android:name=".manage.RepeaterTileService"
            android:directBootAware="true"
            android:exported="true"
            android:icon="@drawable/ic_action_settings_input_antenna"
            android:label="@string/title_repeater"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
            <meta-data
                android:name="android.service.quicksettings.TOGGLEABLE_TILE"
                android:value="true" />
        </service>
        <service
            android:name=".manage.LocalOnlyHotspotTileService"
            android:directBootAware="true"
            android:exported="true"
            android:icon="@drawable/ic_action_perm_scan_wifi"
            android:label="@string/tethering_temp_hotspot"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
            <meta-data
                android:name="android.service.quicksettings.TOGGLEABLE_TILE"
                android:value="true" />
        </service>
        <service
            android:name=".manage.TetheringTileService$Wifi"
            android:directBootAware="true"
            android:exported="true"
            android:icon="@drawable/ic_device_wifi_tethering"
            android:label="@string/tethering_manage_wifi"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
            <meta-data
                android:name="android.service.quicksettings.TOGGLEABLE_TILE"
                android:value="true" />
        </service>
        <service
            android:name=".manage.TetheringTileService$Usb"
            android:directBootAware="true"
            android:exported="true"
            android:icon="@drawable/ic_device_usb"
            android:label="@string/tethering_manage_usb"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
            <meta-data
                android:name="android.service.quicksettings.TOGGLEABLE_TILE"
                android:value="true" />
        </service>
        <service
            android:name=".manage.TetheringTileService$Bluetooth"
            android:directBootAware="true"
            android:exported="true"
            android:icon="@drawable/ic_device_bluetooth"
            android:label="@string/tethering_manage_bluetooth"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
            <meta-data
                android:name="android.service.quicksettings.TOGGLEABLE_TILE"
                android:value="true" />
        </service>
        <service
            android:name=".manage.TetheringTileService$Ethernet"
            android:directBootAware="true"
            android:enabled="@bool/api_ge_30"
            android:exported="true"
            android:icon="@drawable/ic_content_inbox"
            android:label="@string/tethering_manage_ethernet"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
            tools:targetApi="30">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
            <meta-data
                android:name="android.service.quicksettings.TOGGLEABLE_TILE"
                android:value="true" />
        </service>

        <receiver
            android:name=".BootReceiver"
            android:directBootAware="true"
            android:enabled="false"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver>

        <receiver android:name=".MyBroadcastReceiver" android:exported="true">
            <intent-filter>
                <action android:name="hanson.xyz.vpnhotspotmod.WIFI_TETHER_START" />
                <action android:name="hanson.xyz.vpnhotspotmod.WIFI_TETHER_STOP" />
                <action android:name="hanson.xyz.vpnhotspotmod.BT_TETHER_START" />
                <action android:name="hanson.xyz.vpnhotspotmod.BT_TETHER_STOP" />
                <action android:name="android.net.conn.TETHER_STATE_CHANGED" />
            </intent-filter>
        </receiver>

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="hanson.xyz.vpnhotspotmod.log"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/log_paths" />
        </provider>

        <activity android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
                  android:theme="@style/AppTheme.ActionBar"/>
        <activity android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
                  android:theme="@style/AppTheme.ActionBar"/>
        <provider android:name="com.google.firebase.provider.FirebaseInitProvider"
                  tools:node="remove"/>
        <service android:name="com.google.firebase.components.ComponentDiscoveryService"
                 android:directBootAware="true"/>

    </application>

</manifest>
