<?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="cn.garymb.ygomobile.lite">

    <application
        android:name="cn.garymb.ygomobile.App"
        android:allowBackup="false"
        android:icon="@drawable/ic_icon"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:roundIcon="@drawable/ic_icon_round"
        android:supportsRtl="false"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        android:extractNativeLibs="true"
        android:requestLegacyExternalStorage="true"
        android:taskAffinity="cn.garymb.ygomobile.task"
        tools:replace="android:allowBackup,android:supportsRtl"
        tools:targetApi="m">
        <activity
            android:name="cn.garymb.ygomobile.ui.activities.LogoActivity"
            android:excludeFromRecents="false"
            android:theme="@style/TranslucentTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <meta-data
                android:name="android.app.shortcuts"
                android:resource="@xml/shortcuts" />

        </activity>

        <activity
            android:name="com.tencent.bugly.beta.ui.BetaActivity"
            android:launchMode="singleTop"
            android:configChanges="keyboardHidden|orientation|screenSize|locale"
            android:excludeFromRecents="true" />

        <activity
            android:name="cn.garymb.ygomobile.ui.home.MainActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:exported="true"
            android:screenOrientation="portrait"
            android:launchMode="singleTop"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustResize">
            <intent-filter>
                <action android:name="ygomobile.intent.action.DECK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="ygomobile.intent.action.GAME" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

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

                <!--android:pathPrefix="/deck"-->
                <data
                    android:host="deck"
                    android:scheme="ygo" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="content" />
                <data android:scheme="file" />
                <data android:host="*" />
                <data android:mimeType="*/*" />
                <data android:pathPattern=".*\.ydk" />
                <data android:pathPattern=".*\..*\.ydk" />
                <data android:pathPattern=".*\..*\..*\.ydk" />
                <data android:pathPattern=".*\..*\..*\..*\.ydk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\.ydk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\.ydk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\.ydk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\..*\.ydk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\..*\..*\.ydk" />
                <data android:pathPattern=".*\.ypk" />
                <data android:pathPattern=".*\..*\.ypk" />
                <data android:pathPattern=".*\..*\..*\.ypk" />
                <data android:pathPattern=".*\..*\..*\..*\.ypk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\.ypk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\.ypk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\.ypk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\..*\.ypk" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\..*\..*\.ypk" />
                <data android:pathPattern=".*\.yrp" />
                <data android:pathPattern=".*\..*\.yrp" />
                <data android:pathPattern=".*\..*\..*\.yrp" />
                <data android:pathPattern=".*\..*\..*\..*\.yrp" />
                <data android:pathPattern=".*\..*\..*\..*\..*\.yrp" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\.yrp" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\.yrp" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\..*\.yrp" />
                <data android:pathPattern=".*\..*\..*\..*\..*\..*\..*\..*\..*\.yrp" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>
        <activity
            android:name="cn.garymb.ygomobile.ui.activities.ShareFileActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:launchMode="singleTop"
            android:excludeFromRecents="true"
            android:theme="@style/TranslucentTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustResize">
            <intent-filter>
                <action android:name="cn.garymb.ygomobile.game.shared.file" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="cn.garymb.ygomobile.YGOMobileActivity"
            android:theme="@style/AppTheme.Game"
            tools:replace="android:theme" />

        <activity
            android:name="cn.garymb.ygomobile.ui.preference.SettingsActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:label="@string/settings"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />
        <activity
            android:name="cn.garymb.ygomobile.ui.cards.CardSearchActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:label="@string/card_search"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />
        <activity
            android:name="cn.garymb.ygomobile.ui.cards.DeckManagerActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:label="@string/deck_manager"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />
        <activity
            android:name="cn.garymb.ygomobile.ui.file.FileActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />
        <activity
            android:name="cn.garymb.ygomobile.ui.activities.WebActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:launchMode="singleTop"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />
        <activity
            android:name="cn.garymb.ygomobile.ui.mycard.MyCardActivity"
            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
            android:launchMode="singleTop"
            android:theme="@style/AppTheme.Mycard"
            android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />
        <activity
            android:name="cn.garymb.ygomobile.ui.mycard.mcchat.McchatActivity"
            android:label="@string/app_name"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <activity
            android:name="cn.garymb.ygomobile.ui.mycard.mcchat.SplashActivity"
            android:theme="@style/AppTheme.Mycard" />
        <activity android:name="cn.garymb.ygomobile.ui.activities.FileLogActivity" />
        <activity
            android:name="cn.garymb.ygomobile.ui.activities.PermissionsActivity"
            android:theme="@style/TranslucentTheme" />

        <meta-data
            android:name="BUGLY_APPID"
            android:value="${APP_ID}" />
        <meta-data
            android:name="BUGLY_ENABLE_DEBUG"
            android:value="true" />
        <!-- 为防止Service被系统回收，可以尝试通过提高服务的优先级解决，1000是最高优先级，数字越小，优先级越低 -->
        <!--android:priority="1000"-->
        <service
            android:name="com.ourygo.assistant.service.DuelAssistantService"
            android:priority="1000" />

        <!-- 如果已经安装过原版YGOMobile，请注释掉或修改成其他，否则会导致无法安装 -->
        <provider
            android:name="cn.garymb.ygomobile.ui.preference.YGOPreferencesProvider"
            android:authorities="${applicationId}.ui.preference.YGOPreferencesProvider"
            android:exported="false"
            android:grantUriPermissions="true" />
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.gamefiles"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>

        <service
            android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
            android:label="dexopt"
            android:process=":dexopt" />
    </application>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission
        android:name="android.permission.READ_LOGS"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission
        android:name="android.permission.WRITE_SETTINGS"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <!--uses-permission android:name="android.permission.READ_PHONE_STATE" /-->
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

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

    <uses-sdk tools:overrideLibrary="com.toptoche.searchablespinnerlibrary" />
</manifest>