<?xml version="1.0" encoding="utf-8"?><!--
  ~ SPDX-FileCopyrightText: 2014 microG Project Team
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<manifest xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <permission
        android:name="com.android.vending.CHECK_LICENSE"
        android:protectionLevel="normal" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission
        android:name="android.permission.GET_ACCOUNTS"
        android:maxSdkVersion="22" />
    <uses-permission android:name="org.microg.gms.permission.READ_SETTINGS" />
    <uses-permission android:name="org.microg.gms.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="com.google.android.gms.permission.READ_SETTINGS" />
    <uses-permission android:name="com.google.android.gms.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

    <uses-permission android:name="android.permission.INSTALL_PACKAGES"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.DELETE_PACKAGES"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="com.google.android.gms.auth.permission.GOOGLE_ACCOUNT_CHANGE"/>

    <permission
        android:description="@string/billing_permission_desc"
        android:label="@string/billing_permission_label"
        android:name="com.android.vending.BILLING"
        android:protectionLevel="instant|normal"/>

    <uses-permission
        android:name="android.permission.USE_CREDENTIALS"
        android:maxSdkVersion="22" />

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

    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="market" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data
                android:scheme="https"
                android:host="market.android.com" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data
                android:scheme="https"
                android:host="play.google.com" />
        </intent>
    </queries>

    <uses-sdk tools:overrideLibrary="coil.svg, coil.compose.singleton, coil.compose.base,
        androidx.compose.material.icons,com.google.accompanist.drawablepainter,androidx.compose.ui.util,
        androidx.compose.ui.unit,androidx.compose.ui.text,androidx.compose.ui.graphics,androidx.compose.ui.geometry,
        androidx.activity.compose,androidx.compose.runtime.saveable,
        androidx.compose.material.ripple,androidx.compose.foundation.layout,androidx.compose.animation.core,
        coil.singleton, coil.base, androidx.compose.material3, com.google.accompanist.systemuicontroller, androidx.compose.animation.graphics,
        androidx.compose.ui.tooling.data, androidx.compose.ui.tooling.preview" />

    <application
        android:forceQueryable="true"
        android:icon="@mipmap/ic_app"
        android:roundIcon="@mipmap/ic_app"
        android:label="@string/app_name"
        android:name="androidx.multidex.MultiDexApplication">

        <meta-data
            android:name="org.microg.gms.settings:source-package"
            android:value="com.google.android.gms" />

        <meta-data
            android:name="org.microg.gms.profile:source-package"
            android:value="com.google.android.gms" />

        <activity
            android:name=".GrantFakeSignaturePermissionActivity"
            android:exported="true"
            android:theme="@style/Theme.Dialog.NoActionBar" />

        <service
            android:name="com.android.vending.licensing.LicensingService"
            android:permission="com.android.vending.CHECK_LICENSE"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.licensing.ILicensingService" />
            </intent-filter>
        </service>

        <service
            android:name="com.google.android.finsky.externalreferrer.GetInstallReferrerService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.finsky.BIND_GET_INSTALL_REFERRER_SERVICE" />
            </intent-filter>
        </service>

        <activity
            android:name="org.microg.vending.ui.MainActivity"
            android:theme="@style/Theme.Dialog.NoActionBar"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.INFO" />
            </intent-filter>
        </activity>

        <activity-alias
            android:name="com.google.android.finsky.activities.MarketDeepLinkHandlerActivity"
            android:exported="true"
            android:targetActivity="org.microg.vending.MarketIntentRedirect">
        </activity-alias>

        <activity
            android:name="org.microg.vending.MarketIntentRedirect"
            android:theme="@style/Theme.Dialog.NoActionBar"
            android:exported="true">
            <intent-filter android:priority="-100">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="market" />
            </intent-filter>
            <!--
            Play Store website opens this via intent:// URI if BROWSABLE category is added.
            If the only other valid or the configured default retriever of the intent is the web browser itself,
            this would cause an infinite loop of redirects between the redirector and the web browser opening
            the Play Store website.

            To prevent this, we remove the BROWSABLE category. This ensure best possible compatibility without running
            into the aforementioned issue.
            -->
            <intent-filter
                android:priority="-100"
                tools:ignore="AppLinkUrlError">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:host="play.google.com" />
                <data android:host="market.android.com" />
            </intent-filter>
        </activity>

        <receiver
            android:name="com.android.vending.licensing.IgnoreReceiver"
            android:exported="false" />
        <receiver
            android:name="com.android.vending.licensing.SignInReceiver"
            android:exported="false" />

        <activity
            android:name="org.microg.vending.billing.PurchaseActivity"
            android:exported="true"
            android:theme="@style/Theme.Translucent"
            android:process=":ui">
            <intent-filter>
                <action android:name="com.android.vending.billing.PURCHASE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <service android:name="com.google.android.finsky.splitinstallservice.SplitInstallService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.play.core.splitinstall.BIND_SPLIT_INSTALL_SERVICE"/>
            </intent-filter>
        </service>

        <service
            android:name="com.google.android.finsky.appcontentservice.engage.AppEngageServiceV2"
            android:exported="true"
            android:process=":background">
            <intent-filter>
                <action android:name="com.google.android.engage.BIND_APP_ENGAGE_SERVICE"/>
            </intent-filter>
        </service>


        <service
            android:name="com.android.vending.billing.InAppBillingService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.billing.InAppBillingService.BIND" />
            </intent-filter>
        </service>

        <activity
            android:name="org.microg.vending.billing.ui.InAppBillingHostActivity"
            android:exported="true"
            android:theme="@style/InAppBillingStyle"
            android:windowSoftInputMode="adjustResize" />

        <activity
            android:name="org.microg.vending.billing.ui.PlayWebViewActivity"
            android:process=":ui"
            android:exported="false" />

        <service
            android:name="com.google.android.finsky.assetmoduleservice.AssetModuleService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.play.core.assetmoduleservice.BIND_ASSET_MODULE_SERVICE" />
            </intent-filter>
        </service>

        <receiver
            android:name=".installer.SessionResultReceiver"
            android:exported="false"
            tools:targetApi="21" />

        <receiver
            android:name=".installer.InstallReceiver"
            android:exported="false"
            tools:targetApi="21" />

        <!-- Work account store -->
        <activity android:name="org.microg.vending.ui.WorkAppsActivity"
            android:exported="true"
            android:theme="@style/Theme.Material3.DayNight"
            android:label="@string/vending_activity_name"
            android:enabled="false"
            tools:targetApi="21">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service android:name=".installer.InstallService"
            android:foregroundServiceType="dataSync"
            android:exported="false"
            tools:targetApi="21" />

        <receiver android:name="org.microg.vending.WorkAccountChangedReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="org.microg.vending.WORK_ACCOUNT_CHANGED" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.finsky.integrityservice.IntegrityService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.play.core.integrityservice.BIND_INTEGRITY_SERVICE" />
            </intent-filter>
        </service>

        <service
            android:name="com.google.android.finsky.expressintegrityservice.ExpressIntegrityService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.play.core.expressintegrityservice.BIND_EXPRESS_INTEGRITY_SERVICE"/>
            </intent-filter>
        </service>
      
        <receiver
            android:name="com.google.android.finsky.accounts.impl.AccountsChangedReceiver"
            android:permission="com.google.android.gms.auth.permission.GOOGLE_ACCOUNT_CHANGE"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.gms.auth.GOOGLE_ACCOUNT_CHANGE"/>
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.finsky.services.PlayGearheadService"
            android:exported="true" />

        <service android:name="com.google.android.finsky.installservice.DevTriggeredUpdateService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.play.core.install.BIND_UPDATE_SERVICE"/>
            </intent-filter>
        </service>

        <service
            android:name="com.google.android.finsky.inappreviewservice.InAppReviewService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.finsky.BIND_IN_APP_REVIEW_SERVICE"/>
            </intent-filter>
        </service>

        <activity
            android:name="org.microg.vending.installer.AppInstallActivity"
            android:exported="true"
            android:excludeFromRecents="true"
            android:theme="@style/Theme.App.Translucent"
            tools:targetApi="21">
            <intent-filter>
                <action android:name="org.microg.vending.action.INSTALL_PACKAGE"/>
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="application/vnd.android.package-archive" />
            </intent-filter>
        </activity>

        <activity
            android:name="org.microg.vending.installer.AskInstallReminderActivity"
            android:exported="false"
            android:excludeFromRecents="true"
            android:theme="@style/Theme.AppCompat.NoActionBar"
            tools:targetApi="21"/>

    </application>
</manifest>
