<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
  xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-system" version="0.0.1">
  <name>cordova-plugin-system</name>
  <description>Utility methods for Android.</description>
  <license>Apache 2.0</license>
  <keywords>cordova,plugin,system</keywords>

  <js-module src="www/plugin.js" name="system">
    <clobbers target="window.system" />
  </js-module>
  <platform name="android">

    <config-file target="res/xml/config.xml" parent="/*">
      <feature name="System">
        <param name="android-package" value="com.foxdebug.system.System"/>
      </feature>
    </config-file>

    <config-file target="AndroidManifest.xml" parent="./application">
      <provider android:name="androidx.core.content.FileProvider" android:authorities="com.foxdebug.provider" android:exported="false" android:grantUriPermissions="true">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_provider"/>
      </provider>
    </config-file>


    <config-file parent="./application/activity" target="AndroidManifest.xml">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
      </intent-filter>
    </config-file>

    <hook type="before_prepare" src="utils/resetProvider.js" />
    <hook type="after_prepare" src="utils/fixProvider.js" />

    <resource-file src="res/android/file_provider.xml" target="res/xml/file_provider.xml" />
    <resource-file src="res/android/icon.ttf" target="assets/font/icon.ttf" />
    <source-file src="android/com/foxdebug/system/Ui.java" target-dir="src/com/foxdebug/system"/>
    <source-file src="android/com/foxdebug/system/System.java" target-dir="src/com/foxdebug/system"/>

    <framework src="androidx.core:core:1.6.0" />
    <framework src="androidx.core:core-google-shortcuts:1.0.0" />
    <framework src="androidx.documentfile:documentfile:1.0.1" />
    <source-file src="android/com/foxdebug/system/RewardPassManager.java" target-dir="src/com/foxdebug/system"/>
  </platform>
</plugin>
