<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="org.kiwix.kiwixmobile.core"
  android:installLocation="auto">

  <uses-permission
    android:name="android.permission.READ_EXTERNAL_STORAGE"
    android:maxSdkVersion="32" />
  <uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    tools:ignore="ScopedStorage" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

  <!-- Device with versions >= Pie need this permission -->
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

  <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
  <uses-permission
    android:name="android.permission.NEARBY_WIFI_DEVICES"
    android:usesPermissionFlags="neverForLocation"
    tools:targetApi="s" />
  <queries>
    <intent>
      <action android:name="android.intent.action.TTS_SERVICE" />
    </intent>
    <intent>
      <action android:name="android.intent.action.SEND" />
      <data android:mimeType="*/*" />
    </intent>
    <intent>
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.BROWSABLE" />
      <data android:scheme="https" />
    </intent>
    <intent>
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.BROWSABLE" />
      <data android:scheme="http" />
    </intent>
    <!-- To open PDF files in external application -->
    <intent>
      <action android:name="android.intent.action.VIEW" />
      <data android:mimeType="application/pdf" />
    </intent>
    <!-- To open EPUB files in external application -->
    <intent>
      <action android:name="android.intent.action.VIEW" />
      <data android:mimeType="application/pdf" />
    </intent>
  </queries>


  <application
    android:allowBackup="true"
    android:fullBackupContent="@xml/backup_rules"
    android:dataExtractionRules = "@xml/data_extraction_rules"
    android:hardwareAccelerated="true"
    android:requestLegacyExternalStorage="true"
    android:resizeableActivity="true"
    android:supportsRtl="true"
    android:theme="@style/KiwixTheme"
    android:usesCleartextTraffic="true"
    tools:targetApi="s">

    <!-- Version < 3.0. DeX Mode and Screen Mirroring support -->
    <meta-data
      android:name="com.samsung.android.keepalive.density"
      android:value="true" />
    <!-- Version >= 3.0. DeX Dual Mode support -->
    <meta-data
      android:name="com.samsung.android.multidisplay.keep_process_alive"
      android:value="true" />

    <activity
      android:name=".error.ErrorActivity"
      android:exported="false"
      android:process=":error_activity" />

    <provider
      android:name="androidx.core.content.FileProvider"
      android:authorities="${applicationId}.fileprovider"
      android:exported="false"
      tools:node="merge"
      tools:overrideLibrary="com.squareup.picasso.picasso"
      android:grantUriPermissions="true">
      <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/provider_paths" />
    </provider>

    <activity
      android:name=".error.DiagnosticReportActivity"
      android:exported="false" />
    <service android:name=".read_aloud.ReadAloudService" />
    <service android:name=".webserver.wifi_hotspot.HotspotService" />
  </application>
</manifest>
