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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

    <!-- For Android 11+ (API 30+) - Scoped Storage -->
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
        android:minSdkVersion="30" />

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.CRMChat"
        android:usesCleartextTraffic="true"
        tools:targetApi="31">

        <!-- WorkManager initialization -->
        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="${applicationId}.androidx-startup"
            android:exported="false"
            tools:node="merge">
        </provider>
        <activity
            android:name=".ui.auth.AuthActivity"
            android:exported="true"
            android:theme="@style/Theme.CRMChat.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".ui.main.MainActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar" />

        <activity
            android:name=".ui.chat.ChatActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar"
            android:windowSoftInputMode="adjustResize" />

        <activity
            android:name=".ui.main.CreateChatActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar" />

        <activity
            android:name=".ui.main.UserSelectionActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar" />

        <activity
            android:name=".ui.chat.ImageViewerActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar" />

        <activity
            android:name=".ui.profile.ProfileActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar" />

        <activity
            android:name=".ui.chat.GroupChatInfoActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar" />

        <activity
            android:name=".ui.settings.SettingsActivity"
            android:exported="false"
            android:theme="@style/Theme.CRMChat.NoActionBar" />
    </application>

</manifest>
