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

    <dist:module dist:instant="true" />

    <uses-permission
        android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
        tools:node="remove" />
    <uses-permission
        android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"
        tools:node="remove" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="com.google.android.gms.permission.AD_ID" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="32" />
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!--      后续需要再打开-->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <queries>
        <package android:name="com.google.android.gms" />
        <package android:name="com.facebook.katana" />
        <package android:name="com.whatsapp" />

        <package android:name="com.zhiliaoapp.musically" />
        <package android:name="com.ss.android.ugc.trill" />
    </queries>

    <uses-sdk
        android:minSdkVersion="21"
        tools:overrideLibrary="com.hw.videoprocessor" />

    <application
        android:name=".App"
        android:allowBackup="false"
        android:icon="${appIcon}"
        android:label="${appName}"
        android:largeHeap="true"
        android:networkSecurityConfig="@xml/network_security_config"
        android:requestLegacyExternalStorage="true"
        android:supportsRtl="true"
        android:theme="@style/Theme.Weparty"
        tools:replace="android:allowBackup"
        tools:targetApi="n">

        <meta-data
            android:name="android.app.lib_name"
            android:value="cocos" />

        <!-- Facebook AppId -->
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="fb${fbAppId}" />
        <meta-data
            android:name="com.facebook.sdk.ClientToken"
            android:value="${fbClientToken}" />

        <meta-data
            android:name="android.max_aspect"
            android:value="3.0" />

        <!-- Set custom default icon. This is used when no icon is set for incoming notification messages.-->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/notification_ic" />

        <receiver
            android:name="com.appsflyer.SingleInstallBroadcastReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:theme="@style/MainActivityTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="${applicationId}.GO_MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="DISPATCH_ROUTER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity
            android:name=".ui.category.CategoryActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />

        <activity
            android:name="com.adealink.frame.router.RouterDeepLinkActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:exported="true"
            android:theme="@style/TranslucentActivityTheme">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

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

                <data android:scheme="${deepLinkScheme}" />
                <data android:host="${deepLinkHost}" />
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

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

                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:host="${httpDeepLinkHost}" />
            </intent-filter>

            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

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

                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:host="web.gami.vip" />
                <data android:path="/user/profile" />
                <data android:path="/user/category" />
            </intent-filter>

            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

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

                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:host="test-web.gami.vip" />
                <data android:path="/user/profile" />
                <data android:path="/user/category" />
            </intent-filter>
        </activity>
        <activity
            android:name=".debug.DebugActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateVisible" />
        <activity
            android:name=".debug.DebugUIActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateVisible" />

        <!--        <provider-->
        <!--            android:name="com.facebook.FacebookContentProvider"-->
        <!--            android:authorities="com.facebook.app.FacebookContentProvider${fbAppId}"-->
        <!--            android:exported="true" />-->

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

        <activity
            android:name="com.adealink.weparty.commonui.mediapicker.imageselect.ImageSelectActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.adealink.weparty.commonui.mediapicker.imageselect.clip.ClipImageActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.adealink.weparty.commonui.mediapicker.imageselect.selectpreview.SelectPreviewActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.adealink.weparty.commonui.mediapicker.imageselect.takePhoto.CameraActivity"
            android:screenOrientation="portrait" />

        <activity
            android:name="com.adealink.weparty.webview.WebViewActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustNothing" />

        <activity
            android:name="com.adealink.weparty.commonui.mediapicker.videoselect.VideoSelectActivity"
            android:screenOrientation="portrait" />

        <!-- Trigger Google Play services to install the backported photo picker module. -->
        <service
            android:name="com.google.android.gms.metadata.ModuleDependencies"
            android:enabled="false"
            android:exported="false"
            tools:ignore="MissingClass">
            <intent-filter>
                <action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
            </intent-filter>
            <meta-data
                android:name="photopicker_activity:0:required"
                android:value="" />
        </service>

    </application>

</manifest>