<?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="com.greenart7c3.nostrsigner.debug" />
        <package android:name="com.greenart7c3.nostrsigner" />
        <package android:name="dev.zapstore.app" />
    </queries>

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:name=".Amber"
        android:allowBackup="false"
        android:configChanges="orientation|screenSize|screenLayout"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:enableOnBackInvokedCallback="true"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:launchMode="singleTop"
        android:localeConfig="@xml/locales_config"
        android:supportsRtl="true"
        android:theme="@style/Theme.NostrSigner"
        android:usesCleartextTraffic="true"
        android:windowSoftInputMode="adjustResize"
        tools:targetApi="33">
        <service
            android:name=".nostr_nip55_signer"
            android:enabled="true"
            android:exported="true"
            >

        <intent-filter>
            <action android:name="nostr_nip55_signer" />
        </intent-filter>

        </service>

        <receiver
            android:name=".service.KillSwitchReceiver"
            android:enabled="true"
            android:exported="false" />
        <receiver
            android:name=".service.ReconnectReceiver"
            android:enabled="true"
            android:exported="false" />
        <receiver
            android:name=".service.BootReceiver"
            android:enabled="true"
            android:exported="false"
            android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                <action android:name="android.intent.action.PACKAGE_REPLACED" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>

        <provider
            android:name=".SignerProvider"
            android:authorities="${applicationId}.SIGN_MESSAGE;${applicationId}.SIGN_EVENT;${applicationId}.NIP04_ENCRYPT;${applicationId}.NIP04_DECRYPT;${applicationId}.NIP44_ENCRYPT;${applicationId}.NIP44_DECRYPT;${applicationId}.GET_PUBLIC_KEY;${applicationId}.DECRYPT_ZAP_EVENT"
            android:enabled="true"
            android:exported="true"
            tools:ignore="ExportedContentProvider" />

        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.greenart7c3.nostrsigner.MAIN_ACTIVITY" />

                <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" />

                <data android:scheme="nostrsigner" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.journeyapps.barcodescanner.CaptureActivity"
            android:screenOrientation="fullSensor"
            tools:ignore="DiscouragedApi"
            tools:replace="screenOrientation" />
    </application>

</manifest>
