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

    <!-- Doesn't require a camera -->
    <uses-feature android:name="android.hardware.camera" android:required="false" />

    <!-- To connect with relays -->
    <uses-permission android:name="android.permission.INTERNET"/>

    <!-- To Upload media (newer devices) -->
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>

    <!-- To Upload media (old devices) -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <!-- To read QRs that contain nostr:<NIP19> -->
    <uses-permission android:name="android.permission.CAMERA" />

    <!-- To read NFCs that contain nostr:<NIP19> -->
    <uses-permission android:name="android.permission.NFC" />

    <!-- To know receive notifications when the app connects/disconnects from the web -->
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

    <!-- Old permission to access media -->
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="28"
        tools:ignore="ScopedStorage" />

    <application
        android:allowBackup="false"
        android:name=".Amethyst"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:enableOnBackInvokedCallback="true"
        android:supportsRtl="true"
        android:theme="@style/Theme.Amethyst"
        android:largeHeap="true"
        android:usesCleartextTraffic="true"
        android:hardwareAccelerated="true"
        android:localeConfig="@xml/locales_config"
        tools:targetApi="33">
        <activity
            android:name=".ui.MainActivity"
            android:exported="true"
            android:windowSoftInputMode="adjustResize"
            android:configChanges="orientation|screenSize|screenLayout"
            android:theme="@style/Theme.Amethyst">

            <intent-filter android:label="Amethyst">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter android:label="Amethyst">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="nostr" />
            </intent-filter>

            <intent-filter android:label="Amethyst">
                <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="nostr" />
            </intent-filter>

            <intent-filter android:label="Amethyst">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="nostrwalletconnect" />
                <data android:scheme="nostr+walletconnect" />
            </intent-filter>

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

        <activity
            android:name="com.journeyapps.barcodescanner.CaptureActivity"
            android:screenOrientation="fullSensor"
            tools:replace="screenOrientation" />

    </application>

</manifest>