<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2025-2026 Meshtastic LLC
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see <https://www.gnu.org/licenses/>.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <!--
      Required for writing TAK route data packages to ATAK's auto-import directory.
      Only declared for the F-Droid flavor — the Google Play flavor uses scoped
      storage (SAF / app-scoped cache) so this permission is not needed there
      and would violate Play policy.
    -->
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />

    <application>
        <!--
          Register as an "Open in / Send to Meshtastic" target for GeoJSON/KML map files (e.g. the Meshtastic Site
          Planner's "Send to App" share). The F-Droid map renders these as OSMdroid overlays (see #6138). Merged into
          the MainActivity declared in the base manifest. application/json is broad, but the map importer validates the
          file extension and ignores anything that isn't a supported layer.
        -->
        <activity
            android:name="org.meshtastic.app.MainActivity"
            android:exported="true"
            tools:node="merge">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="application/geo+json" />
                <data android:mimeType="application/vnd.geo+json" />
                <data android:mimeType="application/json" />
                <data android:mimeType="application/vnd.google-earth.kml+xml" />
                <data android:mimeType="application/vnd.google-earth.kmz" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="application/geo+json" />
                <data android:mimeType="application/vnd.geo+json" />
                <data android:mimeType="application/json" />
                <data android:mimeType="application/vnd.google-earth.kml+xml" />
                <data android:mimeType="application/vnd.google-earth.kmz" />
            </intent-filter>
        </activity>
    </application>

</manifest>
