<?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.hh.arome">

    <uses-feature
        android:name="android.hardware.usb.host"
        android:required="true" />

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission
        android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
    <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission
        android:name="android.permission.STATUS_BAR"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <!-- 开机自启动 -->
    <uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
    <uses-permission android:name="android.permission.CAMERA" />

    <uses-feature android:name="android.hardware.camera" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.NFC" /> <!-- 安装后自启动app -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- 后台服务 -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

    <uses-permission android:name="android.permission.GET_TASKS"/>

    <uses-feature
        android:name="android.hardware.nfc"
        android:required="true" /> <!-- 自定义provider 权限申请 -->
    <permission
        android:name=".provider.READ"
        android:label="provider permission read"
        android:protectionLevel="normal" />
    <permission
        android:name=".provider.WRITE"
        android:label="provider permission write"
        android:protectionLevel="normal" />

    <application
        android:name=".MyApplication"
        android:allowBackup="false"
        android:icon="@mipmap/ic_main_logo"
        android:label="@string/app_name"
        android:networkSecurityConfig="@xml/network_security_config"
        android:requestLegacyExternalStorage="true"
        android:roundIcon="@mipmap/ic_main_logo"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:name,android:allowBackup,android:theme,android:icon,android:roundIcon">

        <activity android:name=".ui.SplashActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.MainActivity"
            android:theme="@style/AppTheme.Full" />
        <activity android:name=".ui.SecondActivity" />
        <activity
            android:name=".ui.IDCardScanActivity"
            android:excludeFromRecents="true"
            android:exported="false"
            android:finishOnTaskLaunch="false"
            android:launchMode="singleInstance"
            android:theme="@style/DialogStyle">
            <intent-filter>
                <action android:name="dialog" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.IDCardScanNfcActivity"
            android:excludeFromRecents="true"
            android:exported="false"
            android:finishOnTaskLaunch="false"
            android:launchMode="singleInstance"
            android:theme="@style/DialogStyle">
            <intent-filter>
                <action android:name="dialog" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:name=".ui.PasswordActivity" />
        <activity android:name=".ui.setting.SettingActivity" />
        <activity android:name=".ui.setting.GatherActivity" />
        <activity android:name=".ui.setting.BaseInfoActivity" />
        <activity android:name=".ui.setting.PushActivity" />
        <activity android:name=".ui.setting.SystemConfigActivity" />
        <activity android:name=".ui.setting.ZoloActivity" />
        <activity android:name=".ui.setting.FunctionActivity" />

        <receiver
            android:name=".broadcastreceiver.AutoStartBroadReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />

                <category android:name="android.intent.category.HOME" />
            </intent-filter>
        </receiver> <!-- 安装完后自启动 -->
        <receiver android:name=".broadcastreceiver.InstallAutoStartReceiver">
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_ADDED" />
                <action android:name="android.intent.action.PACKAGE_REPLACED" />
                <action android:name="android.intent.action.PACKAGE_REMOVED" />

                <data android:scheme="package" />
            </intent-filter>
        </receiver> <!-- android:theme="@android:style/Theme.Translucent" -->
        <!--
 <service
             android:name=".services.AppMessageService"
             android:enabled="true"
             android:exported="true">
             <intent-filter>
                 <action android:name=".services.AppMessageService"/>
                 <category android:name="android.intent.category.DEFAULT"/>
             </intent-filter>
         </service>
        -->
        <!-- 配置服务端的包名 -->
        <!--
 <queries>
             <package android:name="com.hh.hhomc" />
         </queries>
        -->
        <!-- 扫码枪AccessibilityService服务类 -->
        <service
            android:name=".services.QrcodeScannerService"
            android:enabled="true"
            android:exported="true"
            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/accessibility" />
        </service>
        <service
            android:name=".helper.qr.UsbService"
            android:enabled="true" />



        <!-- 保活service begin -->
       <service
            android:name=".services.keeplive.LocalService"
            android:exported="true" />
        <service
            android:name=".services.keeplive.LocalService$InnnerService"
            android:exported="true" />

        <service
            android:name=".services.keeplive.RemoteService"
            android:exported="true"
            android:process=":remote" />
        <service
            android:name=".services.keeplive.RemoteService$InnnerService"
            android:exported="true"
            android:process=":remote" />
        <service
            android:name=".services.keeplive.MyJobService"
            android:permission="android.permission.BIND_JOB_SERVICE" />
        <!-- 保活service end -->



        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true"
            android:permission=".provider"
            android:readPermission=".provider.READ"
            android:writePermission=".provider.WRITE">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
    </application>

</manifest>