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

    <uses-permission
        android:name="android.permission.QUERY_ALL_PACKAGES"
        tools:ignore="QueryAllPackagesPermission" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <!-- 授予应用程序访问系统开机事件的权限 -->
    <uses-permission
        android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission
        android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />

    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <!--Android 9（API 级别 28）或更高版本并使用前台服务，则其必须请求 FOREGROUND_SERVICE 权限-->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
    <uses-permission
        android:name="android.permission.BATTERY_STATS"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission
        android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.ACTION_NOTIFICATION_LISTENER_SETTINGS" />
    <uses-permission
        android:name="android.permission.INSTALL_PACKAGES"
        tools:ignore="ProtectedPermissions" />
    <uses-permission
        android:name="android.permission.WRITE_SETTINGS"
        tools:ignore="ProtectedPermissions" />
    <!--进程杀死-->
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
    <uses-permission
        android:name="android.permission.READ_LOGS"
        tools:ignore="ProtectedPermissions" />

    <application
        android:name=".App"
        android:configChanges="screenSize|keyboardHidden|orientation|keyboard"
        android:defaultToDeviceProtectedStorage="true"
        android:directBootAware="true"
        android:fullBackupContent="@xml/backup_descriptor"
        android:hardwareAccelerated="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:networkSecurityConfig="@xml/network_security_config"
        android:requestLegacyExternalStorage="true"
        android:roundIcon="@mipmap/ic_launcher"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        android:windowSoftInputMode="adjustPan|stateHidden"
        tools:ignore="DataExtractionRules,LockedOrientationActivity,UnusedAttribute">

        <meta-data
            android:name="ScopedStorage"
            android:value="true" />

        <activity
            android:name=".activity.SplashActivity"
            android:configChanges="screenSize|keyboardHidden|orientation|keyboard"
            android:excludeFromRecents="true"
            android:exported="true"
            android:screenOrientation="portrait"
            android:taskAffinity=":splash"
            android:theme="@style/AppTheme.Launch.App"
            android:windowSoftInputMode="adjustPan|stateHidden"
            tools:ignore="TranslucentOrientation">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activity.MainActivity"
            android:configChanges="screenSize|keyboardHidden|orientation|keyboard"
            android:exported="true"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateHidden" />
        <activity
            android:name=".activity.ClientActivity"
            android:configChanges="screenSize|keyboardHidden|orientation|keyboard"
            android:exported="true"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateHidden" />
        <!--通用浏览器-->
        <activity
            android:name=".core.webview.AgentWebActivity"
            android:configChanges="screenSize|keyboardHidden|orientation|keyboard"
            android:exported="true"
            android:hardwareAccelerated="true"
            android:label="@string/app_browser_name"
            android:theme="@style/AppTheme">
            <!-- Scheme -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="com.xuexiang.xui.applink" />

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

                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:scheme="about" />
                <data android:scheme="javascript" />
                <!--   设置自己的deeplink   -->
                <!--                <data-->
                <!--                    android:host="xxx.com"-->
                <!--                    android:scheme="xui"/>-->
            </intent-filter>
            <!-- AppLink -->
            <intent-filter
                android:autoVerify="true"
                tools:targetApi="m">
                <action android:name="android.intent.action.VIEW" />

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

                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:scheme="inline" />
                <data android:mimeType="text/html" />
                <data android:mimeType="text/plain" />
                <data android:mimeType="application/xhtml+xml" />
                <data android:mimeType="application/vnd.wap.xhtml+xml" />
                <!--   设置自己的applink   -->
                <!--                <data-->
                <!--                    android:host="xxx.com"-->
                <!--                    android:scheme="http"/>-->
                <!--                <data-->
                <!--                    android:host="xxx.com"-->
                <!--                    android:scheme="https"/>-->
            </intent-filter>
        </activity>

        <!--fragment的页面容器-->
        <activity
            android:name=".core.BaseActivity"
            android:configChanges="screenSize|keyboardHidden|orientation|keyboard"
            android:exported="true"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateHidden" />
        <!-- 版本更新提示-->
        <activity
            android:name=".utils.update.UpdateTipDialog"
            android:exported="true"
            android:screenOrientation="portrait"
            android:theme="@style/DialogTheme" />
        <!-- Webview拦截提示弹窗-->
        <activity
            android:name=".core.webview.WebViewInterceptDialog"
            android:exported="true"
            android:screenOrientation="portrait"
            android:theme="@style/DialogTheme" />
        <!-- applink的中转页面 -->
        <activity
            android:name=".core.XPageTransferActivity"
            android:configChanges="screenSize|keyboardHidden|orientation|keyboard"
            android:exported="true"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateHidden" />

        <!--屏幕自适应设计图-->
        <meta-data
            android:name="design_width_in_dp"
            android:exported="true"
            android:value="360" />
        <meta-data
            android:name="design_height_in_dp"
            android:exported="true"
            android:value="640" />

        <service
            android:name=".service.HttpService"
            android:enabled="true" />
        <service
            android:name=".service.NetworkStateService"
            android:enabled="true" />
        <service
            android:name=".service.BatteryService"
            android:enabled="true" />
        <service
            android:name=".service.ForegroundService"
            android:enabled="true" />
        <service
            android:name=".service.NotifyService"
            android:enabled="true"
            android:exported="false"
            android:label="@string/app_name"
            android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
            <intent-filter>
                <action android:name="android.service.notification.NotificationListenerService" />
            </intent-filter>
        </service>

        <receiver
            android:name=".receiver.BootReceiver"
            android:defaultToDeviceProtectedStorage="true"
            android:directBootAware="true"
            android:exported="true"
            tools:ignore="IntentFilterExportedReceiver">
            <intent-filter android:priority="2147483647">
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.USER_PRESENT" />
                <action android:name="android.intent.action.PACKAGE_RESTARTED" />
                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receiver.SmsReceiver"
            android:exported="true"
            android:permission="android.permission.BROADCAST_SMS"
            tools:ignore="IntentFilterExportedReceiver">
            <intent-filter android:priority="2147483647">
                <!--兼容OV系手机短信广播-->
                <action android:name="android.provider.OppoSpeechAssist.SMS_RECEIVED" />
                <action android:name="android.provider.Telephony.SMS_DELIVER" />
                <!--短信广播-->
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receiver.CallReceiver"
            android:exported="true"
            tools:ignore="IntentFilterExportedReceiver">
            <intent-filter>
                <action android:name="android.intent.action.PHONE_STATE" />
                <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
            </intent-filter>
        </receiver>
    </application>

</manifest>