<?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.idormy.sms.forwarder"
    android:installLocation="internalOnly">

    <uses-permission
        android:name="android.permission.QUERY_ALL_PACKAGES"
        tools:ignore="QueryAllPackagesPermission" />
    <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"
        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" />
    <!--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.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" />


    <application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:fullBackupContent="@xml/backup_descriptor"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:requestLegacyExternalStorage="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        tools:targetApi="m">

        <uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />

        <meta-data
            android:name="UPDATE_APP_KEY"
            android:value="SVSfseesfsf" />
        <meta-data
            android:name="UMENG_APPKEY"
            android:value="60254fc7425ec25f10f4293e" />
        <meta-data
            android:name="UMENG_CHANNEL"
            android:value="Umeng" />

        <activity
            android:name=".MainActivity"
            android:exported="true"
            tools:ignore="IntentFilterExportedReceiver">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".AboutActivity"
            android:exported="true"
            android:label="@string/about"
            tools:ignore="IntentFilterExportedReceiver">
            <intent-filter>
                <!--协议部分，随便设置-->
                <data
                    android:host="main"
                    android:scheme="forwarder" />
                <!--下面这几行也必须得设置-->
                <category android:name="android.intent.category.DEFAULT" />
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SettingActivity"
            android:exported="true"
            android:label="@string/setting" />
        <activity
            android:name=".CloneActivity"
            android:exported="true"
            android:label="@string/clone" />
        <activity
            android:name=".RuleActivity"
            android:exported="true"
            android:label="@string/rule_setting" />
        <activity
            android:name=".SenderActivity"
            android:exported="true"
            android:label="@string/sender_setting" />
        <activity
            android:name=".AppListActivity"
            android:exported="true"
            android:label="@string/app_list" />

        <receiver
            android:name=".receiver.RebootBroadcastReceiver"
            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" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receiver.SmsBroadcastReceiver"
            android:exported="true"
            android:permission="android.permission.BROADCAST_SMS"
            tools:ignore="IntentFilterExportedReceiver">
            <intent-filter android:priority="2147483647">
                <!--短信广播-->
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receiver.PhoneStateReceiver"
            android:exported="true"
            tools:ignore="IntentFilterExportedReceiver">
            <intent-filter>
                <action android:name="android.intent.action.PHONE_STATE" />
            </intent-filter>
        </receiver>

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

    </application>

</manifest>