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

    <!-- Remove unnecessary permissions from Firebase dependency -->
    <uses-permission
        android:name="android.permission.ACCESS_ADSERVICES_AD_ID"
        tools:node="remove" />

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

    <uses-permission
        android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"
        tools:node="remove" />

    <uses-permission
        android:name="com.google.android.gms.permission.AD_ID"
        tools:node="remove" />

    <application>
        <!-- Disable for manual opt-in -->
        <meta-data
            android:name="firebase_analytics_collection_enabled"
            android:value="false" />

        <meta-data
            android:name="firebase_crashlytics_collection_enabled"
            android:value="false" />

        <!-- Disable unnecessary stuff from Firebase -->
        <meta-data
            android:name="google_analytics_adid_collection_enabled"
            android:value="false" />

        <meta-data
            android:name="google_analytics_automatic_screen_reporting_enabled"
            android:value="false" />

        <meta-data
            android:name="google_analytics_default_allow_ad_personalization_signals"
            android:value="false" />
    </application>
</manifest>
