Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: removing the outdate cordova codebase

Ilian Sapundshiev29f4a5dd3931
diff --git a/cordova/.gitignore b/cordova/.gitignore
deleted file mode 100644
index 53791a1a2..000000000
--- a/cordova/.gitignore
+++ /dev/null
@@ -1,34 +0,0 @@
-# Logs
-logs
-*.log
-
-# Runtime data
-pids
-*.pid
-*.seed
-
-# node-waf configuration
-.lock-wscript
-
-build/Release
-.eslintcache
-
-# Dependency directory
-node_modules
-
-# OSX
-.DS_Store
-
-node_modules/*
-www/*
-!cordova/www/index.html
-
-platforms/android/.gradle/*
-platforms/android/app/build/*
-platforms/android/build/*
-platforms/android/CordovaLib/build/*
-platforms/android/assets/www/*
-platforms/ios/www/dist/*
-platforms/ios/www/modules/*
-plugins/**/*
-
diff --git a/cordova/.npmignore b/cordova/.npmignore
deleted file mode 100644
index fd2959683..000000000
--- a/cordova/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# OS X
-.DS_Store
diff --git a/cordova/config.xml b/cordova/config.xml
deleted file mode 100644
index 51c3ef111..000000000
--- a/cordova/config.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<widget id="org.tagspaces.mobileapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets"
- xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
- <name>TagSpaces</name>
- <description>
- Offline file organizer and browser with tagging support.
- </description>
- <author email="[email protected]" href="https://tagspaces.org">
- TagSpaces GmbH
- </author>
- <content src="index.html" />
- <access origin="*" />
- <allow-intent href="http://*/*" />
- <allow-intent href="https://*/*" />
- <allow-intent href="tel:*" />
- <allow-intent href="sms:*" />
- <allow-intent href="mailto:*" />
- <allow-intent href="geo:*" />
- <platform name="android">
- <allow-intent href="market:*" />
- <preference name="android-minSdkVersion" value="25" />
- <preference name="android-targetSdkVersion" value="29" />
- <preference name="AndroidXEnabled" value="true" />
- <icon density="mdpi" src="res/icon/android/mipmap-mdpi/ic_launcher.png" />
- <icon density="hdpi" src="res/icon/android/mipmap-hdpi/ic_launcher.png" />
- <icon density="xhdpi" src="res/icon/android/mipmap-xhdpi/ic_launcher.png" />
- <icon density="xxhdpi" src="res/icon/android/mipmap-xxhdpi/ic_launcher.png" />
- <icon density="xxxhdpi" src="res/icon/android/mipmap-xxxhdpi/ic_launcher.png" />
- <resource-file src="res/icon/android/mipmap-mdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_round.png" />
- <resource-file src="res/icon/android/mipmap-hdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_round.png" />
- <resource-file src="res/icon/android/mipmap-xhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_round.png" />
- <resource-file src="res/icon/android/mipmap-xxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png" />
- <resource-file src="res/icon/android/mipmap-xxxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png" />
- <resource-file src="res/icon/android/mipmap-mdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png" />
- <resource-file src="res/icon/android/mipmap-hdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png" />
- <resource-file src="res/icon/android/mipmap-xhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png" />
- <resource-file src="res/icon/android/mipmap-xxhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png" />
- <resource-file src="res/icon/android/mipmap-xxxhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png" />
- <resource-file src="res/icon/android/mipmap-mdpi/ic_launcher_monochrome.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png" />
- <resource-file src="res/icon/android/mipmap-hdpi/ic_launcher_monochrome.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png" />
- <resource-file src="res/icon/android/mipmap-xhdpi/ic_launcher_monochrome.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png" />
- <resource-file src="res/icon/android/mipmap-xxhdpi/ic_launcher_monochrome.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png" />
- <resource-file src="res/icon/android/mipmap-xxxhdpi/ic_launcher_monochrome.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png" />
- <resource-file src="res/icon/android/mipmap-anydpi-v26/ic_launcher.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" />
- <resource-file src="res/icon/android/mipmap-anydpi-v26/ic_launcher_round.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" />
- <resource-file src="res/icon/android/values/ic_launcher_background.xml" target="app/src/main/res/values/ic_launcher_background.xml" />
- <edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
- <application android:roundIcon="@mipmap/ic_launcher_round" />
- </edit-config>
- <config-file platform="android" parent="/manifest/application/activity" target="AndroidManifest.xml" mode="merge">
- <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:mimeType="application/pdf" android:scheme="file" />
- <data android:mimeType="text/plain" android:scheme="file" />
- <data android:mimeType="image/x-windows-bmp" android:scheme="file" />
- <data android:mimeType="image/gif" android:scheme="file" />
- <data android:mimeType="image/png" android:scheme="file" />
- <data android:mimeType="image/jpeg" android:scheme="file" />
- <data android:mimeType="image/webp" android:scheme="file" />
- <data android:mimeType="video/webm" android:scheme="file" />
- <data android:mimeType="video/ogg" android:scheme="file" />
- <data android:mimeType="text/html" android:scheme="file" />
- <data android:mimeType="application/json" android:scheme="file" />
- </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:host="*" android:mimeType="*/*" android:pathPattern="..json" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..mht" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..mhtml" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..md" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..md.txt" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..markdown" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..ogv" android:scheme="file" />
- </intent-filter>
- </config-file>
- <config-file parent="/manifest/application" target="AndroidManifest.xml">
- <provider android:name="androidx.core.content.FileProvider"
- android:authorities="${applicationId}.provider"
- android:exported="false"
- android:grantUriPermissions="true">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS"
- android:resource="@xml/mnk_file_path"/>
- </provider>
- </config-file>
- <resource-file src="res/android/mnk_file_path.xml" target="app/src/main/res/xml/mnk_file_path.xml"/>
- </platform>
- <platform name="ios">
- <!--<preference name="NativeXHRLogging" value="full" />
- <preference name="allowFileAccessFromFileURLs" value="true" />-->
- <allow-intent href="itms:*" />
- <allow-intent href="itms-apps:*" />
- <preference name="UseSwiftLanguageVersion" value="5" />
- </platform>
- <preference name="AndroidPersistentFileLocation" value="Compatibility" />
- <preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
- <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
- <plugin name="cordova-plugin-device" spec="^2.0.3" />
- <plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
- <plugin name="cordova-plugin-background-mode" spec="^0.7.3" />
- <plugin name="cordova-plugin-file" spec="6.0.2" />
-</widget>
diff --git a/cordova/hooks/README.md b/cordova/hooks/README.md
deleted file mode 100644
index 574ad4c9b..000000000
--- a/cordova/hooks/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
--->
-# Cordova Hooks
-
-Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide.
diff --git a/cordova/package-lock.json b/cordova/package-lock.json
deleted file mode 100644
index 1b5f0a036..000000000
--- a/cordova/package-lock.json
+++ /dev/null
@@ -1,2442 +0,0 @@
-{
- "name": "org.tagspaces.iosn",
- "version": "1.0.4",
- "lockfileVersion": 2,
- "requires": true,
- "packages": {
- "": {
- "name": "org.tagspaces.iosn",
- "version": "1.0.4",
- "license": "Apache-2.0",
- "dependencies": {
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-device": "^2.0.3",
- "cordova-plugin-file-opener2": "^3.0.5",
- "cordova-plugin-whitelist": "1.3.5",
- "es6-promise-plugin": "4.2.2"
- },
- "devDependencies": {
- "@globules-io/cordova-plugin-ios-xhr": "^1.0.4",
- "bamboo.cordova.plugin.downloader": "github:sytolk/cordova-plugin-downloader",
- "com-darryncampbell-cordova-plugin-intent": "^2.0.0",
- "cordova-android": "^9.1.0",
- "cordova-ios": "^8.0.0",
- "cordova-ourcodeworld-filebrowser": "git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git",
- "cordova-plugin-androidx": "^3.0.0",
- "cordova-plugin-androidx-adapter": "^1.1.3",
- "cordova-plugin-camera": "^5.0.2",
- "cordova-plugin-file": "7.0.0",
- "cordova-plugin-x-socialsharing": "^6.0.3"
- }
- },
- "node_modules/@globules-io/cordova-plugin-ios-xhr": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@globules-io/cordova-plugin-ios-xhr/-/cordova-plugin-ios-xhr-1.2.1.tgz",
- "integrity": "sha512-UJTK5Z+gV58V7UzvptDObTtYubHtN1/w+X6Jsh87BUrtbBSWQF3mdDWWBPGlRtOlyZa3Q79II/Xf5a2yJ4e5iQ==",
- "dev": true
- },
- "node_modules/@netflix/nerror": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@netflix/nerror/-/nerror-1.1.3.tgz",
- "integrity": "sha512-b+MGNyP9/LXkapreJzNUzcvuzZslj/RGgdVVJ16P2wSlYatfLycPObImqVJSmNAdyeShvNeM/pl3sVZsObFueg==",
- "dev": true,
- "dependencies": {
- "assert-plus": "^1.0.0",
- "extsprintf": "^1.4.0",
- "lodash": "^4.17.15"
- }
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.7",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz",
- "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@xmldom/xmldom": {
- "version": "0.8.11",
- "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz",
- "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=10.0.0"
- }
- },
- "node_modules/abbrev": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
- "dev": true
- },
- "node_modules/android-versions": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.7.0.tgz",
- "integrity": "sha512-TCy4b8Dk8YS6A23ZPfhSKqK66JHFq0D8avGYiwvYpjno6HrrcI0DRgHx9+jtkvWYmrsE2vQWgbHJhvGGhhOb0g==",
- "dev": true,
- "dependencies": {
- "semver": "^5.7.1"
- }
- },
- "node_modules/android-versions/node_modules/semver": {
- "version": "5.7.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
- "dev": true,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver"
- }
- },
- "node_modules/ansi": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
- "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=",
- "dev": true
- },
- "node_modules/assert-plus": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
- "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
- "dev": true,
- "engines": {
- "node": ">=0.8"
- }
- },
- "node_modules/at-least-node": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
- "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
- "dev": true,
- "engines": {
- "node": ">= 4.0.0"
- }
- },
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "node_modules/bamboo.cordova.plugin.downloader": {
- "version": "1.0.0",
- "resolved": "git+ssh://[email protected]/sytolk/cordova-plugin-downloader.git#f4d59a2957a6e1b549634f5e3ba8c7d4898c1396",
- "dev": true,
- "engines": [
- {
- "name": "cordova",
- "version": ">=3.0.0"
- }
- ],
- "license": "Apache 2.0 License"
- },
- "node_modules/base64-js": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/big-integer": {
- "version": "1.6.48",
- "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
- "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==",
- "dev": true,
- "engines": {
- "node": ">=0.6"
- }
- },
- "node_modules/bplist-creator": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
- "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "stream-buffers": "2.2.x"
- }
- },
- "node_modules/bplist-parser": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz",
- "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==",
- "dev": true,
- "dependencies": {
- "big-integer": "^1.6.44"
- },
- "engines": {
- "node": ">= 5.10.0"
- }
- },
- "node_modules/brace-expansion": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
- "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "fill-range": "^7.1.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/com-darryncampbell-cordova-plugin-intent": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/com-darryncampbell-cordova-plugin-intent/-/com-darryncampbell-cordova-plugin-intent-2.0.0.tgz",
- "integrity": "sha512-4f5BAyhpiGVsuouj2cokZCb99RA8V4O5YZnwGMliceFCu35BQcQvC0VLW55jl+xVDLhVymomnaBiHSktKKnK4w==",
- "dev": true
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
- "dev": true
- },
- "node_modules/cordova-android": {
- "version": "9.1.0",
- "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-9.1.0.tgz",
- "integrity": "sha512-bzOX9E4eQsOSpa06oZZ7XAGq3DwB73juhhj0oPqHH/khWk0mkCD4aiVYMFoc0fmIaSQvzbY1ww7L6UBW5pyGfg==",
- "dev": true,
- "dependencies": {
- "android-versions": "^1.5.0",
- "cordova-common": "^4.0.1",
- "execa": "^4.0.2",
- "fast-glob": "^3.2.4",
- "fs-extra": "^9.0.1",
- "is-path-inside": "^3.0.2",
- "nopt": "^4.0.3",
- "properties-parser": "^0.3.1",
- "semver": "^7.3.4",
- "which": "^2.0.2"
- },
- "bin": {
- "create": "bin/create"
- },
- "engines": {
- "node": ">=10.10.0"
- }
- },
- "node_modules/cordova-android/node_modules/semver": {
- "version": "7.7.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
- "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
- "dev": true,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/cordova-common": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-4.0.2.tgz",
- "integrity": "sha512-od7aNShyuBajzPY83mUEO8tERwwWdFklXETHiXP5Ft87CWeo/tSuwNPFztyTy8XYc74yXdogXKPTJeUHuVzB8Q==",
- "dev": true,
- "dependencies": {
- "@netflix/nerror": "^1.1.3",
- "ansi": "^0.3.1",
- "bplist-parser": "^0.2.0",
- "cross-spawn": "^7.0.1",
- "elementtree": "^0.1.7",
- "endent": "^1.4.1",
- "fast-glob": "^3.2.2",
- "fs-extra": "^9.0.0",
- "glob": "^7.1.6",
- "plist": "^3.0.1",
- "q": "^1.5.1",
- "read-chunk": "^3.2.0",
- "strip-bom": "^4.0.0",
- "underscore": "^1.9.2"
- },
- "engines": {
- "node": ">=10.0.0"
- }
- },
- "node_modules/cordova-ios": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-8.0.0.tgz",
- "integrity": "sha512-QsynOV8rnRIhDC3qwM1KdRr1gy5RaqzVCzdOaB+DSBPeR5wVEUGpyyJO0FzlCACzY5X25iDc5O3kbn/F06dJ5Q==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "bplist-parser": "^0.3.2",
- "cordova-common": "^6.0.0",
- "elementtree": "^0.1.7",
- "execa": "^5.1.1",
- "nopt": "^9.0.0",
- "plist": "^3.1.0",
- "semver": "^7.7.3",
- "simctl": "^3.0.0",
- "which": "^6.0.0",
- "xcode": "^3.0.1"
- },
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
- "node_modules/cordova-ios/node_modules/abbrev": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz",
- "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
- "node_modules/cordova-ios/node_modules/bplist-parser": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz",
- "integrity": "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "big-integer": "1.6.x"
- },
- "engines": {
- "node": ">= 5.10.0"
- }
- },
- "node_modules/cordova-ios/node_modules/cordova-common": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-6.0.0.tgz",
- "integrity": "sha512-16WPC1DuxVdshV3RoQUXqhcJVdhxWGwiFysA4TkYuboqoev6mgt0JuIJFxmQbzR/DuyuONaVe0L0O0Hf1C08Mg==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@netflix/nerror": "^1.1.3",
- "ansi": "^0.3.1",
- "bplist-parser": "^0.3.2",
- "elementtree": "^0.1.7",
- "endent": "^2.1.0",
- "fast-glob": "^3.3.3",
- "plist": "^3.1.0"
- },
- "engines": {
- "node": ">=20.9.0"
- }
- },
- "node_modules/cordova-ios/node_modules/endent": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/endent/-/endent-2.1.0.tgz",
- "integrity": "sha512-r8VyPX7XL8U01Xgnb1CjZ3XV+z90cXIJ9JPE/R9SEC9vpw2P6CfsRPJmp20DppC5N7ZAMCmjYkJIa744Iyg96w==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "dedent": "^0.7.0",
- "fast-json-parse": "^1.0.3",
- "objectorarray": "^1.0.5"
- }
- },
- "node_modules/cordova-ios/node_modules/execa": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
- "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "cross-spawn": "^7.0.3",
- "get-stream": "^6.0.0",
- "human-signals": "^2.1.0",
- "is-stream": "^2.0.0",
- "merge-stream": "^2.0.0",
- "npm-run-path": "^4.0.1",
- "onetime": "^5.1.2",
- "signal-exit": "^3.0.3",
- "strip-final-newline": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sindresorhus/execa?sponsor=1"
- }
- },
- "node_modules/cordova-ios/node_modules/get-stream": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
- "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/cordova-ios/node_modules/human-signals": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
- "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
- "dev": true,
- "license": "Apache-2.0",
- "engines": {
- "node": ">=10.17.0"
- }
- },
- "node_modules/cordova-ios/node_modules/isexe": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz",
- "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==",
- "dev": true,
- "license": "BlueOak-1.0.0",
- "engines": {
- "node": ">=20"
- }
- },
- "node_modules/cordova-ios/node_modules/nopt": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz",
- "integrity": "sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "abbrev": "^4.0.0"
- },
- "bin": {
- "nopt": "bin/nopt.js"
- },
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
- "node_modules/cordova-ios/node_modules/semver": {
- "version": "7.7.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
- "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
- "dev": true,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/cordova-ios/node_modules/uuid": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz",
- "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==",
- "dev": true,
- "license": "MIT",
- "bin": {
- "uuid": "dist/bin/uuid"
- }
- },
- "node_modules/cordova-ios/node_modules/which": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz",
- "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "isexe": "^4.0.0"
- },
- "bin": {
- "node-which": "bin/which.js"
- },
- "engines": {
- "node": "^20.17.0 || >=22.9.0"
- }
- },
- "node_modules/cordova-ios/node_modules/xcode": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz",
- "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "simple-plist": "^1.1.0",
- "uuid": "^7.0.3"
- },
- "engines": {
- "node": ">=10.0.0"
- }
- },
- "node_modules/cordova-ourcodeworld-filebrowser": {
- "version": "1.0.0",
- "resolved": "git+ssh://[email protected]/muhammed-noufal/cordova-ourcodeworld-filebrowser.git#07b8d2298a53691913101da5f704cb11159aed70",
- "integrity": "sha512-LIMJWW84bF4M1pKkLCH4g3pdzV+U1Jd3zGmdI2gOhcJ1EmSt9Z4++Jq3qrU2XRO3R3kKtEc6qeW139uOtG1CEg==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/cordova-plugin-androidx": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/cordova-plugin-androidx/-/cordova-plugin-androidx-3.0.0.tgz",
- "integrity": "sha512-niMnhcxKsu4/oKTUbL0jRAnh6/cdoIVxRxJqj3uEyv8CVOlAj1sWhX+9b1XiAo9+bejAM9BbA21YK0mChfbVTA==",
- "dev": true
- },
- "node_modules/cordova-plugin-androidx-adapter": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-androidx-adapter/-/cordova-plugin-androidx-adapter-1.1.3.tgz",
- "integrity": "sha512-W1SImn0cCCvOSTSfWWp5TnanIQrSuh2Bch+dcZXIzEn0km3Qb7VryeAqHhgBQYwwzC5Ollk1DtUAk/AJSojuZA==",
- "dev": true,
- "dependencies": {
- "q": "^1.5.1",
- "recursive-readdir": "^2.2.2"
- }
- },
- "node_modules/cordova-plugin-background-mode": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-background-mode/-/cordova-plugin-background-mode-0.7.3.tgz",
- "integrity": "sha512-LsU1v7EgTUROaks+tcQ8TnMzVUcU/TwjDVwj2O/4e4aI2q2ldLGsiZorqKqfqvwh2HoIssmY73OwJk91hQi62w==",
- "engines": [
- {
- "name": "cordova",
- "version": ">=3.0.0"
- },
- {
- "name": "android-sdk",
- "version": ">=16"
- }
- ]
- },
- "node_modules/cordova-plugin-camera": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-5.0.2.tgz",
- "integrity": "sha512-iR9W9S+USg/YTjwB+6rnIqJ1mZ02da0Q2VDU0Twf/CccEJO+006T5RM/NYDkBRs6vMCw7rWXroCNJOPBLLETPQ==",
- "dev": true,
- "engines": {
- "cordovaDependencies": {
- "3.0.0": {
- "cordova-android": ">=6.3.0"
- },
- "4.1.0": {
- "cordova": ">=7.1.0",
- "cordova-android": ">=6.3.0"
- },
- "5.0.0": {
- "cordova": ">=9.0.0",
- "cordova-android": ">=9.0.0",
- "cordova-ios": ">=5.1.0"
- },
- "6.0.0": {
- "cordova": ">100"
- }
- }
- }
- },
- "node_modules/cordova-plugin-device": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz",
- "integrity": "sha512-Jb3V72btxf3XHpkPQsGdyc8N6tVBYn1vsxSFj43fIz9vonJDUThYPCJJHqk6PX6N4dJw6I4FjxkpfCR4LDYMlw==",
- "engines": {
- "cordovaDependencies": {
- "3.0.0": {
- "cordova": ">100"
- }
- }
- }
- },
- "node_modules/cordova-plugin-file": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-7.0.0.tgz",
- "integrity": "sha512-mSwy9GE5pHq2ZHhu/wYk/VhrwR5VLk+XQsk3+IiiFmDgcPsrVIyELkM2FZKX09cC6i+bJVTFVKUlwteSStj3ow==",
- "dev": true,
- "engines": {
- "cordovaDependencies": {
- "5.0.0": {
- "cordova-android": ">=6.3.0"
- },
- "7.0.0": {
- "cordova-android": ">=10.0.0"
- },
- "8.0.0": {
- "cordova": ">100"
- }
- }
- }
- },
- "node_modules/cordova-plugin-file-opener2": {
- "version": "3.0.5",
- "resolved": "https://registry.npmjs.org/cordova-plugin-file-opener2/-/cordova-plugin-file-opener2-3.0.5.tgz",
- "integrity": "sha512-tjLHDamH5+y0bJZYVe2967L1S4R8tL4Y0rJUzJGoxsyiw3FUlrJNS199POOpzZZ6Xhlntn9a2o7+84r1dMN21A==",
- "engines": {
- "cordova": ">=6.0.0"
- }
- },
- "node_modules/cordova-plugin-whitelist": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.5.tgz",
- "integrity": "sha512-+v/VzCYBdGsIxJTP2m+RWaq7l/NLu7b976w6XGJUFiN2TVOeaGrytaR4jRy0w9akRai8uKFeBmuGHmlS/sOeCA==",
- "engines": {
- "cordovaDependencies": {
- "0.0.0": {
- "cordova-android": ">=4.0.0"
- },
- "1.3.5": {
- "cordova-android": ">=4.0.0 <10.0.0"
- }
- }
- }
- },
- "node_modules/cordova-plugin-x-socialsharing": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-6.0.3.tgz",
- "integrity": "sha512-pnrE2CXsz4G0n0WoFDAasLS1VT3nIsNpddvXgfpiqX3wyOlSjO2NdF+sjYaTvs1B+f7z8EWbYCHpCrgBQiMLIg==",
- "dev": true,
- "engines": [
- {
- "name": "cordova",
- "version": ">=3.0.0"
- }
- ]
- },
- "node_modules/cross-spawn": {
- "version": "7.0.6",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
- "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/dedent": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz",
- "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=",
- "dev": true
- },
- "node_modules/elementtree": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz",
- "integrity": "sha1-mskb5uUvtuYkTE5UpKw+2K6OKcA=",
- "dev": true,
- "dependencies": {
- "sax": "1.1.4"
- },
- "engines": {
- "node": ">= 0.4.0"
- }
- },
- "node_modules/end-of-stream": {
- "version": "1.4.4",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
- "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
- "dev": true,
- "dependencies": {
- "once": "^1.4.0"
- }
- },
- "node_modules/endent": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/endent/-/endent-1.4.1.tgz",
- "integrity": "sha512-buHTb5c8AC9NshtP6dgmNLYkiT+olskbq1z6cEGvfGCF3Qphbu/1zz5Xu+yjTDln8RbxNhPoUyJ5H8MSrp1olQ==",
- "dev": true,
- "dependencies": {
- "dedent": "^0.7.0",
- "fast-json-parse": "^1.0.3",
- "objectorarray": "^1.0.4"
- }
- },
- "node_modules/es6-promise-plugin": {
- "version": "4.2.2",
- "resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz",
- "integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA==",
- "license": "MIT"
- },
- "node_modules/execa": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
- "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==",
- "dev": true,
- "dependencies": {
- "cross-spawn": "^7.0.0",
- "get-stream": "^5.0.0",
- "human-signals": "^1.1.1",
- "is-stream": "^2.0.0",
- "merge-stream": "^2.0.0",
- "npm-run-path": "^4.0.0",
- "onetime": "^5.1.0",
- "signal-exit": "^3.0.2",
- "strip-final-newline": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sindresorhus/execa?sponsor=1"
- }
- },
- "node_modules/extsprintf": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz",
- "integrity": "sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=",
- "dev": true,
- "engines": [
- "node >=0.6.0"
- ]
- },
- "node_modules/fast-glob": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
- "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.2",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.8"
- },
- "engines": {
- "node": ">=8.6.0"
- }
- },
- "node_modules/fast-json-parse": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/fast-json-parse/-/fast-json-parse-1.0.3.tgz",
- "integrity": "sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==",
- "dev": true
- },
- "node_modules/fastq": {
- "version": "1.11.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz",
- "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==",
- "dev": true,
- "dependencies": {
- "reusify": "^1.0.4"
- }
- },
- "node_modules/fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/fs-extra": {
- "version": "9.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
- "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
- "dev": true,
- "dependencies": {
- "at-least-node": "^1.0.0",
- "graceful-fs": "^4.2.0",
- "jsonfile": "^6.0.1",
- "universalify": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
- "dev": true
- },
- "node_modules/get-stream": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
- "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
- "dev": true,
- "dependencies": {
- "pump": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/glob": {
- "version": "7.1.7",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
- "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/graceful-fs": {
- "version": "4.2.6",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
- "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
- "dev": true
- },
- "node_modules/human-signals": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
- "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==",
- "dev": true,
- "engines": {
- "node": ">=8.12.0"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "dev": true
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-glob": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
- "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
- "dev": true,
- "dependencies": {
- "is-extglob": "^2.1.1"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.12.0"
- }
- },
- "node_modules/is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
- "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
- "dev": true
- },
- "node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
- "node_modules/lodash": {
- "version": "4.17.23",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
- "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/merge-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
- "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
- "dev": true
- },
- "node_modules/merge2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
- "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/micromatch": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
- "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "braces": "^3.0.3",
- "picomatch": "^2.3.1"
- },
- "engines": {
- "node": ">=8.6"
- }
- },
- "node_modules/mimic-fn": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
- "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/minimatch": {
- "version": "3.1.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
- "integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/nopt": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
- "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
- "dev": true,
- "dependencies": {
- "abbrev": "1",
- "osenv": "^0.1.4"
- },
- "bin": {
- "nopt": "bin/nopt.js"
- }
- },
- "node_modules/npm-run-path": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
- "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
- "dev": true,
- "dependencies": {
- "path-key": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/objectorarray": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/objectorarray/-/objectorarray-1.0.5.tgz",
- "integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==",
- "dev": true
- },
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "dev": true,
- "dependencies": {
- "wrappy": "1"
- }
- },
- "node_modules/onetime": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
- "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
- "dev": true,
- "dependencies": {
- "mimic-fn": "^2.1.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/os-homedir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
- "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/os-tmpdir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
- "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/osenv": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
- "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
- "dev": true,
- "dependencies": {
- "os-homedir": "^1.0.0",
- "os-tmpdir": "^1.0.0"
- }
- },
- "node_modules/p-finally": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
- "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
- "node_modules/pify": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
- "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/plist": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
- "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@xmldom/xmldom": "^0.8.8",
- "base64-js": "^1.5.1",
- "xmlbuilder": "^15.1.1"
- },
- "engines": {
- "node": ">=10.4.0"
- }
- },
- "node_modules/properties-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz",
- "integrity": "sha1-ExbpU5/7/ZOEXjabIRAiq9R4dxo=",
- "dev": true,
- "dependencies": {
- "string.prototype.codepointat": "^0.2.0"
- },
- "engines": {
- "node": ">= 0.3.1"
- }
- },
- "node_modules/pump": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
- "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
- "dev": true,
- "dependencies": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
- "node_modules/q": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
- "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
- "dev": true,
- "engines": {
- "node": ">=0.6.0",
- "teleport": ">=0.2.0"
- }
- },
- "node_modules/queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/read-chunk": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-3.2.0.tgz",
- "integrity": "sha512-CEjy9LCzhmD7nUpJ1oVOE6s/hBkejlcJEgLQHVnQznOSilOPb+kpKktlLfFDK3/WP43+F80xkUTM2VOkYoSYvQ==",
- "dev": true,
- "dependencies": {
- "pify": "^4.0.1",
- "with-open-file": "^0.1.6"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/recursive-readdir": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz",
- "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "minimatch": "^3.0.5"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
- "dev": true,
- "engines": {
- "iojs": ">=1.0.0",
- "node": ">=0.10.0"
- }
- },
- "node_modules/run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "dependencies": {
- "queue-microtask": "^1.2.2"
- }
- },
- "node_modules/sax": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz",
- "integrity": "sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=",
- "dev": true
- },
- "node_modules/shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "dependencies": {
- "shebang-regex": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/signal-exit": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
- "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
- "dev": true
- },
- "node_modules/simctl": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/simctl/-/simctl-3.0.0.tgz",
- "integrity": "sha512-AoScwFvWCLU7lx9AlqmooHlxQDQDjGdSGAdyLySDeR2IP6ji5L4Z6DdHxmBLAQM61ftaHylXfnF1KWCR56P58w==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 14.17.0"
- }
- },
- "node_modules/simple-plist": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz",
- "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "bplist-creator": "0.1.0",
- "bplist-parser": "0.3.1",
- "plist": "^3.0.5"
- }
- },
- "node_modules/simple-plist/node_modules/bplist-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz",
- "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "big-integer": "1.6.x"
- },
- "engines": {
- "node": ">= 5.10.0"
- }
- },
- "node_modules/stream-buffers": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
- "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==",
- "dev": true,
- "license": "Unlicense",
- "engines": {
- "node": ">= 0.10.0"
- }
- },
- "node_modules/string.prototype.codepointat": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
- "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
- "dev": true
- },
- "node_modules/strip-bom": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
- "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-final-newline": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
- "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
- }
- },
- "node_modules/underscore": {
- "version": "1.13.1",
- "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz",
- "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==",
- "dev": true
- },
- "node_modules/universalify": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
- "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
- "dev": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
- "node_modules/which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/with-open-file": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/with-open-file/-/with-open-file-0.1.7.tgz",
- "integrity": "sha512-ecJS2/oHtESJ1t3ZfMI3B7KIDKyfN0O16miWxdn30zdh66Yd3LsRFebXZXq6GU4xfxLf6nVxp9kIqElb5fqczA==",
- "dev": true,
- "dependencies": {
- "p-finally": "^1.0.0",
- "p-try": "^2.1.0",
- "pify": "^4.0.1"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
- },
- "node_modules/xmlbuilder": {
- "version": "15.1.1",
- "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
- "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8.0"
- }
- }
- },
- "dependencies": {
- "@globules-io/cordova-plugin-ios-xhr": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@globules-io/cordova-plugin-ios-xhr/-/cordova-plugin-ios-xhr-1.2.1.tgz",
- "integrity": "sha512-UJTK5Z+gV58V7UzvptDObTtYubHtN1/w+X6Jsh87BUrtbBSWQF3mdDWWBPGlRtOlyZa3Q79II/Xf5a2yJ4e5iQ==",
- "dev": true
- },
- "@netflix/nerror": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@netflix/nerror/-/nerror-1.1.3.tgz",
- "integrity": "sha512-b+MGNyP9/LXkapreJzNUzcvuzZslj/RGgdVVJ16P2wSlYatfLycPObImqVJSmNAdyeShvNeM/pl3sVZsObFueg==",
- "dev": true,
- "requires": {
- "assert-plus": "^1.0.0",
- "extsprintf": "^1.4.0",
- "lodash": "^4.17.15"
- }
- },
- "@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "dev": true,
- "requires": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- }
- },
- "@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true
- },
- "@nodelib/fs.walk": {
- "version": "1.2.7",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz",
- "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==",
- "dev": true,
- "requires": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- }
- },
- "@xmldom/xmldom": {
- "version": "0.8.11",
- "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz",
- "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==",
- "dev": true
- },
- "abbrev": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
- "dev": true
- },
- "android-versions": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.7.0.tgz",
- "integrity": "sha512-TCy4b8Dk8YS6A23ZPfhSKqK66JHFq0D8avGYiwvYpjno6HrrcI0DRgHx9+jtkvWYmrsE2vQWgbHJhvGGhhOb0g==",
- "dev": true,
- "requires": {
- "semver": "^5.7.1"
- },
- "dependencies": {
- "semver": {
- "version": "5.7.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
- "dev": true
- }
- }
- },
- "ansi": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
- "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=",
- "dev": true
- },
- "assert-plus": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
- "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
- "dev": true
- },
- "at-least-node": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
- "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
- "dev": true
- },
- "balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "bamboo.cordova.plugin.downloader": {
- "version": "git+ssh://[email protected]/sytolk/cordova-plugin-downloader.git#f4d59a2957a6e1b549634f5e3ba8c7d4898c1396",
- "dev": true,
- "from": "bamboo.cordova.plugin.downloader@github:sytolk/cordova-plugin-downloader"
- },
- "base64-js": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "dev": true
- },
- "big-integer": {
- "version": "1.6.48",
- "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
- "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==",
- "dev": true
- },
- "bplist-creator": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
- "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==",
- "dev": true,
- "requires": {
- "stream-buffers": "2.2.x"
- }
- },
- "bplist-parser": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz",
- "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==",
- "dev": true,
- "requires": {
- "big-integer": "^1.6.44"
- }
- },
- "brace-expansion": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
- "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "dev": true,
- "requires": {
- "fill-range": "^7.1.1"
- }
- },
- "com-darryncampbell-cordova-plugin-intent": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/com-darryncampbell-cordova-plugin-intent/-/com-darryncampbell-cordova-plugin-intent-2.0.0.tgz",
- "integrity": "sha512-4f5BAyhpiGVsuouj2cokZCb99RA8V4O5YZnwGMliceFCu35BQcQvC0VLW55jl+xVDLhVymomnaBiHSktKKnK4w==",
- "dev": true
- },
- "concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
- "dev": true
- },
- "cordova-android": {
- "version": "9.1.0",
- "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-9.1.0.tgz",
- "integrity": "sha512-bzOX9E4eQsOSpa06oZZ7XAGq3DwB73juhhj0oPqHH/khWk0mkCD4aiVYMFoc0fmIaSQvzbY1ww7L6UBW5pyGfg==",
- "dev": true,
- "requires": {
- "android-versions": "^1.5.0",
- "cordova-common": "^4.0.1",
- "execa": "^4.0.2",
- "fast-glob": "^3.2.4",
- "fs-extra": "^9.0.1",
- "is-path-inside": "^3.0.2",
- "nopt": "^4.0.3",
- "properties-parser": "^0.3.1",
- "semver": "^7.3.4",
- "which": "^2.0.2"
- },
- "dependencies": {
- "semver": {
- "version": "7.7.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
- "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
- "dev": true
- }
- }
- },
- "cordova-common": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-4.0.2.tgz",
- "integrity": "sha512-od7aNShyuBajzPY83mUEO8tERwwWdFklXETHiXP5Ft87CWeo/tSuwNPFztyTy8XYc74yXdogXKPTJeUHuVzB8Q==",
- "dev": true,
- "requires": {
- "@netflix/nerror": "^1.1.3",
- "ansi": "^0.3.1",
- "bplist-parser": "^0.2.0",
- "cross-spawn": "^7.0.1",
- "elementtree": "^0.1.7",
- "endent": "^1.4.1",
- "fast-glob": "^3.2.2",
- "fs-extra": "^9.0.0",
- "glob": "^7.1.6",
- "plist": "^3.0.1",
- "q": "^1.5.1",
- "read-chunk": "^3.2.0",
- "strip-bom": "^4.0.0",
- "underscore": "^1.9.2"
- }
- },
- "cordova-ios": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-8.0.0.tgz",
- "integrity": "sha512-QsynOV8rnRIhDC3qwM1KdRr1gy5RaqzVCzdOaB+DSBPeR5wVEUGpyyJO0FzlCACzY5X25iDc5O3kbn/F06dJ5Q==",
- "dev": true,
- "requires": {
- "bplist-parser": "^0.3.2",
- "cordova-common": "^6.0.0",
- "elementtree": "^0.1.7",
- "execa": "^5.1.1",
- "nopt": "^9.0.0",
- "plist": "^3.1.0",
- "semver": "^7.7.3",
- "simctl": "^3.0.0",
- "which": "^6.0.0",
- "xcode": "^3.0.1"
- },
- "dependencies": {
- "abbrev": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz",
- "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==",
- "dev": true
- },
- "bplist-parser": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz",
- "integrity": "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==",
- "dev": true,
- "requires": {
- "big-integer": "1.6.x"
- }
- },
- "cordova-common": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-6.0.0.tgz",
- "integrity": "sha512-16WPC1DuxVdshV3RoQUXqhcJVdhxWGwiFysA4TkYuboqoev6mgt0JuIJFxmQbzR/DuyuONaVe0L0O0Hf1C08Mg==",
- "dev": true,
- "requires": {
- "@netflix/nerror": "^1.1.3",
- "ansi": "^0.3.1",
- "bplist-parser": "^0.3.2",
- "elementtree": "^0.1.7",
- "endent": "^2.1.0",
- "fast-glob": "^3.3.3",
- "plist": "^3.1.0"
- }
- },
- "endent": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/endent/-/endent-2.1.0.tgz",
- "integrity": "sha512-r8VyPX7XL8U01Xgnb1CjZ3XV+z90cXIJ9JPE/R9SEC9vpw2P6CfsRPJmp20DppC5N7ZAMCmjYkJIa744Iyg96w==",
- "dev": true,
- "requires": {
- "dedent": "^0.7.0",
- "fast-json-parse": "^1.0.3",
- "objectorarray": "^1.0.5"
- }
- },
- "execa": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
- "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
- "dev": true,
- "requires": {
- "cross-spawn": "^7.0.3",
- "get-stream": "^6.0.0",
- "human-signals": "^2.1.0",
- "is-stream": "^2.0.0",
- "merge-stream": "^2.0.0",
- "npm-run-path": "^4.0.1",
- "onetime": "^5.1.2",
- "signal-exit": "^3.0.3",
- "strip-final-newline": "^2.0.0"
- }
- },
- "get-stream": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
- "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
- "dev": true
- },
- "human-signals": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
- "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
- "dev": true
- },
- "isexe": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz",
- "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==",
- "dev": true
- },
- "nopt": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz",
- "integrity": "sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==",
- "dev": true,
- "requires": {
- "abbrev": "^4.0.0"
- }
- },
- "semver": {
- "version": "7.7.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
- "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
- "dev": true
- },
- "uuid": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz",
- "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==",
- "dev": true
- },
- "which": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz",
- "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==",
- "dev": true,
- "requires": {
- "isexe": "^4.0.0"
- }
- },
- "xcode": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz",
- "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==",
- "dev": true,
- "requires": {
- "simple-plist": "^1.1.0",
- "uuid": "^7.0.3"
- }
- }
- }
- },
- "cordova-ourcodeworld-filebrowser": {
- "version": "git+ssh://[email protected]/muhammed-noufal/cordova-ourcodeworld-filebrowser.git#07b8d2298a53691913101da5f704cb11159aed70",
- "integrity": "sha512-LIMJWW84bF4M1pKkLCH4g3pdzV+U1Jd3zGmdI2gOhcJ1EmSt9Z4++Jq3qrU2XRO3R3kKtEc6qeW139uOtG1CEg==",
- "dev": true,
- "from": "cordova-ourcodeworld-filebrowser@git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git"
- },
- "cordova-plugin-androidx": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/cordova-plugin-androidx/-/cordova-plugin-androidx-3.0.0.tgz",
- "integrity": "sha512-niMnhcxKsu4/oKTUbL0jRAnh6/cdoIVxRxJqj3uEyv8CVOlAj1sWhX+9b1XiAo9+bejAM9BbA21YK0mChfbVTA==",
- "dev": true
- },
- "cordova-plugin-androidx-adapter": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-androidx-adapter/-/cordova-plugin-androidx-adapter-1.1.3.tgz",
- "integrity": "sha512-W1SImn0cCCvOSTSfWWp5TnanIQrSuh2Bch+dcZXIzEn0km3Qb7VryeAqHhgBQYwwzC5Ollk1DtUAk/AJSojuZA==",
- "dev": true,
- "requires": {
- "q": "^1.5.1",
- "recursive-readdir": "^2.2.2"
- }
- },
- "cordova-plugin-background-mode": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-background-mode/-/cordova-plugin-background-mode-0.7.3.tgz",
- "integrity": "sha512-LsU1v7EgTUROaks+tcQ8TnMzVUcU/TwjDVwj2O/4e4aI2q2ldLGsiZorqKqfqvwh2HoIssmY73OwJk91hQi62w=="
- },
- "cordova-plugin-camera": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-5.0.2.tgz",
- "integrity": "sha512-iR9W9S+USg/YTjwB+6rnIqJ1mZ02da0Q2VDU0Twf/CccEJO+006T5RM/NYDkBRs6vMCw7rWXroCNJOPBLLETPQ==",
- "dev": true
- },
- "cordova-plugin-device": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz",
- "integrity": "sha512-Jb3V72btxf3XHpkPQsGdyc8N6tVBYn1vsxSFj43fIz9vonJDUThYPCJJHqk6PX6N4dJw6I4FjxkpfCR4LDYMlw=="
- },
- "cordova-plugin-file": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-7.0.0.tgz",
- "integrity": "sha512-mSwy9GE5pHq2ZHhu/wYk/VhrwR5VLk+XQsk3+IiiFmDgcPsrVIyELkM2FZKX09cC6i+bJVTFVKUlwteSStj3ow==",
- "dev": true
- },
- "cordova-plugin-file-opener2": {
- "version": "3.0.5",
- "resolved": "https://registry.npmjs.org/cordova-plugin-file-opener2/-/cordova-plugin-file-opener2-3.0.5.tgz",
- "integrity": "sha512-tjLHDamH5+y0bJZYVe2967L1S4R8tL4Y0rJUzJGoxsyiw3FUlrJNS199POOpzZZ6Xhlntn9a2o7+84r1dMN21A=="
- },
- "cordova-plugin-whitelist": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.5.tgz",
- "integrity": "sha512-+v/VzCYBdGsIxJTP2m+RWaq7l/NLu7b976w6XGJUFiN2TVOeaGrytaR4jRy0w9akRai8uKFeBmuGHmlS/sOeCA=="
- },
- "cordova-plugin-x-socialsharing": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-6.0.3.tgz",
- "integrity": "sha512-pnrE2CXsz4G0n0WoFDAasLS1VT3nIsNpddvXgfpiqX3wyOlSjO2NdF+sjYaTvs1B+f7z8EWbYCHpCrgBQiMLIg==",
- "dev": true
- },
- "cross-spawn": {
- "version": "7.0.6",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
- "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
- "dev": true,
- "requires": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- }
- },
- "dedent": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz",
- "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=",
- "dev": true
- },
- "elementtree": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz",
- "integrity": "sha1-mskb5uUvtuYkTE5UpKw+2K6OKcA=",
- "dev": true,
- "requires": {
- "sax": "1.1.4"
- }
- },
- "end-of-stream": {
- "version": "1.4.4",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
- "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
- "dev": true,
- "requires": {
- "once": "^1.4.0"
- }
- },
- "endent": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/endent/-/endent-1.4.1.tgz",
- "integrity": "sha512-buHTb5c8AC9NshtP6dgmNLYkiT+olskbq1z6cEGvfGCF3Qphbu/1zz5Xu+yjTDln8RbxNhPoUyJ5H8MSrp1olQ==",
- "dev": true,
- "requires": {
- "dedent": "^0.7.0",
- "fast-json-parse": "^1.0.3",
- "objectorarray": "^1.0.4"
- }
- },
- "es6-promise-plugin": {
- "version": "4.2.2",
- "resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz",
- "integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA=="
- },
- "execa": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
- "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==",
- "dev": true,
- "requires": {
- "cross-spawn": "^7.0.0",
- "get-stream": "^5.0.0",
- "human-signals": "^1.1.1",
- "is-stream": "^2.0.0",
- "merge-stream": "^2.0.0",
- "npm-run-path": "^4.0.0",
- "onetime": "^5.1.0",
- "signal-exit": "^3.0.2",
- "strip-final-newline": "^2.0.0"
- }
- },
- "extsprintf": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz",
- "integrity": "sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=",
- "dev": true
- },
- "fast-glob": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
- "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
- "dev": true,
- "requires": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.2",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.8"
- }
- },
- "fast-json-parse": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/fast-json-parse/-/fast-json-parse-1.0.3.tgz",
- "integrity": "sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==",
- "dev": true
- },
- "fastq": {
- "version": "1.11.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz",
- "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==",
- "dev": true,
- "requires": {
- "reusify": "^1.0.4"
- }
- },
- "fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "dev": true,
- "requires": {
- "to-regex-range": "^5.0.1"
- }
- },
- "fs-extra": {
- "version": "9.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
- "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
- "dev": true,
- "requires": {
- "at-least-node": "^1.0.0",
- "graceful-fs": "^4.2.0",
- "jsonfile": "^6.0.1",
- "universalify": "^2.0.0"
- }
- },
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
- "dev": true
- },
- "get-stream": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
- "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
- "dev": true,
- "requires": {
- "pump": "^3.0.0"
- }
- },
- "glob": {
- "version": "7.1.7",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
- "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "requires": {
- "is-glob": "^4.0.1"
- }
- },
- "graceful-fs": {
- "version": "4.2.6",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
- "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
- "dev": true
- },
- "human-signals": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
- "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==",
- "dev": true
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "dev": true
- },
- "is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
- "dev": true
- },
- "is-glob": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
- "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
- "dev": true,
- "requires": {
- "is-extglob": "^2.1.1"
- }
- },
- "is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true
- },
- "is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true
- },
- "is-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
- "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
- "dev": true
- },
- "isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
- "dev": true
- },
- "jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.6",
- "universalify": "^2.0.0"
- }
- },
- "lodash": {
- "version": "4.17.23",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
- "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
- "dev": true
- },
- "merge-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
- "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
- "dev": true
- },
- "merge2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
- "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
- "dev": true
- },
- "micromatch": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
- "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
- "dev": true,
- "requires": {
- "braces": "^3.0.3",
- "picomatch": "^2.3.1"
- }
- },
- "mimic-fn": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
- "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
- "dev": true
- },
- "minimatch": {
- "version": "3.1.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
- "integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- },
- "nopt": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
- "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
- "dev": true,
- "requires": {
- "abbrev": "1",
- "osenv": "^0.1.4"
- }
- },
- "npm-run-path": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
- "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
- "dev": true,
- "requires": {
- "path-key": "^3.0.0"
- }
- },
- "objectorarray": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/objectorarray/-/objectorarray-1.0.5.tgz",
- "integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==",
- "dev": true
- },
- "once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "dev": true,
- "requires": {
- "wrappy": "1"
- }
- },
- "onetime": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
- "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
- "dev": true,
- "requires": {
- "mimic-fn": "^2.1.0"
- }
- },
- "os-homedir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
- "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
- "dev": true
- },
- "os-tmpdir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
- "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
- "dev": true
- },
- "osenv": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
- "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
- "dev": true,
- "requires": {
- "os-homedir": "^1.0.0",
- "os-tmpdir": "^1.0.0"
- }
- },
- "p-finally": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
- "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
- "dev": true
- },
- "p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
- "dev": true
- },
- "path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true
- },
- "picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true
- },
- "pify": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
- "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
- "dev": true
- },
- "plist": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
- "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",
- "dev": true,
- "requires": {
- "@xmldom/xmldom": "^0.8.8",
- "base64-js": "^1.5.1",
- "xmlbuilder": "^15.1.1"
- }
- },
- "properties-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz",
- "integrity": "sha1-ExbpU5/7/ZOEXjabIRAiq9R4dxo=",
- "dev": true,
- "requires": {
- "string.prototype.codepointat": "^0.2.0"
- }
- },
- "pump": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
- "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
- "dev": true,
- "requires": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
- "q": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
- "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
- "dev": true
- },
- "queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true
- },
- "read-chunk": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-3.2.0.tgz",
- "integrity": "sha512-CEjy9LCzhmD7nUpJ1oVOE6s/hBkejlcJEgLQHVnQznOSilOPb+kpKktlLfFDK3/WP43+F80xkUTM2VOkYoSYvQ==",
- "dev": true,
- "requires": {
- "pify": "^4.0.1",
- "with-open-file": "^0.1.6"
- }
- },
- "recursive-readdir": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz",
- "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==",
- "dev": true,
- "requires": {
- "minimatch": "^3.0.5"
- }
- },
- "reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
- "dev": true
- },
- "run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "requires": {
- "queue-microtask": "^1.2.2"
- }
- },
- "sax": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz",
- "integrity": "sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=",
- "dev": true
- },
- "shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "requires": {
- "shebang-regex": "^3.0.0"
- }
- },
- "shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true
- },
- "signal-exit": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
- "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
- "dev": true
- },
- "simctl": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/simctl/-/simctl-3.0.0.tgz",
- "integrity": "sha512-AoScwFvWCLU7lx9AlqmooHlxQDQDjGdSGAdyLySDeR2IP6ji5L4Z6DdHxmBLAQM61ftaHylXfnF1KWCR56P58w==",
- "dev": true
- },
- "simple-plist": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz",
- "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==",
- "dev": true,
- "requires": {
- "bplist-creator": "0.1.0",
- "bplist-parser": "0.3.1",
- "plist": "^3.0.5"
- },
- "dependencies": {
- "bplist-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz",
- "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==",
- "dev": true,
- "requires": {
- "big-integer": "1.6.x"
- }
- }
- }
- },
- "stream-buffers": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
- "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==",
- "dev": true
- },
- "string.prototype.codepointat": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
- "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
- "dev": true
- },
- "strip-bom": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
- "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
- "dev": true
- },
- "strip-final-newline": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
- "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
- "dev": true
- },
- "to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "requires": {
- "is-number": "^7.0.0"
- }
- },
- "underscore": {
- "version": "1.13.1",
- "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz",
- "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==",
- "dev": true
- },
- "universalify": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
- "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
- "dev": true
- },
- "which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- },
- "with-open-file": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/with-open-file/-/with-open-file-0.1.7.tgz",
- "integrity": "sha512-ecJS2/oHtESJ1t3ZfMI3B7KIDKyfN0O16miWxdn30zdh66Yd3LsRFebXZXq6GU4xfxLf6nVxp9kIqElb5fqczA==",
- "dev": true,
- "requires": {
- "p-finally": "^1.0.0",
- "p-try": "^2.1.0",
- "pify": "^4.0.1"
- }
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
- },
- "xmlbuilder": {
- "version": "15.1.1",
- "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
- "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
- "dev": true
- }
- }
-}
diff --git a/cordova/package.json b/cordova/package.json
deleted file mode 100644
index 016b7edc2..000000000
--- a/cordova/package.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "name": "org.tagspaces.iosn",
- "displayName": "TagSpaces",
- "version": "1.0.4",
- "description": "A sample Apache Cordova application that responds to the deviceready event.",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "Apache Cordova Team",
- "license": "Apache-2.0",
- "dependencies": {
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-device": "^2.0.3",
- "cordova-plugin-file-opener2": "^3.0.5",
- "cordova-plugin-whitelist": "1.3.5",
- "es6-promise-plugin": "4.2.2"
- },
- "cordova": {
- "plugins": {
- "cordova-plugin-whitelist": {},
- "cordova-plugin-device": {},
- "cordova-plugin-background-mode": {},
- "cordova-plugin-file": {},
- "cordova-plugin-file-opener2": {
- "ANDROID_SUPPORT_V4_VERSION": "27.+"
- },
- "bamboo.cordova.plugin.downloader": {},
- "cordova-plugin-x-socialsharing": {
- "ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
- "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
- "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
- },
- "cordova-plugin-camera": {
- "ANDROID_SUPPORT_V4_VERSION": "27.+"
- },
- "cordova-plugin-androidx-adapter": {},
- "com-darryncampbell-cordova-plugin-intent": {},
- "cordova-plugin-androidx": {}
- },
- "platforms": [
- "android",
- "ios"
- ]
- },
- "devDependencies": {
- "@globules-io/cordova-plugin-ios-xhr": "^1.0.4",
- "bamboo.cordova.plugin.downloader": "github:sytolk/cordova-plugin-downloader",
- "com-darryncampbell-cordova-plugin-intent": "^2.0.0",
- "cordova-android": "^9.1.0",
- "cordova-ios": "^8.0.0",
- "cordova-ourcodeworld-filebrowser": "git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git",
- "cordova-plugin-androidx": "^3.0.0",
- "cordova-plugin-androidx-adapter": "^1.1.3",
- "cordova-plugin-camera": "^5.0.2",
- "cordova-plugin-file": "7.0.0",
- "cordova-plugin-x-socialsharing": "^6.0.3"
- }
-}
diff --git a/cordova/platforms/android/.gitignore b/cordova/platforms/android/.gitignore
deleted file mode 100644
index 427a160a1..000000000
--- a/cordova/platforms/android/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-# Non-project-specific build files:
-build.xml
-local.properties
-/gradlew
-/gradlew.bat
-/gradle
-# Ant builds
-ant-build
-ant-gen
-# Eclipse builds
-gen
-out
-# Gradle build artifacts
-.gradle
-.gradletasknamecache
-/build
-/CordovaLib/build
-/app/build
-gradle-app.setting
-# Android Studio
-.idea
diff --git a/cordova/platforms/android/CordovaLib/AndroidManifest.xml b/cordova/platforms/android/CordovaLib/AndroidManifest.xml
deleted file mode 100755
index 320c2538e..000000000
--- a/cordova/platforms/android/CordovaLib/AndroidManifest.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.apache.cordova" android:versionName="1.0" android:versionCode="1">
-</manifest>
diff --git a/cordova/platforms/android/CordovaLib/build.gradle b/cordova/platforms/android/CordovaLib/build.gradle
deleted file mode 100644
index 42978a2f0..000000000
--- a/cordova/platforms/android/CordovaLib/build.gradle
+++ /dev/null
@@ -1,126 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-ext {
- apply from: 'cordova.gradle'
- cdvCompileSdkVersion = privateHelpers.getProjectTarget()
- cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
- if (project.hasProperty('cdvMinSdkVersion') && cdvMinSdkVersion.isInteger()) {
- cdvMinSdkVersion = cdvMinSdkVersion as int
- println '[Cordova] cdvMinSdkVersion is overridden, try it at your own risk.'
- } else {
- cdvMinSdkVersion = 22; // current Cordova's default
- }
-}
-
-buildscript {
- apply from: 'repositories.gradle'
- repositories repos
-
- dependencies {
- // The gradle plugin and the maven plugin have to be updated after each version of Android
- // studio comes out
- classpath 'com.android.tools.build:gradle:4.0.0'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
- }
-}
-
-allprojects {
- apply from: 'repositories.gradle'
- repositories repos
-}
-
-apply plugin: 'com.android.library'
-apply plugin: 'com.github.dcendents.android-maven'
-
-group = 'org.apache.cordova'
-version = '9.1.0'
-
-android {
- compileSdkVersion cdvCompileSdkVersion
- buildToolsVersion cdvBuildToolsVersion
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- // For the Android Cordova Lib, we allow changing the minSdkVersion, but it is at the users own risk
- defaultConfig {
- minSdkVersion cdvMinSdkVersion
- }
-
- sourceSets {
- main {
- manifest.srcFile 'AndroidManifest.xml'
- java.srcDirs = ['src']
- resources.srcDirs = ['src']
- aidl.srcDirs = ['src']
- renderscript.srcDirs = ['src']
- res.srcDirs = ['res']
- assets.srcDirs = ['assets']
- }
- }
-
- packagingOptions {
- exclude 'META-INF/LICENSE'
- exclude 'META-INF/LICENSE.txt'
- exclude 'META-INF/DEPENDENCIES'
- exclude 'META-INF/NOTICE'
- }
-}
-
-install {
- repositories.mavenInstaller {
- pom {
- project {
- packaging 'aar'
- name 'Cordova'
- url 'https://cordova.apache.org'
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- }
- }
- developers {
- developer {
- id 'stevengill'
- name 'Steve Gill'
- }
- }
- scm {
- connection 'scm:git:https://github.com/apache/cordova-android.git'
- developerConnection 'scm:git:[email protected]:apache/cordova-android.git'
- url 'https://github.com/apache/cordova-android'
-
- }
- }
- }
- }
-}
-
-task sourcesJar(type: Jar) {
- from android.sourceSets.main.java.srcDirs
- classifier = 'sources'
-}
-
-artifacts {
- archives sourcesJar
-}
-
diff --git a/cordova/platforms/android/CordovaLib/cordova.gradle b/cordova/platforms/android/CordovaLib/cordova.gradle
deleted file mode 100644
index feee63fc1..000000000
--- a/cordova/platforms/android/CordovaLib/cordova.gradle
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-import java.util.regex.Pattern
-import groovy.swing.SwingBuilder
-
-// Replacement for com.g00fy2:versioncompare (no longer available on JCenter)
-class Version implements Comparable<Version> {
- private final String original
- private final List<Integer> parts
-
- Version(String version) {
- this.original = version ?: '0.0.0'
- this.parts = this.original.tokenize('.').collect {
- try { it.replaceAll('[^0-9].*', '').toInteger() } catch (e) { 0 }
- }
- }
-
- boolean isEqual(String other) { compareTo(new Version(other)) == 0 }
- boolean isHigherThan(String other) { compareTo(new Version(other)) > 0 }
- boolean isLowerThan(String other) { compareTo(new Version(other)) < 0 }
- String getOriginalString() { original }
-
- @Override
- int compareTo(Version other) {
- int maxLen = Math.max(parts.size(), other.parts.size())
- for (int i = 0; i < maxLen; i++) {
- int a = i < parts.size() ? parts[i] : 0
- int b = i < other.parts.size() ? other.parts[i] : 0
- if (a != b) return a <=> b
- }
- return 0
- }
-
- @Override
- String toString() { original }
-}
-
-String doEnsureValueExists(filePath, props, key) {
- if (props.get(key) == null) {
- throw new GradleException(filePath + ': Missing key required "' + key + '"')
- }
- return props.get(key)
-}
-
-String doGetProjectTarget() {
- def props = new Properties()
- def propertiesFile = 'project.properties';
- if(!(file(propertiesFile).exists())) {
- propertiesFile = '../project.properties';
- }
- file(propertiesFile).withReader { reader ->
- props.load(reader)
- }
- return doEnsureValueExists('project.properties', props, 'target')
-}
-
-Boolean isVersionValid(version) {
- return !(new Version(version)).isEqual('0.0.0')
-}
-
-String doFindLatestInstalledBuildTools(String minBuildToolsVersionString) {
- def buildToolsDirContents
- try {
- def buildToolsDir = new File(getAndroidSdkDir(), "build-tools")
- buildToolsDirContents = buildToolsDir.list()
- } catch (e) {
- println "An exception occurred while trying to find the Android build tools."
- throw e
- }
-
- def highestBuildToolsVersion = buildToolsDirContents
- .collect { new Version(it) }
- // Invalid inputs will be handled as 0.0.0
- .findAll { it.isHigherThan('0.0.0') }
- .max()
-
- if (highestBuildToolsVersion == null) {
- throw new RuntimeException("""
- No installed build tools found. Install the Android build tools
- version ${minBuildToolsVersionString} or higher.
- """.replaceAll(/\s+/, ' ').trim())
- }
-
- if (highestBuildToolsVersion.isLowerThan(minBuildToolsVersionString)) {
- throw new RuntimeException("""
- No usable Android build tools found. Highest installed version is
- ${highestBuildToolsVersion.getOriginalString()}; minimum version
- required is ${minBuildToolsVersionString}.
- """.replaceAll(/\s+/, ' ').trim())
- }
-
- highestBuildToolsVersion.getOriginalString()
-}
-
-String getAndroidSdkDir() {
- def rootDir = project.rootDir
- def androidSdkDir = null
- String envVar = System.getenv("ANDROID_SDK_ROOT")
- if (envVar == null) {
- envVar = System.getenv("ANDROID_HOME")
- }
-
- def localProperties = new File(rootDir, 'local.properties')
- String systemProperty = System.getProperty("android.home")
- if (envVar != null) {
- androidSdkDir = envVar
- } else if (localProperties.exists()) {
- Properties properties = new Properties()
- localProperties.withInputStream { instr ->
- properties.load(instr)
- }
- def sdkDirProp = properties.getProperty('sdk.dir')
- if (sdkDirProp != null) {
- androidSdkDir = sdkDirProp
- } else {
- sdkDirProp = properties.getProperty('android.dir')
- if (sdkDirProp != null) {
- androidSdkDir = (new File(rootDir, sdkDirProp)).getAbsolutePath()
- }
- }
- }
- if (androidSdkDir == null && systemProperty != null) {
- androidSdkDir = systemProperty
- }
- if (androidSdkDir == null) {
- throw new RuntimeException(
- "Unable to determine Android SDK directory.")
- }
- androidSdkDir
-}
-
-def doExtractIntFromManifest(name) {
- def manifestFile = file(android.sourceSets.main.manifest.srcFile)
- def pattern = Pattern.compile(name + "=\"(\\d+)\"")
- def matcher = pattern.matcher(manifestFile.getText())
- matcher.find()
- return new BigInteger(matcher.group(1))
-}
-
-def doExtractStringFromManifest(name) {
- def manifestFile = file(android.sourceSets.main.manifest.srcFile)
- def pattern = Pattern.compile(name + "=\"(\\S+)\"")
- def matcher = pattern.matcher(manifestFile.getText())
- matcher.find()
- return matcher.group(1)
-}
-
-def doPromptForPassword(msg) {
- if (System.console() == null) {
- def ret = null
- new SwingBuilder().edt {
- dialog(modal: true, title: 'Enter password', alwaysOnTop: true, resizable: false, locationRelativeTo: null, pack: true, show: true) {
- vbox {
- label(text: msg)
- def input = passwordField()
- button(defaultButton: true, text: 'OK', actionPerformed: {
- ret = input.password;
- dispose();
- })
- }
- }
- }
- if (!ret) {
- throw new GradleException('User canceled build')
- }
- return new String(ret)
- } else {
- return System.console().readPassword('\n' + msg);
- }
-}
-
-def doGetConfigXml() {
- def xml = file("src/main/res/xml/config.xml").getText()
- // Disable namespace awareness since Cordova doesn't use them properly
- return new XmlParser(false, false).parseText(xml)
-}
-
-def doGetConfigPreference(name, defaultValue) {
- name = name.toLowerCase()
- def root = doGetConfigXml()
-
- def ret = defaultValue
- root.preference.each { it ->
- def attrName = it.attribute("name")
- if (attrName && attrName.toLowerCase() == name) {
- ret = it.attribute("value")
- }
- }
- return ret
-}
-
-// Properties exported here are visible to all plugins.
-ext {
- // These helpers are shared, but are not guaranteed to be stable / unchanged.
- privateHelpers = {}
- privateHelpers.getProjectTarget = { doGetProjectTarget() }
- privateHelpers.findLatestInstalledBuildTools = { doFindLatestInstalledBuildTools('19.1.0') }
- privateHelpers.extractIntFromManifest = { name -> doExtractIntFromManifest(name) }
- privateHelpers.extractStringFromManifest = { name -> doExtractStringFromManifest(name) }
- privateHelpers.promptForPassword = { msg -> doPromptForPassword(msg) }
- privateHelpers.ensureValueExists = { filePath, props, key -> doEnsureValueExists(filePath, props, key) }
-
- // These helpers can be used by plugins / projects and will not change.
- cdvHelpers = {}
- // Returns a XmlParser for the config.xml. Added in 4.1.0.
- cdvHelpers.getConfigXml = { doGetConfigXml() }
- // Returns the value for the desired <preference>. Added in 4.1.0.
- cdvHelpers.getConfigPreference = { name, defaultValue -> doGetConfigPreference(name, defaultValue) }
- // isVersionValid exposed for use in build.gradle
- cdvHelpers.isVersionValid = { version -> isVersionValid(version) }
-}
diff --git a/cordova/platforms/android/CordovaLib/project.properties b/cordova/platforms/android/CordovaLib/project.properties
deleted file mode 100644
index d05191746..000000000
--- a/cordova/platforms/android/CordovaLib/project.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file was originally created by the Android Tools, but is now
-# used by cordova-android to manage the project configuration.
-
-# Indicates whether an apk should be generated for each density.
-split.density=false
-
-# Project target.
-target=android-29
-apk-configurations=
-renderscript.opt.level=O0
-android.library=true
diff --git a/cordova/platforms/android/CordovaLib/repositories.gradle b/cordova/platforms/android/CordovaLib/repositories.gradle
deleted file mode 100644
index 3a397a83e..000000000
--- a/cordova/platforms/android/CordovaLib/repositories.gradle
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-ext.repos = {
- mavenCentral()
- google()
- maven { url 'https://jitpack.io' }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/AuthenticationToken.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/AuthenticationToken.java
deleted file mode 100644
index d3a231a0b..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/AuthenticationToken.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-/**
- * The Class AuthenticationToken defines the userName and password to be used for authenticating a web resource
- */
-public class AuthenticationToken {
- private String userName;
- private String password;
-
- /**
- * Gets the user name.
- *
- * @return the user name
- */
- public String getUserName() {
- return userName;
- }
-
- /**
- * Sets the user name.
- *
- * @param userName
- * the new user name
- */
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- /**
- * Gets the password.
- *
- * @return the password
- */
- public String getPassword() {
- return password;
- }
-
- /**
- * Sets the password.
- *
- * @param password
- * the new password
- */
- public void setPassword(String password) {
- this.password = password;
- }
-
-
-
-
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/BuildHelper.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/BuildHelper.java
deleted file mode 100644
index 94fe96120..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/BuildHelper.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-/*
- * This is a utility class that allows us to get the BuildConfig variable, which is required
- * for the use of different providers. This is not guaranteed to work, and it's better for this
- * to be set in the build step in config.xml
- *
- */
-
-import android.app.Activity;
-import android.content.Context;
-
-import java.lang.reflect.Field;
-
-
-public class BuildHelper {
-
-
- private static String TAG="BuildHelper";
-
- /*
- * This needs to be implemented if you wish to use the Camera Plugin or other plugins
- * that read the Build Configuration.
- *
- * Thanks to Phil@Medtronic and Graham Borland for finding the answer and posting it to
- * StackOverflow. This is annoying as hell! However, this method does not work with
- * ProGuard, and you should use the config.xml to define the application_id
- *
- */
-
- public static Object getBuildConfigValue(Context ctx, String key)
- {
- try
- {
- Class<?> clazz = Class.forName(ctx.getClass().getPackage().getName() + ".BuildConfig");
- Field field = clazz.getField(key);
- return field.get(null);
- } catch (ClassNotFoundException e) {
- LOG.d(TAG, "Unable to get the BuildConfig, is this built with ANT?");
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
- LOG.d(TAG, key + " is not a valid field. Check your build.gradle");
- } catch (IllegalAccessException e) {
- LOG.d(TAG, "Illegal Access Exception: Let's print a stack trace.");
- e.printStackTrace();
- } catch (NullPointerException e) {
- LOG.d(TAG, "Null Pointer Exception: Let's print a stack trace.");
- e.printStackTrace();
- }
-
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CallbackContext.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CallbackContext.java
deleted file mode 100644
index 43363869d..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CallbackContext.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import org.json.JSONArray;
-
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.PluginResult;
-import org.json.JSONObject;
-
-public class CallbackContext {
- private static final String LOG_TAG = "CordovaPlugin";
-
- private String callbackId;
- private CordovaWebView webView;
- protected boolean finished;
- private int changingThreads;
-
- public CallbackContext(String callbackId, CordovaWebView webView) {
- this.callbackId = callbackId;
- this.webView = webView;
- }
-
- public boolean isFinished() {
- return finished;
- }
-
- public boolean isChangingThreads() {
- return changingThreads > 0;
- }
-
- public String getCallbackId() {
- return callbackId;
- }
-
- public void sendPluginResult(PluginResult pluginResult) {
- synchronized (this) {
- if (finished) {
- LOG.w(LOG_TAG, "Attempted to send a second callback for ID: " + callbackId + "\nResult was: " + pluginResult.getMessage());
- return;
- } else {
- finished = !pluginResult.getKeepCallback();
- }
- }
- webView.sendPluginResult(pluginResult, callbackId);
- }
-
- /**
- * Helper for success callbacks that just returns the Status.OK by default
- *
- * @param message The message to add to the success result.
- */
- public void success(JSONObject message) {
- sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
- }
-
- /**
- * Helper for success callbacks that just returns the Status.OK by default
- *
- * @param message The message to add to the success result.
- */
- public void success(String message) {
- sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
- }
-
- /**
- * Helper for success callbacks that just returns the Status.OK by default
- *
- * @param message The message to add to the success result.
- */
- public void success(JSONArray message) {
- sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
- }
-
- /**
- * Helper for success callbacks that just returns the Status.OK by default
- *
- * @param message The message to add to the success result.
- */
- public void success(byte[] message) {
- sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
- }
-
- /**
- * Helper for success callbacks that just returns the Status.OK by default
- *
- * @param message The message to add to the success result.
- */
- public void success(int message) {
- sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
- }
-
- /**
- * Helper for success callbacks that just returns the Status.OK by default
- */
- public void success() {
- sendPluginResult(new PluginResult(PluginResult.Status.OK));
- }
-
- /**
- * Helper for error callbacks that just returns the Status.ERROR by default
- *
- * @param message The message to add to the error result.
- */
- public void error(JSONObject message) {
- sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message));
- }
-
- /**
- * Helper for error callbacks that just returns the Status.ERROR by default
- *
- * @param message The message to add to the error result.
- */
- public void error(String message) {
- sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message));
- }
-
- /**
- * Helper for error callbacks that just returns the Status.ERROR by default
- *
- * @param message The message to add to the error result.
- */
- public void error(int message) {
- sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message));
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CallbackMap.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CallbackMap.java
deleted file mode 100644
index 050daa01f..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CallbackMap.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.util.Pair;
-import android.util.SparseArray;
-
-/**
- * Provides a collection that maps unique request codes to CordovaPlugins and Integers.
- * Used to ensure that when plugins make requests for runtime permissions, those requests do not
- * collide with requests from other plugins that use the same request code value.
- */
-public class CallbackMap {
- private int currentCallbackId = 0;
- private SparseArray<Pair<CordovaPlugin, Integer>> callbacks;
-
- public CallbackMap() {
- this.callbacks = new SparseArray<Pair<CordovaPlugin, Integer>>();
- }
-
- /**
- * Stores a CordovaPlugin and request code and returns a new unique request code to use
- * in a permission request.
- *
- * @param receiver The plugin that is making the request
- * @param requestCode The original request code used by the plugin
- * @return A unique request code that can be used to retrieve this callback
- * with getAndRemoveCallback()
- */
- public synchronized int registerCallback(CordovaPlugin receiver, int requestCode) {
- int mappedId = this.currentCallbackId++;
- callbacks.put(mappedId, new Pair<CordovaPlugin, Integer>(receiver, requestCode));
- return mappedId;
- }
-
- /**
- * Retrieves and removes a callback stored in the map using the mapped request code
- * obtained from registerCallback()
- *
- * @param mappedId The request code obtained from registerCallback()
- * @return The CordovaPlugin and orignal request code that correspond to the
- * given mappedCode
- */
- public synchronized Pair<CordovaPlugin, Integer> getAndRemoveCallback(int mappedId) {
- Pair<CordovaPlugin, Integer> callback = callbacks.get(mappedId);
- callbacks.remove(mappedId);
- return callback;
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/Config.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/Config.java
deleted file mode 100644
index 073979599..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/Config.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-import java.util.List;
-
-import android.app.Activity;
-
-@Deprecated // Use Whitelist, CordovaPrefences, etc. directly.
-public class Config {
- private static final String TAG = "Config";
-
- static ConfigXmlParser parser;
-
- private Config() {
- }
-
- public static void init(Activity action) {
- parser = new ConfigXmlParser();
- parser.parse(action);
- //TODO: Add feature to bring this back. Some preferences should be overridden by intents, but not all
- parser.getPreferences().setPreferencesBundle(action.getIntent().getExtras());
- }
-
- // Intended to be used for testing only; creates an empty configuration.
- public static void init() {
- if (parser == null) {
- parser = new ConfigXmlParser();
- }
- }
-
- public static String getStartUrl() {
- if (parser == null) {
- return "file:///android_asset/www/index.html";
- }
- return parser.getLaunchUrl();
- }
-
- public static String getErrorUrl() {
- return parser.getPreferences().getString("errorurl", null);
- }
-
- public static List<PluginEntry> getPluginEntries() {
- return parser.getPluginEntries();
- }
-
- public static CordovaPreferences getPreferences() {
- return parser.getPreferences();
- }
-
- public static boolean isInitialized() {
- return parser != null;
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ConfigXmlParser.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ConfigXmlParser.java
deleted file mode 100644
index 01a97f2d0..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ConfigXmlParser.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import android.content.Context;
-
-public class ConfigXmlParser {
- private static String TAG = "ConfigXmlParser";
-
- private String launchUrl = "file:///android_asset/www/index.html";
- private CordovaPreferences prefs = new CordovaPreferences();
- private ArrayList<PluginEntry> pluginEntries = new ArrayList<PluginEntry>(20);
-
- public CordovaPreferences getPreferences() {
- return prefs;
- }
-
- public ArrayList<PluginEntry> getPluginEntries() {
- return pluginEntries;
- }
-
- public String getLaunchUrl() {
- return launchUrl;
- }
-
- public void parse(Context action) {
- // First checking the class namespace for config.xml
- int id = action.getResources().getIdentifier("config", "xml", action.getClass().getPackage().getName());
- if (id == 0) {
- // If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
- id = action.getResources().getIdentifier("config", "xml", action.getPackageName());
- if (id == 0) {
- LOG.e(TAG, "res/xml/config.xml is missing!");
- return;
- }
- }
- parse(action.getResources().getXml(id));
- }
-
- boolean insideFeature = false;
- String service = "", pluginClass = "", paramType = "";
- boolean onload = false;
-
- public void parse(XmlPullParser xml) {
- int eventType = -1;
-
- while (eventType != XmlPullParser.END_DOCUMENT) {
- if (eventType == XmlPullParser.START_TAG) {
- handleStartTag(xml);
- }
- else if (eventType == XmlPullParser.END_TAG)
- {
- handleEndTag(xml);
- }
- try {
- eventType = xml.next();
- } catch (XmlPullParserException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void handleStartTag(XmlPullParser xml) {
- String strNode = xml.getName();
- if (strNode.equals("feature")) {
- //Check for supported feature sets aka. plugins (Accelerometer, Geolocation, etc)
- //Set the bit for reading params
- insideFeature = true;
- service = xml.getAttributeValue(null, "name");
- }
- else if (insideFeature && strNode.equals("param")) {
- paramType = xml.getAttributeValue(null, "name");
- if (paramType.equals("service")) // check if it is using the older service param
- service = xml.getAttributeValue(null, "value");
- else if (paramType.equals("package") || paramType.equals("android-package"))
- pluginClass = xml.getAttributeValue(null,"value");
- else if (paramType.equals("onload"))
- onload = "true".equals(xml.getAttributeValue(null, "value"));
- }
- else if (strNode.equals("preference")) {
- String name = xml.getAttributeValue(null, "name").toLowerCase(Locale.ENGLISH);
- String value = xml.getAttributeValue(null, "value");
- prefs.set(name, value);
- }
- else if (strNode.equals("content")) {
- String src = xml.getAttributeValue(null, "src");
- if (src != null) {
- setStartUrl(src);
- }
- }
- }
-
- public void handleEndTag(XmlPullParser xml) {
- String strNode = xml.getName();
- if (strNode.equals("feature")) {
- pluginEntries.add(new PluginEntry(service, pluginClass, onload));
-
- service = "";
- pluginClass = "";
- insideFeature = false;
- onload = false;
- }
- }
-
- private void setStartUrl(String src) {
- Pattern schemeRegex = Pattern.compile("^[a-z-]+://");
- Matcher matcher = schemeRegex.matcher(src);
- if (matcher.find()) {
- launchUrl = src;
- } else {
- if (src.charAt(0) == '/') {
- src = src.substring(1);
- }
- launchUrl = "file:///android_asset/www/" + src;
- }
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java
deleted file mode 100755
index 9b15e3366..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.util.ArrayList;
-import java.util.Locale;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.annotation.SuppressLint;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.graphics.Color;
-import android.media.AudioManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
-import android.webkit.WebViewClient;
-import android.widget.FrameLayout;
-
-/**
- * This class is the main Android activity that represents the Cordova
- * application. It should be extended by the user to load the specific
- * html file that contains the application.
- *
- * As an example:
- *
- * <pre>
- * package org.apache.cordova.examples;
- *
- * import android.os.Bundle;
- * import org.apache.cordova.*;
- *
- * public class Example extends CordovaActivity {
- * &#64;Override
- * public void onCreate(Bundle savedInstanceState) {
- * super.onCreate(savedInstanceState);
- * super.init();
- * // Load your application
- * loadUrl(launchUrl);
- * }
- * }
- * </pre>
- *
- * Cordova xml configuration: Cordova uses a configuration file at
- * res/xml/config.xml to specify its settings. See "The config.xml File"
- * guide in cordova-docs at http://cordova.apache.org/docs for the documentation
- * for the configuration. The use of the set*Property() methods is
- * deprecated in favor of the config.xml file.
- *
- */
-public class CordovaActivity extends Activity {
- public static String TAG = "CordovaActivity";
-
- // The webview for our app
- protected CordovaWebView appView;
-
- private static int ACTIVITY_STARTING = 0;
- private static int ACTIVITY_RUNNING = 1;
- private static int ACTIVITY_EXITING = 2;
-
- // Keep app running when pause is received. (default = true)
- // If true, then the JavaScript and native code continue to run in the background
- // when another application (activity) is started.
- protected boolean keepRunning = true;
-
- // Flag to keep immersive mode if set to fullscreen
- protected boolean immersiveMode;
-
- // Read from config.xml:
- protected CordovaPreferences preferences;
- protected String launchUrl;
- protected ArrayList<PluginEntry> pluginEntries;
- protected CordovaInterfaceImpl cordovaInterface;
-
- /**
- * Called when the activity is first created.
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception
- loadConfig();
-
- String logLevel = preferences.getString("loglevel", "ERROR");
- LOG.setLogLevel(logLevel);
-
- LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting");
- LOG.d(TAG, "CordovaActivity.onCreate()");
-
- if (!preferences.getBoolean("ShowTitle", false)) {
- getWindow().requestFeature(Window.FEATURE_NO_TITLE);
- }
-
- if (preferences.getBoolean("SetFullscreen", false)) {
- LOG.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version.");
- preferences.set("Fullscreen", true);
- }
- if (preferences.getBoolean("Fullscreen", false)) {
- // NOTE: use the FullscreenNotImmersive configuration key to set the activity in a REAL full screen
- // (as was the case in previous cordova versions)
- if (!preferences.getBoolean("FullscreenNotImmersive", false)) {
- immersiveMode = true;
- // The splashscreen plugin needs the flags set before we're focused to prevent
- // the nav and title bars from flashing in.
- setImmersiveUiVisibility();
- } else {
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
- } else {
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- }
-
- super.onCreate(savedInstanceState);
-
- cordovaInterface = makeCordovaInterface();
- if (savedInstanceState != null) {
- cordovaInterface.restoreInstanceState(savedInstanceState);
- }
- }
-
- protected void init() {
- appView = makeWebView();
- createViews();
- if (!appView.isInitialized()) {
- appView.init(cordovaInterface, pluginEntries, preferences);
- }
- cordovaInterface.onCordovaInit(appView.getPluginManager());
-
- // Wire the hardware volume controls to control media if desired.
- String volumePref = preferences.getString("DefaultVolumeStream", "");
- if ("media".equals(volumePref.toLowerCase(Locale.ENGLISH))) {
- setVolumeControlStream(AudioManager.STREAM_MUSIC);
- }
- }
-
- @SuppressWarnings("deprecation")
- protected void loadConfig() {
- ConfigXmlParser parser = new ConfigXmlParser();
- parser.parse(this);
- preferences = parser.getPreferences();
- preferences.setPreferencesBundle(getIntent().getExtras());
- launchUrl = parser.getLaunchUrl();
- pluginEntries = parser.getPluginEntries();
- Config.parser = parser;
- }
-
- //Suppressing warnings in AndroidStudio
- @SuppressWarnings({"deprecation", "ResourceType"})
- protected void createViews() {
- //Why are we setting a constant as the ID? This should be investigated
- appView.getView().setId(100);
- appView.getView().setLayoutParams(new FrameLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
-
- setContentView(appView.getView());
-
- if (preferences.contains("BackgroundColor")) {
- try {
- int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
- // Background of activity:
- appView.getView().setBackgroundColor(backgroundColor);
- }
- catch (NumberFormatException e){
- e.printStackTrace();
- }
- }
-
- appView.getView().requestFocusFromTouch();
- }
-
- /**
- * Construct the default web view object.
- * <p/>
- * Override this to customize the webview that is used.
- */
- protected CordovaWebView makeWebView() {
- return new CordovaWebViewImpl(makeWebViewEngine());
- }
-
- protected CordovaWebViewEngine makeWebViewEngine() {
- return CordovaWebViewImpl.createEngine(this, preferences);
- }
-
- protected CordovaInterfaceImpl makeCordovaInterface() {
- return new CordovaInterfaceImpl(this) {
- @Override
- public Object onMessage(String id, Object data) {
- // Plumb this to CordovaActivity.onMessage for backwards compatibility
- return CordovaActivity.this.onMessage(id, data);
- }
- };
- }
-
- /**
- * Load the url into the webview.
- */
- public void loadUrl(String url) {
- if (appView == null) {
- init();
- }
-
- // If keepRunning
- this.keepRunning = preferences.getBoolean("KeepRunning", true);
-
- appView.loadUrlIntoView(url, true);
- }
-
- /**
- * Called when the system is about to start resuming a previous activity.
- */
- @Override
- protected void onPause() {
- super.onPause();
- LOG.d(TAG, "Paused the activity.");
-
- if (this.appView != null) {
- // CB-9382 If there is an activity that started for result and main activity is waiting for callback
- // result, we shoudn't stop WebView Javascript timers, as activity for result might be using them
- boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null;
- this.appView.handlePause(keepRunning);
- }
- }
-
- /**
- * Called when the activity receives a new intent
- */
- @Override
- protected void onNewIntent(Intent intent) {
- super.onNewIntent(intent);
- //Forward to plugins
- if (this.appView != null)
- this.appView.onNewIntent(intent);
- }
-
- /**
- * Called when the activity will start interacting with the user.
- */
- @Override
- protected void onResume() {
- super.onResume();
- LOG.d(TAG, "Resumed the activity.");
-
- if (this.appView == null) {
- return;
- }
- if (! this.getWindow().getDecorView().hasFocus()) {
- // Force window to have focus, so application always
- // receive user input. Workaround for some devices (Samsung Galaxy Note 3 at least)
- this.getWindow().getDecorView().requestFocus();
- }
-
- this.appView.handleResume(this.keepRunning);
- }
-
- /**
- * Called when the activity is no longer visible to the user.
- */
- @Override
- protected void onStop() {
- super.onStop();
- LOG.d(TAG, "Stopped the activity.");
-
- if (this.appView == null) {
- return;
- }
- this.appView.handleStop();
- }
-
- /**
- * Called when the activity is becoming visible to the user.
- */
- @Override
- protected void onStart() {
- super.onStart();
- LOG.d(TAG, "Started the activity.");
-
- if (this.appView == null) {
- return;
- }
- this.appView.handleStart();
- }
-
- /**
- * The final call you receive before your activity is destroyed.
- */
- @Override
- public void onDestroy() {
- LOG.d(TAG, "CordovaActivity.onDestroy()");
- super.onDestroy();
-
- if (this.appView != null) {
- appView.handleDestroy();
- }
- }
-
- /**
- * Called when view focus is changed
- */
- @Override
- public void onWindowFocusChanged(boolean hasFocus) {
- super.onWindowFocusChanged(hasFocus);
- if (hasFocus && immersiveMode) {
- setImmersiveUiVisibility();
- }
- }
-
- @SuppressLint("InlinedApi")
- protected void setImmersiveUiVisibility() {
- final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_FULLSCREEN
- | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
-
- getWindow().getDecorView().setSystemUiVisibility(uiOptions);
- }
-
- @SuppressLint("NewApi")
- @Override
- public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
- // Capture requestCode here so that it is captured in the setActivityResultCallback() case.
- cordovaInterface.setActivityResultRequestCode(requestCode);
- super.startActivityForResult(intent, requestCode, options);
- }
-
- /**
- * Called when an activity you launched exits, giving you the requestCode you started it with,
- * the resultCode it returned, and any additional data from it.
- *
- * @param requestCode The request code originally supplied to startActivityForResult(),
- * allowing you to identify who this result came from.
- * @param resultCode The integer result code returned by the child activity through its setResult().
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
- LOG.d(TAG, "Incoming Result. Request code = " + requestCode);
- super.onActivityResult(requestCode, resultCode, intent);
- cordovaInterface.onActivityResult(requestCode, resultCode, intent);
- }
-
- /**
- * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
- * The errorCode parameter corresponds to one of the ERROR_* constants.
- *
- * @param errorCode The error code corresponding to an ERROR_* value.
- * @param description A String describing the error.
- * @param failingUrl The url that failed to load.
- */
- public void onReceivedError(final int errorCode, final String description, final String failingUrl) {
- final CordovaActivity me = this;
-
- // If errorUrl specified, then load it
- final String errorUrl = preferences.getString("errorUrl", null);
- if ((errorUrl != null) && (!failingUrl.equals(errorUrl)) && (appView != null)) {
- // Load URL on UI thread
- me.runOnUiThread(new Runnable() {
- public void run() {
- me.appView.showWebPage(errorUrl, false, true, null);
- }
- });
- }
- // If not, then display error dialog
- else {
- final boolean exit = !(errorCode == WebViewClient.ERROR_HOST_LOOKUP);
- me.runOnUiThread(new Runnable() {
- public void run() {
- if (exit) {
- me.appView.getView().setVisibility(View.GONE);
- me.displayError("Application Error", description + " (" + failingUrl + ")", "OK", exit);
- }
- }
- });
- }
- }
-
- /**
- * Display an error dialog and optionally exit application.
- */
- public void displayError(final String title, final String message, final String button, final boolean exit) {
- final CordovaActivity me = this;
- me.runOnUiThread(new Runnable() {
- public void run() {
- try {
- AlertDialog.Builder dlg = new AlertDialog.Builder(me);
- dlg.setMessage(message);
- dlg.setTitle(title);
- dlg.setCancelable(false);
- dlg.setPositiveButton(button,
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- if (exit) {
- finish();
- }
- }
- });
- dlg.create();
- dlg.show();
- } catch (Exception e) {
- finish();
- }
- }
- });
- }
-
- /*
- * Hook in Cordova for menu plugins
- */
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- if (appView != null) {
- appView.getPluginManager().postMessage("onCreateOptionsMenu", menu);
- }
- return super.onCreateOptionsMenu(menu);
- }
-
- @Override
- public boolean onPrepareOptionsMenu(Menu menu) {
- if (appView != null) {
- appView.getPluginManager().postMessage("onPrepareOptionsMenu", menu);
- }
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if (appView != null) {
- appView.getPluginManager().postMessage("onOptionsItemSelected", item);
- }
- return true;
- }
-
- /**
- * Called when a message is sent to plugin.
- *
- * @param id The message id
- * @param data The message data
- * @return Object or null
- */
- public Object onMessage(String id, Object data) {
- if ("onReceivedError".equals(id)) {
- JSONObject d = (JSONObject) data;
- try {
- this.onReceivedError(d.getInt("errorCode"), d.getString("description"), d.getString("url"));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- } else if ("exit".equals(id)) {
- finish();
- }
- return null;
- }
-
- protected void onSaveInstanceState(Bundle outState) {
- cordovaInterface.onSaveInstanceState(outState);
- super.onSaveInstanceState(outState);
- }
-
- /**
- * Called by the system when the device configuration changes while your activity is running.
- *
- * @param newConfig The new device configuration
- */
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- if (this.appView == null) {
- return;
- }
- PluginManager pm = this.appView.getPluginManager();
- if (pm != null) {
- pm.onConfigurationChanged(newConfig);
- }
- }
-
- /**
- * Called by the system when the user grants permissions
- *
- * @param requestCode
- * @param permissions
- * @param grantResults
- */
- @Override
- public void onRequestPermissionsResult(int requestCode, String permissions[],
- int[] grantResults) {
- try
- {
- cordovaInterface.onRequestPermissionResult(requestCode, permissions, grantResults);
- }
- catch (JSONException e)
- {
- LOG.d(TAG, "JSONException: Parameters fed into the method are not valid");
- e.printStackTrace();
- }
-
- }
-
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaArgs.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaArgs.java
deleted file mode 100644
index d40d26ebb..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaArgs.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.util.Base64;
-
-public class CordovaArgs {
- private JSONArray baseArgs;
-
- public CordovaArgs(JSONArray args) {
- this.baseArgs = args;
- }
-
-
- // Pass through the basics to the base args.
- public Object get(int index) throws JSONException {
- return baseArgs.get(index);
- }
-
- public boolean getBoolean(int index) throws JSONException {
- return baseArgs.getBoolean(index);
- }
-
- public double getDouble(int index) throws JSONException {
- return baseArgs.getDouble(index);
- }
-
- public int getInt(int index) throws JSONException {
- return baseArgs.getInt(index);
- }
-
- public JSONArray getJSONArray(int index) throws JSONException {
- return baseArgs.getJSONArray(index);
- }
-
- public JSONObject getJSONObject(int index) throws JSONException {
- return baseArgs.getJSONObject(index);
- }
-
- public long getLong(int index) throws JSONException {
- return baseArgs.getLong(index);
- }
-
- public String getString(int index) throws JSONException {
- return baseArgs.getString(index);
- }
-
-
- public Object opt(int index) {
- return baseArgs.opt(index);
- }
-
- public boolean optBoolean(int index) {
- return baseArgs.optBoolean(index);
- }
-
- public double optDouble(int index) {
- return baseArgs.optDouble(index);
- }
-
- public int optInt(int index) {
- return baseArgs.optInt(index);
- }
-
- public JSONArray optJSONArray(int index) {
- return baseArgs.optJSONArray(index);
- }
-
- public JSONObject optJSONObject(int index) {
- return baseArgs.optJSONObject(index);
- }
-
- public long optLong(int index) {
- return baseArgs.optLong(index);
- }
-
- public String optString(int index) {
- return baseArgs.optString(index);
- }
-
- public boolean isNull(int index) {
- return baseArgs.isNull(index);
- }
-
-
- // The interesting custom helpers.
- public byte[] getArrayBuffer(int index) throws JSONException {
- String encoded = baseArgs.getString(index);
- return Base64.decode(encoded, Base64.DEFAULT);
- }
-}
-
-
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java
deleted file mode 100644
index a8e836923..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaBridge.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.annotation.SuppressLint;
-
-import java.security.SecureRandom;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-
-/**
- * Contains APIs that the JS can call. All functions in here should also have
- * an equivalent entry in CordovaChromeClient.java, and be added to
- * cordova-js/lib/android/plugin/android/promptbasednativeapi.js
- */
-public class CordovaBridge {
- private static final String LOG_TAG = "CordovaBridge";
- private PluginManager pluginManager;
- private NativeToJsMessageQueue jsMessageQueue;
- private volatile int expectedBridgeSecret = -1; // written by UI thread, read by JS thread.
-
- public CordovaBridge(PluginManager pluginManager, NativeToJsMessageQueue jsMessageQueue) {
- this.pluginManager = pluginManager;
- this.jsMessageQueue = jsMessageQueue;
- }
-
- public String jsExec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException {
- if (!verifySecret("exec()", bridgeSecret)) {
- return null;
- }
- // If the arguments weren't received, send a message back to JS. It will switch bridge modes and try again. See CB-2666.
- // We send a message meant specifically for this case. It starts with "@" so no other message can be encoded into the same string.
- if (arguments == null) {
- return "@Null arguments.";
- }
-
- jsMessageQueue.setPaused(true);
- try {
- // Tell the resourceApi what thread the JS is running on.
- CordovaResourceApi.jsThread = Thread.currentThread();
-
- pluginManager.exec(service, action, callbackId, arguments);
- String ret = null;
- if (!NativeToJsMessageQueue.DISABLE_EXEC_CHAINING) {
- ret = jsMessageQueue.popAndEncode(false);
- }
- return ret;
- } catch (Throwable e) {
- e.printStackTrace();
- return "";
- } finally {
- jsMessageQueue.setPaused(false);
- }
- }
-
- public void jsSetNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException {
- if (!verifySecret("setNativeToJsBridgeMode()", bridgeSecret)) {
- return;
- }
- jsMessageQueue.setBridgeMode(value);
- }
-
- public String jsRetrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException {
- if (!verifySecret("retrieveJsMessages()", bridgeSecret)) {
- return null;
- }
- return jsMessageQueue.popAndEncode(fromOnlineEvent);
- }
-
- private boolean verifySecret(String action, int bridgeSecret) throws IllegalAccessException {
- if (!jsMessageQueue.isBridgeEnabled()) {
- if (bridgeSecret == -1) {
- LOG.d(LOG_TAG, action + " call made before bridge was enabled.");
- } else {
- LOG.d(LOG_TAG, "Ignoring " + action + " from previous page load.");
- }
- return false;
- }
- // Bridge secret wrong and bridge not due to it being from the previous page.
- if (expectedBridgeSecret < 0 || bridgeSecret != expectedBridgeSecret) {
- LOG.e(LOG_TAG, "Bridge access attempt with wrong secret token, possibly from malicious code. Disabling exec() bridge!");
- clearBridgeSecret();
- throw new IllegalAccessException();
- }
- return true;
- }
-
- /** Called on page transitions */
- void clearBridgeSecret() {
- expectedBridgeSecret = -1;
- }
-
- public boolean isSecretEstablished() {
- return expectedBridgeSecret != -1;
- }
-
- /** Called by cordova.js to initialize the bridge. */
- //On old Androids SecureRandom isn't really secure, this is the least of your problems if
- //you're running Android 4.3 and below in 2017
- int generateBridgeSecret() {
- SecureRandom randGen = new SecureRandom();
- expectedBridgeSecret = randGen.nextInt(Integer.MAX_VALUE);
- return expectedBridgeSecret;
- }
-
- public void reset() {
- jsMessageQueue.reset();
- clearBridgeSecret();
- }
-
- public String promptOnJsPrompt(String origin, String message, String defaultValue) {
- if (defaultValue != null && defaultValue.startsWith("gap:")) {
- JSONArray array;
- try {
- array = new JSONArray(defaultValue.substring(4));
- int bridgeSecret = array.getInt(0);
- String service = array.getString(1);
- String action = array.getString(2);
- String callbackId = array.getString(3);
- String r = jsExec(bridgeSecret, service, action, callbackId, message);
- return r == null ? "" : r;
- } catch (JSONException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- return "";
- }
- // Sets the native->JS bridge mode.
- else if (defaultValue != null && defaultValue.startsWith("gap_bridge_mode:")) {
- try {
- int bridgeSecret = Integer.parseInt(defaultValue.substring(16));
- jsSetNativeToJsBridgeMode(bridgeSecret, Integer.parseInt(message));
- } catch (NumberFormatException e){
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- return "";
- }
- // Polling for JavaScript messages
- else if (defaultValue != null && defaultValue.startsWith("gap_poll:")) {
- int bridgeSecret = Integer.parseInt(defaultValue.substring(9));
- try {
- String r = jsRetrieveJsMessages(bridgeSecret, "1".equals(message));
- return r == null ? "" : r;
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- return "";
- }
- else if (defaultValue != null && defaultValue.startsWith("gap_init:")) {
- // Protect against random iframes being able to talk through the bridge.
- // Trust only pages which the app would have been allowed to navigate to anyway.
- if (pluginManager.shouldAllowBridgeAccess(origin)) {
- // Enable the bridge
- int bridgeMode = Integer.parseInt(defaultValue.substring(9));
- jsMessageQueue.setBridgeMode(bridgeMode);
- // Tell JS the bridge secret.
- int secret = generateBridgeSecret();
- return ""+secret;
- } else {
- LOG.e(LOG_TAG, "gap_init called from restricted origin: " + origin);
- }
- return "";
- }
- return null;
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java
deleted file mode 100644
index ad7c588a8..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-import android.annotation.SuppressLint;
-import android.webkit.ClientCertRequest;
-
-/**
- * Implementation of the ICordovaClientCertRequest for Android WebView.
- *
- */
-public class CordovaClientCertRequest implements ICordovaClientCertRequest {
-
- private final ClientCertRequest request;
-
- public CordovaClientCertRequest(ClientCertRequest request) {
- this.request = request;
- }
-
- /**
- * Cancel this request
- */
- @SuppressLint("NewApi")
- public void cancel()
- {
- request.cancel();
- }
-
- /*
- * Returns the host name of the server requesting the certificate.
- */
- @SuppressLint("NewApi")
- public String getHost()
- {
- return request.getHost();
- }
-
- /*
- * Returns the acceptable types of asymmetric keys (can be null).
- */
- @SuppressLint("NewApi")
- public String[] getKeyTypes()
- {
- return request.getKeyTypes();
- }
-
- /*
- * Returns the port number of the server requesting the certificate.
- */
- @SuppressLint("NewApi")
- public int getPort()
- {
- return request.getPort();
- }
-
- /*
- * Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
- */
- @SuppressLint("NewApi")
- public Principal[] getPrincipals()
- {
- return request.getPrincipals();
- }
-
- /*
- * Ignore the request for now. Do not remember user's choice.
- */
- @SuppressLint("NewApi")
- public void ignore()
- {
- request.ignore();
- }
-
- /*
- * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
- *
- * @param privateKey The privateKey
- * @param chain The certificate chain
- */
- @SuppressLint("NewApi")
- public void proceed(PrivateKey privateKey, X509Certificate[] chain)
- {
- request.proceed(privateKey, chain);
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaDialogsHelper.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaDialogsHelper.java
deleted file mode 100644
index a219c9922..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaDialogsHelper.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.view.KeyEvent;
-import android.widget.EditText;
-
-/**
- * Helper class for WebViews to implement prompt(), alert(), confirm() dialogs.
- */
-public class CordovaDialogsHelper {
- private final Context context;
- private AlertDialog lastHandledDialog;
-
- public CordovaDialogsHelper(Context context) {
- this.context = context;
- }
-
- public void showAlert(String message, final Result result) {
- AlertDialog.Builder dlg = new AlertDialog.Builder(context);
- dlg.setMessage(message);
- dlg.setTitle("Alert");
- //Don't let alerts break the back button
- dlg.setCancelable(true);
- dlg.setPositiveButton(android.R.string.ok,
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(true, null);
- }
- });
- dlg.setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- result.gotResult(false, null);
- }
- });
- dlg.setOnKeyListener(new DialogInterface.OnKeyListener() {
- //DO NOTHING
- public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK)
- {
- result.gotResult(true, null);
- return false;
- }
- else
- return true;
- }
- });
- lastHandledDialog = dlg.show();
- }
-
- public void showConfirm(String message, final Result result) {
- AlertDialog.Builder dlg = new AlertDialog.Builder(context);
- dlg.setMessage(message);
- dlg.setTitle("Confirm");
- dlg.setCancelable(true);
- dlg.setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(true, null);
- }
- });
- dlg.setNegativeButton(android.R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(false, null);
- }
- });
- dlg.setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- result.gotResult(false, null);
- }
- });
- dlg.setOnKeyListener(new DialogInterface.OnKeyListener() {
- //DO NOTHING
- public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK)
- {
- result.gotResult(false, null);
- return false;
- }
- else
- return true;
- }
- });
- lastHandledDialog = dlg.show();
- }
-
- /**
- * Tell the client to display a prompt dialog to the user.
- * If the client returns true, WebView will assume that the client will
- * handle the prompt dialog and call the appropriate JsPromptResult method.
- *
- * Since we are hacking prompts for our own purposes, we should not be using them for
- * this purpose, perhaps we should hack console.log to do this instead!
- */
- public void showPrompt(String message, String defaultValue, final Result result) {
- // Returning false would also show a dialog, but the default one shows the origin (ugly).
- AlertDialog.Builder dlg = new AlertDialog.Builder(context);
- dlg.setMessage(message);
- final EditText input = new EditText(context);
- if (defaultValue != null) {
- input.setText(defaultValue);
- }
- dlg.setView(input);
- dlg.setCancelable(false);
- dlg.setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- String userText = input.getText().toString();
- result.gotResult(true, userText);
- }
- });
- dlg.setNegativeButton(android.R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- result.gotResult(false, null);
- }
- });
- lastHandledDialog = dlg.show();
- }
-
- public void destroyLastDialog(){
- if (lastHandledDialog != null){
- lastHandledDialog.cancel();
- }
- }
-
- public interface Result {
- public void gotResult(boolean success, String value);
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java
deleted file mode 100644
index a2692f8c7..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.webkit.HttpAuthHandler;
-
-/**
- * Specifies interface for HTTP auth handler object which is used to handle auth requests and
- * specifying user credentials.
- */
-public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler {
-
- private final HttpAuthHandler handler;
-
- public CordovaHttpAuthHandler(HttpAuthHandler handler) {
- this.handler = handler;
- }
-
- /**
- * Instructs the WebView to cancel the authentication request.
- */
- public void cancel () {
- this.handler.cancel();
- }
-
- /**
- * Instructs the WebView to proceed with the authentication with the given credentials.
- *
- * @param username
- * @param password
- */
- public void proceed (String username, String password) {
- this.handler.proceed(username, password);
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterface.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterface.java
deleted file mode 100755
index 7661b7421..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterface.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-
-import org.apache.cordova.CordovaPlugin;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * The Activity interface that is implemented by CordovaActivity.
- * It is used to isolate plugin development, and remove dependency on entire Cordova library.
- */
-public interface CordovaInterface {
-
- /**
- * Launch an activity for which you would like a result when it finished. When this activity exits,
- * your onActivityResult() method will be called.
- *
- * @param command The command object
- * @param intent The intent to start
- * @param requestCode The request code that is passed to callback to identify the activity
- */
- abstract public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode);
-
- /**
- * Set the plugin to be called when a sub-activity exits.
- *
- * @param plugin The plugin on which onActivityResult is to be called
- */
- abstract public void setActivityResultCallback(CordovaPlugin plugin);
-
- /**
- * Get the Android activity.
- *
- * If a custom engine lives outside of the Activity's lifecycle the return value may be null.
- *
- * @return the Activity
- */
- public abstract Activity getActivity();
-
- /**
- * Get the Android context.
- *
- * @return the Context
- */
- public Context getContext();
-
- /**
- * Called when a message is sent to plugin.
- *
- * @param id The message id
- * @param data The message data
- * @return Object or null
- */
- public Object onMessage(String id, Object data);
-
- /**
- * Returns a shared thread pool that can be used for background tasks.
- */
- public ExecutorService getThreadPool();
-
- /**
- * Sends a permission request to the activity for one permission.
- */
- public void requestPermission(CordovaPlugin plugin, int requestCode, String permission);
-
- /**
- * Sends a permission request to the activity for a group of permissions
- */
- public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions);
-
- /**
- * Check for a permission. Returns true if the permission is granted, false otherwise.
- */
- public boolean hasPermission(String permission);
-
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java
deleted file mode 100644
index 9a6e9245f..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.util.Pair;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Default implementation of CordovaInterface.
- */
-public class CordovaInterfaceImpl implements CordovaInterface {
- private static final String TAG = "CordovaInterfaceImpl";
- protected Activity activity;
- protected ExecutorService threadPool;
- protected PluginManager pluginManager;
-
- protected ActivityResultHolder savedResult;
- protected CallbackMap permissionResultCallbacks;
- protected CordovaPlugin activityResultCallback;
- protected String initCallbackService;
- protected int activityResultRequestCode;
- protected boolean activityWasDestroyed = false;
- protected Bundle savedPluginState;
-
- public CordovaInterfaceImpl(Activity activity) {
- this(activity, Executors.newCachedThreadPool());
- }
-
- public CordovaInterfaceImpl(Activity activity, ExecutorService threadPool) {
- this.activity = activity;
- this.threadPool = threadPool;
- this.permissionResultCallbacks = new CallbackMap();
- }
-
- @Override
- public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) {
- setActivityResultCallback(command);
- try {
- activity.startActivityForResult(intent, requestCode);
- } catch (RuntimeException e) { // E.g.: ActivityNotFoundException
- activityResultCallback = null;
- throw e;
- }
- }
-
- @Override
- public void setActivityResultCallback(CordovaPlugin plugin) {
- // Cancel any previously pending activity.
- if (activityResultCallback != null) {
- activityResultCallback.onActivityResult(activityResultRequestCode, Activity.RESULT_CANCELED, null);
- }
- activityResultCallback = plugin;
- }
-
- @Override
- public Activity getActivity() {
- return activity;
- }
-
- @Override
- public Context getContext() {
- return activity;
- }
-
- @Override
- public Object onMessage(String id, Object data) {
- if ("exit".equals(id)) {
- activity.finish();
- }
- return null;
- }
-
- @Override
- public ExecutorService getThreadPool() {
- return threadPool;
- }
-
- /**
- * Dispatches any pending onActivityResult callbacks and sends the resume event if the
- * Activity was destroyed by the OS.
- */
- public void onCordovaInit(PluginManager pluginManager) {
- this.pluginManager = pluginManager;
- if (savedResult != null) {
- onActivityResult(savedResult.requestCode, savedResult.resultCode, savedResult.intent);
- } else if(activityWasDestroyed) {
- // If there was no Activity result, we still need to send out the resume event if the
- // Activity was destroyed by the OS
- activityWasDestroyed = false;
- if(pluginManager != null)
- {
- CoreAndroid appPlugin = (CoreAndroid) pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
- if(appPlugin != null) {
- JSONObject obj = new JSONObject();
- try {
- obj.put("action", "resume");
- } catch (JSONException e) {
- LOG.e(TAG, "Failed to create event message", e);
- }
- appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK, obj));
- }
- }
-
- }
- }
-
- /**
- * Routes the result to the awaiting plugin. Returns false if no plugin was waiting.
- */
- public boolean onActivityResult(int requestCode, int resultCode, Intent intent) {
- CordovaPlugin callback = activityResultCallback;
- if(callback == null && initCallbackService != null) {
- // The application was restarted, but had defined an initial callback
- // before being shut down.
- savedResult = new ActivityResultHolder(requestCode, resultCode, intent);
- if (pluginManager != null) {
- callback = pluginManager.getPlugin(initCallbackService);
- if(callback != null) {
- callback.onRestoreStateForActivityResult(savedPluginState.getBundle(callback.getServiceName()),
- new ResumeCallback(callback.getServiceName(), pluginManager));
- }
- }
- }
- activityResultCallback = null;
-
- if (callback != null) {
- LOG.d(TAG, "Sending activity result to plugin");
- initCallbackService = null;
- savedResult = null;
- callback.onActivityResult(requestCode, resultCode, intent);
- return true;
- }
- LOG.w(TAG, "Got an activity result, but no plugin was registered to receive it" + (savedResult != null ? " yet!" : "."));
- return false;
- }
-
- /**
- * Call this from your startActivityForResult() overload. This is required to catch the case
- * where plugins use Activity.startActivityForResult() + CordovaInterface.setActivityResultCallback()
- * rather than CordovaInterface.startActivityForResult().
- */
- public void setActivityResultRequestCode(int requestCode) {
- activityResultRequestCode = requestCode;
- }
-
- /**
- * Saves parameters for startActivityForResult().
- */
- public void onSaveInstanceState(Bundle outState) {
- if (activityResultCallback != null) {
- String serviceName = activityResultCallback.getServiceName();
- outState.putString("callbackService", serviceName);
- }
- if(pluginManager != null){
- outState.putBundle("plugin", pluginManager.onSaveInstanceState());
- }
-
- }
-
- /**
- * Call this from onCreate() so that any saved startActivityForResult parameters will be restored.
- */
- public void restoreInstanceState(Bundle savedInstanceState) {
- initCallbackService = savedInstanceState.getString("callbackService");
- savedPluginState = savedInstanceState.getBundle("plugin");
- activityWasDestroyed = true;
- }
-
- private static class ActivityResultHolder {
- private int requestCode;
- private int resultCode;
- private Intent intent;
-
- public ActivityResultHolder(int requestCode, int resultCode, Intent intent) {
- this.requestCode = requestCode;
- this.resultCode = resultCode;
- this.intent = intent;
- }
- }
-
- /**
- * Called by the system when the user grants permissions
- *
- * @param requestCode
- * @param permissions
- * @param grantResults
- */
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException {
- Pair<CordovaPlugin, Integer> callback = permissionResultCallbacks.getAndRemoveCallback(requestCode);
- if(callback != null) {
- callback.first.onRequestPermissionResult(callback.second, permissions, grantResults);
- }
- }
-
- public void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
- String[] permissions = new String [1];
- permissions[0] = permission;
- requestPermissions(plugin, requestCode, permissions);
- }
-
- @SuppressLint("NewApi")
- public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions) {
- int mappedRequestCode = permissionResultCallbacks.registerCallback(plugin, requestCode);
- getActivity().requestPermissions(permissions, mappedRequestCode);
- }
-
- public boolean hasPermission(String permission)
- {
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
- {
- int result = activity.checkSelfPermission(permission);
- return PackageManager.PERMISSION_GRANTED == result;
- }
- else
- {
- return true;
- }
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPlugin.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPlugin.java
deleted file mode 100644
index 41af1db79..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPlugin.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import org.apache.cordova.CordovaArgs;
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CallbackContext;
-import org.json.JSONArray;
-import org.json.JSONException;
-
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.res.Configuration;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-/**
- * Plugins must extend this class and override one of the execute methods.
- */
-public class CordovaPlugin {
- public CordovaWebView webView;
- public CordovaInterface cordova;
- protected CordovaPreferences preferences;
- private String serviceName;
-
- /**
- * Call this after constructing to initialize the plugin.
- * Final because we want to be able to change args without breaking plugins.
- */
- public final void privateInitialize(String serviceName, CordovaInterface cordova, CordovaWebView webView, CordovaPreferences preferences) {
- assert this.cordova == null;
- this.serviceName = serviceName;
- this.cordova = cordova;
- this.webView = webView;
- this.preferences = preferences;
- initialize(cordova, webView);
- pluginInitialize();
- }
-
- /**
- * Called after plugin construction and fields have been initialized.
- * Prefer to use pluginInitialize instead since there is no value in
- * having parameters on the initialize() function.
- */
- public void initialize(CordovaInterface cordova, CordovaWebView webView) {
- }
-
- /**
- * Called after plugin construction and fields have been initialized.
- */
- protected void pluginInitialize() {
- }
-
- /**
- * Returns the plugin's service name (what you'd use when calling pluginManger.getPlugin())
- */
- public String getServiceName() {
- return serviceName;
- }
-
- /**
- * Executes the request.
- *
- * This method is called from the WebView thread. To do a non-trivial amount of work, use:
- * cordova.getThreadPool().execute(runnable);
- *
- * To run on the UI thread, use:
- * cordova.getActivity().runOnUiThread(runnable);
- *
- * @param action The action to execute.
- * @param rawArgs The exec() arguments in JSON form.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return Whether the action was valid.
- */
- public boolean execute(String action, String rawArgs, CallbackContext callbackContext) throws JSONException {
- JSONArray args = new JSONArray(rawArgs);
- return execute(action, args, callbackContext);
- }
-
- /**
- * Executes the request.
- *
- * This method is called from the WebView thread. To do a non-trivial amount of work, use:
- * cordova.getThreadPool().execute(runnable);
- *
- * To run on the UI thread, use:
- * cordova.getActivity().runOnUiThread(runnable);
- *
- * @param action The action to execute.
- * @param args The exec() arguments.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return Whether the action was valid.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- CordovaArgs cordovaArgs = new CordovaArgs(args);
- return execute(action, cordovaArgs, callbackContext);
- }
-
- /**
- * Executes the request.
- *
- * This method is called from the WebView thread. To do a non-trivial amount of work, use:
- * cordova.getThreadPool().execute(runnable);
- *
- * To run on the UI thread, use:
- * cordova.getActivity().runOnUiThread(runnable);
- *
- * @param action The action to execute.
- * @param args The exec() arguments, wrapped with some Cordova helpers.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return Whether the action was valid.
- */
- public boolean execute(String action, CordovaArgs args, CallbackContext callbackContext) throws JSONException {
- return false;
- }
-
- /**
- * Called when the system is about to start resuming a previous activity.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onPause(boolean multitasking) {
- }
-
- /**
- * Called when the activity will start interacting with the user.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onResume(boolean multitasking) {
- }
-
- /**
- * Called when the activity is becoming visible to the user.
- */
- public void onStart() {
- }
-
- /**
- * Called when the activity is no longer visible to the user.
- */
- public void onStop() {
- }
-
- /**
- * Called when the activity receives a new intent.
- */
- public void onNewIntent(Intent intent) {
- }
-
- /**
- * The final call you receive before your activity is destroyed.
- */
- public void onDestroy() {
- }
-
- /**
- * Called when the Activity is being destroyed (e.g. if a plugin calls out to an external
- * Activity and the OS kills the CordovaActivity in the background). The plugin should save its
- * state in this method only if it is awaiting the result of an external Activity and needs
- * to preserve some information so as to handle that result; onRestoreStateForActivityResult()
- * will only be called if the plugin is the recipient of an Activity result
- *
- * @return Bundle containing the state of the plugin or null if state does not need to be saved
- */
- public Bundle onSaveInstanceState() {
- return null;
- }
-
- /**
- * Called when a plugin is the recipient of an Activity result after the CordovaActivity has
- * been destroyed. The Bundle will be the same as the one the plugin returned in
- * onSaveInstanceState()
- *
- * @param state Bundle containing the state of the plugin
- * @param callbackContext Replacement Context to return the plugin result to
- */
- public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {}
-
- /**
- * Called when a message is sent to plugin.
- *
- * @param id The message id
- * @param data The message data
- * @return Object to stop propagation or null
- */
- public Object onMessage(String id, Object data) {
- return null;
- }
-
- /**
- * Called when an activity you launched exits, giving you the requestCode you started it with,
- * the resultCode it returned, and any additional data from it.
- *
- * @param requestCode The request code originally supplied to startActivityForResult(),
- * allowing you to identify who this result came from.
- * @param resultCode The integer result code returned by the child activity through its setResult().
- * @param intent An Intent, which can return result data to the caller (various data can be
- * attached to Intent "extras").
- */
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
- }
-
- /**
- * Hook for blocking the loading of external resources.
- *
- * This will be called when the WebView's shouldInterceptRequest wants to
- * know whether to open a connection to an external resource. Return false
- * to block the request: if any plugin returns false, Cordova will block
- * the request. If all plugins return null, the default policy will be
- * enforced. If at least one plugin returns true, and no plugins return
- * false, then the request will proceed.
- *
- * Note that this only affects resource requests which are routed through
- * WebViewClient.shouldInterceptRequest, such as XMLHttpRequest requests and
- * img tag loads. WebSockets and media requests (such as <video> and <audio>
- * tags) are not affected by this method. Use CSP headers to control access
- * to such resources.
- */
- public Boolean shouldAllowRequest(String url) {
- return null;
- }
-
- /**
- * Hook for blocking navigation by the Cordova WebView. This applies both to top-level and
- * iframe navigations.
- *
- * This will be called when the WebView's needs to know whether to navigate
- * to a new page. Return false to block the navigation: if any plugin
- * returns false, Cordova will block the navigation. If all plugins return
- * null, the default policy will be enforced. It at least one plugin returns
- * true, and no plugins return false, then the navigation will proceed.
- */
- public Boolean shouldAllowNavigation(String url) {
- return null;
- }
-
- /**
- * Hook for allowing page to call exec(). By default, this returns the result of
- * shouldAllowNavigation(). It's generally unsafe to allow untrusted content to be loaded
- * into a CordovaWebView, even within an iframe, so it's best not to touch this.
- */
- public Boolean shouldAllowBridgeAccess(String url) {
- return shouldAllowNavigation(url);
- }
-
- /**
- * Hook for blocking the launching of Intents by the Cordova application.
- *
- * This will be called when the WebView will not navigate to a page, but
- * could launch an intent to handle the URL. Return false to block this: if
- * any plugin returns false, Cordova will block the navigation. If all
- * plugins return null, the default policy will be enforced. If at least one
- * plugin returns true, and no plugins return false, then the URL will be
- * opened.
- */
- public Boolean shouldOpenExternalUrl(String url) {
- return null;
- }
-
- /**
- * Allows plugins to handle a link being clicked. Return true here to cancel the navigation.
- *
- * @param url The URL that is trying to be loaded in the Cordova webview.
- * @return Return true to prevent the URL from loading. Default is false.
- */
- public boolean onOverrideUrlLoading(String url) {
- return false;
- }
-
- /**
- * Hook for redirecting requests. Applies to WebView requests as well as requests made by plugins.
- * To handle the request directly, return a URI in the form:
- *
- * cdvplugin://pluginId/...
- *
- * And implement handleOpenForRead().
- * To make this easier, use the toPluginUri() and fromPluginUri() helpers:
- *
- * public Uri remapUri(Uri uri) { return toPluginUri(uri); }
- *
- * public CordovaResourceApi.OpenForReadResult handleOpenForRead(Uri uri) throws IOException {
- * Uri origUri = fromPluginUri(uri);
- * ...
- * }
- */
- public Uri remapUri(Uri uri) {
- return null;
- }
-
- /**
- * Called to handle CordovaResourceApi.openForRead() calls for a cdvplugin://pluginId/ URL.
- * Should never return null.
- * Added in [email protected]
- */
- public CordovaResourceApi.OpenForReadResult handleOpenForRead(Uri uri) throws IOException {
- throw new FileNotFoundException("Plugin can't handle uri: " + uri);
- }
-
- /**
- * Refer to remapUri()
- * Added in [email protected]
- */
- protected Uri toPluginUri(Uri origUri) {
- return new Uri.Builder()
- .scheme(CordovaResourceApi.PLUGIN_URI_SCHEME)
- .authority(serviceName)
- .appendQueryParameter("origUri", origUri.toString())
- .build();
- }
-
- /**
- * Refer to remapUri()
- * Added in [email protected]
- */
- protected Uri fromPluginUri(Uri pluginUri) {
- return Uri.parse(pluginUri.getQueryParameter("origUri"));
- }
-
- /**
- * Called when the WebView does a top-level navigation or refreshes.
- *
- * Plugins should stop any long-running processes and clean up internal state.
- *
- * Does nothing by default.
- */
- public void onReset() {
- }
-
- /**
- * Called when the system received an HTTP authentication request. Plugin can use
- * the supplied HttpAuthHandler to process this auth challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param handler The HttpAuthHandler used to set the WebView's response
- * @param host The host requiring authentication
- * @param realm The realm for which authentication is required
- *
- * @return Returns True if plugin will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, String host, String realm) {
- return false;
- }
-
- /**
- * Called when he system received an SSL client certificate request. Plugin can use
- * the supplied ClientCertRequest to process this certificate challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param request The client certificate request
- *
- * @return Returns True if plugin will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedClientCertRequest(CordovaWebView view, ICordovaClientCertRequest request) {
- return false;
- }
-
- /**
- * Called by the system when the device configuration changes while your activity is running.
- *
- * @param newConfig The new device configuration
- */
- public void onConfigurationChanged(Configuration newConfig) {
- }
-
- /**
- * Called by the Plugin Manager when we need to actually request permissions
- *
- * @param requestCode Passed to the activity to track the request
- *
- * @return Returns the permission that was stored in the plugin
- */
-
- public void requestPermissions(int requestCode) {
- }
-
- /*
- * Called by the WebView implementation to check for geolocation permissions, can be used
- * by other Java methods in the event that a plugin is using this as a dependency.
- *
- * @return Returns true if the plugin has all the permissions it needs to operate.
- */
-
- public boolean hasPermisssion() {
- return true;
- }
-
- /**
- * Called by the system when the user grants permissions
- *
- * @param requestCode
- * @param permissions
- * @param grantResults
- */
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException {
-
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPreferences.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPreferences.java
deleted file mode 100644
index 96c219c9e..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaPreferences.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import org.apache.cordova.LOG;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class CordovaPreferences {
- private HashMap<String, String> prefs = new HashMap<String, String>(20);
- private Bundle preferencesBundleExtras;
-
- public void setPreferencesBundle(Bundle extras) {
- preferencesBundleExtras = extras;
- }
-
- public void set(String name, String value) {
- prefs.put(name.toLowerCase(Locale.ENGLISH), value);
- }
-
- public void set(String name, boolean value) {
- set(name, "" + value);
- }
-
- public void set(String name, int value) {
- set(name, "" + value);
- }
-
- public void set(String name, double value) {
- set(name, "" + value);
- }
-
- public Map<String, String> getAll() {
- return prefs;
- }
-
- public boolean getBoolean(String name, boolean defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- return Boolean.parseBoolean(value);
- }
- return defaultValue;
- }
-
- // Added in 4.0.0
- public boolean contains(String name) {
- return getString(name, null) != null;
- }
-
- public int getInteger(String name, int defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- // Use Integer.decode() can't handle it if the highest bit is set.
- return (int)(long)Long.decode(value);
- }
- return defaultValue;
- }
-
- public double getDouble(String name, double defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- return Double.valueOf(value);
- }
- return defaultValue;
- }
-
- public String getString(String name, String defaultValue) {
- name = name.toLowerCase(Locale.ENGLISH);
- String value = prefs.get(name);
- if (value != null) {
- return value;
- }
- return defaultValue;
- }
-
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java
deleted file mode 100644
index a9f3453c0..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.res.AssetFileDescriptor;
-import android.content.res.AssetManager;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Looper;
-import android.util.Base64;
-import android.webkit.MimeTypeMap;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.nio.channels.FileChannel;
-import java.util.Locale;
-import java.util.zip.GZIPInputStream;
-
-/**
- * What this class provides:
- * 1. Helpers for reading & writing to URLs.
- * - E.g. handles assets, resources, content providers, files, data URIs, http[s]
- * - E.g. Can be used to query for mime-type & content length.
- *
- * 2. To allow plugins to redirect URLs (via remapUrl).
- * - All plugins should call remapUrl() on URLs they receive from JS *before*
- * passing the URL onto other utility functions in this class.
- * - For an example usage of this, refer to the org.apache.cordova.file plugin.
- *
- * Future Work:
- * - Consider using a Cursor to query content URLs for their size (like the file plugin does).
- * - Allow plugins to remapUri to "cdv-plugin://plugin-name/foo", which CordovaResourceApi
- * would then delegate to pluginManager.getPlugin(plugin-name).openForRead(url)
- * - Currently, plugins *can* do this by remapping to a data: URL, but it's inefficient
- * for large payloads.
- */
-public class CordovaResourceApi {
- @SuppressWarnings("unused")
- private static final String LOG_TAG = "CordovaResourceApi";
-
- public static final int URI_TYPE_FILE = 0;
- public static final int URI_TYPE_ASSET = 1;
- public static final int URI_TYPE_CONTENT = 2;
- public static final int URI_TYPE_RESOURCE = 3;
- public static final int URI_TYPE_DATA = 4;
- public static final int URI_TYPE_HTTP = 5;
- public static final int URI_TYPE_HTTPS = 6;
- public static final int URI_TYPE_PLUGIN = 7;
- public static final int URI_TYPE_UNKNOWN = -1;
-
- public static final String PLUGIN_URI_SCHEME = "cdvplugin";
-
- private static final String[] LOCAL_FILE_PROJECTION = { "_data" };
-
- public static Thread jsThread;
-
- private final AssetManager assetManager;
- private final ContentResolver contentResolver;
- private final PluginManager pluginManager;
- private boolean threadCheckingEnabled = true;
-
-
- public CordovaResourceApi(Context context, PluginManager pluginManager) {
- this.contentResolver = context.getContentResolver();
- this.assetManager = context.getAssets();
- this.pluginManager = pluginManager;
- }
-
- public void setThreadCheckingEnabled(boolean value) {
- threadCheckingEnabled = value;
- }
-
- public boolean isThreadCheckingEnabled() {
- return threadCheckingEnabled;
- }
-
-
- public static int getUriType(Uri uri) {
- assertNonRelative(uri);
- String scheme = uri.getScheme();
- if (ContentResolver.SCHEME_CONTENT.equalsIgnoreCase(scheme)) {
- return URI_TYPE_CONTENT;
- }
- if (ContentResolver.SCHEME_ANDROID_RESOURCE.equalsIgnoreCase(scheme)) {
- return URI_TYPE_RESOURCE;
- }
- if (ContentResolver.SCHEME_FILE.equalsIgnoreCase(scheme)) {
- if (uri.getPath().startsWith("/android_asset/")) {
- return URI_TYPE_ASSET;
- }
- return URI_TYPE_FILE;
- }
- if ("data".equalsIgnoreCase(scheme)) {
- return URI_TYPE_DATA;
- }
- if ("http".equalsIgnoreCase(scheme)) {
- return URI_TYPE_HTTP;
- }
- if ("https".equalsIgnoreCase(scheme)) {
- return URI_TYPE_HTTPS;
- }
- if (PLUGIN_URI_SCHEME.equalsIgnoreCase(scheme)) {
- return URI_TYPE_PLUGIN;
- }
- return URI_TYPE_UNKNOWN;
- }
-
- public Uri remapUri(Uri uri) {
- assertNonRelative(uri);
- Uri pluginUri = pluginManager.remapUri(uri);
- return pluginUri != null ? pluginUri : uri;
- }
-
- public String remapPath(String path) {
- return remapUri(Uri.fromFile(new File(path))).getPath();
- }
-
- /**
- * Returns a File that points to the resource, or null if the resource
- * is not on the local filesystem.
- */
- public File mapUriToFile(Uri uri) {
- assertBackgroundThread();
- switch (getUriType(uri)) {
- case URI_TYPE_FILE:
- return new File(uri.getPath());
- case URI_TYPE_CONTENT: {
- Cursor cursor = contentResolver.query(uri, LOCAL_FILE_PROJECTION, null, null, null);
- if (cursor != null) {
- try {
- int columnIndex = cursor.getColumnIndex(LOCAL_FILE_PROJECTION[0]);
- if (columnIndex != -1 && cursor.getCount() > 0) {
- cursor.moveToFirst();
- String realPath = cursor.getString(columnIndex);
- if (realPath != null) {
- return new File(realPath);
- }
- }
- } finally {
- cursor.close();
- }
- }
- }
- }
- return null;
- }
-
- public String getMimeType(Uri uri) {
- switch (getUriType(uri)) {
- case URI_TYPE_FILE:
- case URI_TYPE_ASSET:
- return getMimeTypeFromPath(uri.getPath());
- case URI_TYPE_CONTENT:
- case URI_TYPE_RESOURCE:
- return contentResolver.getType(uri);
- case URI_TYPE_DATA: {
- return getDataUriMimeType(uri);
- }
- case URI_TYPE_HTTP:
- case URI_TYPE_HTTPS: {
- try {
- HttpURLConnection conn = (HttpURLConnection)new URL(uri.toString()).openConnection();
- conn.setDoInput(false);
- conn.setRequestMethod("HEAD");
- String mimeType = conn.getHeaderField("Content-Type");
- if (mimeType != null) {
- mimeType = mimeType.split(";")[0];
- }
- return mimeType;
- } catch (IOException e) {
- }
- }
- }
-
- return null;
- }
-
-
- //This already exists
- private String getMimeTypeFromPath(String path) {
- String extension = path;
- int lastDot = extension.lastIndexOf('.');
- if (lastDot != -1) {
- extension = extension.substring(lastDot + 1);
- }
- // Convert the URI string to lower case to ensure compatibility with MimeTypeMap (see CB-2185).
- extension = extension.toLowerCase(Locale.getDefault());
- if (extension.equals("3ga")) {
- return "audio/3gpp";
- } else if (extension.equals("js")) {
- // Missing from the map :(.
- return "text/javascript";
- }
- return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
- }
-
- /**
- * Opens a stream to the given URI, also providing the MIME type & length.
- * @return Never returns null.
- * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
- * resolved before being passed into this function.
- * @throws Throws an IOException if the URI cannot be opened.
- * @throws Throws an IllegalStateException if called on a foreground thread.
- */
- public OpenForReadResult openForRead(Uri uri) throws IOException {
- return openForRead(uri, false);
- }
-
- /**
- * Opens a stream to the given URI, also providing the MIME type & length.
- * @return Never returns null.
- * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
- * resolved before being passed into this function.
- * @throws Throws an IOException if the URI cannot be opened.
- * @throws Throws an IllegalStateException if called on a foreground thread and skipThreadCheck is false.
- */
- public OpenForReadResult openForRead(Uri uri, boolean skipThreadCheck) throws IOException {
- if (!skipThreadCheck) {
- assertBackgroundThread();
- }
- switch (getUriType(uri)) {
- case URI_TYPE_FILE: {
- FileInputStream inputStream = new FileInputStream(uri.getPath());
- String mimeType = getMimeTypeFromPath(uri.getPath());
- long length = inputStream.getChannel().size();
- return new OpenForReadResult(uri, inputStream, mimeType, length, null);
- }
- case URI_TYPE_ASSET: {
- String assetPath = uri.getPath().substring(15);
- AssetFileDescriptor assetFd = null;
- InputStream inputStream;
- long length = -1;
- try {
- assetFd = assetManager.openFd(assetPath);
- inputStream = assetFd.createInputStream();
- length = assetFd.getLength();
- } catch (FileNotFoundException e) {
- // Will occur if the file is compressed.
- inputStream = assetManager.open(assetPath);
- length = inputStream.available();
- }
- String mimeType = getMimeTypeFromPath(assetPath);
- return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);
- }
- case URI_TYPE_CONTENT:
- case URI_TYPE_RESOURCE: {
- String mimeType = contentResolver.getType(uri);
- AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, "r");
- InputStream inputStream = assetFd.createInputStream();
- long length = assetFd.getLength();
- return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);
- }
- case URI_TYPE_DATA: {
- OpenForReadResult ret = readDataUri(uri);
- if (ret == null) {
- break;
- }
- return ret;
- }
- case URI_TYPE_HTTP:
- case URI_TYPE_HTTPS: {
- HttpURLConnection conn = (HttpURLConnection)new URL(uri.toString()).openConnection();
- conn.setRequestProperty("Accept-Encoding", "gzip");
- conn.setDoInput(true);
- String mimeType = conn.getHeaderField("Content-Type");
- if (mimeType != null) {
- mimeType = mimeType.split(";")[0];
- }
- int length = conn.getContentLength();
- InputStream inputStream;
- if ("gzip".equals(conn.getContentEncoding())) {
- inputStream = new GZIPInputStream(conn.getInputStream());
- } else {
- inputStream = conn.getInputStream();
- }
- return new OpenForReadResult(uri, inputStream, mimeType, length, null);
- }
- case URI_TYPE_PLUGIN: {
- String pluginId = uri.getHost();
- CordovaPlugin plugin = pluginManager.getPlugin(pluginId);
- if (plugin == null) {
- throw new FileNotFoundException("Invalid plugin ID in URI: " + uri);
- }
- return plugin.handleOpenForRead(uri);
- }
- }
- throw new FileNotFoundException("URI not supported by CordovaResourceApi: " + uri);
- }
-
- public OutputStream openOutputStream(Uri uri) throws IOException {
- return openOutputStream(uri, false);
- }
-
- /**
- * Opens a stream to the given URI.
- * @return Never returns null.
- * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be
- * resolved before being passed into this function.
- * @throws Throws an IOException if the URI cannot be opened.
- */
- public OutputStream openOutputStream(Uri uri, boolean append) throws IOException {
- assertBackgroundThread();
- switch (getUriType(uri)) {
- case URI_TYPE_FILE: {
- File localFile = new File(uri.getPath());
- File parent = localFile.getParentFile();
- if (parent != null) {
- parent.mkdirs();
- }
- return new FileOutputStream(localFile, append);
- }
- case URI_TYPE_CONTENT:
- case URI_TYPE_RESOURCE: {
- AssetFileDescriptor assetFd = contentResolver.openAssetFileDescriptor(uri, append ? "wa" : "w");
- return assetFd.createOutputStream();
- }
- }
- throw new FileNotFoundException("URI not supported by CordovaResourceApi: " + uri);
- }
-
- public HttpURLConnection createHttpConnection(Uri uri) throws IOException {
- assertBackgroundThread();
- return (HttpURLConnection)new URL(uri.toString()).openConnection();
- }
-
- // Copies the input to the output in the most efficient manner possible.
- // Closes both streams.
- public void copyResource(OpenForReadResult input, OutputStream outputStream) throws IOException {
- assertBackgroundThread();
- try {
- InputStream inputStream = input.inputStream;
- if (inputStream instanceof FileInputStream && outputStream instanceof FileOutputStream) {
- FileChannel inChannel = ((FileInputStream)input.inputStream).getChannel();
- FileChannel outChannel = ((FileOutputStream)outputStream).getChannel();
- long offset = 0;
- long length = input.length;
- if (input.assetFd != null) {
- offset = input.assetFd.getStartOffset();
- }
- // transferFrom()'s 2nd arg is a relative position. Need to set the absolute
- // position first.
- inChannel.position(offset);
- outChannel.transferFrom(inChannel, 0, length);
- } else {
- final int BUFFER_SIZE = 8192;
- byte[] buffer = new byte[BUFFER_SIZE];
-
- for (;;) {
- int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE);
-
- if (bytesRead <= 0) {
- break;
- }
- outputStream.write(buffer, 0, bytesRead);
- }
- }
- } finally {
- input.inputStream.close();
- if (outputStream != null) {
- outputStream.close();
- }
- }
- }
-
- public void copyResource(Uri sourceUri, OutputStream outputStream) throws IOException {
- copyResource(openForRead(sourceUri), outputStream);
- }
-
- // Added in 3.5.0.
- public void copyResource(Uri sourceUri, Uri dstUri) throws IOException {
- copyResource(openForRead(sourceUri), openOutputStream(dstUri));
- }
-
- private void assertBackgroundThread() {
- if (threadCheckingEnabled) {
- Thread curThread = Thread.currentThread();
- if (curThread == Looper.getMainLooper().getThread()) {
- throw new IllegalStateException("Do not perform IO operations on the UI thread. Use CordovaInterface.getThreadPool() instead.");
- }
- if (curThread == jsThread) {
- throw new IllegalStateException("Tried to perform an IO operation on the WebCore thread. Use CordovaInterface.getThreadPool() instead.");
- }
- }
- }
-
- private String getDataUriMimeType(Uri uri) {
- String uriAsString = uri.getSchemeSpecificPart();
- int commaPos = uriAsString.indexOf(',');
- if (commaPos == -1) {
- return null;
- }
- String[] mimeParts = uriAsString.substring(0, commaPos).split(";");
- if (mimeParts.length > 0) {
- return mimeParts[0];
- }
- return null;
- }
-
- private OpenForReadResult readDataUri(Uri uri) {
- String uriAsString = uri.getSchemeSpecificPart();
- int commaPos = uriAsString.indexOf(',');
- if (commaPos == -1) {
- return null;
- }
- String[] mimeParts = uriAsString.substring(0, commaPos).split(";");
- String contentType = null;
- boolean base64 = false;
- if (mimeParts.length > 0) {
- contentType = mimeParts[0];
- }
- for (int i = 1; i < mimeParts.length; ++i) {
- if ("base64".equalsIgnoreCase(mimeParts[i])) {
- base64 = true;
- }
- }
- String dataPartAsString = uriAsString.substring(commaPos + 1);
- byte[] data;
- if (base64) {
- data = Base64.decode(dataPartAsString, Base64.DEFAULT);
- } else {
- try {
- data = dataPartAsString.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- data = dataPartAsString.getBytes();
- }
- }
- InputStream inputStream = new ByteArrayInputStream(data);
- return new OpenForReadResult(uri, inputStream, contentType, data.length, null);
- }
-
- private static void assertNonRelative(Uri uri) {
- if (!uri.isAbsolute()) {
- throw new IllegalArgumentException("Relative URIs are not supported.");
- }
- }
-
- public static final class OpenForReadResult {
- public final Uri uri;
- public final InputStream inputStream;
- public final String mimeType;
- public final long length;
- public final AssetFileDescriptor assetFd;
-
- public OpenForReadResult(Uri uri, InputStream inputStream, String mimeType, long length, AssetFileDescriptor assetFd) {
- this.uri = uri;
- this.inputStream = inputStream;
- this.mimeType = mimeType;
- this.length = length;
- this.assetFd = assetFd;
- }
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
deleted file mode 100644
index 96b2c4f7e..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.util.List;
-import java.util.Map;
-
-import android.content.Context;
-import android.content.Intent;
-import android.view.View;
-import android.webkit.WebChromeClient.CustomViewCallback;
-
-/**
- * Main interface for interacting with a Cordova webview - implemented by CordovaWebViewImpl.
- * This is an interface so that it can be easily mocked in tests.
- * Methods may be added to this interface without a major version bump, as plugins & embedders
- * are not expected to implement it.
- */
-public interface CordovaWebView {
- public static final String CORDOVA_VERSION = "9.1.0";
-
- void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
-
- boolean isInitialized();
-
- View getView();
-
- void loadUrlIntoView(String url, boolean recreatePlugins);
-
- void stopLoading();
-
- boolean canGoBack();
-
- void clearCache();
-
- /** Use parameter-less overload */
- @Deprecated
- void clearCache(boolean b);
-
- void clearHistory();
-
- boolean backHistory();
-
- void handlePause(boolean keepRunning);
-
- void onNewIntent(Intent intent);
-
- void handleResume(boolean keepRunning);
-
- void handleStart();
-
- void handleStop();
-
- void handleDestroy();
-
- /**
- * Send JavaScript statement back to JavaScript.
- *
- * Deprecated (https://issues.apache.org/jira/browse/CB-6851)
- * Instead of executing snippets of JS, you should use the exec bridge
- * to create a Java->JS communication channel.
- * To do this:
- * 1. Within plugin.xml (to have your JS run before deviceready):
- * <js-module><runs/></js-module>
- * 2. Within your .js (call exec on start-up):
- * require('cordova/channel').onCordovaReady.subscribe(function() {
- * require('cordova/exec')(win, null, 'Plugin', 'method', []);
- * function win(message) {
- * ... process message from java here ...
- * }
- * });
- * 3. Within your .java:
- * PluginResult dataResult = new PluginResult(PluginResult.Status.OK, CODE);
- * dataResult.setKeepCallback(true);
- * savedCallbackContext.sendPluginResult(dataResult);
- */
- @Deprecated
- void sendJavascript(String statememt);
-
- /**
- * Load the specified URL in the Cordova webview or a new browser instance.
- *
- * NOTE: If openExternal is false, only whitelisted URLs can be loaded.
- *
- * @param url The url to load.
- * @param openExternal Load url in browser instead of Cordova webview.
- * @param clearHistory Clear the history stack, so new page becomes top of history
- * @param params Parameters for new app
- */
- void showWebPage(String url, boolean openExternal, boolean clearHistory, Map<String, Object> params);
-
- /**
- * Deprecated in 4.0.0. Use your own View-toggling logic.
- */
- @Deprecated
- boolean isCustomViewShowing();
-
- /**
- * Deprecated in 4.0.0. Use your own View-toggling logic.
- */
- @Deprecated
- void showCustomView(View view, CustomViewCallback callback);
-
- /**
- * Deprecated in 4.0.0. Use your own View-toggling logic.
- */
- @Deprecated
- void hideCustomView();
-
- CordovaResourceApi getResourceApi();
-
- void setButtonPlumbedToJs(int keyCode, boolean override);
- boolean isButtonPlumbedToJs(int keyCode);
-
- void sendPluginResult(PluginResult cr, String callbackId);
-
- PluginManager getPluginManager();
- CordovaWebViewEngine getEngine();
- CordovaPreferences getPreferences();
- ICordovaCookieManager getCookieManager();
-
- String getUrl();
-
- // TODO: Work on deleting these by removing refs from plugins.
- Context getContext();
- void loadUrl(String url);
- Object postMessage(String id, Object data);
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java
deleted file mode 100644
index c8e5a55d2..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewEngine.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.view.KeyEvent;
-import android.view.View;
-import android.webkit.ValueCallback;
-
-/**
- * Interface for all Cordova engines.
- * No methods will be added to this class (in order to be compatible with existing engines).
- * Instead, we will create a new interface: e.g. CordovaWebViewEngineV2
- */
-public interface CordovaWebViewEngine {
- void init(CordovaWebView parentWebView, CordovaInterface cordova, Client client,
- CordovaResourceApi resourceApi, PluginManager pluginManager,
- NativeToJsMessageQueue nativeToJsMessageQueue);
-
- CordovaWebView getCordovaWebView();
- ICordovaCookieManager getCookieManager();
- View getView();
-
- void loadUrl(String url, boolean clearNavigationStack);
-
- void stopLoading();
-
- /** Return the currently loaded URL */
- String getUrl();
-
- void clearCache();
-
- /** After calling clearHistory(), canGoBack() should be false. */
- void clearHistory();
-
- boolean canGoBack();
-
- /** Returns whether a navigation occurred */
- boolean goBack();
-
- /** Pauses / resumes the WebView's event loop. */
- void setPaused(boolean value);
-
- /** Clean up all resources associated with the WebView. */
- void destroy();
-
- /** Add the evaulate Javascript method **/
- void evaluateJavascript(String js, ValueCallback<String> callback);
-
- /**
- * Used to retrieve the associated CordovaWebView given a View without knowing the type of Engine.
- * E.g. ((CordovaWebView.EngineView)activity.findViewById(android.R.id.webView)).getCordovaWebView();
- */
- public interface EngineView {
- CordovaWebView getCordovaWebView();
- }
-
- /**
- * Contains methods that an engine uses to communicate with the parent CordovaWebView.
- * Methods may be added in future cordova versions, but never removed.
- */
- public interface Client {
- Boolean onDispatchKeyEvent(KeyEvent event);
- void clearLoadTimeoutTimer();
- void onPageStarted(String newUrl);
- void onReceivedError(int errorCode, String description, String failingUrl);
- void onPageFinishedLoading(String url);
- boolean onNavigationAttempt(String url);
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java
deleted file mode 100644
index b0ddcf439..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.annotation.SuppressLint;
-import android.content.ActivityNotFoundException;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.view.Gravity;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.WebChromeClient;
-import android.widget.FrameLayout;
-
-import org.apache.cordova.engine.SystemWebViewEngine;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.lang.reflect.Constructor;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Main class for interacting with a Cordova webview. Manages plugins, events, and a CordovaWebViewEngine.
- * Class uses two-phase initialization. You must call init() before calling any other methods.
- */
-public class CordovaWebViewImpl implements CordovaWebView {
-
- public static final String TAG = "CordovaWebViewImpl";
-
- private PluginManager pluginManager;
-
- protected final CordovaWebViewEngine engine;
- private CordovaInterface cordova;
-
- // Flag to track that a loadUrl timeout occurred
- private int loadUrlTimeout = 0;
-
- private CordovaResourceApi resourceApi;
- private CordovaPreferences preferences;
- private CoreAndroid appPlugin;
- private NativeToJsMessageQueue nativeToJsMessageQueue;
- private EngineClient engineClient = new EngineClient();
- private boolean hasPausedEver;
-
- // The URL passed to loadUrl(), not necessarily the URL of the current page.
- String loadedUrl;
-
- /** custom view created by the browser (a video player for example) */
- private View mCustomView;
- private WebChromeClient.CustomViewCallback mCustomViewCallback;
-
- private Set<Integer> boundKeyCodes = new HashSet<Integer>();
-
- public static CordovaWebViewEngine createEngine(Context context, CordovaPreferences preferences) {
- String className = preferences.getString("webview", SystemWebViewEngine.class.getCanonicalName());
- try {
- Class<?> webViewClass = Class.forName(className);
- Constructor<?> constructor = webViewClass.getConstructor(Context.class, CordovaPreferences.class);
- return (CordovaWebViewEngine) constructor.newInstance(context, preferences);
- } catch (Exception e) {
- throw new RuntimeException("Failed to create webview. ", e);
- }
- }
-
- public CordovaWebViewImpl(CordovaWebViewEngine cordovaWebViewEngine) {
- this.engine = cordovaWebViewEngine;
- }
-
- // Convenience method for when creating programmatically (not from Config.xml).
- public void init(CordovaInterface cordova) {
- init(cordova, new ArrayList<PluginEntry>(), new CordovaPreferences());
- }
-
- @SuppressLint("Assert")
- @Override
- public void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences) {
- if (this.cordova != null) {
- throw new IllegalStateException();
- }
- this.cordova = cordova;
- this.preferences = preferences;
- pluginManager = new PluginManager(this, this.cordova, pluginEntries);
- resourceApi = new CordovaResourceApi(engine.getView().getContext(), pluginManager);
- nativeToJsMessageQueue = new NativeToJsMessageQueue();
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.NoOpBridgeMode());
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.LoadUrlBridgeMode(engine, cordova));
-
- if (preferences.getBoolean("DisallowOverscroll", false)) {
- engine.getView().setOverScrollMode(View.OVER_SCROLL_NEVER);
- }
- engine.init(this, cordova, engineClient, resourceApi, pluginManager, nativeToJsMessageQueue);
- // This isn't enforced by the compiler, so assert here.
- assert engine.getView() instanceof CordovaWebViewEngine.EngineView;
-
- pluginManager.addService(CoreAndroid.PLUGIN_NAME, "org.apache.cordova.CoreAndroid");
- pluginManager.init();
-
- }
-
- @Override
- public boolean isInitialized() {
- return cordova != null;
- }
-
- @Override
- public void loadUrlIntoView(final String url, boolean recreatePlugins) {
- LOG.d(TAG, ">>> loadUrl(" + url + ")");
- if (url.equals("about:blank") || url.startsWith("javascript:")) {
- engine.loadUrl(url, false);
- return;
- }
-
- recreatePlugins = recreatePlugins || (loadedUrl == null);
-
- if (recreatePlugins) {
- // Don't re-initialize on first load.
- if (loadedUrl != null) {
- appPlugin = null;
- pluginManager.init();
- }
- loadedUrl = url;
- }
-
- // Create a timeout timer for loadUrl
- final int currentLoadUrlTimeout = loadUrlTimeout;
- final int loadUrlTimeoutValue = preferences.getInteger("LoadUrlTimeoutValue", 20000);
-
- // Timeout error method
- final Runnable loadError = new Runnable() {
- public void run() {
- stopLoading();
- LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!");
-
- // Handle other errors by passing them to the webview in JS
- JSONObject data = new JSONObject();
- try {
- data.put("errorCode", -6);
- data.put("description", "The connection to the server was unsuccessful.");
- data.put("url", url);
- } catch (JSONException e) {
- // Will never happen.
- }
- pluginManager.postMessage("onReceivedError", data);
- }
- };
-
- // Timeout timer method
- final Runnable timeoutCheck = new Runnable() {
- public void run() {
- try {
- synchronized (this) {
- wait(loadUrlTimeoutValue);
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- // If timeout, then stop loading and handle error (if activity still exists)
- if (loadUrlTimeout == currentLoadUrlTimeout && cordova.getActivity() != null) {
- cordova.getActivity().runOnUiThread(loadError);
- } else if (cordova.getActivity() == null) {
- LOG.d(TAG, "Cordova activity does not exist.");
- }
- }
- };
-
- if (cordova.getActivity() != null) {
- final boolean _recreatePlugins = recreatePlugins;
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- if (loadUrlTimeoutValue > 0) {
- cordova.getThreadPool().execute(timeoutCheck);
- }
- engine.loadUrl(url, _recreatePlugins);
- }
- });
- } else {
- LOG.d(TAG, "Cordova activity does not exist.");
- }
- }
-
-
- @Override
- public void loadUrl(String url) {
- loadUrlIntoView(url, true);
- }
-
- @Override
- public void showWebPage(String url, boolean openExternal, boolean clearHistory, Map<String, Object> params) {
- LOG.d(TAG, "showWebPage(%s, %b, %b, HashMap)", url, openExternal, clearHistory);
-
- // If clearing history
- if (clearHistory) {
- engine.clearHistory();
- }
-
- // If loading into our webview
- if (!openExternal) {
- // Make sure url is in whitelist
- if (pluginManager.shouldAllowNavigation(url)) {
- // TODO: What about params?
- // Load new URL
- loadUrlIntoView(url, true);
- return;
- } else {
- LOG.w(TAG, "showWebPage: Refusing to load URL into webview since it is not in the <allow-navigation> whitelist. URL=" + url);
- return;
- }
- }
- if (!pluginManager.shouldOpenExternalUrl(url)) {
- LOG.w(TAG, "showWebPage: Refusing to send intent for URL since it is not in the <allow-intent> whitelist. URL=" + url);
- return;
- }
-
- Intent intent = null;
- try {
- if (url.startsWith("intent://")) {
- intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
- } else {
- intent = new Intent(Intent.ACTION_VIEW);
- // To send an intent without CATEGORY_BROWSER, a custom plugin should be used.
- intent.addCategory(Intent.CATEGORY_BROWSABLE);
- Uri uri = Uri.parse(url);
- // Omitting the MIME type for file: URLs causes "No Activity found to handle Intent".
- // Adding the MIME type to http: URLs causes them to not be handled by the downloader.
- if ("file".equals(uri.getScheme())) {
- intent.setDataAndType(uri, resourceApi.getMimeType(uri));
- } else {
- intent.setData(uri);
- }
- }
- if (cordova.getActivity() != null) {
- cordova.getActivity().startActivity(intent);
- } else {
- LOG.d(TAG, "Cordova activity does not exist.");
- }
- } catch (URISyntaxException e) {
- LOG.e(TAG, "Error parsing url " + url, e);
- } catch (ActivityNotFoundException e) {
- if (url.startsWith("intent://") && intent != null && intent.getStringExtra("browser_fallback_url") != null) {
- showWebPage(intent.getStringExtra("browser_fallback_url"), openExternal, clearHistory, params);
- } else {
- LOG.e(TAG, "Error loading url " + url, e);
- }
- }
- }
-
- private static class WrapperView extends FrameLayout {
-
- private final CordovaWebViewEngine engine;
-
- public WrapperView(Context context, CordovaWebViewEngine engine) {
- super(context);
- this.engine = engine;
- }
-
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- boolean ret = engine.getView().dispatchKeyEvent(event);
- if (!ret) {
- // If the engine didn't handle the event, handle it normally.
- ret = super.dispatchKeyEvent(event);
- }
- return ret;
- }
- }
-
- @Override
- @Deprecated
- public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
- // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
- LOG.d(TAG, "showing Custom View");
- // if a view already exists then immediately terminate the new one
- if (mCustomView != null) {
- callback.onCustomViewHidden();
- return;
- }
-
- WrapperView wrapperView = new WrapperView(getContext(), engine);
- wrapperView.addView(view);
-
- // Store the view and its callback for later (to kill it properly)
- mCustomView = wrapperView;
- mCustomViewCallback = callback;
-
- // Add the custom view to its container.
- ViewGroup parent = (ViewGroup) engine.getView().getParent();
- parent.addView(wrapperView, new FrameLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT,
- Gravity.CENTER));
-
- // Hide the content view.
- engine.getView().setVisibility(View.GONE);
-
- // Finally show the custom view container.
- parent.setVisibility(View.VISIBLE);
- parent.bringToFront();
- }
-
- @Override
- @Deprecated
- public void hideCustomView() {
- // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
- if (mCustomView == null) return;
- LOG.d(TAG, "Hiding Custom View");
-
- // Hide the custom view.
- mCustomView.setVisibility(View.GONE);
-
- // Remove the custom view from its container.
- ViewGroup parent = (ViewGroup) engine.getView().getParent();
- parent.removeView(mCustomView);
- mCustomView = null;
- mCustomViewCallback.onCustomViewHidden();
-
- // Show the content view.
- engine.getView().setVisibility(View.VISIBLE);
- }
-
- @Override
- @Deprecated
- public boolean isCustomViewShowing() {
- return mCustomView != null;
- }
-
- @Override
- @Deprecated
- public void sendJavascript(String statement) {
- nativeToJsMessageQueue.addJavaScript(statement);
- }
-
- @Override
- public void sendPluginResult(PluginResult cr, String callbackId) {
- nativeToJsMessageQueue.addPluginResult(cr, callbackId);
- }
-
- @Override
- public PluginManager getPluginManager() {
- return pluginManager;
- }
- @Override
- public CordovaPreferences getPreferences() {
- return preferences;
- }
- @Override
- public ICordovaCookieManager getCookieManager() {
- return engine.getCookieManager();
- }
- @Override
- public CordovaResourceApi getResourceApi() {
- return resourceApi;
- }
- @Override
- public CordovaWebViewEngine getEngine() {
- return engine;
- }
- @Override
- public View getView() {
- return engine.getView();
- }
- @Override
- public Context getContext() {
- return engine.getView().getContext();
- }
-
- private void sendJavascriptEvent(String event) {
- if (appPlugin == null) {
- appPlugin = (CoreAndroid)pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
- }
-
- if (appPlugin == null) {
- LOG.w(TAG, "Unable to fire event without existing plugin");
- return;
- }
- appPlugin.fireJavascriptEvent(event);
- }
-
- @Override
- public void setButtonPlumbedToJs(int keyCode, boolean override) {
- switch (keyCode) {
- case KeyEvent.KEYCODE_VOLUME_DOWN:
- case KeyEvent.KEYCODE_VOLUME_UP:
- case KeyEvent.KEYCODE_BACK:
- case KeyEvent.KEYCODE_MENU:
- // TODO: Why are search and menu buttons handled separately?
- if (override) {
- boundKeyCodes.add(keyCode);
- } else {
- boundKeyCodes.remove(keyCode);
- }
- return;
- default:
- throw new IllegalArgumentException("Unsupported keycode: " + keyCode);
- }
- }
-
- @Override
- public boolean isButtonPlumbedToJs(int keyCode) {
- return boundKeyCodes.contains(keyCode);
- }
-
- @Override
- public Object postMessage(String id, Object data) {
- return pluginManager.postMessage(id, data);
- }
-
- // Engine method proxies:
- @Override
- public String getUrl() {
- return engine.getUrl();
- }
-
- @Override
- public void stopLoading() {
- // Clear timeout flag
- loadUrlTimeout++;
- }
-
- @Override
- public boolean canGoBack() {
- return engine.canGoBack();
- }
-
- @Override
- public void clearCache() {
- engine.clearCache();
- }
-
- @Override
- @Deprecated
- public void clearCache(boolean b) {
- engine.clearCache();
- }
-
- @Override
- public void clearHistory() {
- engine.clearHistory();
- }
-
- @Override
- public boolean backHistory() {
- return engine.goBack();
- }
-
- /////// LifeCycle methods ///////
- @Override
- public void onNewIntent(Intent intent) {
- if (this.pluginManager != null) {
- this.pluginManager.onNewIntent(intent);
- }
- }
- @Override
- public void handlePause(boolean keepRunning) {
- if (!isInitialized()) {
- return;
- }
- hasPausedEver = true;
- pluginManager.onPause(keepRunning);
- sendJavascriptEvent("pause");
-
- // If app doesn't want to run in background
- if (!keepRunning) {
- // Pause JavaScript timers. This affects all webviews within the app!
- engine.setPaused(true);
- }
- }
- @Override
- public void handleResume(boolean keepRunning) {
- if (!isInitialized()) {
- return;
- }
-
- // Resume JavaScript timers. This affects all webviews within the app!
- engine.setPaused(false);
- this.pluginManager.onResume(keepRunning);
-
- // In order to match the behavior of the other platforms, we only send onResume after an
- // onPause has occurred. The resume event might still be sent if the Activity was killed
- // while waiting for the result of an external Activity once the result is obtained
- if (hasPausedEver) {
- sendJavascriptEvent("resume");
- }
- }
- @Override
- public void handleStart() {
- if (!isInitialized()) {
- return;
- }
- pluginManager.onStart();
- }
- @Override
- public void handleStop() {
- if (!isInitialized()) {
- return;
- }
- pluginManager.onStop();
- }
- @Override
- public void handleDestroy() {
- if (!isInitialized()) {
- return;
- }
- // Cancel pending timeout timer.
- loadUrlTimeout++;
-
- // Forward to plugins
- this.pluginManager.onDestroy();
-
- // TODO: about:blank is a bit special (and the default URL for new frames)
- // We should use a blank data: url instead so it's more obvious
- this.loadUrl("about:blank");
-
- // TODO: Should not destroy webview until after about:blank is done loading.
- engine.destroy();
- hideCustomView();
- }
-
- protected class EngineClient implements CordovaWebViewEngine.Client {
- @Override
- public void clearLoadTimeoutTimer() {
- loadUrlTimeout++;
- }
-
- @Override
- public void onPageStarted(String newUrl) {
- LOG.d(TAG, "onPageDidNavigate(" + newUrl + ")");
- boundKeyCodes.clear();
- pluginManager.onReset();
- pluginManager.postMessage("onPageStarted", newUrl);
- }
-
- @Override
- public void onReceivedError(int errorCode, String description, String failingUrl) {
- clearLoadTimeoutTimer();
- JSONObject data = new JSONObject();
- try {
- data.put("errorCode", errorCode);
- data.put("description", description);
- data.put("url", failingUrl);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- pluginManager.postMessage("onReceivedError", data);
- }
-
- @Override
- public void onPageFinishedLoading(String url) {
- LOG.d(TAG, "onPageFinished(" + url + ")");
-
- clearLoadTimeoutTimer();
-
- // Broadcast message that page has loaded
- pluginManager.postMessage("onPageFinished", url);
-
- // Make app visible after 2 sec in case there was a JS error and Cordova JS never initialized correctly
- if (engine.getView().getVisibility() != View.VISIBLE) {
- Thread t = new Thread(new Runnable() {
- public void run() {
- try {
- Thread.sleep(2000);
- if (cordova.getActivity() != null) {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- pluginManager.postMessage("spinner", "stop");
- }
- });
- } else {
- LOG.d(TAG, "Cordova activity does not exist.");
- }
- } catch (InterruptedException e) {
- }
- }
- });
- t.start();
- }
-
- // Shutdown if blank loaded
- if (url.equals("about:blank")) {
- pluginManager.postMessage("exit", null);
- }
- }
-
- @Override
- public Boolean onDispatchKeyEvent(KeyEvent event) {
- int keyCode = event.getKeyCode();
- boolean isBackButton = keyCode == KeyEvent.KEYCODE_BACK;
- if (event.getAction() == KeyEvent.ACTION_DOWN) {
- if (isBackButton && mCustomView != null) {
- return true;
- } else if (boundKeyCodes.contains(keyCode)) {
- return true;
- } else if (isBackButton) {
- return engine.canGoBack();
- }
- } else if (event.getAction() == KeyEvent.ACTION_UP) {
- if (isBackButton && mCustomView != null) {
- hideCustomView();
- return true;
- } else if (boundKeyCodes.contains(keyCode)) {
- String eventName = null;
- switch (keyCode) {
- case KeyEvent.KEYCODE_VOLUME_DOWN:
- eventName = "volumedownbutton";
- break;
- case KeyEvent.KEYCODE_VOLUME_UP:
- eventName = "volumeupbutton";
- break;
- case KeyEvent.KEYCODE_SEARCH:
- eventName = "searchbutton";
- break;
- case KeyEvent.KEYCODE_MENU:
- eventName = "menubutton";
- break;
- case KeyEvent.KEYCODE_BACK:
- eventName = "backbutton";
- break;
- }
- if (eventName != null) {
- sendJavascriptEvent(eventName);
- return true;
- }
- } else if (isBackButton) {
- return engine.goBack();
- }
- }
- return null;
- }
-
- @Override
- public boolean onNavigationAttempt(String url) {
- // Give plugins the chance to handle the url
- if (pluginManager.onOverrideUrlLoading(url)) {
- return true;
- } else if (pluginManager.shouldAllowNavigation(url)) {
- return false;
- } else if (pluginManager.shouldOpenExternalUrl(url)) {
- showWebPage(url, true, false, null);
- return true;
- }
- LOG.w(TAG, "Blocked (possibly sub-frame) navigation to non-allowed URL: " + url);
- return true;
- }
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java
deleted file mode 100755
index 6ebdecb3a..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.telephony.TelephonyManager;
-import android.view.KeyEvent;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-
-/**
- * This class exposes methods in Cordova that can be called from JavaScript.
- */
-public class CoreAndroid extends CordovaPlugin {
-
- public static final String PLUGIN_NAME = "CoreAndroid";
- protected static final String TAG = "CordovaApp";
- private BroadcastReceiver telephonyReceiver;
- private CallbackContext messageChannel;
- private PluginResult pendingResume;
- private PluginResult pendingPause;
- private final Object messageChannelLock = new Object();
-
- /**
- * Send an event to be fired on the Javascript side.
- *
- * @param action The name of the event to be fired
- */
- public void fireJavascriptEvent(String action) {
- sendEventMessage(action);
- }
-
- /**
- * Sets the context of the Command. This can then be used to do things like
- * get file paths associated with the Activity.
- */
- @Override
- public void pluginInitialize() {
- this.initTelephonyReceiver();
- }
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArry of arguments for the plugin.
- * @param callbackContext The callback context from which we were invoked.
- * @return A PluginResult object with a status and message.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- PluginResult.Status status = PluginResult.Status.OK;
- String result = "";
-
- try {
- if (action.equals("clearCache")) {
- this.clearCache();
- }
- else if (action.equals("show")) {
- // This gets called from JavaScript onCordovaReady to show the webview.
- // I recommend we change the name of the Message as spinner/stop is not
- // indicative of what this actually does (shows the webview).
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.getPluginManager().postMessage("spinner", "stop");
- }
- });
- }
- else if (action.equals("loadUrl")) {
- this.loadUrl(args.getString(0), args.optJSONObject(1));
- }
- else if (action.equals("cancelLoadUrl")) {
- //this.cancelLoadUrl();
- }
- else if (action.equals("clearHistory")) {
- this.clearHistory();
- }
- else if (action.equals("backHistory")) {
- this.backHistory();
- }
- else if (action.equals("overrideButton")) {
- this.overrideButton(args.getString(0), args.getBoolean(1));
- }
- else if (action.equals("overrideBackbutton")) {
- this.overrideBackbutton(args.getBoolean(0));
- }
- else if (action.equals("exitApp")) {
- this.exitApp();
- }
- else if (action.equals("messageChannel")) {
- synchronized(messageChannelLock) {
- messageChannel = callbackContext;
- if (pendingPause != null) {
- sendEventMessage(pendingPause);
- pendingPause = null;
- }
- if (pendingResume != null) {
- sendEventMessage(pendingResume);
- pendingResume = null;
- }
- }
- return true;
- }
-
- callbackContext.sendPluginResult(new PluginResult(status, result));
- return true;
- } catch (JSONException e) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- return false;
- }
- }
-
- //--------------------------------------------------------------------------
- // LOCAL METHODS
- //--------------------------------------------------------------------------
-
- /**
- * Clear the resource cache.
- */
- public void clearCache() {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.clearCache();
- }
- });
- }
-
- /**
- * Load the url into the webview.
- *
- * @param url
- * @param props Properties that can be passed in to the Cordova activity (i.e. loadingDialog, wait, ...)
- * @throws JSONException
- */
- public void loadUrl(String url, JSONObject props) throws JSONException {
- LOG.d("App", "App.loadUrl("+url+","+props+")");
- int wait = 0;
- boolean openExternal = false;
- boolean clearHistory = false;
-
- // If there are properties, then set them on the Activity
- HashMap<String, Object> params = new HashMap<String, Object>();
- if (props != null) {
- JSONArray keys = props.names();
- for (int i = 0; i < keys.length(); i++) {
- String key = keys.getString(i);
- if (key.equals("wait")) {
- wait = props.getInt(key);
- }
- else if (key.equalsIgnoreCase("openexternal")) {
- openExternal = props.getBoolean(key);
- }
- else if (key.equalsIgnoreCase("clearhistory")) {
- clearHistory = props.getBoolean(key);
- }
- else {
- Object value = props.get(key);
- if (value == null) {
-
- }
- else if (value.getClass().equals(String.class)) {
- params.put(key, (String)value);
- }
- else if (value.getClass().equals(Boolean.class)) {
- params.put(key, (Boolean)value);
- }
- else if (value.getClass().equals(Integer.class)) {
- params.put(key, (Integer)value);
- }
- }
- }
- }
-
- // If wait property, then delay loading
-
- if (wait > 0) {
- try {
- synchronized(this) {
- this.wait(wait);
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- this.webView.showWebPage(url, openExternal, clearHistory, params);
- }
-
- /**
- * Clear page history for the app.
- */
- public void clearHistory() {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.clearHistory();
- }
- });
- }
-
- /**
- * Go to previous page displayed.
- * This is the same as pressing the backbutton on Android device.
- */
- public void backHistory() {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- webView.backHistory();
- }
- });
- }
-
- /**
- * Override the default behavior of the Android back button.
- * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
- *
- * @param override T=override, F=cancel override
- */
- public void overrideBackbutton(boolean override) {
- LOG.i("App", "WARNING: Back Button Default Behavior will be overridden. The backbutton event will be fired!");
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_BACK, override);
- }
-
- /**
- * Override the default behavior of the Android volume buttons.
- * If overridden, when the volume button is pressed, the "volume[up|down]button" JavaScript event will be fired.
- *
- * @param button volumeup, volumedown
- * @param override T=override, F=cancel override
- */
- public void overrideButton(String button, boolean override) {
- LOG.i("App", "WARNING: Volume Button Default Behavior will be overridden. The volume event will be fired!");
- if (button.equals("volumeup")) {
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_UP, override);
- }
- else if (button.equals("volumedown")) {
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_DOWN, override);
- }
- else if (button.equals("menubutton")) {
- webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_MENU, override);
- }
- }
-
- /**
- * Return whether the Android back button is overridden by the user.
- *
- * @return boolean
- */
- public boolean isBackbuttonOverridden() {
- return webView.isButtonPlumbedToJs(KeyEvent.KEYCODE_BACK);
- }
-
- /**
- * Exit the Android application.
- */
- public void exitApp() {
- this.webView.getPluginManager().postMessage("exit", null);
- }
-
-
- /**
- * Listen for telephony events: RINGING, OFFHOOK and IDLE
- * Send these events to all plugins using
- * CordovaActivity.onMessage("telephone", "ringing" | "offhook" | "idle")
- */
- private void initTelephonyReceiver() {
- IntentFilter intentFilter = new IntentFilter();
- intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
- //final CordovaInterface mycordova = this.cordova;
- this.telephonyReceiver = new BroadcastReceiver() {
-
- @Override
- public void onReceive(Context context, Intent intent) {
-
- // If state has changed
- if ((intent != null) && intent.getAction().equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) {
- if (intent.hasExtra(TelephonyManager.EXTRA_STATE)) {
- String extraData = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
- if (extraData.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
- LOG.i(TAG, "Telephone RINGING");
- webView.getPluginManager().postMessage("telephone", "ringing");
- }
- else if (extraData.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) {
- LOG.i(TAG, "Telephone OFFHOOK");
- webView.getPluginManager().postMessage("telephone", "offhook");
- }
- else if (extraData.equals(TelephonyManager.EXTRA_STATE_IDLE)) {
- LOG.i(TAG, "Telephone IDLE");
- webView.getPluginManager().postMessage("telephone", "idle");
- }
- }
- }
- }
- };
-
- // Register the receiver
- webView.getContext().registerReceiver(this.telephonyReceiver, intentFilter);
- }
-
- private void sendEventMessage(String action) {
- JSONObject obj = new JSONObject();
- try {
- obj.put("action", action);
- } catch (JSONException e) {
- LOG.e(TAG, "Failed to create event message", e);
- }
- PluginResult result = new PluginResult(PluginResult.Status.OK, obj);
-
- if (messageChannel == null) {
- LOG.i(TAG, "Request to send event before messageChannel initialised: " + action);
- if ("pause".equals(action)) {
- pendingPause = result;
- } else if ("resume".equals(action)) {
- // When starting normally onPause then onResume is called
- pendingPause = null;
- }
- } else {
- sendEventMessage(result);
- }
- }
-
- private void sendEventMessage(PluginResult payload) {
- payload.setKeepCallback(true);
- if (messageChannel != null) {
- messageChannel.sendPluginResult(payload);
- }
- }
-
- /*
- * Unregister the receiver
- *
- */
- public void onDestroy()
- {
- webView.getContext().unregisterReceiver(this.telephonyReceiver);
- }
-
- /**
- * Used to send the resume event in the case that the Activity is destroyed by the OS
- *
- * @param resumeEvent PluginResult containing the payload for the resume event to be fired
- */
- public void sendResumeEvent(PluginResult resumeEvent) {
- // This operation must be synchronized because plugin results that trigger resume
- // events can be processed asynchronously
- synchronized(messageChannelLock) {
- if (messageChannel != null) {
- sendEventMessage(resumeEvent);
- } else {
- // Might get called before the page loads, so we need to store it until the
- // messageChannel gets created
- this.pendingResume = resumeEvent;
- }
- }
- }
-
- /*
- * This needs to be implemented if you wish to use the Camera Plugin or other plugins
- * that read the Build Configuration.
- *
- * Thanks to Phil@Medtronic and Graham Borland for finding the answer and posting it to
- * StackOverflow. This is annoying as hell!
- *
- */
-
- public static Object getBuildConfigValue(Context ctx, String key)
- {
- try
- {
- Class<?> clazz = Class.forName(ctx.getClass().getPackage().getName() + ".BuildConfig");
- Field field = clazz.getField(key);
- return field.get(null);
- } catch (ClassNotFoundException e) {
- LOG.d(TAG, "Unable to get the BuildConfig, is this built with ANT?");
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
- LOG.d(TAG, key + " is not a valid field. Check your build.gradle");
- } catch (IllegalAccessException e) {
- LOG.d(TAG, "Illegal Access Exception: Let's print a stack trace.");
- e.printStackTrace();
- } catch (NullPointerException e) {
- LOG.d(TAG, "Null Pointer Exception: Let's print a stack trace.");
- e.printStackTrace();
- }
-
- return null;
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java
deleted file mode 100644
index acc65c6fc..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-import org.json.JSONException;
-
-/*
- * Any exposed Javascript API MUST implement these three things!
- */
-public interface ExposedJsApi {
- public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException;
- public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException;
- public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException;
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java
deleted file mode 100644
index 1417a156c..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-/**
- * Specifies interface for handling certificate requests.
- */
-public interface ICordovaClientCertRequest {
- /**
- * Cancel this request
- */
- public void cancel();
-
- /*
- * Returns the host name of the server requesting the certificate.
- */
- public String getHost();
-
- /*
- * Returns the acceptable types of asymmetric keys (can be null).
- */
- public String[] getKeyTypes();
-
- /*
- * Returns the port number of the server requesting the certificate.
- */
- public int getPort();
-
- /*
- * Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
- */
- public Principal[] getPrincipals();
-
- /*
- * Ignore the request for now. Do not remember user's choice.
- */
- public void ignore();
-
- /*
- * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
- *
- * @param privateKey The privateKey
- * @param chain The certificate chain
- */
- public void proceed(PrivateKey privateKey, X509Certificate[] chain);
-}
\ No newline at end of file
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java
deleted file mode 100644
index e776194f2..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-public interface ICordovaCookieManager {
-
- public void setCookiesEnabled(boolean accept);
-
- public void setCookie(final String url, final String value);
-
- public String getCookie(final String url);
-
- public void clearCookies();
-
- public void flush();
-};
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java
deleted file mode 100644
index c89e5b9a2..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-/**
- * Specifies interface for HTTP auth handler object which is used to handle auth requests and
- * specifying user credentials.
- */
- public interface ICordovaHttpAuthHandler {
- /**
- * Instructs the WebView to cancel the authentication request.
- */
- public void cancel ();
-
- /**
- * Instructs the WebView to proceed with the authentication with the given credentials.
- *
- * @param username The user name
- * @param password The password
- */
- public void proceed (String username, String password);
-}
\ No newline at end of file
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/LOG.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/LOG.java
deleted file mode 100755
index 9fe7a7dfc..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/LOG.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import android.util.Log;
-
-/**
- * Log to Android logging system.
- *
- * Log message can be a string or a printf formatted string with arguments.
- * See http://developer.android.com/reference/java/util/Formatter.html
- */
-public class LOG {
-
- public static final int VERBOSE = Log.VERBOSE;
- public static final int DEBUG = Log.DEBUG;
- public static final int INFO = Log.INFO;
- public static final int WARN = Log.WARN;
- public static final int ERROR = Log.ERROR;
-
- // Current log level
- public static int LOGLEVEL = Log.ERROR;
-
- /**
- * Set the current log level.
- *
- * @param logLevel
- */
- public static void setLogLevel(int logLevel) {
- LOGLEVEL = logLevel;
- Log.i("CordovaLog", "Changing log level to " + logLevel);
- }
-
- /**
- * Set the current log level.
- *
- * @param logLevel
- */
- public static void setLogLevel(String logLevel) {
- if ("VERBOSE".equals(logLevel)) LOGLEVEL = VERBOSE;
- else if ("DEBUG".equals(logLevel)) LOGLEVEL = DEBUG;
- else if ("INFO".equals(logLevel)) LOGLEVEL = INFO;
- else if ("WARN".equals(logLevel)) LOGLEVEL = WARN;
- else if ("ERROR".equals(logLevel)) LOGLEVEL = ERROR;
- Log.i("CordovaLog", "Changing log level to " + logLevel + "(" + LOGLEVEL + ")");
- }
-
- /**
- * Determine if log level will be logged
- *
- * @param logLevel
- * @return true if the parameter passed in is greater than or equal to the current log level
- */
- public static boolean isLoggable(int logLevel) {
- return (logLevel >= LOGLEVEL);
- }
-
- /**
- * Verbose log message.
- *
- * @param tag
- * @param s
- */
- public static void v(String tag, String s) {
- if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, s);
- }
-
- /**
- * Debug log message.
- *
- * @param tag
- * @param s
- */
- public static void d(String tag, String s) {
- if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, s);
- }
-
- /**
- * Info log message.
- *
- * @param tag
- * @param s
- */
- public static void i(String tag, String s) {
- if (LOG.INFO >= LOGLEVEL) Log.i(tag, s);
- }
-
- /**
- * Warning log message.
- *
- * @param tag
- * @param s
- */
- public static void w(String tag, String s) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, s);
- }
-
- /**
- * Error log message.
- *
- * @param tag
- * @param s
- */
- public static void e(String tag, String s) {
- if (LOG.ERROR >= LOGLEVEL) Log.e(tag, s);
- }
-
- /**
- * Verbose log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void v(String tag, String s, Throwable e) {
- if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, s, e);
- }
-
- /**
- * Debug log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void d(String tag, String s, Throwable e) {
- if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, s, e);
- }
-
- /**
- * Info log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void i(String tag, String s, Throwable e) {
- if (LOG.INFO >= LOGLEVEL) Log.i(tag, s, e);
- }
-
- /**
- * Warning log message.
- *
- * @param tag
- * @param e
- */
- public static void w(String tag, Throwable e) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, e);
- }
-
- /**
- * Warning log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void w(String tag, String s, Throwable e) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, s, e);
- }
-
- /**
- * Error log message.
- *
- * @param tag
- * @param s
- * @param e
- */
- public static void e(String tag, String s, Throwable e) {
- if (LOG.ERROR >= LOGLEVEL) Log.e(tag, s, e);
- }
-
- /**
- * Verbose log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void v(String tag, String s, Object... args) {
- if (LOG.VERBOSE >= LOGLEVEL) Log.v(tag, String.format(s, args));
- }
-
- /**
- * Debug log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void d(String tag, String s, Object... args) {
- if (LOG.DEBUG >= LOGLEVEL) Log.d(tag, String.format(s, args));
- }
-
- /**
- * Info log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void i(String tag, String s, Object... args) {
- if (LOG.INFO >= LOGLEVEL) Log.i(tag, String.format(s, args));
- }
-
- /**
- * Warning log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void w(String tag, String s, Object... args) {
- if (LOG.WARN >= LOGLEVEL) Log.w(tag, String.format(s, args));
- }
-
- /**
- * Error log message with printf formatting.
- *
- * @param tag
- * @param s
- * @param args
- */
- public static void e(String tag, String s, Object... args) {
- if (LOG.ERROR >= LOGLEVEL) Log.e(tag, String.format(s, args));
- }
-
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java
deleted file mode 100755
index 311ba4446..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-
-/**
- * Holds the list of messages to be sent to the WebView.
- */
-public class NativeToJsMessageQueue {
- private static final String LOG_TAG = "JsMessageQueue";
-
- // Set this to true to force plugin results to be encoding as
- // JS instead of the custom format (useful for benchmarking).
- // Doesn't work for multipart messages.
- private static final boolean FORCE_ENCODE_USING_EVAL = false;
-
- // Disable sending back native->JS messages during an exec() when the active
- // exec() is asynchronous. Set this to true when running bridge benchmarks.
- static final boolean DISABLE_EXEC_CHAINING = false;
-
- // A hopefully reasonable upper limit of how much combined payload data
- // to send to the JavaScript in one shot.
- // This currently only chops up on message boundaries.
- // It may be useful to split and reassemble response messages someday.
- private static int COMBINED_RESPONSE_CUTOFF = 16 * 1024 * 1024;
-
- /**
- * When true, the active listener is not fired upon enqueue. When set to false,
- * the active listener will be fired if the queue is non-empty.
- */
- private boolean paused;
-
- /**
- * The list of JavaScript statements to be sent to JavaScript.
- */
- private final LinkedList<JsMessage> queue = new LinkedList<JsMessage>();
-
- /**
- * The array of listeners that can be used to send messages to JS.
- */
- private ArrayList<BridgeMode> bridgeModes = new ArrayList<BridgeMode>();
-
- /**
- * When null, the bridge is disabled. This occurs during page transitions.
- * When disabled, all callbacks are dropped since they are assumed to be
- * relevant to the previous page.
- */
- private BridgeMode activeBridgeMode;
-
- public void addBridgeMode(BridgeMode bridgeMode) {
- bridgeModes.add(bridgeMode);
- }
-
- public boolean isBridgeEnabled() {
- return activeBridgeMode != null;
- }
-
- public boolean isEmpty() {
- return queue.isEmpty();
- }
-
- /**
- * Changes the bridge mode.
- */
- public void setBridgeMode(int value) {
- if (value < -1 || value >= bridgeModes.size()) {
- LOG.d(LOG_TAG, "Invalid NativeToJsBridgeMode: " + value);
- } else {
- BridgeMode newMode = value < 0 ? null : bridgeModes.get(value);
- if (newMode != activeBridgeMode) {
- LOG.d(LOG_TAG, "Set native->JS mode to " + (newMode == null ? "null" : newMode.getClass().getSimpleName()));
- synchronized (this) {
- activeBridgeMode = newMode;
- if (newMode != null) {
- newMode.reset();
- if (!paused && !queue.isEmpty()) {
- newMode.onNativeToJsMessageAvailable(this);
- }
- }
- }
- }
- }
- }
-
- /**
- * Clears all messages and resets to the default bridge mode.
- */
- public void reset() {
- synchronized (this) {
- queue.clear();
- setBridgeMode(-1);
- }
- }
-
- private int calculatePackedMessageLength(JsMessage message) {
- int messageLen = message.calculateEncodedLength();
- String messageLenStr = String.valueOf(messageLen);
- return messageLenStr.length() + messageLen + 1;
- }
-
- private void packMessage(JsMessage message, StringBuilder sb) {
- int len = message.calculateEncodedLength();
- sb.append(len)
- .append(' ');
- message.encodeAsMessage(sb);
- }
-
- /**
- * Combines and returns queued messages combined into a single string.
- *
- * Combines as many messages as possible, without exceeding
- * COMBINED_RESPONSE_CUTOFF in case of multiple response messages.
- *
- * Returns null if the queue is empty.
- */
- public String popAndEncode(boolean fromOnlineEvent) {
- synchronized (this) {
- if (activeBridgeMode == null) {
- return null;
- }
- activeBridgeMode.notifyOfFlush(this, fromOnlineEvent);
- if (queue.isEmpty()) {
- return null;
- }
- int totalPayloadLen = 0;
- int numMessagesToSend = 0;
- for (JsMessage message : queue) {
- int messageSize = calculatePackedMessageLength(message);
- if (numMessagesToSend > 0 &&
- COMBINED_RESPONSE_CUTOFF > 0 &&
- totalPayloadLen + messageSize > COMBINED_RESPONSE_CUTOFF
- ) {
- break;
- }
- totalPayloadLen += messageSize;
- numMessagesToSend += 1;
- }
-
- StringBuilder sb = new StringBuilder(totalPayloadLen);
- for (int i = 0; i < numMessagesToSend; ++i) {
- JsMessage message = queue.removeFirst();
- packMessage(message, sb);
- }
-
- if (!queue.isEmpty()) {
- // Attach a char to indicate that there are more messages pending.
- sb.append('*');
- }
- String ret = sb.toString();
- return ret;
- }
- }
-
- /**
- * Same as popAndEncode(), except encodes in a form that can be executed as JS.
- */
- public String popAndEncodeAsJs() {
- synchronized (this) {
- int length = queue.size();
- if (length == 0) {
- return null;
- }
- int totalPayloadLen = 0;
- int numMessagesToSend = 0;
- for (JsMessage message : queue) {
- int messageSize = message.calculateEncodedLength() + 50; // overestimate.
- if (numMessagesToSend > 0 &&
- COMBINED_RESPONSE_CUTOFF > 0 &&
- totalPayloadLen + messageSize > COMBINED_RESPONSE_CUTOFF
- ) {
- break;
- }
- totalPayloadLen += messageSize;
- numMessagesToSend += 1;
- }
- boolean willSendAllMessages = numMessagesToSend == queue.size();
- StringBuilder sb = new StringBuilder(totalPayloadLen + (willSendAllMessages ? 0 : 100));
- // Wrap each statement in a try/finally so that if one throws it does
- // not affect the next.
- for (int i = 0; i < numMessagesToSend; ++i) {
- JsMessage message = queue.removeFirst();
- if (willSendAllMessages && (i + 1 == numMessagesToSend)) {
- message.encodeAsJsMessage(sb);
- } else {
- sb.append("try{");
- message.encodeAsJsMessage(sb);
- sb.append("}finally{");
- }
- }
- if (!willSendAllMessages) {
- sb.append("window.setTimeout(function(){cordova.require('cordova/plugin/android/polling').pollOnce();},0);");
- }
- for (int i = willSendAllMessages ? 1 : 0; i < numMessagesToSend; ++i) {
- sb.append('}');
- }
- String ret = sb.toString();
- return ret;
- }
- }
-
- /**
- * Add a JavaScript statement to the list.
- */
- public void addJavaScript(String statement) {
- enqueueMessage(new JsMessage(statement));
- }
-
- /**
- * Add a JavaScript statement to the list.
- */
- public void addPluginResult(PluginResult result, String callbackId) {
- if (callbackId == null) {
- LOG.e(LOG_TAG, "Got plugin result with no callbackId", new Throwable());
- return;
- }
- // Don't send anything if there is no result and there is no need to
- // clear the callbacks.
- boolean noResult = result.getStatus() == PluginResult.Status.NO_RESULT.ordinal();
- boolean keepCallback = result.getKeepCallback();
- if (noResult && keepCallback) {
- return;
- }
- JsMessage message = new JsMessage(result, callbackId);
- if (FORCE_ENCODE_USING_EVAL) {
- StringBuilder sb = new StringBuilder(message.calculateEncodedLength() + 50);
- message.encodeAsJsMessage(sb);
- message = new JsMessage(sb.toString());
- }
-
- enqueueMessage(message);
- }
-
- private void enqueueMessage(JsMessage message) {
- synchronized (this) {
- if (activeBridgeMode == null) {
- LOG.d(LOG_TAG, "Dropping Native->JS message due to disabled bridge");
- return;
- }
- queue.add(message);
- if (!paused) {
- activeBridgeMode.onNativeToJsMessageAvailable(this);
- }
- }
- }
-
- public void setPaused(boolean value) {
- if (paused && value) {
- // This should never happen. If a use-case for it comes up, we should
- // change pause to be a counter.
- LOG.e(LOG_TAG, "nested call to setPaused detected.", new Throwable());
- }
- paused = value;
- if (!value) {
- synchronized (this) {
- if (!queue.isEmpty() && activeBridgeMode != null) {
- activeBridgeMode.onNativeToJsMessageAvailable(this);
- }
- }
- }
- }
-
- public static abstract class BridgeMode {
- public abstract void onNativeToJsMessageAvailable(NativeToJsMessageQueue queue);
- public void notifyOfFlush(NativeToJsMessageQueue queue, boolean fromOnlineEvent) {}
- public void reset() {}
- }
-
- /** Uses JS polls for messages on a timer.. */
- public static class NoOpBridgeMode extends BridgeMode {
- @Override public void onNativeToJsMessageAvailable(NativeToJsMessageQueue queue) {
- }
- }
-
- /** Uses webView.loadUrl("javascript:") to execute messages. */
- public static class LoadUrlBridgeMode extends BridgeMode {
- private final CordovaWebViewEngine engine;
- private final CordovaInterface cordova;
-
- public LoadUrlBridgeMode(CordovaWebViewEngine engine, CordovaInterface cordova) {
- this.engine = engine;
- this.cordova = cordova;
- }
-
- @Override
- public void onNativeToJsMessageAvailable(final NativeToJsMessageQueue queue) {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- String js = queue.popAndEncodeAsJs();
- if (js != null) {
- engine.loadUrl("javascript:" + js, false);
- }
- }
- });
- }
- }
-
- /** Uses online/offline events to tell the JS when to poll for messages. */
- public static class OnlineEventsBridgeMode extends BridgeMode {
- private final OnlineEventsBridgeModeDelegate delegate;
- private boolean online;
- private boolean ignoreNextFlush;
-
- public interface OnlineEventsBridgeModeDelegate {
- void setNetworkAvailable(boolean value);
- void runOnUiThread(Runnable r);
- }
-
- public OnlineEventsBridgeMode(OnlineEventsBridgeModeDelegate delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public void reset() {
- delegate.runOnUiThread(new Runnable() {
- public void run() {
- online = false;
- // If the following call triggers a notifyOfFlush, then ignore it.
- ignoreNextFlush = true;
- delegate.setNetworkAvailable(true);
- }
- });
- }
-
- @Override
- public void onNativeToJsMessageAvailable(final NativeToJsMessageQueue queue) {
- delegate.runOnUiThread(new Runnable() {
- public void run() {
- if (!queue.isEmpty()) {
- ignoreNextFlush = false;
- delegate.setNetworkAvailable(online);
- }
- }
- });
- }
- // Track when online/offline events are fired so that we don't fire excess events.
- @Override
- public void notifyOfFlush(final NativeToJsMessageQueue queue, boolean fromOnlineEvent) {
- if (fromOnlineEvent && !ignoreNextFlush) {
- online = !online;
- }
- }
- }
-
- /** Uses webView.evaluateJavascript to execute messages. */
- public static class EvalBridgeMode extends BridgeMode {
- private final CordovaWebViewEngine engine;
- private final CordovaInterface cordova;
-
- public EvalBridgeMode(CordovaWebViewEngine engine, CordovaInterface cordova) {
- this.engine = engine;
- this.cordova = cordova;
- }
-
- @Override
- public void onNativeToJsMessageAvailable(final NativeToJsMessageQueue queue) {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- String js = queue.popAndEncodeAsJs();
- if (js != null) {
- engine.evaluateJavascript(js, null);
- }
- }
- });
- }
- }
-
-
-
- private static class JsMessage {
- final String jsPayloadOrCallbackId;
- final PluginResult pluginResult;
- JsMessage(String js) {
- if (js == null) {
- throw new NullPointerException();
- }
- jsPayloadOrCallbackId = js;
- pluginResult = null;
- }
- JsMessage(PluginResult pluginResult, String callbackId) {
- if (callbackId == null || pluginResult == null) {
- throw new NullPointerException();
- }
- jsPayloadOrCallbackId = callbackId;
- this.pluginResult = pluginResult;
- }
-
- static int calculateEncodedLengthHelper(PluginResult pluginResult) {
- switch (pluginResult.getMessageType()) {
- case PluginResult.MESSAGE_TYPE_BOOLEAN: // f or t
- case PluginResult.MESSAGE_TYPE_NULL: // N
- return 1;
- case PluginResult.MESSAGE_TYPE_NUMBER: // n
- return 1 + pluginResult.getMessage().length();
- case PluginResult.MESSAGE_TYPE_STRING: // s
- return 1 + pluginResult.getStrMessage().length();
- case PluginResult.MESSAGE_TYPE_BINARYSTRING:
- return 1 + pluginResult.getMessage().length();
- case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
- return 1 + pluginResult.getMessage().length();
- case PluginResult.MESSAGE_TYPE_MULTIPART:
- int ret = 1;
- for (int i = 0; i < pluginResult.getMultipartMessagesSize(); i++) {
- int length = calculateEncodedLengthHelper(pluginResult.getMultipartMessage(i));
- int argLength = String.valueOf(length).length();
- ret += argLength + 1 + length;
- }
- return ret;
- case PluginResult.MESSAGE_TYPE_JSON:
- default:
- return pluginResult.getMessage().length();
- }
- }
-
- int calculateEncodedLength() {
- if (pluginResult == null) {
- return jsPayloadOrCallbackId.length() + 1;
- }
- int statusLen = String.valueOf(pluginResult.getStatus()).length();
- int ret = 2 + statusLen + 1 + jsPayloadOrCallbackId.length() + 1;
- return ret + calculateEncodedLengthHelper(pluginResult);
- }
-
- static void encodeAsMessageHelper(StringBuilder sb, PluginResult pluginResult) {
- switch (pluginResult.getMessageType()) {
- case PluginResult.MESSAGE_TYPE_BOOLEAN:
- sb.append(pluginResult.getMessage().charAt(0)); // t or f.
- break;
- case PluginResult.MESSAGE_TYPE_NULL: // N
- sb.append('N');
- break;
- case PluginResult.MESSAGE_TYPE_NUMBER: // n
- sb.append('n')
- .append(pluginResult.getMessage());
- break;
- case PluginResult.MESSAGE_TYPE_STRING: // s
- sb.append('s');
- sb.append(pluginResult.getStrMessage());
- break;
- case PluginResult.MESSAGE_TYPE_BINARYSTRING: // S
- sb.append('S');
- sb.append(pluginResult.getMessage());
- break;
- case PluginResult.MESSAGE_TYPE_ARRAYBUFFER: // A
- sb.append('A');
- sb.append(pluginResult.getMessage());
- break;
- case PluginResult.MESSAGE_TYPE_MULTIPART:
- sb.append('M');
- for (int i = 0; i < pluginResult.getMultipartMessagesSize(); i++) {
- PluginResult multipartMessage = pluginResult.getMultipartMessage(i);
- sb.append(String.valueOf(calculateEncodedLengthHelper(multipartMessage)));
- sb.append(' ');
- encodeAsMessageHelper(sb, multipartMessage);
- }
- break;
- case PluginResult.MESSAGE_TYPE_JSON:
- default:
- sb.append(pluginResult.getMessage()); // [ or {
- }
- }
-
- void encodeAsMessage(StringBuilder sb) {
- if (pluginResult == null) {
- sb.append('J')
- .append(jsPayloadOrCallbackId);
- return;
- }
- int status = pluginResult.getStatus();
- boolean noResult = status == PluginResult.Status.NO_RESULT.ordinal();
- boolean resultOk = status == PluginResult.Status.OK.ordinal();
- boolean keepCallback = pluginResult.getKeepCallback();
-
- sb.append((noResult || resultOk) ? 'S' : 'F')
- .append(keepCallback ? '1' : '0')
- .append(status)
- .append(' ')
- .append(jsPayloadOrCallbackId)
- .append(' ');
-
- encodeAsMessageHelper(sb, pluginResult);
- }
-
- void buildJsMessage(StringBuilder sb) {
- switch (pluginResult.getMessageType()) {
- case PluginResult.MESSAGE_TYPE_MULTIPART:
- int size = pluginResult.getMultipartMessagesSize();
- for (int i=0; i<size; i++) {
- PluginResult subresult = pluginResult.getMultipartMessage(i);
- JsMessage submessage = new JsMessage(subresult, jsPayloadOrCallbackId);
- submessage.buildJsMessage(sb);
- if (i < (size-1)) {
- sb.append(",");
- }
- }
- break;
- case PluginResult.MESSAGE_TYPE_BINARYSTRING:
- sb.append("atob('")
- .append(pluginResult.getMessage())
- .append("')");
- break;
- case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
- sb.append("cordova.require('cordova/base64').toArrayBuffer('")
- .append(pluginResult.getMessage())
- .append("')");
- break;
- case PluginResult.MESSAGE_TYPE_NULL:
- sb.append("null");
- break;
- default:
- sb.append(pluginResult.getMessage());
- }
- }
-
- void encodeAsJsMessage(StringBuilder sb) {
- if (pluginResult == null) {
- sb.append(jsPayloadOrCallbackId);
- } else {
- int status = pluginResult.getStatus();
- boolean success = (status == PluginResult.Status.OK.ordinal()) || (status == PluginResult.Status.NO_RESULT.ordinal());
- sb.append("cordova.callbackFromNative('")
- .append(jsPayloadOrCallbackId)
- .append("',")
- .append(success)
- .append(",")
- .append(status)
- .append(",[");
- buildJsMessage(sb);
- sb.append("],")
- .append(pluginResult.getKeepCallback())
- .append(");");
- }
- }
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PermissionHelper.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PermissionHelper.java
deleted file mode 100644
index 52f6e1403..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PermissionHelper.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.util.Arrays;
-
-import org.json.JSONException;
-
-import android.content.pm.PackageManager;
-
-/**
- * This class provides reflective methods for permission requesting and checking so that plugins
- * written for cordova-android 5.0.0+ can still compile with earlier cordova-android versions.
- */
-public class PermissionHelper {
- private static final String LOG_TAG = "CordovaPermissionHelper";
-
- /**
- * Requests a "dangerous" permission for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermission() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permission request
- * @param permission The permission to be requested
- */
- public static void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
- PermissionHelper.requestPermissions(plugin, requestCode, new String[] {permission});
- }
-
- /**
- * Requests "dangerous" permissions for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermissions() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permissions are being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permissions request
- * @param permissions The permissions to be requested
- */
- public static void requestPermissions(CordovaPlugin plugin, int requestCode, String[] permissions) {
- plugin.cordova.requestPermissions(plugin, requestCode, permissions);
- }
-
- /**
- * Checks at runtime to see if the application has been granted a permission. This is a helper
- * method alternative to cordovaInterface.hasPermission() that does not require the project to
- * be built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being checked against
- * @param permission The permission to be checked
- *
- * @return True if the permission has already been granted and false otherwise
- */
- public static boolean hasPermission(CordovaPlugin plugin, String permission) {
- return plugin.cordova.hasPermission(permission);
- }
-
- private static void deliverPermissionResult(CordovaPlugin plugin, int requestCode, String[] permissions) {
- // Generate the request results
- int[] requestResults = new int[permissions.length];
- Arrays.fill(requestResults, PackageManager.PERMISSION_GRANTED);
-
- try {
- plugin.onRequestPermissionResult(requestCode, permissions, requestResults);
- } catch (JSONException e) {
- LOG.e(LOG_TAG, "JSONException when delivering permissions results", e);
- }
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java
deleted file mode 100755
index c56c453c6..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova;
-
-import org.apache.cordova.CordovaPlugin;
-
-/**
- * This class represents a service entry object.
- */
-public final class PluginEntry {
-
- /**
- * The name of the service that this plugin implements
- */
- public final String service;
-
- /**
- * The plugin class name that implements the service.
- */
- public final String pluginClass;
-
- /**
- * The pre-instantiated plugin to use for this entry.
- */
- public final CordovaPlugin plugin;
-
- /**
- * Flag that indicates the plugin object should be created when PluginManager is initialized.
- */
- public final boolean onload;
-
- /**
- * Constructs with a CordovaPlugin already instantiated.
- */
- public PluginEntry(String service, CordovaPlugin plugin) {
- this(service, plugin.getClass().getName(), true, plugin);
- }
-
- /**
- * @param service The name of the service
- * @param pluginClass The plugin class name
- * @param onload Create plugin object when HTML page is loaded
- */
- public PluginEntry(String service, String pluginClass, boolean onload) {
- this(service, pluginClass, onload, null);
- }
-
- private PluginEntry(String service, String pluginClass, boolean onload, CordovaPlugin plugin) {
- this.service = service;
- this.pluginClass = pluginClass;
- this.onload = onload;
- this.plugin = plugin;
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginManager.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginManager.java
deleted file mode 100755
index 21aec73ef..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginManager.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.json.JSONException;
-
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Debug;
-import android.os.Build;
-
-/**
- * PluginManager is exposed to JavaScript in the Cordova WebView.
- *
- * Calling native plugin code can be done by calling PluginManager.exec(...)
- * from JavaScript.
- */
-public class PluginManager {
- private static String TAG = "PluginManager";
- private static final int SLOW_EXEC_WARNING_THRESHOLD = Debug.isDebuggerConnected() ? 60 : 16;
-
- // List of service entries
- private final Map<String, CordovaPlugin> pluginMap = Collections.synchronizedMap(new LinkedHashMap<String, CordovaPlugin>());
- private final Map<String, PluginEntry> entryMap = Collections.synchronizedMap(new LinkedHashMap<String, PluginEntry>());
-
- private final CordovaInterface ctx;
- private final CordovaWebView app;
- private boolean isInitialized;
-
- private CordovaPlugin permissionRequester;
-
- public PluginManager(CordovaWebView cordovaWebView, CordovaInterface cordova, Collection<PluginEntry> pluginEntries) {
- this.ctx = cordova;
- this.app = cordovaWebView;
- setPluginEntries(pluginEntries);
- }
-
- public Collection<PluginEntry> getPluginEntries() {
- return entryMap.values();
- }
-
- public void setPluginEntries(Collection<PluginEntry> pluginEntries) {
- if (isInitialized) {
- this.onPause(false);
- this.onDestroy();
- pluginMap.clear();
- entryMap.clear();
- }
- for (PluginEntry entry : pluginEntries) {
- addService(entry);
- }
- if (isInitialized) {
- startupPlugins();
- }
- }
-
- /**
- * Init when loading a new HTML page into webview.
- */
- public void init() {
- LOG.d(TAG, "init()");
- isInitialized = true;
- this.onPause(false);
- this.onDestroy();
- pluginMap.clear();
- this.startupPlugins();
- }
-
- /**
- * Create plugins objects that have onload set.
- */
- private void startupPlugins() {
- synchronized (entryMap) {
- for (PluginEntry entry : entryMap.values()) {
- // Add a null entry to for each non-startup plugin to avoid ConcurrentModificationException
- // When iterating plugins.
- if (entry.onload) {
- getPlugin(entry.service);
- }
- else {
- LOG.d(TAG, "startupPlugins: put - " + entry.service);
- pluginMap.put(entry.service, null);
- }
- }
- }
- }
-
- /**
- * Receives a request for execution and fulfills it by finding the appropriate
- * Java class and calling it's execute method.
- *
- * PluginManager.exec can be used either synchronously or async. In either case, a JSON encoded
- * string is returned that will indicate if any errors have occurred when trying to find
- * or execute the class denoted by the clazz argument.
- *
- * @param service String containing the service to run
- * @param action String containing the action that the class is supposed to perform. This is
- * passed to the plugin execute method and it is up to the plugin developer
- * how to deal with it.
- * @param callbackId String containing the id of the callback that is execute in JavaScript if
- * this is an async plugin call.
- * @param rawArgs An Array literal string containing any arguments needed in the
- * plugin execute method.
- */
- public void exec(final String service, final String action, final String callbackId, final String rawArgs) {
- CordovaPlugin plugin = getPlugin(service);
- if (plugin == null) {
- LOG.d(TAG, "exec() call to unknown plugin: " + service);
- PluginResult cr = new PluginResult(PluginResult.Status.CLASS_NOT_FOUND_EXCEPTION);
- app.sendPluginResult(cr, callbackId);
- return;
- }
- CallbackContext callbackContext = new CallbackContext(callbackId, app);
- try {
- long pluginStartTime = System.currentTimeMillis();
- boolean wasValidAction = plugin.execute(action, rawArgs, callbackContext);
- long duration = System.currentTimeMillis() - pluginStartTime;
-
- if (duration > SLOW_EXEC_WARNING_THRESHOLD) {
- LOG.w(TAG, "THREAD WARNING: exec() call to " + service + "." + action + " blocked the main thread for " + duration + "ms. Plugin should use CordovaInterface.getThreadPool().");
- }
- if (!wasValidAction) {
- PluginResult cr = new PluginResult(PluginResult.Status.INVALID_ACTION);
- callbackContext.sendPluginResult(cr);
- }
- } catch (JSONException e) {
- PluginResult cr = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
- callbackContext.sendPluginResult(cr);
- } catch (Exception e) {
- LOG.e(TAG, "Uncaught exception from plugin", e);
- callbackContext.error(e.getMessage());
- }
- }
-
- /**
- * Get the plugin object that implements the service.
- * If the plugin object does not already exist, then create it.
- * If the service doesn't exist, then return null.
- *
- * @param service The name of the service.
- * @return CordovaPlugin or null
- */
- public CordovaPlugin getPlugin(String service) {
- CordovaPlugin ret = pluginMap.get(service);
- if (ret == null) {
- PluginEntry pe = entryMap.get(service);
- if (pe == null) {
- return null;
- }
- if (pe.plugin != null) {
- ret = pe.plugin;
- } else {
- ret = instantiatePlugin(pe.pluginClass);
- }
- ret.privateInitialize(service, ctx, app, app.getPreferences());
- LOG.d(TAG, "getPlugin - put: " + service);
- pluginMap.put(service, ret);
- }
- return ret;
- }
-
- /**
- * Add a plugin class that implements a service to the service entry table.
- * This does not create the plugin object instance.
- *
- * @param service The service name
- * @param className The plugin class name
- */
- public void addService(String service, String className) {
- PluginEntry entry = new PluginEntry(service, className, false);
- this.addService(entry);
- }
-
- /**
- * Add a plugin class that implements a service to the service entry table.
- * This does not create the plugin object instance.
- *
- * @param entry The plugin entry
- */
- public void addService(PluginEntry entry) {
- this.entryMap.put(entry.service, entry);
- if (entry.plugin != null) {
- entry.plugin.privateInitialize(entry.service, ctx, app, app.getPreferences());
- LOG.d(TAG, "addService: put - " + entry.service);
- pluginMap.put(entry.service, entry.plugin);
- }
- }
-
- /**
- * Called when the system is about to start resuming a previous activity.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onPause(boolean multitasking) {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onPause(multitasking);
- }
- }
- }
- }
-
- /**
- * Called when the system received an HTTP authentication request. Plugins can use
- * the supplied HttpAuthHandler to process this auth challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param handler The HttpAuthHandler used to set the WebView's response
- * @param host The host requiring authentication
- * @param realm The realm for which authentication is required
- *
- * @return Returns True if there is a plugin which will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, String host, String realm) {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null && plugin.onReceivedHttpAuthRequest(app, handler, host, realm)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Called when he system received an SSL client certificate request. Plugin can use
- * the supplied ClientCertRequest to process this certificate challenge.
- *
- * @param view The WebView that is initiating the callback
- * @param request The client certificate request
- *
- * @return Returns True if plugin will resolve this auth challenge, otherwise False
- *
- */
- public boolean onReceivedClientCertRequest(CordovaWebView view, ICordovaClientCertRequest request) {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null && plugin.onReceivedClientCertRequest(app, request)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Called when the activity will start interacting with the user.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app
- */
- public void onResume(boolean multitasking) {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onResume(multitasking);
- }
- }
- }
- }
-
- /**
- * Called when the activity is becoming visible to the user.
- */
- public void onStart() {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onStart();
- }
- }
- }
- }
-
- /**
- * Called when the activity is no longer visible to the user.
- */
- public void onStop() {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onStop();
- }
- }
- }
- }
-
- /**
- * The final call you receive before your activity is destroyed.
- */
- public void onDestroy() {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onDestroy();
- }
- }
- }
- }
-
- /**
- * Send a message to all plugins.
- *
- * @param id The message id
- * @param data The message data
- * @return Object to stop propagation or null
- */
- public Object postMessage(String id, Object data) {
- LOG.d(TAG, "postMessage: " + id);
- synchronized (this.pluginMap) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- this.pluginMap.forEach((s, plugin) -> {
- if (plugin != null) {
- plugin.onMessage(id, data);
- }
- });
- } else {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- Object obj = plugin.onMessage(id, data);
- if (obj != null) {
- return obj;
- }
- }
- }
- }
- }
- return ctx.onMessage(id, data);
- }
-
- /**
- * Called when the activity receives a new intent.
- */
- public void onNewIntent(Intent intent) {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onNewIntent(intent);
- }
- }
- }
- }
-
- /**
- * Called when the webview is going to request an external resource.
- *
- * This delegates to the installed plugins, and returns true/false for the
- * first plugin to provide a non-null result. If no plugins respond, then
- * the default policy is applied.
- *
- * @param url The URL that is being requested.
- * @return Returns true to allow the resource to load,
- * false to block the resource.
- */
- public boolean shouldAllowRequest(String url) {
- synchronized (this.entryMap) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldAllowRequest(url);
- if (result != null) {
- return result;
- }
- }
- }
- }
-
- // Default policy:
- if (url.startsWith("blob:") || url.startsWith("data:") || url.startsWith("about:blank")) {
- return true;
- }
- // TalkBack requires this, so allow it by default.
- if (url.startsWith("https://ssl.gstatic.com/accessibility/javascript/android/")) {
- return true;
- }
- if (url.startsWith("file://")) {
- //This directory on WebKit/Blink based webviews contains SQLite databases!
- //DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
- return !url.contains("/app_webview/");
- }
- return false;
- }
-
- /**
- * Called when the webview is going to change the URL of the loaded content.
- *
- * This delegates to the installed plugins, and returns true/false for the
- * first plugin to provide a non-null result. If no plugins respond, then
- * the default policy is applied.
- *
- * @param url The URL that is being requested.
- * @return Returns true to allow the navigation,
- * false to block the navigation.
- */
- public boolean shouldAllowNavigation(String url) {
- synchronized (this.entryMap) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldAllowNavigation(url);
- if (result != null) {
- return result;
- }
- }
- }
- }
-
- // Default policy:
- return url.startsWith("file://") || url.startsWith("about:blank");
- }
-
-
- /**
- * Called when the webview is requesting the exec() bridge be enabled.
- */
- public boolean shouldAllowBridgeAccess(String url) {
- synchronized (this.entryMap) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldAllowBridgeAccess(url);
- if (result != null) {
- return result;
- }
- }
- }
- }
-
- // Default policy:
- return url.startsWith("file://");
- }
-
- /**
- * Called when the webview is going not going to navigate, but may launch
- * an Intent for an URL.
- *
- * This delegates to the installed plugins, and returns true/false for the
- * first plugin to provide a non-null result. If no plugins respond, then
- * the default policy is applied.
- *
- * @param url The URL that is being requested.
- * @return Returns true to allow the URL to launch an intent,
- * false to block the intent.
- */
- public Boolean shouldOpenExternalUrl(String url) {
- synchronized (this.entryMap) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null) {
- Boolean result = plugin.shouldOpenExternalUrl(url);
- if (result != null) {
- return result;
- }
- }
- }
- }
- // Default policy:
- // External URLs are not allowed
- return false;
- }
-
- /**
- * Called when the URL of the webview changes.
- *
- * @param url The URL that is being changed to.
- * @return Return false to allow the URL to load, return true to prevent the URL from loading.
- */
- public boolean onOverrideUrlLoading(String url) {
- synchronized (this.entryMap) {
- for (PluginEntry entry : this.entryMap.values()) {
- CordovaPlugin plugin = pluginMap.get(entry.service);
- if (plugin != null && plugin.onOverrideUrlLoading(url)) {
- return true;
- }
- }
- return false;
- }
- }
-
- /**
- * Called when the app navigates or refreshes.
- */
- public void onReset() {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onReset();
- }
- }
- }
- }
-
- Uri remapUri(Uri uri) {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- Uri ret = plugin.remapUri(uri);
- if (ret != null) {
- return ret;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Create a plugin based on class name.
- */
- private CordovaPlugin instantiatePlugin(String className) {
- CordovaPlugin ret = null;
- try {
- Class<?> c = null;
- if ((className != null) && !("".equals(className))) {
- c = Class.forName(className);
- }
- if (c != null & CordovaPlugin.class.isAssignableFrom(c)) {
- ret = (CordovaPlugin) c.newInstance();
- }
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println("Error adding plugin " + className + ".");
- }
- return ret;
- }
-
- /**
- * Called by the system when the device configuration changes while your activity is running.
- *
- * @param newConfig The new device configuration
- */
- public void onConfigurationChanged(Configuration newConfig) {
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- plugin.onConfigurationChanged(newConfig);
- }
- }
- }
- }
-
- public Bundle onSaveInstanceState() {
- Bundle state = new Bundle();
- synchronized (this.pluginMap) {
- for (CordovaPlugin plugin : this.pluginMap.values()) {
- if (plugin != null) {
- Bundle pluginState = plugin.onSaveInstanceState();
- if (pluginState != null) {
- state.putBundle(plugin.getServiceName(), pluginState);
- }
- }
- }
- }
- return state;
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginResult.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginResult.java
deleted file mode 100644
index 5db60b3b7..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/PluginResult.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-import android.util.Base64;
-
-public class PluginResult {
- private final int status;
- private final int messageType;
- private boolean keepCallback = false;
- private String strMessage;
- private String encodedMessage;
- private List<PluginResult> multipartMessages;
-
- public PluginResult(Status status) {
- this(status, PluginResult.StatusMessages[status.ordinal()]);
- }
-
- public PluginResult(Status status, String message) {
- this.status = status.ordinal();
- this.messageType = message == null ? MESSAGE_TYPE_NULL : MESSAGE_TYPE_STRING;
- this.strMessage = message;
- }
-
- public PluginResult(Status status, JSONArray message) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_JSON;
- encodedMessage = message.toString();
- }
-
- public PluginResult(Status status, JSONObject message) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_JSON;
- encodedMessage = message.toString();
- }
-
- public PluginResult(Status status, int i) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_NUMBER;
- this.encodedMessage = ""+i;
- }
-
- public PluginResult(Status status, float f) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_NUMBER;
- this.encodedMessage = ""+f;
- }
-
- public PluginResult(Status status, boolean b) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_BOOLEAN;
- this.encodedMessage = Boolean.toString(b);
- }
-
- public PluginResult(Status status, byte[] data) {
- this(status, data, false);
- }
-
- public PluginResult(Status status, byte[] data, boolean binaryString) {
- this.status = status.ordinal();
- this.messageType = binaryString ? MESSAGE_TYPE_BINARYSTRING : MESSAGE_TYPE_ARRAYBUFFER;
- this.encodedMessage = Base64.encodeToString(data, Base64.NO_WRAP);
- }
-
- // The keepCallback and status of multipartMessages are ignored.
- public PluginResult(Status status, List<PluginResult> multipartMessages) {
- this.status = status.ordinal();
- this.messageType = MESSAGE_TYPE_MULTIPART;
- this.multipartMessages = multipartMessages;
- }
-
- public void setKeepCallback(boolean b) {
- this.keepCallback = b;
- }
-
- public int getStatus() {
- return status;
- }
-
- public int getMessageType() {
- return messageType;
- }
-
- public String getMessage() {
- if (encodedMessage == null) {
- encodedMessage = JSONObject.quote(strMessage);
- }
- return encodedMessage;
- }
-
- public int getMultipartMessagesSize() {
- return multipartMessages.size();
- }
-
- public PluginResult getMultipartMessage(int index) {
- return multipartMessages.get(index);
- }
-
- /**
- * If messageType == MESSAGE_TYPE_STRING, then returns the message string.
- * Otherwise, returns null.
- */
- public String getStrMessage() {
- return strMessage;
- }
-
- public boolean getKeepCallback() {
- return this.keepCallback;
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String getJSONString() {
- return "{\"status\":" + this.status + ",\"message\":" + this.getMessage() + ",\"keepCallback\":" + this.keepCallback + "}";
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String toCallbackString(String callbackId) {
- // If no result to be sent and keeping callback, then no need to sent back to JavaScript
- if ((status == PluginResult.Status.NO_RESULT.ordinal()) && keepCallback) {
- return null;
- }
-
- // Check the success (OK, NO_RESULT & !KEEP_CALLBACK)
- if ((status == PluginResult.Status.OK.ordinal()) || (status == PluginResult.Status.NO_RESULT.ordinal())) {
- return toSuccessCallbackString(callbackId);
- }
-
- return toErrorCallbackString(callbackId);
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String toSuccessCallbackString(String callbackId) {
- return "cordova.callbackSuccess('"+callbackId+"',"+this.getJSONString()+");";
- }
-
- @Deprecated // Use sendPluginResult instead of sendJavascript.
- public String toErrorCallbackString(String callbackId) {
- return "cordova.callbackError('"+callbackId+"', " + this.getJSONString()+ ");";
- }
-
- public static final int MESSAGE_TYPE_STRING = 1;
- public static final int MESSAGE_TYPE_JSON = 2;
- public static final int MESSAGE_TYPE_NUMBER = 3;
- public static final int MESSAGE_TYPE_BOOLEAN = 4;
- public static final int MESSAGE_TYPE_NULL = 5;
- public static final int MESSAGE_TYPE_ARRAYBUFFER = 6;
- // Use BINARYSTRING when your string may contain null characters.
- // This is required to work around a bug in the platform :(.
- public static final int MESSAGE_TYPE_BINARYSTRING = 7;
- public static final int MESSAGE_TYPE_MULTIPART = 8;
-
- public static String[] StatusMessages = new String[] {
- "No result",
- "OK",
- "Class not found",
- "Illegal access",
- "Instantiation error",
- "Malformed url",
- "IO error",
- "Invalid action",
- "JSON error",
- "Error"
- };
-
- public enum Status {
- NO_RESULT,
- OK,
- CLASS_NOT_FOUND_EXCEPTION,
- ILLEGAL_ACCESS_EXCEPTION,
- INSTANTIATION_EXCEPTION,
- MALFORMED_URL_EXCEPTION,
- IO_EXCEPTION,
- INVALID_ACTION,
- JSON_EXCEPTION,
- ERROR
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java
deleted file mode 100644
index 49a43b5d4..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ResumeCallback extends CallbackContext {
- private final String TAG = "CordovaResumeCallback";
- private String serviceName;
- private PluginManager pluginManager;
-
- public ResumeCallback(String serviceName, PluginManager pluginManager) {
- super("resumecallback", null);
- this.serviceName = serviceName;
- this.pluginManager = pluginManager;
- }
-
- @Override
- public void sendPluginResult(PluginResult pluginResult) {
- synchronized (this) {
- if (finished) {
- LOG.w(TAG, serviceName + " attempted to send a second callback to ResumeCallback\nResult was: " + pluginResult.getMessage());
- return;
- } else {
- finished = true;
- }
- }
-
- JSONObject event = new JSONObject();
- JSONObject pluginResultObject = new JSONObject();
-
- try {
- pluginResultObject.put("pluginServiceName", this.serviceName);
- pluginResultObject.put("pluginStatus", PluginResult.StatusMessages[pluginResult.getStatus()]);
-
- event.put("action", "resume");
- event.put("pendingResult", pluginResultObject);
- } catch (JSONException e) {
- LOG.e(TAG, "Unable to create resume object for Activity Result");
- }
-
- PluginResult eventResult = new PluginResult(PluginResult.Status.OK, event);
-
- // We send a list of results to the js so that we don't have to decode
- // the PluginResult passed to this CallbackContext into JSON twice.
- // The results are combined into an event payload before the event is
- // fired on the js side of things (see platform.js)
- List<PluginResult> result = new ArrayList<PluginResult>();
- result.add(eventResult);
- result.add(pluginResult);
-
- CoreAndroid appPlugin = (CoreAndroid) pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
- appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK, result));
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/Whitelist.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/Whitelist.java
deleted file mode 100644
index d0f823c3c..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/Whitelist.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.cordova.LOG;
-
-import android.net.Uri;
-
-public class Whitelist {
- private static class URLPattern {
- public Pattern scheme;
- public Pattern host;
- public Integer port;
- public Pattern path;
-
- private String regexFromPattern(String pattern, boolean allowWildcards) {
- final String toReplace = "\\.[]{}()^$?+|";
- StringBuilder regex = new StringBuilder();
- for (int i=0; i < pattern.length(); i++) {
- char c = pattern.charAt(i);
- if (c == '*' && allowWildcards) {
- regex.append(".");
- } else if (toReplace.indexOf(c) > -1) {
- regex.append('\\');
- }
- regex.append(c);
- }
- return regex.toString();
- }
-
- public URLPattern(String scheme, String host, String port, String path) throws MalformedURLException {
- try {
- if (scheme == null || "*".equals(scheme)) {
- this.scheme = null;
- } else {
- this.scheme = Pattern.compile(regexFromPattern(scheme, false), Pattern.CASE_INSENSITIVE);
- }
- if ("*".equals(host)) {
- this.host = null;
- } else if (host.startsWith("*.")) {
- this.host = Pattern.compile("([a-z0-9.-]*\\.)?" + regexFromPattern(host.substring(2), false), Pattern.CASE_INSENSITIVE);
- } else {
- this.host = Pattern.compile(regexFromPattern(host, false), Pattern.CASE_INSENSITIVE);
- }
- if (port == null || "*".equals(port)) {
- this.port = null;
- } else {
- this.port = Integer.parseInt(port,10);
- }
- if (path == null || "/*".equals(path)) {
- this.path = null;
- } else {
- this.path = Pattern.compile(regexFromPattern(path, true));
- }
- } catch (NumberFormatException e) {
- throw new MalformedURLException("Port must be a number");
- }
- }
-
- public boolean matches(Uri uri) {
- try {
- return ((scheme == null || scheme.matcher(uri.getScheme()).matches()) &&
- (host == null || host.matcher(uri.getHost()).matches()) &&
- (port == null || port.equals(uri.getPort())) &&
- (path == null || path.matcher(uri.getPath()).matches()));
- } catch (Exception e) {
- LOG.d(TAG, e.toString());
- return false;
- }
- }
- }
-
- private ArrayList<URLPattern> whiteList;
-
- public static final String TAG = "Whitelist";
-
- public Whitelist() {
- this.whiteList = new ArrayList<URLPattern>();
- }
-
- /* Match patterns (from http://developer.chrome.com/extensions/match_patterns.html)
- *
- * <url-pattern> := <scheme>://<host><path>
- * <scheme> := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome-extension'
- * <host> := '*' | '*.' <any char except '/' and '*'>+
- * <path> := '/' <any chars>
- *
- * We extend this to explicitly allow a port attached to the host, and we allow
- * the scheme to be omitted for backwards compatibility. (Also host is not required
- * to begin with a "*" or "*.".)
- */
- public void addWhiteListEntry(String origin, boolean subdomains) {
- if (whiteList != null) {
- try {
- // Unlimited access to network resources
- if (origin.compareTo("*") == 0) {
- LOG.d(TAG, "Unlimited access to network resources");
- whiteList = null;
- }
- else { // specific access
- Pattern parts = Pattern.compile("^((\\*|[A-Za-z-]+):(//)?)?(\\*|((\\*\\.)?[^*/:]+))?(:(\\d+))?(/.*)?");
- Matcher m = parts.matcher(origin);
- if (m.matches()) {
- String scheme = m.group(2);
- String host = m.group(4);
- // Special case for two urls which are allowed to have empty hosts
- if (("file".equals(scheme) || "content".equals(scheme)) && host == null) host = "*";
- String port = m.group(8);
- String path = m.group(9);
- if (scheme == null) {
- // XXX making it stupid friendly for people who forget to include protocol/SSL
- whiteList.add(new URLPattern("http", host, port, path));
- whiteList.add(new URLPattern("https", host, port, path));
- } else {
- whiteList.add(new URLPattern(scheme, host, port, path));
- }
- }
- }
- } catch (Exception e) {
- LOG.d(TAG, "Failed to add origin %s", origin);
- }
- }
- }
-
-
- /**
- * Determine if URL is in approved list of URLs to load.
- *
- * @param uri
- * @return true if wide open or whitelisted
- */
- public boolean isUrlWhiteListed(String uri) {
- // If there is no whitelist, then it's wide open
- if (whiteList == null) return true;
-
- Uri parsedUri = Uri.parse(uri);
- // Look for match in white list
- Iterator<URLPattern> pit = whiteList.iterator();
- while (pit.hasNext()) {
- URLPattern p = pit.next();
- if (p.matches(parsedUri)) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
deleted file mode 100644
index f8128bc20..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.engine;
-
-import android.annotation.TargetApi;
-import android.os.Build;
-import android.webkit.CookieManager;
-import android.webkit.WebView;
-
-import org.apache.cordova.ICordovaCookieManager;
-
-class SystemCookieManager implements ICordovaCookieManager {
-
- protected final WebView webView;
- private final CookieManager cookieManager;
-
- public SystemCookieManager(WebView webview) {
- webView = webview;
- cookieManager = CookieManager.getInstance();
-
- cookieManager.setAcceptFileSchemeCookies(true);
- cookieManager.setAcceptThirdPartyCookies(webView, true);
- }
-
- public void setCookiesEnabled(boolean accept) {
- cookieManager.setAcceptCookie(accept);
- }
-
- public void setCookie(final String url, final String value) {
- cookieManager.setCookie(url, value);
- }
-
- public String getCookie(final String url) {
- return cookieManager.getCookie(url);
- }
-
- @SuppressWarnings("deprecation")
- public void clearCookies() {
- cookieManager.removeAllCookies(null);
- }
-
- public void flush() {
- cookieManager.flush();
- }
-};
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java
deleted file mode 100755
index 94c3d9340..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.engine;
-
-import android.webkit.JavascriptInterface;
-
-import org.apache.cordova.CordovaBridge;
-import org.apache.cordova.ExposedJsApi;
-import org.json.JSONException;
-
-/**
- * Contains APIs that the JS can call. All functions in here should also have
- * an equivalent entry in CordovaChromeClient.java, and be added to
- * cordova-js/lib/android/plugin/android/promptbasednativeapi.js
- */
-class SystemExposedJsApi implements ExposedJsApi {
- private final CordovaBridge bridge;
-
- SystemExposedJsApi(CordovaBridge bridge) {
- this.bridge = bridge;
- }
-
- @JavascriptInterface
- public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException {
- return bridge.jsExec(bridgeSecret, service, action, callbackId, arguments);
- }
-
- @JavascriptInterface
- public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException {
- bridge.jsSetNativeToJsBridgeMode(bridgeSecret, value);
- }
-
- @JavascriptInterface
- public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException {
- return bridge.jsRetrieveJsMessages(bridgeSecret, fromOnlineEvent);
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java
deleted file mode 100755
index cad098e45..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.engine;
-
-import java.util.Arrays;
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.content.Context;
-import android.content.ActivityNotFoundException;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Build;
-import android.view.Gravity;
-import android.view.View;
-import android.view.ViewGroup.LayoutParams;
-import android.webkit.ConsoleMessage;
-import android.webkit.GeolocationPermissions.Callback;
-import android.webkit.JsPromptResult;
-import android.webkit.JsResult;
-import android.webkit.ValueCallback;
-import android.webkit.WebChromeClient;
-import android.webkit.WebStorage;
-import android.webkit.WebView;
-import android.webkit.PermissionRequest;
-import android.widget.LinearLayout;
-import android.widget.ProgressBar;
-import android.widget.RelativeLayout;
-
-import org.apache.cordova.CordovaDialogsHelper;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-
-/**
- * This class is the WebChromeClient that implements callbacks for our web view.
- * The kind of callbacks that happen here are on the chrome outside the document,
- * such as onCreateWindow(), onConsoleMessage(), onProgressChanged(), etc. Related
- * to but different than CordovaWebViewClient.
- */
-public class SystemWebChromeClient extends WebChromeClient {
-
- private static final int FILECHOOSER_RESULTCODE = 5173;
- private static final String LOG_TAG = "SystemWebChromeClient";
- private long MAX_QUOTA = 100 * 1024 * 1024;
- protected final SystemWebViewEngine parentEngine;
-
- // the video progress view
- private View mVideoProgressView;
-
- private CordovaDialogsHelper dialogsHelper;
- private Context appContext;
-
- private WebChromeClient.CustomViewCallback mCustomViewCallback;
- private View mCustomView;
-
- public SystemWebChromeClient(SystemWebViewEngine parentEngine) {
- this.parentEngine = parentEngine;
- appContext = parentEngine.webView.getContext();
- dialogsHelper = new CordovaDialogsHelper(appContext);
- }
-
- /**
- * Tell the client to display a javascript alert dialog.
- */
- @Override
- public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
- dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
- @Override public void gotResult(boolean success, String value) {
- if (success) {
- result.confirm();
- } else {
- result.cancel();
- }
- }
- });
- return true;
- }
-
- /**
- * Tell the client to display a confirm dialog to the user.
- */
- @Override
- public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
- dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
- @Override
- public void gotResult(boolean success, String value) {
- if (success) {
- result.confirm();
- } else {
- result.cancel();
- }
- }
- });
- return true;
- }
-
- /**
- * Tell the client to display a prompt dialog to the user.
- * If the client returns true, WebView will assume that the client will
- * handle the prompt dialog and call the appropriate JsPromptResult method.
- *
- * Since we are hacking prompts for our own purposes, we should not be using them for
- * this purpose, perhaps we should hack console.log to do this instead!
- */
- @Override
- public boolean onJsPrompt(WebView view, String origin, String message, String defaultValue, final JsPromptResult result) {
- // Unlike the @JavascriptInterface bridge, this method is always called on the UI thread.
- String handledRet = parentEngine.bridge.promptOnJsPrompt(origin, message, defaultValue);
- if (handledRet != null) {
- result.confirm(handledRet);
- } else {
- dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
- @Override
- public void gotResult(boolean success, String value) {
- if (success) {
- result.confirm(value);
- } else {
- result.cancel();
- }
- }
- });
- }
- return true;
- }
-
- /**
- * Handle database quota exceeded notification.
- */
- @Override
- @SuppressWarnings("deprecation")
- public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
- long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
- {
- LOG.d(LOG_TAG, "onExceededDatabaseQuota estimatedSize: %d currentQuota: %d totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
- quotaUpdater.updateQuota(MAX_QUOTA);
- }
-
- @Override
- /**
- * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
- *
- * This also checks for the Geolocation Plugin and requests permission from the application to use Geolocation.
- *
- * @param origin
- * @param callback
- */
- public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
- super.onGeolocationPermissionsShowPrompt(origin, callback);
- callback.invoke(origin, true, false);
- //Get the plugin, it should be loaded
- CordovaPlugin geolocation = parentEngine.pluginManager.getPlugin("Geolocation");
- if(geolocation != null && !geolocation.hasPermisssion())
- {
- geolocation.requestPermissions(0);
- }
- }
-
- // API level 7 is required for this, see if we could lower this using something else
- @Override
- @SuppressWarnings("deprecation")
- public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
- parentEngine.getCordovaWebView().showCustomView(view, callback);
- }
-
- @Override
- @SuppressWarnings("deprecation")
- public void onHideCustomView() {
- parentEngine.getCordovaWebView().hideCustomView();
- }
-
- @Override
- /**
- * Ask the host application for a custom progress view to show while
- * a <video> is loading.
- * @return View The progress view.
- */
- public View getVideoLoadingProgressView() {
- if (mVideoProgressView == null) {
- // Create a new Loading view programmatically.
-
- // create the linear layout
- LinearLayout layout = new LinearLayout(parentEngine.getView().getContext());
- layout.setOrientation(LinearLayout.VERTICAL);
- RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
- layout.setLayoutParams(layoutParams);
- // the proress bar
- ProgressBar bar = new ProgressBar(parentEngine.getView().getContext());
- LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- barLayoutParams.gravity = Gravity.CENTER;
- bar.setLayoutParams(barLayoutParams);
- layout.addView(bar);
-
- mVideoProgressView = layout;
- }
- return mVideoProgressView;
- }
-
- @Override
- public boolean onShowFileChooser(WebView webView, final ValueCallback<Uri[]> filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams) {
- // Check if multiple-select is specified
- Boolean selectMultiple = false;
- if (fileChooserParams.getMode() == WebChromeClient.FileChooserParams.MODE_OPEN_MULTIPLE) {
- selectMultiple = true;
- }
- Intent intent = fileChooserParams.createIntent();
- intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, selectMultiple);
-
- // Uses Intent.EXTRA_MIME_TYPES to pass multiple mime types.
- String[] acceptTypes = fileChooserParams.getAcceptTypes();
- if (acceptTypes.length > 1) {
- intent.setType("*/*"); // Accept all, filter mime types by Intent.EXTRA_MIME_TYPES.
- intent.putExtra(Intent.EXTRA_MIME_TYPES, acceptTypes);
- }
- try {
- parentEngine.cordova.startActivityForResult(new CordovaPlugin() {
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
- Uri[] result = null;
- if (resultCode == Activity.RESULT_OK && intent != null) {
- if (intent.getClipData() != null) {
- // handle multiple-selected files
- final int numSelectedFiles = intent.getClipData().getItemCount();
- result = new Uri[numSelectedFiles];
- for (int i = 0; i < numSelectedFiles; i++) {
- result[i] = intent.getClipData().getItemAt(i).getUri();
- LOG.d(LOG_TAG, "Receive file chooser URL: " + result[i]);
- }
- }
- else if (intent.getData() != null) {
- // handle single-selected file
- result = WebChromeClient.FileChooserParams.parseResult(resultCode, intent);
- LOG.d(LOG_TAG, "Receive file chooser URL: " + result);
- }
- }
- filePathsCallback.onReceiveValue(result);
- }
- }, intent, FILECHOOSER_RESULTCODE);
- } catch (ActivityNotFoundException e) {
- LOG.w("No activity found to handle file chooser intent.", e);
- filePathsCallback.onReceiveValue(null);
- }
- return true;
- }
-
- @Override
- public void onPermissionRequest(final PermissionRequest request) {
- LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
- request.grant(request.getResources());
- }
-
- public void destroyLastDialog(){
- dialogsHelper.destroyLastDialog();
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebView.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebView.java
deleted file mode 100644
index 01c2f0005..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebView.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.engine;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.webkit.WebChromeClient;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CordovaWebViewEngine;
-
-/**
- * Custom WebView subclass that enables us to capture events needed for Cordova.
- */
-public class SystemWebView extends WebView implements CordovaWebViewEngine.EngineView {
- private SystemWebViewClient viewClient;
- SystemWebChromeClient chromeClient;
- private SystemWebViewEngine parentEngine;
- private CordovaInterface cordova;
-
- public SystemWebView(Context context) {
- this(context, null);
- }
-
- public SystemWebView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- // Package visibility to enforce that only SystemWebViewEngine should call this method.
- void init(SystemWebViewEngine parentEngine, CordovaInterface cordova) {
- this.cordova = cordova;
- this.parentEngine = parentEngine;
- if (this.viewClient == null) {
- setWebViewClient(new SystemWebViewClient(parentEngine));
- }
-
- if (this.chromeClient == null) {
- setWebChromeClient(new SystemWebChromeClient(parentEngine));
- }
- }
-
- @Override
- public CordovaWebView getCordovaWebView() {
- return parentEngine != null ? parentEngine.getCordovaWebView() : null;
- }
-
- @Override
- public void setWebViewClient(WebViewClient client) {
- viewClient = (SystemWebViewClient)client;
- super.setWebViewClient(client);
- }
-
- @Override
- public void setWebChromeClient(WebChromeClient client) {
- chromeClient = (SystemWebChromeClient)client;
- super.setWebChromeClient(client);
- }
-
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- Boolean ret = parentEngine.client.onDispatchKeyEvent(event);
- if (ret != null) {
- return ret.booleanValue();
- }
- return super.dispatchKeyEvent(event);
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java
deleted file mode 100755
index af9e51f11..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.engine;
-
-import android.annotation.TargetApi;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.net.http.SslError;
-import android.os.Build;
-import android.webkit.ClientCertRequest;
-import android.webkit.HttpAuthHandler;
-import android.webkit.SslErrorHandler;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import org.apache.cordova.AuthenticationToken;
-import org.apache.cordova.CordovaClientCertRequest;
-import org.apache.cordova.CordovaHttpAuthHandler;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.LOG;
-import org.apache.cordova.PluginManager;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Hashtable;
-
-
-/**
- * This class is the WebViewClient that implements callbacks for our web view.
- * The kind of callbacks that happen here are regarding the rendering of the
- * document instead of the chrome surrounding it, such as onPageStarted(),
- * shouldOverrideUrlLoading(), etc. Related to but different than
- * CordovaChromeClient.
- */
-public class SystemWebViewClient extends WebViewClient {
-
- private static final String TAG = "SystemWebViewClient";
- protected final SystemWebViewEngine parentEngine;
- private boolean doClearHistory = false;
- boolean isCurrentlyLoading;
-
- /** The authorization tokens. */
- private Hashtable<String, AuthenticationToken> authenticationTokens = new Hashtable<String, AuthenticationToken>();
-
- public SystemWebViewClient(SystemWebViewEngine parentEngine) {
- this.parentEngine = parentEngine;
- }
-
- /**
- * Give the host application a chance to take over the control when a new url
- * is about to be loaded in the current WebView.
- *
- * @param view The WebView that is initiating the callback.
- * @param url The url to be loaded.
- * @return true to override, false for default behavior
- */
- @Override
- @SuppressWarnings("deprecation")
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- return parentEngine.client.onNavigationAttempt(url);
- }
-
- /**
- * On received http auth request.
- * The method reacts on all registered authentication tokens. There is one and only one authentication token for any host + realm combination
- */
- @Override
- public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
-
- // Get the authentication token (if specified)
- AuthenticationToken token = this.getAuthenticationToken(host, realm);
- if (token != null) {
- handler.proceed(token.getUserName(), token.getPassword());
- return;
- }
-
- // Check if there is some plugin which can resolve this auth challenge
- PluginManager pluginManager = this.parentEngine.pluginManager;
- if (pluginManager != null && pluginManager.onReceivedHttpAuthRequest(null, new CordovaHttpAuthHandler(handler), host, realm)) {
- parentEngine.client.clearLoadTimeoutTimer();
- return;
- }
-
- // By default handle 401 like we'd normally do!
- super.onReceivedHttpAuthRequest(view, handler, host, realm);
- }
-
- /**
- * On received client cert request.
- * The method forwards the request to any running plugins before using the default implementation.
- *
- * @param view
- * @param request
- */
- @Override
- public void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
- {
-
- // Check if there is some plugin which can resolve this certificate request
- PluginManager pluginManager = this.parentEngine.pluginManager;
- if (pluginManager != null && pluginManager.onReceivedClientCertRequest(null, new CordovaClientCertRequest(request))) {
- parentEngine.client.clearLoadTimeoutTimer();
- return;
- }
-
- // By default pass to WebViewClient
- super.onReceivedClientCertRequest(view, request);
- }
-
- /**
- * Notify the host application that a page has started loading.
- * This method is called once for each main frame load so a page with iframes or framesets will call onPageStarted
- * one time for the main frame. This also means that onPageStarted will not be called when the contents of an
- * embedded frame changes, i.e. clicking a link whose target is an iframe.
- *
- * @param view The webview initiating the callback.
- * @param url The url of the page.
- */
- @Override
- public void onPageStarted(WebView view, String url, Bitmap favicon) {
- super.onPageStarted(view, url, favicon);
- isCurrentlyLoading = true;
- // Flush stale messages & reset plugins.
- parentEngine.bridge.reset();
- parentEngine.client.onPageStarted(url);
- }
-
- /**
- * Notify the host application that a page has finished loading.
- * This method is called only for main frame. When onPageFinished() is called, the rendering picture may not be updated yet.
- *
- *
- * @param view The webview initiating the callback.
- * @param url The url of the page.
- */
- @Override
- public void onPageFinished(WebView view, String url) {
- super.onPageFinished(view, url);
- // Ignore excessive calls, if url is not about:blank (CB-8317).
- if (!isCurrentlyLoading && !url.startsWith("about:")) {
- return;
- }
- isCurrentlyLoading = false;
-
- /**
- * Because of a timing issue we need to clear this history in onPageFinished as well as
- * onPageStarted. However we only want to do this if the doClearHistory boolean is set to
- * true. You see when you load a url with a # in it which is common in jQuery applications
- * onPageStared is not called. Clearing the history at that point would break jQuery apps.
- */
- if (this.doClearHistory) {
- view.clearHistory();
- this.doClearHistory = false;
- }
- parentEngine.client.onPageFinishedLoading(url);
-
- }
-
- /**
- * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
- * The errorCode parameter corresponds to one of the ERROR_* constants.
- *
- * @param view The WebView that is initiating the callback.
- * @param errorCode The error code corresponding to an ERROR_* value.
- * @param description A String describing the error.
- * @param failingUrl The url that failed to load.
- */
- @Override
- @SuppressWarnings("deprecation")
- public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
- // Ignore error due to stopLoading().
- if (!isCurrentlyLoading) {
- return;
- }
- LOG.d(TAG, "CordovaWebViewClient.onReceivedError: Error code=%s Description=%s URL=%s", errorCode, description, failingUrl);
-
- // If this is a "Protocol Not Supported" error, then revert to the previous
- // page. If there was no previous page, then punt. The application's config
- // is likely incorrect (start page set to sms: or something like that)
- if (errorCode == WebViewClient.ERROR_UNSUPPORTED_SCHEME) {
- parentEngine.client.clearLoadTimeoutTimer();
-
- if (view.canGoBack()) {
- view.goBack();
- return;
- } else {
- super.onReceivedError(view, errorCode, description, failingUrl);
- }
- }
- parentEngine.client.onReceivedError(errorCode, description, failingUrl);
- }
-
- /**
- * Notify the host application that an SSL error occurred while loading a resource.
- * The host application must call either handler.cancel() or handler.proceed().
- * Note that the decision may be retained for use in response to future SSL errors.
- * The default behavior is to cancel the load.
- *
- * @param view The WebView that is initiating the callback.
- * @param handler An SslErrorHandler object that will handle the user's response.
- * @param error The SSL error object.
- */
- @Override
- public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
-
- final String packageName = parentEngine.cordova.getActivity().getPackageName();
- final PackageManager pm = parentEngine.cordova.getActivity().getPackageManager();
-
- ApplicationInfo appInfo;
- try {
- appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
- if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
- // debug = true
- handler.proceed();
- return;
- } else {
- // debug = false
- super.onReceivedSslError(view, handler, error);
- }
- } catch (NameNotFoundException e) {
- // When it doubt, lock it out!
- super.onReceivedSslError(view, handler, error);
- }
- }
-
-
- /**
- * Sets the authentication token.
- *
- * @param authenticationToken
- * @param host
- * @param realm
- */
- public void setAuthenticationToken(AuthenticationToken authenticationToken, String host, String realm) {
- if (host == null) {
- host = "";
- }
- if (realm == null) {
- realm = "";
- }
- this.authenticationTokens.put(host.concat(realm), authenticationToken);
- }
-
- /**
- * Removes the authentication token.
- *
- * @param host
- * @param realm
- *
- * @return the authentication token or null if did not exist
- */
- public AuthenticationToken removeAuthenticationToken(String host, String realm) {
- return this.authenticationTokens.remove(host.concat(realm));
- }
-
- /**
- * Gets the authentication token.
- *
- * In order it tries:
- * 1- host + realm
- * 2- host
- * 3- realm
- * 4- no host, no realm
- *
- * @param host
- * @param realm
- *
- * @return the authentication token
- */
- public AuthenticationToken getAuthenticationToken(String host, String realm) {
- AuthenticationToken token = null;
- token = this.authenticationTokens.get(host.concat(realm));
-
- if (token == null) {
- // try with just the host
- token = this.authenticationTokens.get(host);
-
- // Try the realm
- if (token == null) {
- token = this.authenticationTokens.get(realm);
- }
-
- // if no host found, just query for default
- if (token == null) {
- token = this.authenticationTokens.get("");
- }
- }
-
- return token;
- }
-
- /**
- * Clear all authentication tokens.
- */
- public void clearAuthenticationTokens() {
- this.authenticationTokens.clear();
- }
-
- @Override
- @SuppressWarnings("deprecation")
- public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
- try {
- // Check the against the whitelist and lock out access to the WebView directory
- // Changing this will cause problems for your application
- if (!parentEngine.pluginManager.shouldAllowRequest(url)) {
- LOG.w(TAG, "URL blocked by whitelist: " + url);
- // Results in a 404.
- return new WebResourceResponse("text/plain", "UTF-8", null);
- }
-
- CordovaResourceApi resourceApi = parentEngine.resourceApi;
- Uri origUri = Uri.parse(url);
- // Allow plugins to intercept WebView requests.
- Uri remappedUri = resourceApi.remapUri(origUri);
-
- if (!origUri.equals(remappedUri) || needsSpecialsInAssetUrlFix(origUri) || needsContentUrlFix(origUri)) {
- CordovaResourceApi.OpenForReadResult result = resourceApi.openForRead(remappedUri, true);
- return new WebResourceResponse(result.mimeType, "UTF-8", result.inputStream);
- }
- // If we don't need to special-case the request, let the browser load it.
- return null;
- } catch (IOException e) {
- if (!(e instanceof FileNotFoundException)) {
- LOG.e(TAG, "Error occurred while loading a file (returning a 404).", e);
- }
- // Results in a 404.
- return new WebResourceResponse("text/plain", "UTF-8", null);
- }
- }
-
- private static boolean needsContentUrlFix(Uri uri) {
- return "content".equals(uri.getScheme());
- }
-
- private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
- if (CordovaResourceApi.getUriType(uri) != CordovaResourceApi.URI_TYPE_ASSET) {
- return false;
- }
- if (uri.getQuery() != null || uri.getFragment() != null) {
- return true;
- }
-
- if (!uri.toString().contains("%")) {
- return false;
- }
-
- return false;
- }
-}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java
deleted file mode 100755
index e703f09d4..000000000
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.engine;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ApplicationInfo;
-import android.os.Build;
-import android.view.View;
-import android.webkit.ValueCallback;
-import android.webkit.WebSettings;
-import android.webkit.WebSettings.LayoutAlgorithm;
-import android.webkit.WebView;
-
-import org.apache.cordova.CordovaBridge;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPreferences;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CordovaWebViewEngine;
-import org.apache.cordova.ICordovaCookieManager;
-import org.apache.cordova.LOG;
-import org.apache.cordova.NativeToJsMessageQueue;
-import org.apache.cordova.PluginManager;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-
-/**
- * Glue class between CordovaWebView (main Cordova logic) and SystemWebView (the actual View).
- * We make the Engine separate from the actual View so that:
- * A) We don't need to worry about WebView methods clashing with CordovaWebViewEngine methods
- * (e.g.: goBack() is void for WebView, and boolean for CordovaWebViewEngine)
- * B) Separating the actual View from the Engine makes API surfaces smaller.
- * Class uses two-phase initialization. However, CordovaWebView is responsible for calling .init().
- */
-public class SystemWebViewEngine implements CordovaWebViewEngine {
- public static final String TAG = "SystemWebViewEngine";
-
- protected final SystemWebView webView;
- protected final SystemCookieManager cookieManager;
- protected CordovaPreferences preferences;
- protected CordovaBridge bridge;
- protected CordovaWebViewEngine.Client client;
- protected CordovaWebView parentWebView;
- protected CordovaInterface cordova;
- protected PluginManager pluginManager;
- protected CordovaResourceApi resourceApi;
- protected NativeToJsMessageQueue nativeToJsMessageQueue;
- private BroadcastReceiver receiver;
-
- /** Used when created via reflection. */
- public SystemWebViewEngine(Context context, CordovaPreferences preferences) {
- this(new SystemWebView(context), preferences);
- }
-
- public SystemWebViewEngine(SystemWebView webView) {
- this(webView, null);
- }
-
- public SystemWebViewEngine(SystemWebView webView, CordovaPreferences preferences) {
- this.preferences = preferences;
- this.webView = webView;
- cookieManager = new SystemCookieManager(webView);
- }
-
- @Override
- public void init(CordovaWebView parentWebView, CordovaInterface cordova, CordovaWebViewEngine.Client client,
- CordovaResourceApi resourceApi, PluginManager pluginManager,
- NativeToJsMessageQueue nativeToJsMessageQueue) {
- if (this.cordova != null) {
- throw new IllegalStateException();
- }
- // Needed when prefs are not passed by the constructor
- if (preferences == null) {
- preferences = parentWebView.getPreferences();
- }
- this.parentWebView = parentWebView;
- this.cordova = cordova;
- this.client = client;
- this.resourceApi = resourceApi;
- this.pluginManager = pluginManager;
- this.nativeToJsMessageQueue = nativeToJsMessageQueue;
- webView.init(this, cordova);
-
- initWebViewSettings();
-
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode.OnlineEventsBridgeModeDelegate() {
- @Override
- public void setNetworkAvailable(boolean value) {
- //sometimes this can be called after calling webview.destroy() on destroy()
- //thus resulting in a NullPointerException
- if(webView!=null) {
- webView.setNetworkAvailable(value);
- }
- }
- @Override
- public void runOnUiThread(Runnable r) {
- SystemWebViewEngine.this.cordova.getActivity().runOnUiThread(r);
- }
- }));
- nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.EvalBridgeMode(this, cordova));
- bridge = new CordovaBridge(pluginManager, nativeToJsMessageQueue);
- exposeJsInterface(webView, bridge);
- }
-
- @Override
- public CordovaWebView getCordovaWebView() {
- return parentWebView;
- }
-
- @Override
- public ICordovaCookieManager getCookieManager() {
- return cookieManager;
- }
-
- @Override
- public View getView() {
- return webView;
- }
-
- @SuppressLint({"NewApi", "SetJavaScriptEnabled"})
- @SuppressWarnings("deprecation")
- private void initWebViewSettings() {
- webView.setInitialScale(0);
- webView.setVerticalScrollBarEnabled(false);
- // Enable JavaScript
- final WebSettings settings = webView.getSettings();
- settings.setJavaScriptEnabled(true);
- settings.setJavaScriptCanOpenWindowsAutomatically(true);
- settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
-
- /**
- * https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccess(boolean)
- *
- * SDK >= 30 has recently set this value to false by default.
- * It is recommended to turn off this settings To prevent possible security issues targeting Build.VERSION_CODES.Q and earlier.
- * For existing functionality, this setting is set to true. In a future release, this should be defaulted to false.
- */
- settings.setAllowFileAccess(true);
-
- String manufacturer = android.os.Build.MANUFACTURER;
- LOG.d(TAG, "CordovaWebView is running on device made by: " + manufacturer);
-
- //We don't save any form data in the application
- settings.setSaveFormData(false);
- settings.setSavePassword(false);
-
- // Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
- // while we do this
- settings.setAllowUniversalAccessFromFileURLs(true);
- settings.setMediaPlaybackRequiresUserGesture(false);
-
- // Enable database
- // We keep this disabled because we use or shim to get around DOM_EXCEPTION_ERROR_16
- String databasePath = webView.getContext().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
- settings.setDatabaseEnabled(true);
- settings.setDatabasePath(databasePath);
-
-
- //Determine whether we're in debug or release mode, and turn on Debugging!
- ApplicationInfo appInfo = webView.getContext().getApplicationContext().getApplicationInfo();
- if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
- enableRemoteDebugging();
- }
-
- settings.setGeolocationDatabasePath(databasePath);
-
- // Enable DOM storage
- settings.setDomStorageEnabled(true);
-
- // Enable built-in geolocation
- settings.setGeolocationEnabled(true);
-
- // Enable AppCache
- // Fix for CB-2282
- settings.setAppCacheMaxSize(5 * 1048576);
- settings.setAppCachePath(databasePath);
- settings.setAppCacheEnabled(true);
-
- // Fix for CB-1405
- // Google issue 4641
- String defaultUserAgent = settings.getUserAgentString();
-
- // Fix for CB-3360
- String overrideUserAgent = preferences.getString("OverrideUserAgent", null);
- if (overrideUserAgent != null) {
- settings.setUserAgentString(overrideUserAgent);
- } else {
- String appendUserAgent = preferences.getString("AppendUserAgent", null);
- if (appendUserAgent != null) {
- settings.setUserAgentString(defaultUserAgent + " " + appendUserAgent);
- }
- }
- // End CB-3360
-
- IntentFilter intentFilter = new IntentFilter();
- intentFilter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
- if (this.receiver == null) {
- this.receiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- settings.getUserAgentString();
- }
- };
- webView.getContext().registerReceiver(this.receiver, intentFilter);
- }
- // end CB-1405
- }
-
- private void enableRemoteDebugging() {
- try {
- WebView.setWebContentsDebuggingEnabled(true);
- } catch (IllegalArgumentException e) {
- LOG.d(TAG, "You have one job! To turn on Remote Web Debugging! YOU HAVE FAILED! ");
- e.printStackTrace();
- }
- }
-
- // Yeah, we know. It'd be great if lint was just a little smarter.
- @SuppressLint("AddJavascriptInterface")
- private static void exposeJsInterface(WebView webView, CordovaBridge bridge) {
- SystemExposedJsApi exposedJsApi = new SystemExposedJsApi(bridge);
- webView.addJavascriptInterface(exposedJsApi, "_cordovaNative");
- }
-
-
- /**
- * Load the url into the webview.
- */
- @Override
- public void loadUrl(final String url, boolean clearNavigationStack) {
- webView.loadUrl(url);
- }
-
- @Override
- public String getUrl() {
- return webView.getUrl();
- }
-
- @Override
- public void stopLoading() {
- webView.stopLoading();
- }
-
- @Override
- public void clearCache() {
- webView.clearCache(true);
- }
-
- @Override
- public void clearHistory() {
- webView.clearHistory();
- }
-
- @Override
- public boolean canGoBack() {
- return webView.canGoBack();
- }
-
- /**
- * Go to previous page in history. (We manage our own history)
- *
- * @return true if we went back, false if we are already at top
- */
- @Override
- public boolean goBack() {
- // Check webview first to see if there is a history
- // This is needed to support curPage#diffLink, since they are added to parentEngine's history, but not our history url array (JQMobile behavior)
- if (webView.canGoBack()) {
- webView.goBack();
- return true;
- }
- return false;
- }
-
- @Override
- public void setPaused(boolean value) {
- if (value) {
- webView.onPause();
- webView.pauseTimers();
- } else {
- webView.onResume();
- webView.resumeTimers();
- }
- }
-
- @Override
- public void destroy() {
- webView.chromeClient.destroyLastDialog();
- webView.destroy();
- // unregister the receiver
- if (receiver != null) {
- try {
- webView.getContext().unregisterReceiver(receiver);
- } catch (Exception e) {
- LOG.e(TAG, "Error unregistering configuration receiver: " + e.getMessage(), e);
- }
- }
- }
-
- @Override
- public void evaluateJavascript(String js, ValueCallback<String> callback) {
- webView.evaluateJavascript(js, callback);
- }
-}
diff --git a/cordova/platforms/android/android.json b/cordova/platforms/android/android.json
deleted file mode 100644
index 23ec372f5..000000000
--- a/cordova/platforms/android/android.json
+++ /dev/null
@@ -1,485 +0,0 @@
-{
- "prepare_queue": {
- "installed": [],
- "uninstalled": []
- },
- "config_munge": {
- "files": {
- "AndroidManifest.xml": {
- "parents": {
- "/manifest/application/activity": [
- {
- "xml": "<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:mimeType=\"application/pdf\" android:scheme=\"file\" /><data android:mimeType=\"text/plain\" android:scheme=\"file\" /><data android:mimeType=\"image/x-windows-bmp\" android:scheme=\"file\" /><data android:mimeType=\"image/gif\" android:scheme=\"file\" /><data android:mimeType=\"image/png\" android:scheme=\"file\" /><data android:mimeType=\"image/jpeg\" android:scheme=\"file\" /><data android:mimeType=\"image/webp\" android:scheme=\"file\" /><data android:mimeType=\"video/webm\" android:scheme=\"file\" /><data android:mimeType=\"video/ogg\" android:scheme=\"file\" /><data android:mimeType=\"text/html\" android:scheme=\"file\" /><data android:mimeType=\"application/json\" android:scheme=\"file\" /></intent-filter>",
- "count": 44
- },
- {
- "xml": "<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:host=\"*\" android:mimeType=\"*/*\" android:pathPattern=\"..json\" android:scheme=\"file\" /><data android:host=\"*\" android:mimeType=\"*/*\" android:pathPattern=\"..mht\" android:scheme=\"file\" /><data android:host=\"*\" android:mimeType=\"*/*\" android:pathPattern=\"..mhtml\" android:scheme=\"file\" /><data android:host=\"*\" android:mimeType=\"*/*\" android:pathPattern=\"..md\" android:scheme=\"file\" /><data android:host=\"*\" android:mimeType=\"*/*\" android:pathPattern=\"..md.txt\" android:scheme=\"file\" /><data android:host=\"*\" android:mimeType=\"*/*\" android:pathPattern=\"..markdown\" android:scheme=\"file\" /><data android:host=\"*\" android:mimeType=\"*/*\" android:pathPattern=\"..ogv\" android:scheme=\"file\" /></intent-filter>",
- "count": 44
- },
- {
- "xml": "<intent-filter><action android:name=\"com.darryncampbell.cordova.plugin.intent.ACTION\" /><category android:name=\"android.intent.category.DEFAULT\" /></intent-filter>",
- "count": 1
- }
- ],
- "/manifest/application": [
- {
- "xml": "<provider android:authorities=\"${applicationId}.provider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"android.support.v4.content.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/mnk_file_path\" /></provider>",
- "count": 19
- },
- {
- "xml": "<provider android:authorities=\"${applicationId}.darryncampbell.cordova.plugin.intent.fileprovider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"com.darryncampbell.cordova.plugin.intent.CordovaPluginIntentFileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/provider_paths\" /></provider>",
- "count": 1
- },
- {
- "xml": "<activity android:label=\"Our Code World filepicker\" android:name=\"com.ourcodeworld.plugins.filebrowser.DialogShowPicker\"><intent-filter><action android:name=\"com.ourcodeworld.plugins.filebrowser.DialogShowPicker\" /><category android:name=\"android.intent.category.DEFAULT\" /></intent-filter></activity>",
- "count": 1
- },
- {
- "xml": "<service android:name=\"de.appplant.cordova.plugin.background.ForegroundService\" />",
- "count": 1
- },
- {
- "xml": "<provider android:authorities=\"${applicationId}.sharing.provider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"nl.xservices.plugins.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/sharing_paths\" /></provider>",
- "count": 1
- },
- {
- "xml": "<provider android:authorities=\"${applicationId}.provider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"androidx.core.content.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/mnk_file_path\" /></provider>",
- "count": 25
- }
- ],
- "/manifest": [
- {
- "xml": "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />",
- "count": 2
- },
- {
- "xml": "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />",
- "count": 1
- },
- {
- "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
- "count": 1
- },
- {
- "xml": "<uses-permission android:name=\"android.permission.WAKE_LOCK\" />",
- "count": 1
- }
- ],
- "/*": [
- {
- "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
- "count": 3
- },
- {
- "xml": "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />",
- "count": 1
- },
- {
- "xml": "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />",
- "count": 1
- }
- ],
- "application": [
- {
- "xml": "<provider android:authorities=\"${applicationId}.cordova.plugin.camera.provider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"org.apache.cordova.camera.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/camera_provider_paths\" /></provider>",
- "count": 1
- },
- {
- "xml": "<provider android:authorities=\"${applicationId}.fileOpener2.provider\" android:exported=\"false\" android:grantUriPermissions=\"true\" android:name=\"io.github.pwlin.cordova.plugins.fileopener2.FileProvider\"><meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/opener_paths\" /></provider>",
- "count": 1
- }
- ],
- "/*/application": [
- {
- "xml": "<receiver android:enabled=\"true\" android:name=\"nl.xservices.plugins.ShareChooserPendingIntent\"><intent-filter><action android:name=\"android.intent.action.SEND\" /></intent-filter></receiver>",
- "count": 1
- }
- ]
- }
- },
- "res/xml/config.xml": {
- "parents": {
- "/*": [
- {
- "xml": "<feature name=\"IntentShim\"><param name=\"android-package\" value=\"com.darryncampbell.cordova.plugin.intent.IntentShim\" /><param name=\"onload\" value=\"true\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"Filebrowser\"><param name=\"android-package\" value=\"com.ourcodeworld.plugins.filebrowser.Filebrowser\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"Downloader\"><param name=\"android-package\" value=\"com.whebcraft.android.plugin.Downloader\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"BackgroundMode\"><param name=\"android-package\" value=\"de.appplant.cordova.plugin.background.BackgroundMode\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"BackgroundModeExt\"><param name=\"android-package\" value=\"de.appplant.cordova.plugin.background.BackgroundModeExt\" /></feature>",
- "count": 1
- },
- {
- "xml": "<preference name=\"KeepRunning\" value=\"true\" />",
- "count": 1
- },
- {
- "xml": "<feature name=\"Camera\"><param name=\"android-package\" value=\"org.apache.cordova.camera.CameraLauncher\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>",
- "count": 1
- },
- {
- "xml": "<allow-navigation href=\"cdvfile:*\" />",
- "count": 1
- },
- {
- "xml": "<feature name=\"FileOpener2\"><param name=\"android-package\" value=\"io.github.pwlin.cordova.plugins.fileopener2.FileOpener2\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"Whitelist\"><param name=\"android-package\" value=\"org.apache.cordova.whitelist.WhitelistPlugin\" /><param name=\"onload\" value=\"true\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"SocialSharing\"><param name=\"android-package\" value=\"nl.xservices.plugins.SocialSharing\" /></feature>",
- "count": 1
- }
- ]
- }
- }
- }
- },
- "installed_plugins": {
- "com-darryncampbell-cordova-plugin-intent": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "com.ourcodeworld.plugins.Filebrowser": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "com.whebcraft.cordova.plugin.downloader": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-androidx-adapter": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-device": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-background-mode": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-camera": {
- "ANDROID_SUPPORT_V4_VERSION": "27.+",
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-file": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-file-opener2": {
- "ANDROID_SUPPORT_V4_VERSION": "27.+",
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-whitelist": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "es6-promise-plugin": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-x-socialsharing": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- }
- },
- "dependent_plugins": {},
- "modules": [
- {
- "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
- "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
- "pluginId": "com-darryncampbell-cordova-plugin-intent",
- "clobbers": [
- "intentShim"
- ]
- },
- {
- "id": "com.ourcodeworld.plugins.Filebrowser.Filebrowser",
- "file": "plugins/com.ourcodeworld.plugins.Filebrowser/www/filebrowser.js",
- "pluginId": "com.ourcodeworld.plugins.Filebrowser",
- "clobbers": [
- "window.OurCodeWorld.Filebrowser"
- ]
- },
- {
- "id": "com.whebcraft.cordova.plugin.downloader.Downloader",
- "file": "plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js",
- "pluginId": "com.whebcraft.cordova.plugin.downloader",
- "clobbers": [
- "plugins.Downloader"
- ]
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
- },
- {
- "id": "cordova-plugin-background-mode.BackgroundMode",
- "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
- "pluginId": "cordova-plugin-background-mode",
- "clobbers": [
- "cordova.plugins.backgroundMode",
- "plugin.backgroundMode"
- ]
- },
- {
- "id": "cordova-plugin-camera.Camera",
- "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "Camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverOptions",
- "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverOptions"
- ]
- },
- {
- "id": "cordova-plugin-camera.camera",
- "file": "plugins/cordova-plugin-camera/www/Camera.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "navigator.camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverHandle",
- "file": "plugins/cordova-plugin-camera/www/CameraPopoverHandle.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverHandle"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryEntry",
- "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryReader",
- "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryReader"
- ]
- },
- {
- "id": "cordova-plugin-file.Entry",
- "file": "plugins/cordova-plugin-file/www/Entry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Entry"
- ]
- },
- {
- "id": "cordova-plugin-file.File",
- "file": "plugins/cordova-plugin-file/www/File.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.File"
- ]
- },
- {
- "id": "cordova-plugin-file.FileEntry",
- "file": "plugins/cordova-plugin-file/www/FileEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.FileError",
- "file": "plugins/cordova-plugin-file/www/FileError.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileError"
- ]
- },
- {
- "id": "cordova-plugin-file.FileReader",
- "file": "plugins/cordova-plugin-file/www/FileReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileReader"
- ]
- },
- {
- "id": "cordova-plugin-file.FileSystem",
- "file": "plugins/cordova-plugin-file/www/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadOptions",
- "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadOptions"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadResult",
- "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadResult"
- ]
- },
- {
- "id": "cordova-plugin-file.FileWriter",
- "file": "plugins/cordova-plugin-file/www/FileWriter.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileWriter"
- ]
- },
- {
- "id": "cordova-plugin-file.Flags",
- "file": "plugins/cordova-plugin-file/www/Flags.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Flags"
- ]
- },
- {
- "id": "cordova-plugin-file.LocalFileSystem",
- "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.LocalFileSystem"
- ],
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.Metadata",
- "file": "plugins/cordova-plugin-file/www/Metadata.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Metadata"
- ]
- },
- {
- "id": "cordova-plugin-file.ProgressEvent",
- "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.ProgressEvent"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems",
- "file": "plugins/cordova-plugin-file/www/fileSystems.js",
- "pluginId": "cordova-plugin-file"
- },
- {
- "id": "cordova-plugin-file.requestFileSystem",
- "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.requestFileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.resolveLocalFileSystemURI",
- "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.isChrome",
- "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.androidFileSystem",
- "file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems-roots",
- "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.fileSystemPaths",
- "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "cordova"
- ],
- "runs": true
- },
- {
- "id": "cordova-plugin-file-opener2.FileOpener2",
- "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
- "pluginId": "cordova-plugin-file-opener2",
- "clobbers": [
- "cordova.plugins.fileOpener2"
- ]
- },
- {
- "id": "es6-promise-plugin.Promise",
- "file": "plugins/es6-promise-plugin/www/promise.js",
- "pluginId": "es6-promise-plugin",
- "runs": true
- },
- {
- "id": "cordova-plugin-x-socialsharing.SocialSharing",
- "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
- "pluginId": "cordova-plugin-x-socialsharing",
- "clobbers": [
- "window.plugins.socialsharing"
- ]
- }
- ],
- "plugin_metadata": {
- "com-darryncampbell-cordova-plugin-intent": "2.0.0",
- "com.ourcodeworld.plugins.Filebrowser": "1.0.0",
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "cordova-plugin-device": "2.0.3",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-camera": "5.0.1",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.5",
- "cordova-plugin-whitelist": "1.3.4",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-x-socialsharing": "6.0.3"
- }
-}
diff --git a/cordova/platforms/android/app/build.gradle b/cordova/platforms/android/app/build.gradle
deleted file mode 100644
index 063289491..000000000
--- a/cordova/platforms/android/app/build.gradle
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-apply plugin: 'com.android.application'
-
-if (cdvHelpers.getConfigPreference('GradlePluginKotlinEnabled', 'false').toBoolean()) {
- apply plugin: 'kotlin-android'
- apply plugin: 'kotlin-android-extensions'
-}
-
-buildscript {
- apply from: '../CordovaLib/cordova.gradle'
-
- if(cdvHelpers.getConfigPreference('GradlePluginKotlinEnabled', 'false').toBoolean()) {
- String defaultGradlePluginKotlinVersion = kotlin_version
-
- /**
- * Fetches the user's defined Kotlin Version from config.xml.
- * If the version is not set or invalid, it will default to the ${defaultGradlePluginKotlinVersion}
- */
- String gradlePluginKotlinVersion = cdvHelpers.getConfigPreference('GradlePluginKotlinVersion', defaultGradlePluginKotlinVersion)
- if(!cdvHelpers.isVersionValid(gradlePluginKotlinVersion)) {
- println("The defined Kotlin version (${gradlePluginKotlinVersion}) does not appear to be a valid version. Falling back to version: ${defaultGradlePluginKotlinVersion}.")
- gradlePluginKotlinVersion = defaultGradlePluginKotlinVersion
- }
-
- // Change the version to be used.
- ext.kotlin_version = gradlePluginKotlinVersion
- }
-
- apply from: 'repositories.gradle'
- repositories repos
-
- dependencies {
- apply from: '../CordovaLib/cordova.gradle'
-
- classpath 'com.android.tools.build:gradle:4.0.0'
-
- if (cdvHelpers.getConfigPreference('GradlePluginKotlinEnabled', 'false').toBoolean()) {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-
- if(cdvHelpers.getConfigPreference('GradlePluginGoogleServicesEnabled', 'false').toBoolean()) {
- String defaultGradlePluginGoogleServicesVersion = '4.2.0'
-
- /**
- * Fetches the user's defined Google Services Plugin Version from config.xml.
- * If the version is not set or invalid, it will default to the ${defaultGradlePluginGoogleServicesVersion}
- */
- String gradlePluginGoogleServicesVersion = cdvHelpers.getConfigPreference('GradlePluginGoogleServicesVersion', defaultGradlePluginGoogleServicesVersion)
- if(!cdvHelpers.isVersionValid(gradlePluginGoogleServicesVersion)) {
- println("The defined Google Services plugin version (${gradlePluginGoogleServicesVersion}) does not appear to be a valid version. Falling back to version: ${defaultGradlePluginGoogleServicesVersion}.")
- gradlePluginGoogleServicesVersion = defaultGradlePluginGoogleServicesVersion
- }
-
- // Create the Google Services classpath and set it.
- String gradlePluginGoogleServicesClassPath = "com.google.gms:google-services:${gradlePluginGoogleServicesVersion}"
- println "Adding classpath: ${gradlePluginGoogleServicesClassPath}"
- classpath gradlePluginGoogleServicesClassPath
- }
- }
-}
-
-// Allow plugins to declare Maven dependencies via build-extras.gradle.
-allprojects {
- apply from: 'repositories.gradle'
- repositories repos
-}
-
-task wrapper(type: Wrapper) {
- gradleVersion = '6.5'
-}
-
-// Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties.
-// Refer to: http://www.gradle.org/docs/current/userguide/tutorial_this_and_that.html
-ext {
- apply from: '../CordovaLib/cordova.gradle'
-
- // The value for android.compileSdkVersion.
- if (!project.hasProperty('cdvCompileSdkVersion')) {
- cdvCompileSdkVersion = null;
- }
- // The value for android.buildToolsVersion.
- if (!project.hasProperty('cdvBuildToolsVersion')) {
- cdvBuildToolsVersion = null;
- }
- // Sets the versionCode to the given value.
- if (!project.hasProperty('cdvVersionCode')) {
- cdvVersionCode = null
- }
- // Sets the minSdkVersion to the given value.
- if (!project.hasProperty('cdvMinSdkVersion')) {
- cdvMinSdkVersion = null
- }
- // Sets the maxSdkVersion to the given value.
- if (!project.hasProperty('cdvMaxSdkVersion')) {
- cdvMaxSdkVersion = null
- }
- // The value for android.targetSdkVersion.
- if (!project.hasProperty('cdvTargetSdkVersion')) {
- cdvTargetSdkVersion = null;
- }
- // Whether to build architecture-specific APKs.
- if (!project.hasProperty('cdvBuildMultipleApks')) {
- cdvBuildMultipleApks = null
- }
- // Whether to append a 0 "abi digit" to versionCode when only a single APK is build
- if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) {
- cdvVersionCodeForceAbiDigit = null
- }
- // .properties files to use for release signing.
- if (!project.hasProperty('cdvReleaseSigningPropertiesFile')) {
- cdvReleaseSigningPropertiesFile = null
- }
- // .properties files to use for debug signing.
- if (!project.hasProperty('cdvDebugSigningPropertiesFile')) {
- cdvDebugSigningPropertiesFile = null
- }
- // Set by build.js script.
- if (!project.hasProperty('cdvBuildArch')) {
- cdvBuildArch = null
- }
-
- // Plugin gradle extensions can append to this to have code run at the end.
- cdvPluginPostBuildExtras = []
-}
-
-// PLUGIN GRADLE EXTENSIONS START
-apply from: "../com.ourcodeworld.plugins.Filebrowser/mobileapp-plugin.gradle"
-// PLUGIN GRADLE EXTENSIONS END
-
-def hasBuildExtras1 = file('build-extras.gradle').exists()
-if (hasBuildExtras1) {
- apply from: 'build-extras.gradle'
-}
-
-def hasBuildExtras2 = file('../build-extras.gradle').exists()
-if (hasBuildExtras2) {
- apply from: '../build-extras.gradle'
-}
-
-// Set property defaults after extension .gradle files.
-ext.cdvCompileSdkVersion = cdvCompileSdkVersion == null ? (
- defaultCompileSdkVersion == null
- ? privateHelpers.getProjectTarget()
- : defaultCompileSdkVersion
-) : Integer.parseInt('' + cdvCompileSdkVersion);
-
-if (ext.cdvBuildToolsVersion == null) {
- ext.cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
- //ext.cdvBuildToolsVersion = project.ext.defaultBuildToolsVersion
-}
-if (ext.cdvDebugSigningPropertiesFile == null && file('../debug-signing.properties').exists()) {
- ext.cdvDebugSigningPropertiesFile = '../debug-signing.properties'
-}
-if (ext.cdvReleaseSigningPropertiesFile == null && file('../release-signing.properties').exists()) {
- ext.cdvReleaseSigningPropertiesFile = '../release-signing.properties'
-}
-
-// Cast to appropriate types.
-ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean();
-ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean();
-
-// minSdkVersion, maxSdkVersion and targetSdkVersion
-ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? defaultMinSdkVersion : Integer.parseInt('' + cdvMinSdkVersion)
-if (cdvMaxSdkVersion != null) {
- ext.cdvMaxSdkVersion = Integer.parseInt('' + cdvMaxSdkVersion)
-}
-ext.cdvTargetSdkVersion = cdvTargetSdkVersion == null ? defaultTargetSdkVersion : Integer.parseInt('' + cdvTargetSdkVersion)
-
-ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode)
-
-def computeBuildTargetName(debugBuild) {
- def ret = 'assemble'
- if (cdvBuildMultipleApks && cdvBuildArch) {
- def arch = cdvBuildArch == 'arm' ? 'armv7' : cdvBuildArch
- ret += '' + arch.toUpperCase().charAt(0) + arch.substring(1);
- }
- return ret + (debugBuild ? 'Debug' : 'Release')
-}
-
-// Make cdvBuild a task that depends on the debug/arch-sepecific task.
-task cdvBuildDebug
-cdvBuildDebug.dependsOn {
- return computeBuildTargetName(true)
-}
-
-task cdvBuildRelease
-cdvBuildRelease.dependsOn {
- return computeBuildTargetName(false)
-}
-
-task cdvPrintProps {
- doLast {
- println('cdvCompileSdkVersion=' + cdvCompileSdkVersion)
- println('cdvBuildToolsVersion=' + cdvBuildToolsVersion)
- println('cdvVersionCode=' + cdvVersionCode)
- println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit)
- println('cdvMinSdkVersion=' + cdvMinSdkVersion)
- println('cdvMaxSdkVersion=' + cdvMaxSdkVersion)
- println('cdvTargetSdkVersion=' + cdvTargetSdkVersion)
- println('cdvBuildMultipleApks=' + cdvBuildMultipleApks)
- println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile)
- println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile)
- println('cdvBuildArch=' + cdvBuildArch)
- println('computedVersionCode=' + android.defaultConfig.versionCode)
- android.productFlavors.each { flavor ->
- println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode)
- }
- }
-}
-
-android {
- defaultConfig {
- versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
- applicationId privateHelpers.extractStringFromManifest("package")
-
- if (cdvMinSdkVersion != null) {
- minSdkVersion cdvMinSdkVersion
- }
-
- if (cdvMaxSdkVersion != null) {
- maxSdkVersion cdvMaxSdkVersion
- }
-
- if(cdvTargetSdkVersion != null) {
- targetSdkVersion cdvTargetSdkVersion
- }
- }
-
- lintOptions {
- abortOnError false;
- }
-
- compileSdkVersion cdvCompileSdkVersion
- buildToolsVersion cdvBuildToolsVersion
-
- // This code exists for Crosswalk and other Native APIs.
- // By default, we multiply the existing version code in the
- // Android Manifest by 10 and add a number for each architecture.
- // If you are not using Crosswalk or SQLite, you can
- // ignore this chunk of code, and your version codes will be respected.
-
- if (Boolean.valueOf(cdvBuildMultipleApks)) {
- flavorDimensions "default"
-
- productFlavors {
- armeabi {
- versionCode defaultConfig.versionCode*10 + 1
- ndk {
- abiFilters = ["armeabi"]
- }
- }
- armv7 {
- versionCode defaultConfig.versionCode*10 + 2
- ndk {
- abiFilters = ["armeabi-v7a"]
- }
- }
- arm64 {
- versionCode defaultConfig.versionCode*10 + 3
- ndk {
- abiFilters = ["arm64-v8a"]
- }
- }
- x86 {
- versionCode defaultConfig.versionCode*10 + 4
- ndk {
- abiFilters = ["x86"]
- }
- }
- x86_64 {
- versionCode defaultConfig.versionCode*10 + 5
- ndk {
- abiFilters = ["x86_64"]
- }
- }
- }
- } else if (Boolean.valueOf(cdvVersionCodeForceAbiDigit)) {
- // This provides compatibility to the default logic for versionCode before cordova-android 5.2.0
- defaultConfig {
- versionCode defaultConfig.versionCode*10
- }
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- if (cdvReleaseSigningPropertiesFile) {
- signingConfigs {
- release {
- // These must be set or Gradle will complain (even if they are overridden).
- keyAlias = ""
- keyPassword = "__unset" // And these must be set to non-empty in order to have the signing step added to the task graph.
- storeFile = null
- storePassword = "__unset"
- }
- }
- buildTypes {
- release {
- signingConfig signingConfigs.release
- }
- }
- addSigningProps(cdvReleaseSigningPropertiesFile, signingConfigs.release)
- }
-
- if (cdvDebugSigningPropertiesFile) {
- addSigningProps(cdvDebugSigningPropertiesFile, signingConfigs.debug)
- }
-
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
-}
-
-/*
- * WARNING: Cordova Lib and platform scripts do management inside of this code here,
- * if you are adding the dependencies manually, do so outside the comments, otherwise
- * the Cordova tools will overwrite them
- */
-
-
-dependencies {
- implementation fileTree(dir: 'libs', include: '*.jar')
-
- if (cdvHelpers.getConfigPreference('GradlePluginKotlinEnabled', 'false').toBoolean()) {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- }
-
- // SUB-PROJECT DEPENDENCIES START
- implementation(project(path: ":CordovaLib"))
- implementation "androidx.core:core:1.1.0"
- implementation "androidx.legacy:legacy-support-v4:1.0.0"
- // SUB-PROJECT DEPENDENCIES END
-}
-
-def promptForReleaseKeyPassword() {
- if (!cdvReleaseSigningPropertiesFile) {
- return;
- }
- if ('__unset'.equals(android.signingConfigs.release.storePassword)) {
- android.signingConfigs.release.storePassword = privateHelpers.promptForPassword('Enter key store password: ')
- }
- if ('__unset'.equals(android.signingConfigs.release.keyPassword)) {
- android.signingConfigs.release.keyPassword = privateHelpers.promptForPassword('Enter key password: ');
- }
-}
-
-gradle.taskGraph.whenReady { taskGraph ->
- taskGraph.getAllTasks().each() { task ->
- if(['validateReleaseSigning', 'validateSigningRelease', 'validateSigningArmv7Release', 'validateSigningX76Release'].contains(task.name)) {
- promptForReleaseKeyPassword()
- }
- }
-}
-
-def addSigningProps(propsFilePath, signingConfig) {
- def propsFile = file(propsFilePath)
- def props = new Properties()
- propsFile.withReader { reader ->
- props.load(reader)
- }
-
- def storeFile = new File(props.get('key.store') ?: privateHelpers.ensureValueExists(propsFilePath, props, 'storeFile'))
- if (!storeFile.isAbsolute()) {
- storeFile = RelativePath.parse(true, storeFile.toString()).getFile(propsFile.getParentFile())
- }
- if (!storeFile.exists()) {
- throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath())
- }
- signingConfig.keyAlias = props.get('key.alias') ?: privateHelpers.ensureValueExists(propsFilePath, props, 'keyAlias')
- signingConfig.keyPassword = props.get('keyPassword', props.get('key.alias.password', signingConfig.keyPassword))
- signingConfig.storeFile = storeFile
- signingConfig.storePassword = props.get('storePassword', props.get('key.store.password', signingConfig.storePassword))
- def storeType = props.get('storeType', props.get('key.store.type', ''))
- if (!storeType) {
- def filename = storeFile.getName().toLowerCase();
- if (filename.endsWith('.p12') || filename.endsWith('.pfx')) {
- storeType = 'pkcs12'
- } else {
- storeType = signingConfig.storeType // "jks"
- }
- }
- signingConfig.storeType = storeType
-}
-
-for (def func : cdvPluginPostBuildExtras) {
- func()
-}
-
-// This can be defined within build-extras.gradle as:
-// ext.postBuildExtras = { ... code here ... }
-if (hasProperty('postBuildExtras')) {
- postBuildExtras()
-}
-
-if (cdvHelpers.getConfigPreference('GradlePluginGoogleServicesEnabled', 'false').toBoolean()) {
- apply plugin: 'com.google.gms.google-services'
-}
diff --git a/cordova/platforms/android/app/libs/filepicker-4.2.1.aar b/cordova/platforms/android/app/libs/filepicker-4.2.1.aar
deleted file mode 100644
index 2f638922e..000000000
Binary files a/cordova/platforms/android/app/libs/filepicker-4.2.1.aar and /dev/null differ
diff --git a/cordova/platforms/android/app/repositories.gradle b/cordova/platforms/android/app/repositories.gradle
deleted file mode 100644
index 3a397a83e..000000000
--- a/cordova/platforms/android/app/repositories.gradle
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-ext.repos = {
- mavenCentral()
- google()
- maven { url 'https://jitpack.io' }
-}
diff --git a/cordova/platforms/android/app/src/main/AndroidManifest.xml b/cordova/platforms/android/app/src/main/AndroidManifest.xml
deleted file mode 100644
index afe78bcb1..000000000
--- a/cordova/platforms/android/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="org.tagspaces.mobileapp" xmlns:android="http://schemas.android.com/apk/res/android">
- <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
- <uses-permission android:name="android.permission.INTERNET" />
- <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:requestLegacyExternalStorage="true" android:supportsRtl="true">
- <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
- <intent-filter android:label="@string/launcher_name">
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </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:mimeType="application/pdf" android:scheme="file" />
- <data android:mimeType="text/plain" android:scheme="file" />
- <data android:mimeType="image/x-windows-bmp" android:scheme="file" />
- <data android:mimeType="image/gif" android:scheme="file" />
- <data android:mimeType="image/png" android:scheme="file" />
- <data android:mimeType="image/jpeg" android:scheme="file" />
- <data android:mimeType="image/webp" android:scheme="file" />
- <data android:mimeType="video/webm" android:scheme="file" />
- <data android:mimeType="video/ogg" android:scheme="file" />
- <data android:mimeType="text/html" android:scheme="file" />
- <data android:mimeType="application/json" android:scheme="file" />
- </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:host="*" android:mimeType="*/*" android:pathPattern="..json" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..mht" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..mhtml" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..md" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..md.txt" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..markdown" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..ogv" android:scheme="file" />
- </intent-filter>
- <intent-filter>
- <action android:name="com.darryncampbell.cordova.plugin.intent.ACTION" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- </activity>
- <provider android:authorities="${applicationId}.darryncampbell.cordova.plugin.intent.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="com.darryncampbell.cordova.plugin.intent.CordovaPluginIntentFileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
- </provider>
- <activity android:label="Our Code World filepicker" android:name="com.ourcodeworld.plugins.filebrowser.DialogShowPicker">
- <intent-filter>
- <action android:name="com.ourcodeworld.plugins.filebrowser.DialogShowPicker" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- </activity>
- <service android:name="de.appplant.cordova.plugin.background.ForegroundService" />
- <provider android:authorities="${applicationId}.cordova.plugin.camera.provider" android:exported="false" android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/camera_provider_paths" />
- </provider>
- <provider android:authorities="${applicationId}.fileOpener2.provider" android:exported="false" android:grantUriPermissions="true" android:name="io.github.pwlin.cordova.plugins.fileopener2.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/opener_paths" />
- </provider>
- <receiver android:enabled="true" android:name="nl.xservices.plugins.ShareChooserPendingIntent">
- <intent-filter>
- <action android:name="android.intent.action.SEND" />
- </intent-filter>
- </receiver>
- <provider android:authorities="${applicationId}.sharing.provider" android:exported="false" android:grantUriPermissions="true" android:name="nl.xservices.plugins.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/sharing_paths" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- </application>
- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
- <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <uses-permission android:name="android.permission.WAKE_LOCK" />
-</manifest>
diff --git a/cordova/platforms/android/app/src/main/java/com/darryncampbell/plugin/intent/CordovaPluginIntentFileProvider.java b/cordova/platforms/android/app/src/main/java/com/darryncampbell/plugin/intent/CordovaPluginIntentFileProvider.java
deleted file mode 100644
index a88663cf7..000000000
--- a/cordova/platforms/android/app/src/main/java/com/darryncampbell/plugin/intent/CordovaPluginIntentFileProvider.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.darryncampbell.cordova.plugin.intent;
-
-public class CordovaPluginIntentFileProvider extends androidx.core.content.FileProvider {
-}
diff --git a/cordova/platforms/android/app/src/main/java/com/darryncampbell/plugin/intent/IntentShim.java b/cordova/platforms/android/app/src/main/java/com/darryncampbell/plugin/intent/IntentShim.java
deleted file mode 100644
index 4bc5ceca0..000000000
--- a/cordova/platforms/android/app/src/main/java/com/darryncampbell/plugin/intent/IntentShim.java
+++ /dev/null
@@ -1,830 +0,0 @@
-package com.darryncampbell.cordova.plugin.intent;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.BroadcastReceiver;
-import android.content.ClipData;
-import android.content.ComponentName;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.PackageManager;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.provider.DocumentsContract;
-import android.provider.MediaStore;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
-import androidx.core.content.FileProvider;
-import android.text.Html;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.webkit.MimeTypeMap;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaActivity;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.File;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import static android.os.Environment.getExternalStorageDirectory;
-import static android.os.Environment.getExternalStorageState;
-
-public class IntentShim extends CordovaPlugin {
-
- private static final String LOG_TAG = "Cordova Intents Shim";
- private CallbackContext onNewIntentCallbackContext = null;
- private CallbackContext onBroadcastCallbackContext = null;
- private CallbackContext onActivityResultCallbackContext = null;
-
- private Intent deferredIntent = null;
-
- public IntentShim() {
-
- }
-
- public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException
- {
- Log.d(LOG_TAG, "Action: " + action);
- if (action.equals("startActivity") || action.equals("startActivityForResult"))
- {
- // Credit: https://github.com/chrisekelley/cordova-webintent
- if (args.length() != 1) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- JSONObject obj = args.getJSONObject(0);
- Intent intent = populateIntent(obj, callbackContext);
- int requestCode = obj.has("requestCode") ? obj.getInt("requestCode") : 1;
-
- boolean bExpectResult = false;
- if (action.equals("startActivityForResult"))
- {
- bExpectResult = true;
- this.onActivityResultCallbackContext = callbackContext;
- }
- startActivity(intent, bExpectResult, requestCode, callbackContext);
-
- return true;
- }
- else if (action.equals("sendBroadcast"))
- {
- // Credit: https://github.com/chrisekelley/cordova-webintent
- if (args.length() != 1) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- // Parse the arguments
- JSONObject obj = args.getJSONObject(0);
- Intent intent = populateIntent(obj, callbackContext);
-
- sendBroadcast(intent);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- return true;
- }
- else if (action.equals("startService"))
- {
- if (args.length() != 1) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
- JSONObject obj = args.getJSONObject(0);
- Intent intent = populateIntent(obj, callbackContext);
- startService(intent);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- return true;
- }
- else if (action.equals("registerBroadcastReceiver")) {
- try
- {
- // Ensure we only have a single registered broadcast receiver
- this.cordova.getActivity().unregisterReceiver(myBroadcastReceiver);
- }
- catch (IllegalArgumentException e) {}
-
- // No error callback
- if(args.length() != 1) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- // Expect an array of filterActions
- JSONObject obj = args.getJSONObject(0);
- JSONArray filterActions = obj.has("filterActions") ? obj.getJSONArray("filterActions") : null;
- if (filterActions == null || filterActions.length() == 0)
- {
- // The arguments are not correct
- Log.w(LOG_TAG, "filterActions argument is not in the expected format");
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- this.onBroadcastCallbackContext = callbackContext;
-
- PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
- result.setKeepCallback(true);
-
- IntentFilter filter = new IntentFilter();
- for (int i = 0; i < filterActions.length(); i++) {
- Log.d(LOG_TAG, "Registering broadcast receiver for filter: " + filterActions.getString(i));
- filter.addAction(filterActions.getString(i));
- }
-
- // Allow an array of filterCategories
- JSONArray filterCategories = obj.has("filterCategories") ? obj.getJSONArray("filterCategories") : null;
- if (filterCategories != null) {
- for (int i = 0; i < filterCategories.length(); i++) {
- Log.d(LOG_TAG, "Registering broadcast receiver for category filter: " + filterCategories.getString(i));
- filter.addCategory(filterCategories.getString(i));
- }
- }
-
- // Add any specified Data Schemes
- // https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/issues/24
- JSONArray filterDataSchemes = obj.has("filterDataSchemes") ? obj.getJSONArray("filterDataSchemes") : null;
- if (filterDataSchemes != null && filterDataSchemes.length() > 0)
- {
- for (int i = 0; i < filterDataSchemes.length(); i++)
- {
- Log.d(LOG_TAG, "Associating data scheme to filter: " + filterDataSchemes.getString(i));
- filter.addDataScheme(filterDataSchemes.getString(i));
- }
- }
-
- this.cordova.getActivity().registerReceiver(myBroadcastReceiver, filter);
-
- callbackContext.sendPluginResult(result);
- }
- else if (action.equals("unregisterBroadcastReceiver"))
- {
- try
- {
- this.cordova.getActivity().unregisterReceiver(myBroadcastReceiver);
- }
- catch (IllegalArgumentException e) {}
- }
- else if (action.equals("onIntent"))
- {
- // Credit: https://github.com/napolitano/cordova-plugin-intent
- if(args.length() != 1) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- this.onNewIntentCallbackContext = callbackContext;
-
- if (this.deferredIntent != null) {
- fireOnNewIntent(this.deferredIntent);
- this.deferredIntent = null;
- }
-
- PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
- result.setKeepCallback(true);
- callbackContext.sendPluginResult(result);
- return true;
- }
- else if (action.equals("onActivityResult"))
- {
- if(args.length() != 1) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- this.onActivityResultCallbackContext = callbackContext;
-
- PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
- result.setKeepCallback(true);
- callbackContext.sendPluginResult(result);
- return true;
- }
- else if (action.equals("getIntent"))
- {
- // Credit: https://github.com/napolitano/cordova-plugin-intent
- if(args.length() != 0) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- Intent intent;
-
- if (this.deferredIntent != null) {
- intent = this.deferredIntent;
- this.deferredIntent = null;
- }
- else {
- intent = cordova.getActivity().getIntent();
- }
-
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, getIntentJson(intent)));
- return true;
- }
- else if (action.equals("sendResult"))
- {
- // Assuming this application was started with startActivityForResult, send the result back
- // https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/issues/3
- Intent result = new Intent();
- if (args.length() > 0)
- {
- JSONObject json = args.getJSONObject(0);
- JSONObject extras = (json.has("extras"))?json.getJSONObject("extras"):null;
-
- // Populate the extras if any exist
- if (extras != null) {
- JSONArray extraNames = extras.names();
- for (int i = 0; i < extraNames.length(); i++) {
- String key = extraNames.getString(i);
- Object extrasObj = extras.get(key);
- if (extrasObj instanceof JSONObject) {
- // The extra is a bundle
- Bundle bundle = toBundle((JSONObject) extras.get(key));
- result.putExtra(key, bundle);
- } else if (extrasObj instanceof Boolean) {
- result.putExtra(key, extras.getBoolean(key));
- } else if(extrasObj instanceof Integer) {
- result.putExtra(key, extras.getInt(key));
- } else if(extrasObj instanceof Long) {
- result.putExtra(key, extras.getLong(key));
- } else if(extrasObj instanceof Double) {
- result.putExtra(key, extras.getDouble(key));
- } else if (extrasObj instanceof Float) {
- result.putExtra(key, extras.getDouble(key));
- } else {
- result.putExtra(key, extras.getString(key));
- }
- }
- }
- }
-
- //set result
- cordova.getActivity().setResult(Activity.RESULT_OK, result);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
-
- //finish the activity
- cordova.getActivity().finish();
-
- }
- else if (action.equals("realPathFromUri"))
- {
- if (args.length() != 1) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.INVALID_ACTION));
- return false;
- }
-
- JSONObject obj = args.getJSONObject(0);
- String realPath = getRealPathFromURI_API19(obj, callbackContext);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, realPath));
- return true;
-
- }
-
- return true;
- }
-
- private Uri remapUriWithFileProvider(String uriAsString, final CallbackContext callbackContext)
- {
- // Create the URI via FileProvider Special case for N and above when installing apks
- int permissionCheck = ContextCompat.checkSelfPermission(this.cordova.getActivity(),
- Manifest.permission.READ_EXTERNAL_STORAGE);
- if (permissionCheck != PackageManager.PERMISSION_GRANTED)
- {
- // Could do better here - if the app does not already have permission should
- // only continue when we get the success callback from this.
- ActivityCompat.requestPermissions(this.cordova.getActivity(),
- new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
- callbackContext.error("Please grant read external storage permission");
- return null;
- }
-
- try
- {
- String externalStorageState = getExternalStorageState();
- if (externalStorageState.equals(Environment.MEDIA_MOUNTED) || externalStorageState.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
- String fileName = uriAsString.substring(uriAsString.indexOf('/') + 2, uriAsString.length());
- File uriAsFile = new File(fileName);
- boolean fileExists = uriAsFile.exists();
- if (!fileExists)
- {
- Log.e(LOG_TAG, "File at path " + uriAsFile.getPath() + " with name " + uriAsFile.getName() + "does not exist");
- callbackContext.error("File not found: " + uriAsFile.toString());
- return null;
- }
- String PACKAGE_NAME = this.cordova.getActivity().getPackageName() + ".darryncampbell.cordova.plugin.intent.fileprovider";
- Uri uri = FileProvider.getUriForFile(this.cordova.getActivity().getApplicationContext(), PACKAGE_NAME, uriAsFile);
- return uri;
- }
- else
- {
- Log.e(LOG_TAG, "Storage directory is not mounted. Please ensure the device is not connected via USB for file transfer");
- callbackContext.error("Storage directory is returning not mounted");
- return null;
- }
- }
- catch(StringIndexOutOfBoundsException e)
- {
- Log.e(LOG_TAG, "URL is not well formed");
- callbackContext.error("URL is not well formed");
- return null;
- }
- }
-
- private String getRealPathFromURI_API19(JSONObject obj, CallbackContext callbackContext) throws JSONException
- {
- // Credit: https://stackoverflow.com/questions/2789276/android-get-real-path-by-uri-getpath/2790688
- Uri uri = obj.has("uri") ? Uri.parse(obj.getString("uri")) : null;
- if (uri == null)
- {
- Log.w(LOG_TAG, "URI is not a specified parameter");
- throw new JSONException("URI is not a specified parameter");
- }
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
- String filePath = "";
- if (uri.getHost().contains("com.android.providers.media")) {
- int permissionCheck = ContextCompat.checkSelfPermission(this.cordova.getActivity(),
- Manifest.permission.READ_EXTERNAL_STORAGE);
- if (permissionCheck != PackageManager.PERMISSION_GRANTED)
- {
- // Could do better here - if the app does not already have permission should
- // only continue when we get the success callback from this.
- ActivityCompat.requestPermissions(this.cordova.getActivity(),
- new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
- callbackContext.error("Please grant read external storage permission");
- return null;
- }
-
- // Image pick from recent
- String wholeID = DocumentsContract.getDocumentId(uri);
-
- // Split at colon, use second item in the array
- String id = wholeID.split(":")[1];
-
- String[] column = {MediaStore.Images.Media.DATA};
-
- // where id is equal to
- String sel = MediaStore.Images.Media._ID + "=?";
-
- // This line requires read storage permission
-
- Cursor cursor = this.cordova.getActivity().getApplicationContext().getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
- column, sel, new String[]{id}, null);
-
- int columnIndex = cursor.getColumnIndex(column[0]);
-
- if (cursor.moveToFirst()) {
- filePath = cursor.getString(columnIndex);
- }
- cursor.close();
- return filePath;
- } else {
- // image pick from gallery
- String[] proj = {MediaStore.Images.Media.DATA};
- Cursor cursor = this.cordova.getActivity().getApplicationContext().getContentResolver().query(uri, proj, null, null, null);
- int column_index
- = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
- cursor.moveToFirst();
- return cursor.getString(column_index);
- }
- }
-
- return "Requires KK or higher";
- }
-
- private void startActivity(Intent i, boolean bExpectResult, int requestCode, CallbackContext callbackContext) {
-
- if (i.resolveActivityInfo(this.cordova.getActivity().getPackageManager(), 0) != null)
- {
- if (bExpectResult)
- {
- cordova.setActivityResultCallback(this);
- this.cordova.getActivity().startActivityForResult(i, requestCode);
- }
- else
- {
- this.cordova.getActivity().startActivity(i);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- }
- }
- else
- {
- // Return an error as there is no app to handle this intent
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR));
- }
- }
-
- private void sendBroadcast(Intent intent) {
- this.cordova.getActivity().sendBroadcast(intent);
- }
-
- private void startService(Intent intent)
- {
- this.cordova.getActivity().startService(intent);
- }
-
- private Intent populateIntent(JSONObject obj, CallbackContext callbackContext) throws JSONException
- {
- // Credit: https://github.com/chrisekelley/cordova-webintent
- // Credit: https://github.com/chrisekelley/cordova-webintent
- String type = obj.has("type") ? obj.getString("type") : null;
- String packageAssociated = obj.has("package") ? obj.getString("package") : null;
-
- //Uri uri = obj.has("url") ? resourceApi.remapUri(Uri.parse(obj.getString("url"))) : null;
- Uri uri = null;
- final CordovaResourceApi resourceApi = webView.getResourceApi();
- if (obj.has("url"))
- {
- String uriAsString = obj.getString("url");
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && uriAsString.startsWith("file://"))
- {
- uri = remapUriWithFileProvider(uriAsString, callbackContext);
- }
- else
- {
- uri = resourceApi.remapUri(Uri.parse(obj.getString("url")));
- }
- }
-
- JSONObject extras = obj.has("extras") ? obj.getJSONObject("extras") : null;
- Map<String, Object> extrasMap = new HashMap<String, Object>();
- Bundle bundle = null;
- String bundleKey = "";
- if (extras != null) {
- JSONArray extraNames = extras.names();
- for (int i = 0; i < extraNames.length(); i++) {
- String key = extraNames.getString(i);
- Object extrasObj = extras.get(key);
- if (extrasObj instanceof JSONObject) {
- // The extra is a bundle
- bundleKey = key;
- bundle = toBundle((JSONObject) extras.get(key));
- } else {
- extrasMap.put(key, extras.get(key));
- }
- }
- }
-
- String action = obj.has("action") ? obj.getString("action") : null;
- Intent i = new Intent();
- if (action != null)
- i.setAction(action);
-
- if (type != null && uri != null) {
- i.setDataAndType(uri, type); //Fix the crash problem with android 2.3.6
- } else {
- if (type != null) {
- i.setType(type);
- }
- if (uri != null)
- {
- i.setData(uri);
- }
- }
-
- JSONObject component = obj.has("component") ? obj.getJSONObject("component") : null;
- if (component != null)
- {
- // User has specified an explicit intent
- String componentPackage = component.has("package") ? component.getString("package") : null;
- String componentClass = component.has("class") ? component.getString("class") : null;
- if (componentPackage == null || componentClass == null)
- {
- Log.w(LOG_TAG, "Component specified but missing corresponding package or class");
- throw new JSONException("Component specified but missing corresponding package or class");
- }
-
- else
- {
- ComponentName componentName = new ComponentName(componentPackage, componentClass);
- i.setComponent(componentName);
- }
- }
-
- if (packageAssociated != null)
- i.setPackage(packageAssociated);
-
- JSONArray flags = obj.has("flags") ? obj.getJSONArray("flags") : null;
- if (flags != null)
- {
- int length = flags.length();
- for (int k = 0; k < length; k++)
- {
- i.addFlags(flags.getInt(k));
- }
- }
-
- if (bundle != null)
- i.putExtra(bundleKey, bundle);
-
- for (String key : extrasMap.keySet()) {
- Object value = extrasMap.get(key);
- String valueStr = String.valueOf(value);
- // If type is text html, the extra text must sent as HTML
- if (key.equals(Intent.EXTRA_TEXT) && type.equals("text/html")) {
- i.putExtra(key, Html.fromHtml(valueStr));
- } else if (key.equals(Intent.EXTRA_STREAM)) {
- // allows sharing of images as attachments.
- // value in this case should be a URI of a file
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && valueStr.startsWith("file://"))
- {
- Uri uriOfStream = remapUriWithFileProvider(valueStr, callbackContext);
- if (uriOfStream != null)
- i.putExtra(key, uriOfStream);
- }
- else
- {
- //final CordovaResourceApi resourceApi = webView.getResourceApi();
- i.putExtra(key, resourceApi.remapUri(Uri.parse(valueStr)));
- }
- } else if (key.equals(Intent.EXTRA_EMAIL)) {
- // allows to add the email address of the receiver
- i.putExtra(Intent.EXTRA_EMAIL, new String[] { valueStr });
- } else if (key.equals(Intent.EXTRA_KEY_EVENT)) {
- // allows to add a key event object
- JSONObject keyEventJson = new JSONObject(valueStr);
- int keyAction = keyEventJson.getInt("action");
- int keyCode = keyEventJson.getInt("code");
- KeyEvent keyEvent = new KeyEvent(keyAction, keyCode);
- i.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
- } else {
- if (value instanceof Boolean) {
- i.putExtra(key, Boolean.valueOf(valueStr));
- } else if(value instanceof Integer) {
- i.putExtra(key, Integer.valueOf(valueStr));
- } else if(value instanceof Long) {
- i.putExtra(key, Long.valueOf(valueStr));
- } else if(value instanceof Double) {
- i.putExtra(key, Double.valueOf(valueStr));
- } else {
- i.putExtra(key, valueStr);
- }
- }
- }
-
- i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
-
- if (obj.has("chooser")) {
- i = Intent.createChooser(i, obj.getString("chooser"));
- }
-
- return i;
- }
-
- @Override
- public void onNewIntent(Intent intent) {
- if (this.onNewIntentCallbackContext != null) {
- fireOnNewIntent(intent);
- }
- else {
- // save the intent for use when onIntent action is called in the execute method
- this.deferredIntent = intent;
- }
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent intent)
- {
- super.onActivityResult(requestCode, resultCode, intent);
- if (onActivityResultCallbackContext != null && intent != null)
- {
- intent.putExtra("requestCode", requestCode);
- intent.putExtra("resultCode", resultCode);
- PluginResult result = new PluginResult(PluginResult.Status.OK, getIntentJson(intent));
- result.setKeepCallback(true);
- onActivityResultCallbackContext.sendPluginResult(result);
- }
- else if (onActivityResultCallbackContext != null)
- {
- Intent canceledIntent = new Intent();
- canceledIntent.putExtra("requestCode", requestCode);
- canceledIntent.putExtra("resultCode", resultCode);
- PluginResult canceledResult = new PluginResult(PluginResult.Status.OK, getIntentJson(canceledIntent));
- canceledResult.setKeepCallback(true);
- onActivityResultCallbackContext.sendPluginResult(canceledResult);
- }
-
- }
-
- private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- if (onBroadcastCallbackContext != null)
- {
- PluginResult result = new PluginResult(PluginResult.Status.OK, getIntentJson(intent));
- result.setKeepCallback(true);
- onBroadcastCallbackContext.sendPluginResult(result);
- }
- }
- };
-
- /**
- * Sends the provided Intent to the onNewIntentCallbackContext.
- *
- * @param intent This is the intent to send to the JS layer.
- */
- private void fireOnNewIntent(Intent intent) {
- PluginResult result = new PluginResult(PluginResult.Status.OK, getIntentJson(intent));
- result.setKeepCallback(true);
- this.onNewIntentCallbackContext.sendPluginResult(result);
- }
-
- /**
- * Return JSON representation of intent attributes
- *
- * @param intent
- * Credit: https://github.com/napolitano/cordova-plugin-intent
- */
- private JSONObject getIntentJson(Intent intent) {
- JSONObject intentJSON = null;
- ClipData clipData = null;
- JSONObject[] items = null;
- ContentResolver cR = this.cordova.getActivity().getApplicationContext().getContentResolver();
- MimeTypeMap mime = MimeTypeMap.getSingleton();
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- clipData = intent.getClipData();
- if(clipData != null) {
- int clipItemCount = clipData.getItemCount();
- items = new JSONObject[clipItemCount];
-
- for (int i = 0; i < clipItemCount; i++) {
-
- ClipData.Item item = clipData.getItemAt(i);
-
- try {
- items[i] = new JSONObject();
- items[i].put("htmlText", item.getHtmlText());
- items[i].put("intent", item.getIntent());
- items[i].put("text", item.getText());
- items[i].put("uri", item.getUri());
-
- if (item.getUri() != null) {
- String type = cR.getType(item.getUri());
- String extension = mime.getExtensionFromMimeType(cR.getType(item.getUri()));
-
- items[i].put("type", type);
- items[i].put("extension", extension);
- }
-
- } catch (JSONException e) {
- Log.d(LOG_TAG, " Error thrown during intent > JSON conversion");
- Log.d(LOG_TAG, e.getMessage());
- Log.d(LOG_TAG, Arrays.toString(e.getStackTrace()));
- }
-
- }
- }
- }
-
- try {
- intentJSON = new JSONObject();
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- if(items != null) {
- intentJSON.put("clipItems", new JSONArray(items));
- }
- }
-
- intentJSON.put("type", intent.getType());
- intentJSON.put("extras", toJsonObject(intent.getExtras()));
- intentJSON.put("action", intent.getAction());
- intentJSON.put("categories", intent.getCategories());
- intentJSON.put("flags", intent.getFlags());
- intentJSON.put("component", intent.getComponent());
- intentJSON.put("data", intent.getData());
- intentJSON.put("package", intent.getPackage());
-
- return intentJSON;
- } catch (JSONException e) {
- Log.d(LOG_TAG, " Error thrown during intent > JSON conversion");
- Log.d(LOG_TAG, e.getMessage());
- Log.d(LOG_TAG, Arrays.toString(e.getStackTrace()));
-
- return null;
- }
- }
-
- private static JSONObject toJsonObject(Bundle bundle) {
- // Credit: https://github.com/napolitano/cordova-plugin-intent
- try {
- return (JSONObject) toJsonValue(bundle);
- } catch (JSONException e) {
- throw new IllegalArgumentException("Cannot convert bundle to JSON: " + e.getMessage(), e);
- }
- }
-
- private static Object toJsonValue(final Object value) throws JSONException {
- // Credit: https://github.com/napolitano/cordova-plugin-intent
- if (value == null) {
- return null;
- } else if (value instanceof Bundle) {
- final Bundle bundle = (Bundle) value;
- final JSONObject result = new JSONObject();
- for (final String key : bundle.keySet()) {
- result.put(key, toJsonValue(bundle.get(key)));
- }
- return result;
- } else if ((value.getClass().isArray())) {
- final JSONArray result = new JSONArray();
- int length = Array.getLength(value);
- for (int i = 0; i < length; ++i) {
- result.put(i, toJsonValue(Array.get(value, i)));
- }
- return result;
- }
- else if (value instanceof ArrayList<?>) {
- final ArrayList arrayList = (ArrayList<?>)value;
- final JSONArray result = new JSONArray();
- for (int i = 0; i < arrayList.size(); i++)
- result.put(toJsonValue(arrayList.get(i)));
- return result;
- }
- else if (
- value instanceof String
- || value instanceof Boolean
- || value instanceof Integer
- || value instanceof Long
- || value instanceof Double) {
- return value;
- } else {
- return String.valueOf(value);
- }
- }
-
- private Bundle toBundle(final JSONObject obj) {
- Bundle returnBundle = new Bundle();
- if (obj == null) {
- return null;
- }
- try {
- Iterator<?> keys = obj.keys();
- while(keys.hasNext())
- {
- String key = (String)keys.next();
- Object compare = obj.get(key);
- if (obj.get(key) instanceof String)
- returnBundle.putString(key, obj.getString(key));
- else if (obj.get(key) instanceof Boolean)
- returnBundle.putBoolean(key, obj.getBoolean(key));
- else if (obj.get(key) instanceof Integer)
- returnBundle.putInt(key, obj.getInt(key));
- else if (obj.get(key) instanceof Long)
- returnBundle.putLong(key, obj.getLong(key));
- else if (obj.get(key) instanceof Double)
- returnBundle.putDouble(key, obj.getDouble(key));
- else if (obj.get(key).getClass().isArray() || obj.get(key) instanceof JSONArray)
- {
- JSONArray jsonArray = obj.getJSONArray(key);
- int length = jsonArray.length();
- if (jsonArray.get(0) instanceof String)
- {
- String[] stringArray = new String[length];
- for (int j = 0; j < length; j++)
- stringArray[j] = jsonArray.getString(j);
- returnBundle.putStringArray(key, stringArray);
- //returnBundle.putParcelableArray(key, obj.get);
- }
- else
- {
- if (key.equals("PLUGIN_CONFIG")) {
- ArrayList<Bundle> bundleArray = new ArrayList<Bundle>();
- for (int k = 0; k < length; k++) {
- bundleArray.add(toBundle(jsonArray.getJSONObject(k)));
- }
- returnBundle.putParcelableArrayList(key, bundleArray);
- } else {
- Bundle[] bundleArray = new Bundle[length];
- for (int k = 0; k < length; k++)
- bundleArray[k] = toBundle(jsonArray.getJSONObject(k));
- returnBundle.putParcelableArray(key, bundleArray);
- }
- }
- }
- else if (obj.get(key) instanceof JSONObject)
- returnBundle.putBundle(key, toBundle((JSONObject)obj.get(key)));
- }
- }
- catch (JSONException e) {
- e.printStackTrace();
- }
-
-
- return returnBundle;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/com/ourcodeworld/plugin/DialogShowPicker.java b/cordova/platforms/android/app/src/main/java/com/ourcodeworld/plugin/DialogShowPicker.java
deleted file mode 100644
index d315dadfc..000000000
--- a/cordova/platforms/android/app/src/main/java/com/ourcodeworld/plugin/DialogShowPicker.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package com.ourcodeworld.plugins.filebrowser;
-
-import android.app.Activity;
-import android.content.ClipData;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.storage.StorageManager;
-import android.os.storage.StorageVolume;
-import android.provider.DocumentsContract;
-
-import org.json.JSONArray;
-
-import java.io.File;
-import java.util.List;
-
-public class DialogShowPicker extends Activity {
- static final int FILE_CODE = 1;
- private boolean firstTime = true;
-
- @Override
- public void onStart() {
- super.onStart();
-
- if (firstTime) {
- Bundle extras = getIntent().getExtras();
- String action = extras.getString("action");
-
- Intent i;
-
- if (action.equals("showFolderpicker") || action.equals("showMultiFolderpicker")) {
- i = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
- i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
- } else if (action.equals("showCreatefile")) {
- i = new Intent(Intent.ACTION_CREATE_DOCUMENT);
- i.addCategory(Intent.CATEGORY_OPENABLE);
- i.setType("*/*");
- i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
- } else {
- // showPicker, showMultiFilepicker, showMixedPicker
- i = new Intent(Intent.ACTION_GET_CONTENT);
- i.addCategory(Intent.CATEGORY_OPENABLE);
- i.setType("*/*");
- i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- if (action.equals("showMultiFilepicker") || action.equals("showMixedPicker")) {
- i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
- }
- }
-
- startActivityForResult(i, FILE_CODE);
- }
- }
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- firstTime = false;
- JSONArray jsonArray = new JSONArray();
-
- if (requestCode == FILE_CODE && resultCode == Activity.RESULT_OK && data != null) {
- if (data.getClipData() != null) {
- ClipData clip = data.getClipData();
- for (int i = 0; i < clip.getItemCount(); i++) {
- jsonArray.put(uriToPath(clip.getItemAt(i).getUri()));
- }
- } else if (data.getData() != null) {
- jsonArray.put(uriToPath(data.getData()));
- }
- }
-
- Intent intent = new Intent();
- intent.putExtra("information", jsonArray.toString());
- intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- setResult(Activity.RESULT_OK, intent);
- finish();
- }
-
- /**
- * Converts a SAF content URI back to a plain file system path where possible.
- */
- private String uriToPath(Uri uri) {
- if (uri == null) return "";
-
- if ("file".equals(uri.getScheme())) {
- return uri.getPath();
- }
-
- if ("content".equals(uri.getScheme())
- && "com.android.externalstorage.documents".equals(uri.getAuthority())) {
- String docId = uri.getPathSegments().contains("tree")
- ? DocumentsContract.getTreeDocumentId(uri)
- : DocumentsContract.getDocumentId(uri);
- return docIdToPath(docId);
- }
-
- return uri.toString();
- }
-
- /**
- * Converts a document ID like "primary:Pictures" or "XXXX-XXXX:folder" to an absolute path.
- * Uses StorageManager to resolve the actual mount point of removable volumes.
- */
- private String docIdToPath(String docId) {
- if (docId == null) return "";
- String[] parts = docId.split(":", 2);
- if (parts.length < 2) return docId;
-
- String storageType = parts[0];
- String relativePath = parts[1];
-
- if ("primary".equalsIgnoreCase(storageType)) {
- String root = Environment.getExternalStorageDirectory().getAbsolutePath();
- return relativePath.isEmpty() ? root : root + "/" + relativePath;
- }
-
- // Removable storage (SD card, USB stick) — resolve via StorageManager
- String mountPath = resolveRemovableVolume(storageType);
- return relativePath.isEmpty() ? mountPath : mountPath + "/" + relativePath;
- }
-
- /**
- * Finds the actual mount path for a removable volume by its UUID/ID.
- */
- private String resolveRemovableVolume(String volumeId) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- StorageManager sm = (StorageManager) getSystemService(STORAGE_SERVICE);
- if (sm != null) {
- List<StorageVolume> volumes = sm.getStorageVolumes();
- for (StorageVolume vol : volumes) {
- String uuid = vol.getUuid();
- if (volumeId.equalsIgnoreCase(uuid)) {
- // API 30+: getDirectory() — use reflection to avoid compile-time dependency
- try {
- java.lang.reflect.Method getDirectory = vol.getClass().getMethod("getDirectory");
- Object dir = getDirectory.invoke(vol);
- if (dir instanceof File) return ((File) dir).getAbsolutePath();
- } catch (Exception ignored) {}
- // API 24-29: getPath() hidden but reliable
- try {
- java.lang.reflect.Method getPath = vol.getClass().getMethod("getPath");
- Object path = getPath.invoke(vol);
- if (path != null) return path.toString();
- } catch (Exception ignored) {}
- // Last resort: standard mount point convention
- return "/storage/" + volumeId;
- }
- }
- }
- }
- return "/storage/" + volumeId;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/com/ourcodeworld/plugin/Filebrowser.java b/cordova/platforms/android/app/src/main/java/com/ourcodeworld/plugin/Filebrowser.java
deleted file mode 100644
index 8b2df5c6b..000000000
--- a/cordova/platforms/android/app/src/main/java/com/ourcodeworld/plugin/Filebrowser.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.ourcodeworld.plugins.filebrowser;
-
-import org.apache.cordova.*;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.json.JSONException;
-import android.content.Intent;
-import android.content.ActivityNotFoundException;
-
-import android.os.Bundle;
-
-public class Filebrowser extends CordovaPlugin {
- private CallbackContext PUBLIC_CALLBACKS = null;
-
- @Override
- public boolean execute(String action, JSONArray data, CallbackContext callbackContext) throws JSONException {
- PUBLIC_CALLBACKS = callbackContext;
- final JSONObject arg_object = data.getJSONObject(0);
- String startDirectory = arg_object.getString("start_directory");
-
- try {
- Intent intent = new Intent("com.ourcodeworld.plugins.filebrowser.DialogShowPicker");
- intent.putExtra("action", action);
- intent.putExtra("start_directory", startDirectory);
- intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- cordova.startActivityForResult((CordovaPlugin) this, intent, 0);
- } catch (ActivityNotFoundException e) {
- PluginResult errorResults = new PluginResult(PluginResult.Status.ERROR, "Cannot find activity com.ourcodeworld.plugins.filebrowser.DialogShowPicker");
- errorResults.setKeepCallback(true);
- PUBLIC_CALLBACKS.sendPluginResult(errorResults);
- }
-
- PluginResult pluginResult = new PluginResult(PluginResult.Status.NO_RESULT);
- pluginResult.setKeepCallback(true);
-
- return true;
- }
-
- @Override
- public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
- if(resultCode == cordova.getActivity().RESULT_OK){
- Bundle extras = data.getExtras();
- String resultData = extras.getString("information");
-
- PluginResult resultado = new PluginResult(PluginResult.Status.OK, resultData);
- resultado.setKeepCallback(true);
- PUBLIC_CALLBACKS.sendPluginResult(resultado);
- return;
- }
-
- super.onActivityResult(requestCode, resultCode, data);
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/com/whebcraft/android/plugin/Downloader.java b/cordova/platforms/android/app/src/main/java/com/whebcraft/android/plugin/Downloader.java
deleted file mode 100644
index 0a32301a2..000000000
--- a/cordova/platforms/android/app/src/main/java/com/whebcraft/android/plugin/Downloader.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package com.whebcraft.android.plugin;
-
-import android.app.Activity;
-import android.app.DownloadManager;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.database.Cursor;
-import android.net.Uri;
-import java.io.File;
-import android.os.Environment;
-import android.preference.PreferenceManager;
-import android.util.Log;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.json.JSONObject;
-import org.json.JSONArray;
-import org.json.JSONException;
-import java.util.HashMap;
-
-public class Downloader extends CordovaPlugin {
-
- public static final String ACTION_DOWNLOAD = "download";
-
- private static final String TAG = "DownloaderPlugin";
-
- private Activity cordovaActivity;
- private DownloadManager downloadManager;
- private HashMap<Long, Download> downloadMap;
-
- @Override
- protected void pluginInitialize()
- {
- Log.d(TAG, "PluginInitialize");
-
- cordovaActivity = this.cordova.getActivity();
-
- downloadManager = (DownloadManager) cordovaActivity.getSystemService(Context.DOWNLOAD_SERVICE);
- downloadMap = new HashMap();
-
- // Register receiver for Notification actions
- cordovaActivity.registerReceiver(downloadReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
- }
-
- @Override
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
-
- Log.d(TAG, "CordovaPlugin: execute " + action);
-
- if (ACTION_DOWNLOAD.equals(action)) {
-
- Log.d(TAG, "CordovaPlugin: load " + action);
- return download(args, callbackContext);
-
- }
-
- return false;
-
-
- }
-
- private boolean download(JSONArray args, CallbackContext callbackContext)
- {
- Log.d(TAG, "CordovaPlugin: " + ACTION_DOWNLOAD);
-
- try {
-
- JSONObject arg_object = args.getJSONObject(0);
- String path = arg_object.getString("path");
- String title = arg_object.getString("title");
- String folder = arg_object.getString("folder");
- String description = arg_object.getString("description");
-
-
- File direct = new File(Environment.getExternalStorageDirectory()+ "/"+folder);
-
- if (!direct.exists()) {
- direct.mkdirs();
- }
-
- File delExisingFile = new File(Environment.getExternalStorageDirectory()+ "/"+folder+"/"+path);
- delExisingFile.delete();
-
- Boolean visible = Boolean.valueOf(arg_object.getString("visible"));
-
- Uri uri = Uri.parse(arg_object.getString("url"));
- Download mDownload = new Download(path, folder, callbackContext);
-
- DownloadManager.Request request = new DownloadManager.Request(uri);
- // Restrict the types of networks over which this download may proceed.
- request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE);
- // Set whether this download may proceed over a roaming connection.
- request.setAllowedOverRoaming(true);
- // Set the title of this download, to be displayed in notifications (if enabled).
- request.setTitle(title);
- // Set a description of this download, to be displayed in notifications (if enabled)
- request.setDescription(description);
- // This download doesn't show in the UI or in the notifications.
- if(!visible){
- request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);
- } else {
- // This download is visible and shows in the notifications while in progress and after completion.
- request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
- }
- // Set the destination for the downloaded as defined by the user within the device files directory
- // https://stackoverflow.com/a/60598059/2285631
- // request.setDestinationInExternalPublicDir("/"+folder, path);
- request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, path);
-
- // save the download
- downloadMap.put(downloadManager.enqueue(request), mDownload);
-
- return true;
-
- } catch (Exception e) {
-
- System.err.println("Exception: " + e.getMessage());
- callbackContext.error(e.getMessage());
-
- return false;
- }
- }
-
- private BroadcastReceiver downloadReceiver = new BroadcastReceiver() {
-
- @Override
- public void onReceive(Context context, Intent intent) {
-
- DownloadManager.Query query = new DownloadManager.Query();
- Long downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, 0);
- query.setFilterById(downloadId);
- Cursor cursor = downloadManager.query(query);
-
- if (cursor.moveToFirst()){
-
- //Retrieve the saved download
- Download currentDownload = downloadMap.get(downloadId);
- downloadMap.remove(currentDownload);
-
- int columnIndex = cursor.getColumnIndex(DownloadManager.COLUMN_STATUS);
- int status = cursor.getInt(columnIndex);
- int columnReason = cursor.getColumnIndex(DownloadManager.COLUMN_REASON);
- int reason = cursor.getInt(columnReason);
-
- switch (status) {
- case DownloadManager.STATUS_SUCCESSFUL:
- try {
- JSONObject entry = new JSONObject();
- entry.put("path", "file:///storage/sdcard0/"+currentDownload.folder+"/"+currentDownload.path);
- entry.put("file", currentDownload.path);
- entry.put("folder", currentDownload.folder);
- currentDownload.callbackContext.success(entry);
- } catch (Exception e) {
- System.err.println("Exception: " + e.getMessage());
- currentDownload.callbackContext.error(e.getMessage());
- }
- break;
- case DownloadManager.STATUS_FAILED:
- currentDownload.callbackContext.error(reason);
- break;
- case DownloadManager.STATUS_PAUSED:
- case DownloadManager.STATUS_PENDING:
- case DownloadManager.STATUS_RUNNING:
- default:
- break;
- }
- }
- }
-
- };
-
- private class Download {
- public String path;
- public String folder;
- public CallbackContext callbackContext;
-
- public Download(String path, String folder, CallbackContext callbackContext) {
- this.path = path;
- this.folder = folder;
- this.callbackContext = callbackContext;
- }
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/BackgroundMode.java b/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/BackgroundMode.java
deleted file mode 100644
index 3ccb5cd14..000000000
--- a/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/BackgroundMode.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- Copyright 2013 Sebastián Katzer
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package de.appplant.cordova.plugin.background;
-
-import android.app.Activity;
-import android.content.ComponentName;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.os.IBinder;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-import de.appplant.cordova.plugin.background.ForegroundService.ForegroundBinder;
-
-import static android.content.Context.BIND_AUTO_CREATE;
-import static de.appplant.cordova.plugin.background.BackgroundModeExt.clearKeyguardFlags;
-
-public class BackgroundMode extends CordovaPlugin {
-
- // Event types for callbacks
- private enum Event { ACTIVATE, DEACTIVATE, FAILURE }
-
- // Plugin namespace
- private static final String JS_NAMESPACE = "cordova.plugins.backgroundMode";
-
- // Flag indicates if the app is in background or foreground
- private boolean inBackground = false;
-
- // Flag indicates if the plugin is enabled or disabled
- private boolean isDisabled = true;
-
- // Flag indicates if the service is bind
- private boolean isBind = false;
-
- // Default settings for the notification
- private static JSONObject defaultSettings = new JSONObject();
-
- // Service that keeps the app awake
- private ForegroundService service;
-
- // Used to (un)bind the service to with the activity
- private final ServiceConnection connection = new ServiceConnection()
- {
- @Override
- public void onServiceConnected (ComponentName name, IBinder service)
- {
- ForegroundBinder binder = (ForegroundBinder) service;
- BackgroundMode.this.service = binder.getService();
- }
-
- @Override
- public void onServiceDisconnected (ComponentName name)
- {
- fireEvent(Event.FAILURE, "'service disconnected'");
- }
- };
-
- /**
- * Executes the request.
- *
- * @param action The action to execute.
- * @param args The exec() arguments.
- * @param callback The callback context used when
- * calling back into JavaScript.
- *
- * @return Returning false results in a "MethodNotFound" error.
- */
- @Override
- public boolean execute (String action, JSONArray args,
- CallbackContext callback)
- {
- boolean validAction = true;
-
- switch (action)
- {
- case "configure":
- configure(args.optJSONObject(0), args.optBoolean(1));
- break;
- case "enable":
- enableMode();
- break;
- case "disable":
- disableMode();
- break;
- default:
- validAction = false;
- }
-
- if (validAction) {
- callback.success();
- } else {
- callback.error("Invalid action: " + action);
- }
-
- return validAction;
- }
-
- /**
- * Called when the system is about to start resuming a previous activity.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app.
- */
- @Override
- public void onPause(boolean multitasking)
- {
- try {
- inBackground = true;
- startService();
- } finally {
- clearKeyguardFlags(cordova.getActivity());
- }
- }
-
- /**
- * Called when the activity is no longer visible to the user.
- */
- @Override
- public void onStop () {
- clearKeyguardFlags(cordova.getActivity());
- }
-
- /**
- * Called when the activity will start interacting with the user.
- *
- * @param multitasking Flag indicating if multitasking is turned on for app.
- */
- @Override
- public void onResume (boolean multitasking)
- {
- inBackground = false;
- stopService();
- }
-
- /**
- * Called when the activity will be destroyed.
- */
- @Override
- public void onDestroy()
- {
- stopService();
- android.os.Process.killProcess(android.os.Process.myPid());
- }
-
- /**
- * Enable the background mode.
- */
- private void enableMode()
- {
- isDisabled = false;
-
- if (inBackground) {
- startService();
- }
- }
-
- /**
- * Disable the background mode.
- */
- private void disableMode()
- {
- stopService();
- isDisabled = true;
- }
-
- /**
- * Update the default settings and configure the notification.
- *
- * @param settings The settings
- * @param update A truthy value means to update the running service.
- */
- private void configure(JSONObject settings, boolean update)
- {
- if (update) {
- updateNotification(settings);
- } else {
- setDefaultSettings(settings);
- }
- }
-
- /**
- * Update the default settings for the notification.
- *
- * @param settings The new default settings
- */
- private void setDefaultSettings(JSONObject settings)
- {
- defaultSettings = settings;
- }
-
- /**
- * Returns the settings for the new/updated notification.
- */
- static JSONObject getSettings () {
- return defaultSettings;
- }
-
- /**
- * Update the notification.
- *
- * @param settings The config settings
- */
- private void updateNotification(JSONObject settings)
- {
- if (isBind) {
- service.updateNotification(settings);
- }
- }
-
- /**
- * Bind the activity to a background service and put them into foreground
- * state.
- */
- private void startService()
- {
- Activity context = cordova.getActivity();
-
- if (isDisabled || isBind)
- return;
-
- Intent intent = new Intent(context, ForegroundService.class);
-
- try {
- context.bindService(intent, connection, BIND_AUTO_CREATE);
- fireEvent(Event.ACTIVATE, null);
- context.startService(intent);
- } catch (Exception e) {
- fireEvent(Event.FAILURE, String.format("'%s'", e.getMessage()));
- }
-
- isBind = true;
- }
-
- /**
- * Bind the activity to a background service and put them into foreground
- * state.
- */
- private void stopService()
- {
- Activity context = cordova.getActivity();
- Intent intent = new Intent(context, ForegroundService.class);
-
- if (!isBind) return;
-
- fireEvent(Event.DEACTIVATE, null);
- context.unbindService(connection);
- context.stopService(intent);
-
- isBind = false;
- }
-
- /**
- * Fire vent with some parameters inside the web view.
- *
- * @param event The name of the event
- * @param params Optional arguments for the event
- */
- private void fireEvent (Event event, String params)
- {
- String eventName = event.name().toLowerCase();
- Boolean active = event == Event.ACTIVATE;
-
- String str = String.format("%s._setActive(%b)",
- JS_NAMESPACE, active);
-
- str = String.format("%s;%s.on('%s', %s)",
- str, JS_NAMESPACE, eventName, params);
-
- str = String.format("%s;%s.fireEvent('%s',%s);",
- str, JS_NAMESPACE, eventName, params);
-
- final String js = str;
-
- cordova.getActivity().runOnUiThread(() -> webView.loadUrl("javascript:" + js));
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/BackgroundModeExt.java b/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/BackgroundModeExt.java
deleted file mode 100644
index ed7659849..000000000
--- a/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/BackgroundModeExt.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- Copyright 2013 Sebastián Katzer
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package de.appplant.cordova.plugin.background;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.app.ActivityManager;
-import android.app.ActivityManager.AppTask;
-import android.app.AlertDialog;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.PowerManager;
-import android.view.View;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.PluginResult;
-import org.apache.cordova.PluginResult.Status;
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static android.R.string.cancel;
-import static android.R.string.ok;
-import static android.R.style.Theme_DeviceDefault_Light_Dialog;
-import static android.content.Context.ACTIVITY_SERVICE;
-import static android.content.Context.POWER_SERVICE;
-import static android.content.pm.PackageManager.MATCH_DEFAULT_ONLY;
-import static android.os.Build.VERSION.SDK_INT;
-import static android.os.Build.VERSION_CODES.M;
-import static android.provider.Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS;
-import static android.view.WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON;
-import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
-import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
-import static android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
-
-/**
- * Implements extended functions around the main purpose
- * of infinite execution in the background.
- */
-public class BackgroundModeExt extends CordovaPlugin {
-
- // To keep the device awake
- private PowerManager.WakeLock wakeLock;
-
- /**
- * Executes the request.
- *
- * @param action The action to execute.
- * @param args The exec() arguments.
- * @param callback The callback context used when
- * calling back into JavaScript.
- *
- * @return Returning false results in a "MethodNotFound" error.
- */
- @Override
- public boolean execute (String action, JSONArray args,
- CallbackContext callback)
- {
- boolean validAction = true;
-
- switch (action)
- {
- case "battery":
- disableBatteryOptimizations();
- break;
- case "webview":
- disableWebViewOptimizations();
- break;
- case "appstart":
- openAppStart(args.opt(0));
- break;
- case "background":
- moveToBackground();
- break;
- case "foreground":
- moveToForeground();
- break;
- case "tasklist":
- excludeFromTaskList();
- break;
- case "dimmed":
- isDimmed(callback);
- break;
- case "wakeup":
- wakeup();
- break;
- case "unlock":
- wakeup();
- unlock();
- break;
- default:
- validAction = false;
- }
-
- if (validAction) {
- callback.success();
- } else {
- callback.error("Invalid action: " + action);
- }
-
- return validAction;
- }
-
- /**
- * Moves the app to the background.
- */
- private void moveToBackground()
- {
- Intent intent = new Intent(Intent.ACTION_MAIN);
-
- intent.addCategory(Intent.CATEGORY_HOME);
-
- getApp().startActivity(intent);
- }
-
- /**
- * Moves the app to the foreground.
- */
- private void moveToForeground()
- {
- Activity app = getApp();
- Intent intent = getLaunchIntent();
-
- intent.addFlags(
- Intent.FLAG_ACTIVITY_REORDER_TO_FRONT |
- Intent.FLAG_ACTIVITY_SINGLE_TOP |
- Intent.FLAG_ACTIVITY_CLEAR_TOP);
-
- clearScreenAndKeyguardFlags();
- app.startActivity(intent);
- }
-
- /**
- * Enable GPS position tracking while in background.
- */
- private void disableWebViewOptimizations() {
- Thread thread = new Thread(){
- public void run() {
- try {
- Thread.sleep(1000);
- getApp().runOnUiThread(() -> {
- View view = webView.getEngine().getView();
-
- try {
- Class.forName("org.crosswalk.engine.XWalkCordovaView")
- .getMethod("onShow")
- .invoke(view);
- } catch (Exception e){
- view.dispatchWindowVisibilityChanged(View.VISIBLE);
- }
- });
- } catch (InterruptedException e) {
- // do nothing
- }
- }
- };
-
- thread.start();
- }
-
- /**
- * Disables battery optimizations for the app.
- * Requires permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS to function.
- */
- @SuppressLint("BatteryLife")
- private void disableBatteryOptimizations()
- {
- Activity activity = cordova.getActivity();
- Intent intent = new Intent();
- String pkgName = activity.getPackageName();
- PowerManager pm = (PowerManager)getService(POWER_SERVICE);
-
- if (SDK_INT < M)
- return;
-
- if (pm.isIgnoringBatteryOptimizations(pkgName))
- return;
-
- intent.setAction(ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
- intent.setData(Uri.parse("package:" + pkgName));
-
- cordova.getActivity().startActivity(intent);
- }
-
- /**
- * Opens the system settings dialog where the user can tweak or turn off any
- * custom app start settings added by the manufacturer if available.
- *
- * @param arg Text and title for the dialog or false to skip the dialog.
- */
- private void openAppStart (Object arg)
- {
- Activity activity = cordova.getActivity();
- PackageManager pm = activity.getPackageManager();
-
- for (Intent intent : getAppStartIntents())
- {
- if (pm.resolveActivity(intent, MATCH_DEFAULT_ONLY) != null)
- {
- JSONObject spec = (arg instanceof JSONObject) ? (JSONObject) arg : null;
-
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- if (arg instanceof Boolean && !((Boolean) arg))
- {
- activity.startActivity(intent);
- break;
- }
-
- AlertDialog.Builder dialog = new AlertDialog.Builder(activity, Theme_DeviceDefault_Light_Dialog);
-
- dialog.setPositiveButton(ok, (o, d) -> activity.startActivity(intent));
- dialog.setNegativeButton(cancel, (o, d) -> {});
- dialog.setCancelable(true);
-
- if (spec != null && spec.has("title"))
- {
- dialog.setTitle(spec.optString("title"));
- }
-
- if (spec != null && spec.has("text"))
- {
- dialog.setMessage(spec.optString("text"));
- }
- else
- {
- dialog.setMessage("missing text");
- }
-
- activity.runOnUiThread(dialog::show);
-
- break;
- }
- }
- }
-
- /**
- * Excludes the app from the recent tasks list.
- */
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
- private void excludeFromTaskList()
- {
- ActivityManager am = (ActivityManager) getService(ACTIVITY_SERVICE);
-
- if (am == null || SDK_INT < 21)
- return;
-
- List<AppTask> tasks = am.getAppTasks();
-
- if (tasks == null || tasks.isEmpty())
- return;
-
- tasks.get(0).setExcludeFromRecents(true);
- }
-
- /**
- * Invokes the callback with information if the screen is on.
- *
- * @param callback The callback to invoke.
- */
- @SuppressWarnings("deprecation")
- private void isDimmed (CallbackContext callback)
- {
- boolean status = isDimmed();
- PluginResult res = new PluginResult(Status.OK, status);
-
- callback.sendPluginResult(res);
- }
-
- /**
- * Returns if the screen is active.
- */
- @SuppressWarnings("deprecation")
- private boolean isDimmed()
- {
- PowerManager pm = (PowerManager) getService(POWER_SERVICE);
-
- if (SDK_INT < 20)
- {
- return !pm.isScreenOn();
- }
-
- return !pm.isInteractive();
- }
-
- /**
- * Wakes up the device if the screen isn't still on.
- */
- private void wakeup()
- {
- try {
- acquireWakeLock();
- } catch (Exception e) {
- releaseWakeLock();
- }
- }
-
- /**
- * Unlocks the device even with password protection.
- */
- private void unlock()
- {
- addSreenAndKeyguardFlags();
- getApp().startActivity(getLaunchIntent());
- }
-
- /**
- * Acquires a wake lock to wake up the device.
- */
- @SuppressWarnings("deprecation")
- private void acquireWakeLock()
- {
- PowerManager pm = (PowerManager) getService(POWER_SERVICE);
-
- releaseWakeLock();
-
- if (!isDimmed())
- return;
-
- int level = PowerManager.SCREEN_DIM_WAKE_LOCK |
- PowerManager.ACQUIRE_CAUSES_WAKEUP;
-
- wakeLock = pm.newWakeLock(level, "backgroundmode:wakelock");
- wakeLock.setReferenceCounted(false);
- wakeLock.acquire(1000);
- }
-
- /**
- * Releases the previously acquire wake lock.
- */
- private void releaseWakeLock()
- {
- if (wakeLock != null && wakeLock.isHeld()) {
- wakeLock.release();
- wakeLock = null;
- }
- }
-
- /**
- * Adds required flags to the window to unlock/wakeup the device.
- */
- private void addSreenAndKeyguardFlags()
- {
- getApp().runOnUiThread(() -> getApp().getWindow().addFlags(FLAG_ALLOW_LOCK_WHILE_SCREEN_ON | FLAG_SHOW_WHEN_LOCKED | FLAG_TURN_SCREEN_ON | FLAG_DISMISS_KEYGUARD));
- }
-
- /**
- * Clears required flags to the window to unlock/wakeup the device.
- */
- private void clearScreenAndKeyguardFlags()
- {
- getApp().runOnUiThread(() -> getApp().getWindow().clearFlags(FLAG_ALLOW_LOCK_WHILE_SCREEN_ON | FLAG_SHOW_WHEN_LOCKED | FLAG_TURN_SCREEN_ON | FLAG_DISMISS_KEYGUARD));
- }
-
- /**
- * Removes required flags to the window to unlock/wakeup the device.
- */
- static void clearKeyguardFlags (Activity app)
- {
- app.runOnUiThread(() -> app.getWindow().clearFlags(FLAG_DISMISS_KEYGUARD));
- }
-
- /**
- * Returns the activity referenced by cordova.
- */
- Activity getApp() {
- return cordova.getActivity();
- }
-
- /**
- * Gets the launch intent for the main activity.
- */
- private Intent getLaunchIntent()
- {
- Context app = getApp().getApplicationContext();
- String pkgName = app.getPackageName();
-
- return app.getPackageManager().getLaunchIntentForPackage(pkgName);
- }
-
- /**
- * Get the requested system service by name.
- *
- * @param name The name of the service.
- */
- private Object getService(String name)
- {
- return getApp().getSystemService(name);
- }
-
- /**
- * Returns list of all possible intents to present the app start settings.
- */
- private List<Intent> getAppStartIntents()
- {
- return Arrays.asList(
- new Intent().setComponent(new ComponentName("com.miui.securitycenter","com.miui.permcenter.autostart.AutoStartManagementActivity")),
- new Intent().setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity")),
- new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")),
- new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")),
- new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity")),
- new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.StartupAppListActivity")),
- new Intent().setComponent(new ComponentName("com.oppo.safe", "com.oppo.safe.permission.startup.StartupAppListActivity")),
- new Intent().setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.AddWhiteListActivity")),
- new Intent().setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.BgStartUpManager")),
- new Intent().setComponent(new ComponentName("com.vivo.permissionmanager", "com.vivo.permissionmanager.activity.BgStartUpManagerActivity")),
- new Intent().setComponent(new ComponentName("com.asus.mobilemanager", "com.asus.mobilemanager.autostart.AutoStartActivity")),
- new Intent().setComponent(new ComponentName("com.asus.mobilemanager", "com.asus.mobilemanager.entry.FunctionActivity")).setData(android.net.Uri.parse("mobilemanager://function/entry/AutoStart")),
- new Intent().setAction("com.letv.android.permissionautoboot"),
- new Intent().setComponent(new ComponentName("com.samsung.android.sm_cn", "com.samsung.android.sm.ui.ram.AutoRunActivity")),
- new Intent().setComponent(ComponentName.unflattenFromString("com.iqoo.secure/.MainActivity")),
- new Intent().setComponent(ComponentName.unflattenFromString("com.meizu.safe/.permission.SmartBGActivity")),
- new Intent().setComponent(new ComponentName("com.yulong.android.coolsafe", ".ui.activity.autorun.AutoRunListActivity")),
- new Intent().setComponent(new ComponentName("cn.nubia.security2", "cn.nubia.security.appmanage.selfstart.ui.SelfStartActivity")),
- new Intent().setComponent(new ComponentName("com.zui.safecenter", "com.lenovo.safecenter.MainTab.LeSafeMainActivity"))
- );
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/ForegroundService.java b/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/ForegroundService.java
deleted file mode 100644
index 806c9568b..000000000
--- a/cordova/platforms/android/app/src/main/java/de/appplant/cordova/plugin/background/ForegroundService.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- Copyright 2013 Sebastián Katzer
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package de.appplant.cordova.plugin.background;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.app.Service;
-import android.content.Context;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.os.Binder;
-import android.os.Build;
-import android.os.IBinder;
-import android.os.PowerManager;
-import android.app.NotificationChannel;
-
-import org.json.JSONObject;
-
-import static android.os.PowerManager.PARTIAL_WAKE_LOCK;
-
-/**
- * Puts the service in a foreground state, where the system considers it to be
- * something the user is actively aware of and thus not a candidate for killing
- * when low on memory.
- */
-public class ForegroundService extends Service {
-
- // Fixed ID for the 'foreground' notification
- public static final int NOTIFICATION_ID = -574543954;
-
- // Default title of the background notification
- private static final String NOTIFICATION_TITLE =
- "App is running in background";
-
- // Default text of the background notification
- private static final String NOTIFICATION_TEXT =
- "Doing heavy tasks.";
-
- // Default icon of the background notification
- private static final String NOTIFICATION_ICON = "icon";
-
- // Binder given to clients
- private final IBinder binder = new ForegroundBinder();
-
- // Partial wake lock to prevent the app from going to sleep when locked
- private PowerManager.WakeLock wakeLock;
-
- /**
- * Allow clients to call on to the service.
- */
- @Override
- public IBinder onBind (Intent intent) {
- return binder;
- }
-
- /**
- * Class used for the client Binder. Because we know this service always
- * runs in the same process as its clients, we don't need to deal with IPC.
- */
- class ForegroundBinder extends Binder
- {
- ForegroundService getService()
- {
- // Return this instance of ForegroundService
- // so clients can call public methods
- return ForegroundService.this;
- }
- }
-
- /**
- * Put the service in a foreground state to prevent app from being killed
- * by the OS.
- */
- @Override
- public void onCreate()
- {
- super.onCreate();
- keepAwake();
- }
-
- /**
- * No need to run headless on destroy.
- */
- @Override
- public void onDestroy()
- {
- super.onDestroy();
- sleepWell();
- }
-
- /**
- * Prevent Android from stopping the background service automatically.
- */
- @Override
- public int onStartCommand (Intent intent, int flags, int startId) {
- return START_STICKY;
- }
-
- /**
- * Put the service in a foreground state to prevent app from being killed
- * by the OS.
- */
- @SuppressLint("WakelockTimeout")
- private void keepAwake()
- {
- JSONObject settings = BackgroundMode.getSettings();
- boolean isSilent = settings.optBoolean("silent", false);
-
- if (!isSilent) {
- startForeground(NOTIFICATION_ID, makeNotification());
- }
-
- PowerManager pm = (PowerManager)getSystemService(POWER_SERVICE);
-
- wakeLock = pm.newWakeLock(
- PARTIAL_WAKE_LOCK, "backgroundmode:wakelock");
-
- wakeLock.acquire();
- }
-
- /**
- * Stop background mode.
- */
- private void sleepWell()
- {
- stopForeground(true);
- getNotificationManager().cancel(NOTIFICATION_ID);
-
- if (wakeLock != null) {
- wakeLock.release();
- wakeLock = null;
- }
- }
-
- /**
- * Create a notification as the visible part to be able to put the service
- * in a foreground state by using the default settings.
- */
- private Notification makeNotification()
- {
- return makeNotification(BackgroundMode.getSettings());
- }
-
- /**
- * Create a notification as the visible part to be able to put the service
- * in a foreground state.
- *
- * @param settings The config settings
- */
- private Notification makeNotification (JSONObject settings)
- {
- // use channelid for Oreo and higher
- String CHANNEL_ID = "cordova-plugin-background-mode-id";
- if(Build.VERSION.SDK_INT >= 26){
- // The user-visible name of the channel.
- CharSequence name = "cordova-plugin-background-mode";
- // The user-visible description of the channel.
- String description = "cordova-plugin-background-moden notification";
-
- int importance = NotificationManager.IMPORTANCE_LOW;
-
- NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name,importance);
-
- // Configure the notification channel.
- mChannel.setDescription(description);
-
- getNotificationManager().createNotificationChannel(mChannel);
- }
- String title = settings.optString("title", NOTIFICATION_TITLE);
- String text = settings.optString("text", NOTIFICATION_TEXT);
- boolean bigText = settings.optBoolean("bigText", false);
-
- Context context = getApplicationContext();
- String pkgName = context.getPackageName();
- Intent intent = context.getPackageManager()
- .getLaunchIntentForPackage(pkgName);
-
- Notification.Builder notification = new Notification.Builder(context)
- .setContentTitle(title)
- .setContentText(text)
- .setOngoing(true)
- .setSmallIcon(getIconResId(settings));
-
- if(Build.VERSION.SDK_INT >= 26){
- notification.setChannelId(CHANNEL_ID);
- }
-
- if (settings.optBoolean("hidden", true)) {
- notification.setPriority(Notification.PRIORITY_MIN);
- }
-
- if (bigText || text.contains("\n")) {
- notification.setStyle(
- new Notification.BigTextStyle().bigText(text));
- }
-
- setColor(notification, settings);
-
- if (intent != null && settings.optBoolean("resume")) {
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
- PendingIntent contentIntent = PendingIntent.getActivity(
- context, NOTIFICATION_ID, intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
-
-
- notification.setContentIntent(contentIntent);
- }
-
- return notification.build();
- }
-
- /**
- * Update the notification.
- *
- * @param settings The config settings
- */
- protected void updateNotification (JSONObject settings)
- {
- boolean isSilent = settings.optBoolean("silent", false);
-
- if (isSilent) {
- stopForeground(true);
- return;
- }
-
- Notification notification = makeNotification(settings);
- getNotificationManager().notify(NOTIFICATION_ID, notification);
-
- }
-
- /**
- * Retrieves the resource ID of the app icon.
- *
- * @param settings A JSON dict containing the icon name.
- */
- private int getIconResId (JSONObject settings)
- {
- String icon = settings.optString("icon", NOTIFICATION_ICON);
-
- int resId = getIconResId(icon, "mipmap");
-
- if (resId == 0) {
- resId = getIconResId(icon, "drawable");
- }
-
- return resId;
- }
-
- /**
- * Retrieve resource id of the specified icon.
- *
- * @param icon The name of the icon.
- * @param type The resource type where to look for.
- *
- * @return The resource id or 0 if not found.
- */
- private int getIconResId (String icon, String type)
- {
- Resources res = getResources();
- String pkgName = getPackageName();
-
- int resId = res.getIdentifier(icon, type, pkgName);
-
- if (resId == 0) {
- resId = res.getIdentifier("icon", type, pkgName);
- }
-
- return resId;
- }
-
- /**
- * Set notification color if its supported by the SDK.
- *
- * @param notification A Notification.Builder instance
- * @param settings A JSON dict containing the color definition (red: FF0000)
- */
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
- private void setColor (Notification.Builder notification, JSONObject settings)
- {
-
- String hex = settings.optString("color", null);
-
- if (Build.VERSION.SDK_INT < 21 || hex == null)
- return;
-
- try {
- int aRGB = Integer.parseInt(hex, 16) + 0xFF000000;
- notification.setColor(aRGB);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Returns the shared notification service manager.
- */
- private NotificationManager getNotificationManager()
- {
- return (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java b/cordova/platforms/android/app/src/main/java/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java
deleted file mode 100644
index 399eb191b..000000000
--- a/cordova/platforms/android/app/src/main/java/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2013 pwlin - [email protected]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-package io.github.pwlin.cordova.plugins.fileopener2;
-
-import java.io.File;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.net.Uri;
-import android.os.Build;
-import android.webkit.MimeTypeMap;
-
-import io.github.pwlin.cordova.plugins.fileopener2.FileProvider;
-
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.PluginResult;
-import org.apache.cordova.CordovaResourceApi;
-
-public class FileOpener2 extends CordovaPlugin {
-
- /**
- * Executes the request and returns a boolean.
- *
- * @param action
- * The action to execute.
- * @param args
- * JSONArry of arguments for the plugin.
- * @param callbackContext
- * The callback context used when calling back into JavaScript.
- * @return boolean.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- if (action.equals("open")) {
- String fileUrl = args.getString(0);
- String contentType = args.getString(1);
- Boolean openWithDefault = true;
- if(args.length() > 2){
- openWithDefault = args.getBoolean(2);
- }
- this._open(fileUrl, contentType, openWithDefault, callbackContext);
- }
- else if (action.equals("uninstall")) {
- this._uninstall(args.getString(0), callbackContext);
- }
- else if (action.equals("appIsInstalled")) {
- JSONObject successObj = new JSONObject();
- if (this._appIsInstalled(args.getString(0))) {
- successObj.put("status", PluginResult.Status.OK.ordinal());
- successObj.put("message", "Installed");
- }
- else {
- successObj.put("status", PluginResult.Status.NO_RESULT.ordinal());
- successObj.put("message", "Not installed");
- }
- callbackContext.success(successObj);
- }
- else {
- JSONObject errorObj = new JSONObject();
- errorObj.put("status", PluginResult.Status.INVALID_ACTION.ordinal());
- errorObj.put("message", "Invalid action");
- callbackContext.error(errorObj);
- }
- return true;
- }
-
- private void _open(String fileArg, String contentType, Boolean openWithDefault, CallbackContext callbackContext) throws JSONException {
- String fileName = "";
- try {
- CordovaResourceApi resourceApi = webView.getResourceApi();
- Uri fileUri = resourceApi.remapUri(Uri.parse(fileArg));
- fileName = fileUri.getPath();
- } catch (Exception e) {
- fileName = fileArg;
- }
- File file = new File(fileName);
- if (file.exists()) {
- try {
- if (contentType == null || contentType.trim().equals("")) {
- contentType = _getMimeType(fileName);
- }
-
- Intent intent;
- if (contentType.equals("application/vnd.android.package-archive")) {
- // https://stackoverflow.com/questions/9637629/can-we-install-an-apk-from-a-contentprovider/9672282#9672282
- intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
- Uri path;
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
- path = Uri.fromFile(file);
- } else {
- Context context = cordova.getActivity().getApplicationContext();
- path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".fileOpener2.provider", file);
- }
- intent.setDataAndType(path, contentType);
- intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NEW_TASK);
-
- } else {
- intent = new Intent(Intent.ACTION_VIEW);
- Context context = cordova.getActivity().getApplicationContext();
- Uri path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".fileOpener2.provider", file);
- intent.setDataAndType(path, contentType);
- intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
-
- }
-
- /*
- * @see
- * http://stackoverflow.com/questions/14321376/open-an-activity-from-a-cordovaplugin
- */
- if(openWithDefault){
- cordova.getActivity().startActivity(intent);
- }
- else{
- cordova.getActivity().startActivity(Intent.createChooser(intent, "Open File in..."));
- }
-
- callbackContext.success();
- } catch (android.content.ActivityNotFoundException e) {
- JSONObject errorObj = new JSONObject();
- errorObj.put("status", PluginResult.Status.ERROR.ordinal());
- errorObj.put("message", "Activity not found: " + e.getMessage());
- callbackContext.error(errorObj);
- }
- } else {
- JSONObject errorObj = new JSONObject();
- errorObj.put("status", PluginResult.Status.ERROR.ordinal());
- errorObj.put("message", "File not found");
- callbackContext.error(errorObj);
- }
- }
-
- private String _getMimeType(String url) {
- String mimeType = "*/*";
- int extensionIndex = url.lastIndexOf('.');
- if (extensionIndex > 0) {
- String extMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(url.substring(extensionIndex+1));
- if (extMimeType != null) {
- mimeType = extMimeType;
- }
- }
- return mimeType;
- }
-
- private void _uninstall(String packageId, CallbackContext callbackContext) throws JSONException {
- if (this._appIsInstalled(packageId)) {
- Intent intent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE);
- intent.setData(Uri.parse("package:" + packageId));
- cordova.getActivity().startActivity(intent);
- callbackContext.success();
- }
- else {
- JSONObject errorObj = new JSONObject();
- errorObj.put("status", PluginResult.Status.ERROR.ordinal());
- errorObj.put("message", "This package is not installed");
- callbackContext.error(errorObj);
- }
- }
-
- private boolean _appIsInstalled(String packageId) {
- PackageManager pm = cordova.getActivity().getPackageManager();
- boolean appInstalled = false;
- try {
- pm.getPackageInfo(packageId, PackageManager.GET_ACTIVITIES);
- appInstalled = true;
- } catch (PackageManager.NameNotFoundException e) {
- appInstalled = false;
- }
- return appInstalled;
- }
-
-}
-
diff --git a/cordova/platforms/android/app/src/main/java/io/github/pwlin/cordova/plugins/fileopener2/FileProvider.java b/cordova/platforms/android/app/src/main/java/io/github/pwlin/cordova/plugins/fileopener2/FileProvider.java
deleted file mode 100644
index b9f6bc5ca..000000000
--- a/cordova/platforms/android/app/src/main/java/io/github/pwlin/cordova/plugins/fileopener2/FileProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2013 pwlin - [email protected]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-package io.github.pwlin.cordova.plugins.fileopener2;
-
-/*
- * http://stackoverflow.com/questions/40746144/error-with-duplicated-fileprovider-in-manifest-xml-with-cordova/41550634#41550634
- */
-public class FileProvider extends androidx.core.content.FileProvider {
-}
diff --git a/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/FileProvider.java b/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/FileProvider.java
deleted file mode 100644
index 2dedd9c91..000000000
--- a/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/FileProvider.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package nl.xservices.plugins;
-
-public class FileProvider extends androidx.core.content.FileProvider {
-}
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/ShareChooserPendingIntent.java b/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/ShareChooserPendingIntent.java
deleted file mode 100644
index 6ca4315b6..000000000
--- a/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/ShareChooserPendingIntent.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package nl.xservices.plugins;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.util.Log;
-
-public class ShareChooserPendingIntent extends BroadcastReceiver {
- public static String chosenComponent = null;
- @Override
- public void onReceive(Context context, Intent intent) {
- if (intent.getExtras() != null) {
- ShareChooserPendingIntent.chosenComponent = intent.getExtras().get(Intent.EXTRA_CHOSEN_COMPONENT).toString();
- }
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/SocialSharing.java b/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/SocialSharing.java
deleted file mode 100644
index e60340ef6..000000000
--- a/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/SocialSharing.java
+++ /dev/null
@@ -1,802 +0,0 @@
-package nl.xservices.plugins;
-
-import nl.xservices.plugins.*;
-
-import android.annotation.SuppressLint;
-import android.app.PendingIntent;
-import android.app.Activity;
-import android.content.*;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.LabeledIntent;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Environment;
-import android.text.Html;
-import android.util.Base64;
-import android.view.Gravity;
-import android.widget.Toast;
-import android.util.Log;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.*;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class SocialSharing extends CordovaPlugin {
-
- private static final String ACTION_AVAILABLE_EVENT = "available";
- private static final String ACTION_SHARE_EVENT = "share";
- private static final String ACTION_SHARE_WITH_OPTIONS_EVENT = "shareWithOptions";
- private static final String ACTION_CAN_SHARE_VIA = "canShareVia";
- private static final String ACTION_CAN_SHARE_VIA_EMAIL = "canShareViaEmail";
- private static final String ACTION_SHARE_VIA = "shareVia";
- private static final String ACTION_SHARE_VIA_TWITTER_EVENT = "shareViaTwitter";
- private static final String ACTION_SHARE_VIA_FACEBOOK_EVENT = "shareViaFacebook";
- private static final String ACTION_SHARE_VIA_FACEBOOK_WITH_PASTEMESSAGEHINT = "shareViaFacebookWithPasteMessageHint";
- private static final String ACTION_SHARE_VIA_WHATSAPP_EVENT = "shareViaWhatsApp";
- private static final String ACTION_SHARE_VIA_INSTAGRAM_EVENT = "shareViaInstagram";
- private static final String ACTION_SHARE_VIA_SMS_EVENT = "shareViaSMS";
- private static final String ACTION_SHARE_VIA_EMAIL_EVENT = "shareViaEmail";
-
- private static final int ACTIVITY_CODE_SEND__BOOLRESULT = 1;
- private static final int ACTIVITY_CODE_SEND__OBJECT = 2;
- private static final int ACTIVITY_CODE_SENDVIAEMAIL = 3;
- private static final int ACTIVITY_CODE_SENDVIAWHATSAPP = 4;
-
- private CallbackContext _callbackContext;
-
- private String pasteMessage;
-
- private abstract class SocialSharingRunnable implements Runnable {
- public CallbackContext callbackContext;
-
- SocialSharingRunnable(CallbackContext cb) {
- this.callbackContext = cb;
- }
- }
-
- @Override
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- this._callbackContext = callbackContext; // only used for onActivityResult
- this.pasteMessage = null;
- if (ACTION_AVAILABLE_EVENT.equals(action)) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- return true;
- } else if (ACTION_SHARE_EVENT.equals(action)) {
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), null, null, false, true);
- } else if (ACTION_SHARE_WITH_OPTIONS_EVENT.equals(action)) {
- return shareWithOptions(callbackContext, args.getJSONObject(0));
- } else if (ACTION_SHARE_VIA_TWITTER_EVENT.equals(action)) {
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), "twitter", null, false, true);
- } else if (ACTION_SHARE_VIA_FACEBOOK_EVENT.equals(action)) {
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.isNull(3) ? args.getJSONArray(2) : new JSONArray(), args.getString(3), "com.facebook.katana", null, false, true, "com.facebook.composer.shareintent");
- } else if (ACTION_SHARE_VIA_FACEBOOK_WITH_PASTEMESSAGEHINT.equals(action)) {
- this.pasteMessage = args.getString(4);
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.isNull(3) ? args.getJSONArray(2) : new JSONArray(), args.getString(3), "com.facebook.katana", null, false, true, "com.facebook.composer.shareintent");
- } else if (ACTION_SHARE_VIA_WHATSAPP_EVENT.equals(action)) {
- if (notEmpty(args.getString(4))) { // abid
- return shareViaWhatsAppDirectly(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), args.getString(4));
- } else if (notEmpty(args.getString(5))) { // phone
- return shareViaWhatsAppDirectly(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), args.getString(5));
- } else {
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), "whatsapp", null, false, true);
- }
- } else if (ACTION_SHARE_VIA_INSTAGRAM_EVENT.equals(action)) {
- if (notEmpty(args.getString(0))) {
- copyHintToClipboard(args.getString(0), "Instagram paste message");
- }
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), "com.instagram.android", null, false, true, "com.instagram.share.handleractivity.ShareHandlerActivity");
- } else if (ACTION_CAN_SHARE_VIA.equals(action)) {
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), args.getString(4), null, true, true);
- } else if (ACTION_CAN_SHARE_VIA_EMAIL.equals(action)) {
- if (isEmailAvailable()) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- return true;
- } else {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, "not available"));
- return false;
- }
- } else if (ACTION_SHARE_VIA.equals(action)) {
- return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), args.getString(4), null, false, true);
- } else if (ACTION_SHARE_VIA_SMS_EVENT.equals(action)) {
- return invokeSMSIntent(callbackContext, args.getJSONObject(0), args.getString(1));
- } else if (ACTION_SHARE_VIA_EMAIL_EVENT.equals(action)) {
- return invokeEmailIntent(callbackContext, args.getString(0), args.getString(1), args.getJSONArray(2), args.isNull(3) ? null : args.getJSONArray(3), args.isNull(4) ? null : args.getJSONArray(4), args.isNull(5) ? null : args.getJSONArray(5));
- } else {
- callbackContext.error("socialSharing." + action + " is not a supported function. Did you mean '" + ACTION_SHARE_EVENT + "'?");
- return false;
- }
- }
-
- private boolean isEmailAvailable() {
- final Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "[email protected]", null));
- return cordova.getActivity().getPackageManager().queryIntentActivities(intent, 0).size() > 0;
- }
-
- private boolean invokeEmailIntent(final CallbackContext callbackContext, final String message, final String subject, final JSONArray to, final JSONArray cc, final JSONArray bcc, final JSONArray files) throws JSONException {
-
- final SocialSharing plugin = this;
- cordova.getThreadPool().execute(new SocialSharingRunnable(callbackContext) {
- public void run() {
- Intent draft = new Intent(Intent.ACTION_SENDTO);
- if (notEmpty(message)) {
- Pattern htmlPattern = Pattern.compile(".*\\<[^>]+>.*", Pattern.DOTALL);
- if (htmlPattern.matcher(message).matches()) {
- draft.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(message));
- draft.setType("text/html");
- } else {
- draft.putExtra(android.content.Intent.EXTRA_TEXT, message);
- draft.setType("text/plain");
- }
- }
- if (notEmpty(subject)) {
- draft.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
- }
- try {
- if (to != null && to.length() > 0) {
- draft.putExtra(android.content.Intent.EXTRA_EMAIL, toStringArray(to));
- }
- if (cc != null && cc.length() > 0) {
- draft.putExtra(android.content.Intent.EXTRA_CC, toStringArray(cc));
- }
- if (bcc != null && bcc.length() > 0) {
- draft.putExtra(android.content.Intent.EXTRA_BCC, toStringArray(bcc));
- }
- if (files.length() > 0) {
- final String dir = getDownloadDir();
- if (dir != null) {
- ArrayList<Uri> fileUris = new ArrayList<Uri>();
- for (int i = 0; i < files.length(); i++) {
- Uri fileUri = getFileUriAndSetType(draft, dir, files.getString(i), subject, i);
- fileUri = FileProvider.getUriForFile(webView.getContext(), cordova.getActivity().getPackageName()+".sharing.provider", new File(fileUri.getPath()));
- if (fileUri != null) {
- fileUris.add(fileUri);
- }
- }
- if (!fileUris.isEmpty()) {
- draft.putExtra(Intent.EXTRA_STREAM, fileUris);
- }
- }
- }
- } catch (Exception e) {
- callbackContext.error(e.getMessage());
- return;
- }
-
- // this was added to start the intent in a new window as suggested in #300 to prevent crashes upon return
- draft.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- draft.setData(Uri.parse("mailto:"));
-
- List<ResolveInfo> emailAppList = cordova.getActivity().getPackageManager().queryIntentActivities(draft, 0);
-
- List<LabeledIntent> labeledIntentList = new ArrayList();
- for (ResolveInfo info : emailAppList) {
- draft.setAction(Intent.ACTION_SEND_MULTIPLE);
- draft.setType("application/octet-stream");
-
- draft.setComponent(new ComponentName(info.activityInfo.packageName, info.activityInfo.name));
- labeledIntentList.add(new LabeledIntent(draft, info.activityInfo.packageName, info.loadLabel(cordova.getActivity().getPackageManager()), info.icon));
- }
- final Intent emailAppLists = Intent.createChooser(labeledIntentList.remove(labeledIntentList.size() - 1), "Choose Email App");
- emailAppLists.putExtra(Intent.EXTRA_INITIAL_INTENTS, labeledIntentList.toArray(new LabeledIntent[labeledIntentList.size()]));
-
- // as an experiment for #300 we're explicitly running it on the ui thread here
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- cordova.startActivityForResult(plugin, emailAppLists, ACTIVITY_CODE_SENDVIAEMAIL);
- }
- });
- }
- });
-
- return true;
- }
-
- private String getDownloadDir() throws IOException {
- // better check, otherwise it may crash the app
- if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
- // we need to use external storage since we need to share to another app
- final String dir = webView.getContext().getExternalFilesDir(null) + "/socialsharing-downloads";
- createOrCleanDir(dir);
- return dir;
- } else {
- return null;
- }
- }
-
- private boolean shareWithOptions(CallbackContext callbackContext, JSONObject jsonObject) {
- return doSendIntent(
- callbackContext,
- jsonObject.optString("message", null),
- jsonObject.optString("subject", null),
- jsonObject.optJSONArray("files") == null ? new JSONArray() : jsonObject.optJSONArray("files"),
- jsonObject.optString("url", null),
- jsonObject.optString("appPackageName", null),
- jsonObject.optString("chooserTitle", null),
- false,
- false
- );
- }
-
- private boolean doSendIntent(
- final CallbackContext callbackContext,
- final String msg,
- final String subject,
- final JSONArray files,
- final String url,
- final String appPackageName,
- final String chooserTitle,
- final boolean peek,
- final boolean boolResult) {
- return doSendIntent(callbackContext, msg, subject, files, url, appPackageName, chooserTitle, peek, boolResult, null);
- }
-
- private boolean doSendIntent(
- final CallbackContext callbackContext,
- final String msg,
- final String subject,
- final JSONArray files,
- final String url,
- final String appPackageName,
- final String chooserTitle,
- final boolean peek,
- final boolean boolResult,
- final String appName) {
-
- final CordovaInterface mycordova = cordova;
- final CordovaPlugin plugin = this;
-
- cordova.getThreadPool().execute(new SocialSharingRunnable(callbackContext) {
- public void run() {
- String message = msg;
- final boolean hasMultipleAttachments = files.length() > 1;
- final Intent sendIntent = new Intent(hasMultipleAttachments ? Intent.ACTION_SEND_MULTIPLE : Intent.ACTION_SEND);
- final Intent receiverIntent = new Intent(cordova.getActivity().getApplicationContext(), ShareChooserPendingIntent.class);
- final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT);
- sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
-
- try {
- if (files.length() > 0 && !"".equals(files.getString(0))) {
- final String dir = getDownloadDir();
- if (dir != null) {
- ArrayList<Uri> fileUris = new ArrayList<Uri>();
- Uri fileUri = null;
- for (int i = 0; i < files.length(); i++) {
- fileUri = getFileUriAndSetType(sendIntent, dir, files.getString(i), subject, i);
- fileUri = FileProvider.getUriForFile(webView.getContext(), cordova.getActivity().getPackageName()+".sharing.provider", new File(fileUri.getPath()));
- fileUris.add(fileUri);
- }
- if (!fileUris.isEmpty()) {
- if (hasMultipleAttachments) {
- sendIntent.putExtra(Intent.EXTRA_STREAM, fileUris);
- } else {
- sendIntent.putExtra(Intent.EXTRA_STREAM, fileUri);
- }
- }
- } else {
- sendIntent.setType("text/plain");
- }
- } else {
- sendIntent.setType("text/plain");
- }
- } catch (Exception e) {
- callbackContext.error(e.getMessage());
- }
-
- if (notEmpty(subject)) {
- sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
- }
-
- // add the URL to the message, as there seems to be no separate field
- if (notEmpty(url)) {
- if (notEmpty(message)) {
- message += " " + url;
- } else {
- message = url;
- }
- }
- if (notEmpty(message)) {
- sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
- // sometimes required when the user picks share via sms
- if (Build.VERSION.SDK_INT < 21) { // LOLLIPOP
- sendIntent.putExtra("sms_body", message);
- }
- }
-
- // this was added to start the intent in a new window as suggested in #300 to prevent crashes upon return
- sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- if (appPackageName != null) {
- String packageName = appPackageName;
- String passedActivityName = null;
- if (packageName.contains("/")) {
- String[] items = appPackageName.split("/");
- packageName = items[0];
- passedActivityName = items[1];
- }
- final ActivityInfo activity = getActivity(callbackContext, sendIntent, packageName, appName);
- if (activity != null) {
- if (peek) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- } else {
- sendIntent.addCategory(Intent.CATEGORY_LAUNCHER);
- sendIntent.setComponent(new ComponentName(activity.applicationInfo.packageName,
- passedActivityName != null ? passedActivityName : activity.name));
-
- // as an experiment for #300 we're explicitly running it on the ui thread here
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- mycordova.startActivityForResult(plugin, sendIntent, 0);
- }
- });
-
- if (pasteMessage != null) {
- // add a little delay because target app (facebook only atm) needs to be started first
- new Timer().schedule(new TimerTask() {
- public void run() {
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- copyHintToClipboard(msg, pasteMessage);
- showPasteMessage(pasteMessage);
- }
- });
- }
- }, 2000);
- }
- }
- }
- } else {
- if (peek) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- } else {
- // experimenting a bit
- // as an experiment for #300 we're explicitly running it on the ui thread here
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- Intent chooseIntent;
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {
- // Intent.createChooser's third param was only added in SDK version 22.
- chooseIntent = Intent.createChooser(sendIntent, chooserTitle, pendingIntent.getIntentSender());
- } else {
- chooseIntent = Intent.createChooser(sendIntent, chooserTitle);
- }
- mycordova.startActivityForResult(plugin, chooseIntent, boolResult ? ACTIVITY_CODE_SEND__BOOLRESULT : ACTIVITY_CODE_SEND__OBJECT);
- }
- });
- }
- }
- }
- });
- return true;
- }
-
- @SuppressLint("NewApi")
- private void copyHintToClipboard(String msg, String label) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
- return;
- }
- final ClipboardManager clipboard = (android.content.ClipboardManager) cordova.getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
- final ClipData clip = android.content.ClipData.newPlainText(label, msg);
- clipboard.setPrimaryClip(clip);
- }
-
- @SuppressLint("NewApi")
- private void showPasteMessage(String label) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
- return;
- }
- final Toast toast = Toast.makeText(webView.getContext(), label, Toast.LENGTH_LONG);
- toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0);
- toast.show();
- }
-
- private Uri getFileUriAndSetType(Intent sendIntent, String dir, String image, String subject, int nthFile) throws IOException {
- // we're assuming an image, but this can be any filetype you like
- String localImage = image;
- if (image.endsWith("mp4") || image.endsWith("mov") || image.endsWith("3gp")){
- sendIntent.setType("video/*");
- } else if (image.endsWith("mp3")) {
- sendIntent.setType("audio/x-mpeg");
- } else {
- sendIntent.setType("image/*");
- }
-
- if (image.startsWith("http") || image.startsWith("www/")) {
- String filename = getFileName(image);
- localImage = "file://" + dir + "/" + filename.replaceAll("[^a-zA-Z0-9._-]", "");
- if (image.startsWith("http")) {
- // filename optimisation taken from https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/pull/56
- URLConnection connection = new URL(image).openConnection();
- String disposition = connection.getHeaderField("Content-Disposition");
- if (disposition != null) {
- final Pattern dispositionPattern = Pattern.compile("filename=([^;]+)");
- Matcher matcher = dispositionPattern.matcher(disposition);
- if (matcher.find()) {
- filename = matcher.group(1).replaceAll("[^a-zA-Z0-9._-]", "");
- if (filename.length() == 0) {
- // in this case we can't determine a filetype so some targets (gmail) may not render it correctly
- filename = "file";
- }
- localImage = "file://" + dir + "/" + filename;
- }
- }
- saveFile(getBytes(connection.getInputStream()), dir, filename);
- // update file type
- String fileType = getMIMEType(image);
- sendIntent.setType(fileType);
- } else {
- saveFile(getBytes(webView.getContext().getAssets().open(image)), dir, filename);
- }
- } else if (image.startsWith("data:")) {
- // safeguard for https://code.google.com/p/android/issues/detail?id=7901#c43
- if (!image.contains(";base64,")) {
- sendIntent.setType("text/plain");
- return null;
- }
- // image looks like this: data:image/png;base64,R0lGODlhDAA...
- final String encodedImg = image.substring(image.indexOf(";base64,") + 8);
- // correct the intent type if anything else was passed, like a pdf: data:application/pdf;base64,..
- if (!image.contains("data:image/")) {
- sendIntent.setType(image.substring(image.indexOf("data:") + 5, image.indexOf(";base64")));
- }
- // the filename needs a valid extension, so it renders correctly in target apps
- final String imgExtension = image.substring(image.indexOf("/") + 1, image.indexOf(";base64"));
- String fileName;
- // if a subject was passed, use it as the filename
- // filenames must be unique when passing in multiple files [#158]
- if (notEmpty(subject)) {
- fileName = sanitizeFilename(subject) + (nthFile == 0 ? "" : "_" + nthFile) + "." + imgExtension;
- } else {
- fileName = "file" + (nthFile == 0 ? "" : "_" + nthFile) + "." + imgExtension;
- }
- saveFile(Base64.decode(encodedImg, Base64.DEFAULT), dir, fileName);
- localImage = "file://" + dir + "/" + fileName;
- } else if (image.startsWith("df:")) {
- // safeguard for https://code.google.com/p/android/issues/detail?id=7901#c43
- if (!image.contains(";base64,")) {
- sendIntent.setType("text/plain");
- return null;
- }
- // format looks like this : df:filename.txt;data:image/png;base64,R0lGODlhDAA...
- final String fileName = image.substring(image.indexOf("df:") + 3, image.indexOf(";data:"));
- final String fileType = image.substring(image.indexOf(";data:") + 6, image.indexOf(";base64,"));
- final String encodedImg = image.substring(image.indexOf(";base64,") + 8);
- sendIntent.setType(fileType);
- saveFile(Base64.decode(encodedImg, Base64.DEFAULT), dir, sanitizeFilename(fileName));
- localImage = "file://" + dir + "/" + sanitizeFilename(fileName);
- } else if (!image.startsWith("file://")) {
- throw new IllegalArgumentException("URL_NOT_SUPPORTED");
- } else {
- //get file MIME type
- String type = getMIMEType(image);
- //set intent data and Type
- sendIntent.setType(type);
- }
- return Uri.parse(localImage);
- }
-
- private String getMIMEType(String fileName) {
- String type = "*/*";
- int dotIndex = fileName.lastIndexOf(".");
- if (dotIndex == -1) {
- return type;
- }
- final String end = fileName.substring(dotIndex+1, fileName.length()).toLowerCase();
- String fromMap = MIME_Map.get(end);
- return fromMap == null ? type : fromMap;
- }
-
- private static final Map<String, String> MIME_Map = new HashMap<String, String>();
- static {
- MIME_Map.put("3gp", "video/3gpp");
- MIME_Map.put("apk", "application/vnd.android.package-archive");
- MIME_Map.put("asf", "video/x-ms-asf");
- MIME_Map.put("avi", "video/x-msvideo");
- MIME_Map.put("bin", "application/octet-stream");
- MIME_Map.put("bmp", "image/bmp");
- MIME_Map.put("c", "text/plain");
- MIME_Map.put("class", "application/octet-stream");
- MIME_Map.put("conf", "text/plain");
- MIME_Map.put("cpp", "text/plain");
- MIME_Map.put("doc", "application/msword");
- MIME_Map.put("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
- MIME_Map.put("xls", "application/vnd.ms-excel");
- MIME_Map.put("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
- MIME_Map.put("exe", "application/octet-stream");
- MIME_Map.put("gif", "image/gif");
- MIME_Map.put("gtar", "application/x-gtar");
- MIME_Map.put("gz", "application/x-gzip");
- MIME_Map.put("h", "text/plain");
- MIME_Map.put("htm", "text/html");
- MIME_Map.put("html", "text/html");
- MIME_Map.put("jar", "application/java-archive");
- MIME_Map.put("java", "text/plain");
- MIME_Map.put("jpeg", "image/jpeg");
- MIME_Map.put("jpg", "image/*");
- MIME_Map.put("js", "application/x-javascript");
- MIME_Map.put("log", "text/plain");
- MIME_Map.put("m3u", "audio/x-mpegurl");
- MIME_Map.put("m4a", "audio/mp4a-latm");
- MIME_Map.put("m4b", "audio/mp4a-latm");
- MIME_Map.put("m4p", "audio/mp4a-latm");
- MIME_Map.put("m4u", "video/vnd.mpegurl");
- MIME_Map.put("m4v", "video/x-m4v");
- MIME_Map.put("mov", "video/quicktime");
- MIME_Map.put("mp2", "audio/x-mpeg");
- MIME_Map.put("mp3", "audio/x-mpeg");
- MIME_Map.put("mp4", "video/mp4");
- MIME_Map.put("mpc", "application/vnd.mpohun.certificate");
- MIME_Map.put("mpe", "video/mpeg");
- MIME_Map.put("mpeg", "video/mpeg");
- MIME_Map.put("mpg", "video/mpeg");
- MIME_Map.put("mpg4", "video/mp4");
- MIME_Map.put("mpga", "audio/mpeg");
- MIME_Map.put("msg", "application/vnd.ms-outlook");
- MIME_Map.put("ogg", "audio/ogg");
- MIME_Map.put("pdf", "application/pdf");
- MIME_Map.put("png", "image/png");
- MIME_Map.put("pps", "application/vnd.ms-powerpoint");
- MIME_Map.put("ppt", "application/vnd.ms-powerpoint");
- MIME_Map.put("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
- MIME_Map.put("prop", "text/plain");
- MIME_Map.put("rc", "text/plain");
- MIME_Map.put("rmvb", "audio/x-pn-realaudio");
- MIME_Map.put("rtf", "application/rtf");
- MIME_Map.put("sh", "text/plain");
- MIME_Map.put("tar", "application/x-tar");
- MIME_Map.put("tgz", "application/x-compressed");
- MIME_Map.put("txt", "text/plain");
- MIME_Map.put("wav", "audio/x-wav");
- MIME_Map.put("wma", "audio/x-ms-wma");
- MIME_Map.put("wmv", "audio/x-ms-wmv");
- MIME_Map.put("wps", "application/vnd.ms-works");
- MIME_Map.put("xml", "text/plain");
- MIME_Map.put("z", "application/x-compress");
- MIME_Map.put("zip", "application/x-zip-compressed");
- MIME_Map.put("", "*/*");
- }
-
- // sending files is not supported with ACTION_VIEW, and with ACTION_SEND the message doesn't get prefilled :(
- private boolean shareViaWhatsAppDirectly(final CallbackContext callbackContext, String message, final String subject, final JSONArray files, final String url, final String number) {
- // add the URL to the message, as there seems to be no separate field
- if (notEmpty(url)) {
- if (notEmpty(message)) {
- message += " " + url;
- } else {
- message = url;
- }
- }
- final String shareMessage = message;
- final SocialSharing plugin = this;
- cordova.getThreadPool().execute(new SocialSharingRunnable(callbackContext) {
- public void run() {
- final Intent intent = new Intent(Intent.ACTION_VIEW);
- try {
- intent.setData(Uri.parse("https://api.whatsapp.com/send?phone=" + number + "&text=" + URLEncoder.encode(shareMessage, "UTF-8")));
- // this was added to start the intent in a new window as suggested in #300 to prevent crashes upon return
- // update: didn't help (doesn't seem to hurt either though)
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- // as an experiment for #300 we're explicitly running it on the ui thread here
- cordova.getActivity().runOnUiThread(new Runnable() {
- public void run() {
- try {
- cordova.startActivityForResult(plugin, intent, ACTIVITY_CODE_SENDVIAWHATSAPP);
- } catch (Exception e) {
- callbackContext.error(e.getMessage());
- }
- }
- });
- } catch (Exception e) {
- callbackContext.error(e.getMessage());
- }
- }
- });
- return true;
- }
-
- private boolean invokeSMSIntent(final CallbackContext callbackContext, JSONObject options, String p_phonenumbers) {
- final String message = options.optString("message");
- // TODO test this on a real SMS enabled device before releasing it
-// final String subject = options.optString("subject");
-// final String image = options.optString("image");
- final String subject = null; //options.optString("subject");
- final String image = null; // options.optString("image");
- final String phonenumbers = getPhoneNumbersWithManufacturerSpecificSeparators(p_phonenumbers);
- final SocialSharing plugin = this;
- cordova.getThreadPool().execute(new SocialSharingRunnable(callbackContext) {
- public void run() {
- Intent intent;
-
- if (Build.VERSION.SDK_INT >= 19) { // Build.VERSION_CODES.KITKAT) {
- // passing in no phonenumbers for kitkat may result in an error,
- // but it may also work for some devices, so documentation will need to cover this case
- intent = new Intent(Intent.ACTION_SENDTO);
- intent.setData(Uri.parse("smsto:" + (notEmpty(phonenumbers) ? phonenumbers : "")));
- } else {
- intent = new Intent(Intent.ACTION_VIEW);
- intent.setType("vnd.android-dir/mms-sms");
- if (phonenumbers != null) {
- intent.putExtra("address", phonenumbers);
- }
- }
- intent.putExtra("sms_body", message);
- intent.putExtra("sms_subject", subject);
-
- try {
- if (image != null && !"".equals(image)) {
- final Uri fileUri = getFileUriAndSetType(intent, getDownloadDir(), image, subject, 0);
- if (fileUri != null) {
- intent.putExtra(Intent.EXTRA_STREAM, fileUri);
- }
- }
- // this was added to start the intent in a new window as suggested in #300 to prevent crashes upon return
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- cordova.startActivityForResult(plugin, intent, 0);
- } catch (Exception e) {
- callbackContext.error(e.getMessage());
- }
- }
- });
- return true;
- }
-
- private static String getPhoneNumbersWithManufacturerSpecificSeparators(String phonenumbers) {
- if (notEmpty(phonenumbers)) {
- char separator;
- if (android.os.Build.MANUFACTURER.equalsIgnoreCase("samsung")) {
- separator = ',';
- } else {
- separator = ';';
- }
- return phonenumbers.replace(';', separator).replace(',', separator);
- }
- return null;
- }
-
- private ActivityInfo getActivity(final CallbackContext callbackContext, final Intent shareIntent, final String appPackageName, final String appName) {
- final PackageManager pm = webView.getContext().getPackageManager();
- List<ResolveInfo> activityList = pm.queryIntentActivities(shareIntent, 0);
- for (final ResolveInfo app : activityList) {
- if ((app.activityInfo.packageName).contains(appPackageName)) {
- if (appName == null || (app.activityInfo.name).contains(appName)) {
- return app.activityInfo;
- }
- }
- }
- // no matching app found
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, getShareActivities(activityList)));
- return null;
- }
-
- private JSONArray getShareActivities(List<ResolveInfo> activityList) {
- List<String> packages = new ArrayList<String>();
- for (final ResolveInfo app : activityList) {
- packages.add(app.activityInfo.packageName);
- }
- return new JSONArray(packages);
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
- super.onActivityResult(requestCode, resultCode, intent);
- if (_callbackContext != null) {
- switch (requestCode) {
- case ACTIVITY_CODE_SEND__BOOLRESULT:
- _callbackContext.sendPluginResult(new PluginResult(
- PluginResult.Status.OK,
- resultCode == Activity.RESULT_OK));
- break;
- case ACTIVITY_CODE_SEND__OBJECT:
- JSONObject json = new JSONObject();
- try {
- json.put("completed", resultCode == Activity.RESULT_OK);
- json.put("app", (ShareChooserPendingIntent.chosenComponent != null ? ShareChooserPendingIntent.chosenComponent : "")); // we need a completely different approach if we want to support this on Android. Idea: https://clickclickclack.wordpress.com/2012/01/03/intercepting-androids-action_send-intents/
- _callbackContext.sendPluginResult(new PluginResult(
- PluginResult.Status.OK,
- json));
- } catch (JSONException e) {
- _callbackContext.error(e.getMessage());
- }
- break;
- default:
- _callbackContext.success();
- }
- }
- }
-
- private void createOrCleanDir(final String downloadDir) throws IOException {
- final File dir = new File(downloadDir);
- if (!dir.exists()) {
- if (!dir.mkdirs()) {
- throw new IOException("CREATE_DIRS_FAILED");
- }
- } else {
- cleanupOldFiles(dir);
- }
- }
-
- private static String getFileName(String url) {
- if (url.endsWith("/")) {
- url = url.substring(0, url.length()-1);
- }
- final String pattern = ".*/([^?#]+)?";
- Pattern r = Pattern.compile(pattern);
- Matcher m = r.matcher(url);
- if (m.find()) {
- return m.group(1);
- } else {
- return "file";
- }
- }
-
- private byte[] getBytes(InputStream is) throws IOException {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- int nRead;
- byte[] data = new byte[16384];
- while ((nRead = is.read(data, 0, data.length)) != -1) {
- buffer.write(data, 0, nRead);
- }
- buffer.flush();
- return buffer.toByteArray();
- }
-
- private void saveFile(byte[] bytes, String dirName, String fileName) throws IOException {
- final File dir = new File(dirName);
- final FileOutputStream fos = new FileOutputStream(new File(dir, fileName));
- fos.write(bytes);
- fos.flush();
- fos.close();
- }
-
- /**
- * As file.deleteOnExit does not work on Android, we need to delete files manually.
- * Deleting them in onActivityResult is not a good idea, because for example a base64 encoded file
- * will not be available for upload to Facebook (it's deleted before it's uploaded).
- * So the best approach is deleting old files when saving (sharing) a new one.
- */
- private void cleanupOldFiles(File dir) {
- for (File f : dir.listFiles()) {
- //noinspection ResultOfMethodCallIgnored
- f.delete();
- }
- }
-
- private static boolean notEmpty(String what) {
- return what != null &&
- !"".equals(what) &&
- !"null".equalsIgnoreCase(what);
- }
-
- private static String[] toStringArray(JSONArray jsonArray) throws JSONException {
- String[] result = new String[jsonArray.length()];
- for (int i = 0; i < jsonArray.length(); i++) {
- result[i] = jsonArray.getString(i);
- }
- return result;
- }
-
- public static String sanitizeFilename(String name) {
- return name.replaceAll("[:\\\\/*?|<> ]", "_");
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/CameraLauncher.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/CameraLauncher.java
deleted file mode 100644
index 614935d19..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/CameraLauncher.java
+++ /dev/null
@@ -1,1380 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.camera;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.ActivityNotFoundException;
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.Bitmap.CompressFormat;
-import android.graphics.BitmapFactory;
-import android.graphics.Matrix;
-import android.media.ExifInterface;
-import android.media.MediaScannerConnection;
-import android.media.MediaScannerConnection.MediaScannerConnectionClient;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.provider.MediaStore;
-import androidx.core.content.FileProvider;
-import android.util.Base64;
-
-import org.apache.cordova.BuildHelper;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-import org.apache.cordova.PermissionHelper;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * This class launches the camera view, allows the user to take a picture, closes the camera view,
- * and returns the captured image. When the camera view is closed, the screen displayed before
- * the camera view was shown is redisplayed.
- */
-public class CameraLauncher extends CordovaPlugin implements MediaScannerConnectionClient {
-
- private static final int DATA_URL = 0; // Return base64 encoded string
- private static final int FILE_URI = 1; // Return file uri (content://media/external/images/media/2 for Android)
-
- private static final int PHOTOLIBRARY = 0; // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)
- private static final int CAMERA = 1; // Take picture from camera
- private static final int SAVEDPHOTOALBUM = 2; // Choose image from picture library (same as PHOTOLIBRARY for Android)
-
- private static final int PICTURE = 0; // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
- private static final int VIDEO = 1; // allow selection of video only, ONLY RETURNS URL
- private static final int ALLMEDIA = 2; // allow selection from all media types
-
- private static final int JPEG = 0; // Take a picture of type JPEG
- private static final int PNG = 1; // Take a picture of type PNG
- private static final String JPEG_TYPE = "jpg";
- private static final String PNG_TYPE = "png";
- private static final String JPEG_EXTENSION = "." + JPEG_TYPE;
- private static final String PNG_EXTENSION = "." + PNG_TYPE;
- private static final String PNG_MIME_TYPE = "image/png";
- private static final String JPEG_MIME_TYPE = "image/jpeg";
- private static final String GET_PICTURE = "Get Picture";
- private static final String GET_VIDEO = "Get Video";
- private static final String GET_All = "Get All";
- private static final String CROPPED_URI_KEY = "croppedUri";
- private static final String IMAGE_URI_KEY = "imageUri";
-
- private static final String TAKE_PICTURE_ACTION = "takePicture";
-
- public static final int PERMISSION_DENIED_ERROR = 20;
- public static final int TAKE_PIC_SEC = 0;
- public static final int SAVE_TO_ALBUM_SEC = 1;
-
- private static final String LOG_TAG = "CameraLauncher";
-
- //Where did this come from?
- private static final int CROP_CAMERA = 100;
-
- private static final String TIME_FORMAT = "yyyyMMdd_HHmmss";
-
- private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
- private int targetWidth; // desired width of the image
- private int targetHeight; // desired height of the image
- private Uri imageUri; // Uri of captured image
- private String imageFilePath; // File where the image is stored
- private int encodingType; // Type of encoding to use
- private int mediaType; // What type of media to retrieve
- private int destType; // Source type (needs to be saved for the permission handling)
- private int srcType; // Destination type (needs to be saved for permission handling)
- private boolean saveToPhotoAlbum; // Should the picture be saved to the device's photo album
- private boolean correctOrientation; // Should the pictures orientation be corrected
- private boolean orientationCorrected; // Has the picture's orientation been corrected
- private boolean allowEdit; // Should we allow the user to crop the image.
-
- protected final static String[] permissions = { Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE };
-
- public CallbackContext callbackContext;
- private int numPics;
-
- private MediaScannerConnection conn; // Used to update gallery app with newly-written files
- private Uri scanMe; // Uri of image to be added to content store
- private Uri croppedUri;
- private String croppedFilePath;
- private ExifHelper exifData; // Exif data from source
- private String applicationId;
-
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArry of arguments for the plugin.
- * @param callbackContext The callback id used when calling back into JavaScript.
- * @return A PluginResult object with a status and message.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- this.callbackContext = callbackContext;
- //Adding an API to CoreAndroid to get the BuildConfigValue
- //This allows us to not make this a breaking change to embedding
- this.applicationId = (String) BuildHelper.getBuildConfigValue(cordova.getActivity(), "APPLICATION_ID");
- this.applicationId = preferences.getString("applicationId", this.applicationId);
-
-
- if (action.equals(TAKE_PICTURE_ACTION)) {
- this.srcType = CAMERA;
- this.destType = FILE_URI;
- this.saveToPhotoAlbum = false;
- this.targetHeight = 0;
- this.targetWidth = 0;
- this.encodingType = JPEG;
- this.mediaType = PICTURE;
- this.mQuality = 50;
-
- //Take the values from the arguments if they're not already defined (this is tricky)
- this.destType = args.getInt(1);
- this.srcType = args.getInt(2);
- this.mQuality = args.getInt(0);
- this.targetWidth = args.getInt(3);
- this.targetHeight = args.getInt(4);
- this.encodingType = args.getInt(5);
- this.mediaType = args.getInt(6);
- this.allowEdit = args.getBoolean(7);
- this.correctOrientation = args.getBoolean(8);
- this.saveToPhotoAlbum = args.getBoolean(9);
-
- // If the user specifies a 0 or smaller width/height
- // make it -1 so later comparisons succeed
- if (this.targetWidth < 1) {
- this.targetWidth = -1;
- }
- if (this.targetHeight < 1) {
- this.targetHeight = -1;
- }
-
- // We don't return full-quality PNG files. The camera outputs a JPEG
- // so requesting it as a PNG provides no actual benefit
- if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
- !this.correctOrientation && this.encodingType == PNG && this.srcType == CAMERA) {
- this.encodingType = JPEG;
- }
-
- try {
- if (this.srcType == CAMERA) {
- this.callTakePicture(destType, encodingType);
- }
- else if ((this.srcType == PHOTOLIBRARY) || (this.srcType == SAVEDPHOTOALBUM)) {
- // FIXME: Stop always requesting the permission
- if(!PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)) {
- PermissionHelper.requestPermission(this, SAVE_TO_ALBUM_SEC, Manifest.permission.READ_EXTERNAL_STORAGE);
- } else {
- this.getImage(this.srcType, destType, encodingType);
- }
- }
- }
- catch (IllegalArgumentException e)
- {
- callbackContext.error("Illegal Argument Exception");
- PluginResult r = new PluginResult(PluginResult.Status.ERROR);
- callbackContext.sendPluginResult(r);
- return true;
- }
-
- PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
- r.setKeepCallback(true);
- callbackContext.sendPluginResult(r);
-
- return true;
- }
- return false;
- }
-
- //--------------------------------------------------------------------------
- // LOCAL METHODS
- //--------------------------------------------------------------------------
-
- private String getTempDirectoryPath() {
- File cache = cordova.getActivity().getCacheDir();
- // Create the cache directory if it doesn't exist
- cache.mkdirs();
- return cache.getAbsolutePath();
- }
-
- /**
- * Take a picture with the camera.
- * When an image is captured or the camera view is cancelled, the result is returned
- * in CordovaActivity.onActivityResult, which forwards the result to this.onActivityResult.
- *
- * The image can either be returned as a base64 string or a URI that points to the file.
- * To display base64 string in an img tag, set the source to:
- * img.src="data:image/jpeg;base64,"+result;
- * or to display URI in an img tag
- * img.src=result;
- *
- * @param returnType Set the type of image to return.
- * @param encodingType Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
- */
- public void callTakePicture(int returnType, int encodingType) {
- boolean saveAlbumPermission = PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
- && PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
- boolean takePicturePermission = PermissionHelper.hasPermission(this, Manifest.permission.CAMERA);
-
- // CB-10120: The CAMERA permission does not need to be requested unless it is declared
- // in AndroidManifest.xml. This plugin does not declare it, but others may and so we must
- // check the package info to determine if the permission is present.
-
- if (!takePicturePermission) {
- takePicturePermission = true;
- try {
- PackageManager packageManager = this.cordova.getActivity().getPackageManager();
- String[] permissionsInPackage = packageManager.getPackageInfo(this.cordova.getActivity().getPackageName(), PackageManager.GET_PERMISSIONS).requestedPermissions;
- if (permissionsInPackage != null) {
- for (String permission : permissionsInPackage) {
- if (permission.equals(Manifest.permission.CAMERA)) {
- takePicturePermission = false;
- break;
- }
- }
- }
- } catch (NameNotFoundException e) {
- // We are requesting the info for our package, so this should
- // never be caught
- }
- }
-
- if (takePicturePermission && saveAlbumPermission) {
- takePicture(returnType, encodingType);
- } else if (saveAlbumPermission && !takePicturePermission) {
- PermissionHelper.requestPermission(this, TAKE_PIC_SEC, Manifest.permission.CAMERA);
- } else if (!saveAlbumPermission && takePicturePermission) {
- PermissionHelper.requestPermissions(this, TAKE_PIC_SEC,
- new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE});
- } else {
- PermissionHelper.requestPermissions(this, TAKE_PIC_SEC, permissions);
- }
- }
-
- public void takePicture(int returnType, int encodingType)
- {
- // Save the number of images currently on disk for later
- this.numPics = queryImgDB(whichContentStore()).getCount();
-
- // Let's use the intent and see what happens
- Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
-
- // Specify file so that large image is captured and returned
- File photo = createCaptureFile(encodingType);
- this.imageFilePath = photo.getAbsolutePath();
- this.imageUri = FileProvider.getUriForFile(cordova.getActivity(),
- applicationId + ".cordova.plugin.camera.provider",
- photo);
- intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
- //We can write to this URI, this will hopefully allow us to write files to get to the next step
- intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
-
- if (this.cordova != null) {
- // Let's check to make sure the camera is actually installed. (Legacy Nexus 7 code)
- PackageManager mPm = this.cordova.getActivity().getPackageManager();
- if(intent.resolveActivity(mPm) != null)
- {
- this.cordova.startActivityForResult((CordovaPlugin) this, intent, (CAMERA + 1) * 16 + returnType + 1);
- }
- else
- {
- LOG.d(LOG_TAG, "Error: You don't have a default camera. Your device may not be CTS complaint.");
- }
- }
-// else
-// LOG.d(LOG_TAG, "ERROR: You must use the CordovaInterface for this to work correctly. Please implement it in your activity");
- }
-
- /**
- * Create a file in the applications temporary directory based upon the supplied encoding.
- *
- * @param encodingType of the image to be taken
- * @return a File object pointing to the temporary picture
- */
- private File createCaptureFile(int encodingType) {
- return createCaptureFile(encodingType, "");
- }
-
- /**
- * Create a file in the applications temporary directory based upon the supplied encoding.
- *
- * @param encodingType of the image to be taken
- * @param fileName or resultant File object.
- * @return a File object pointing to the temporary picture
- */
- private File createCaptureFile(int encodingType, String fileName) {
- if (fileName.isEmpty()) {
- fileName = ".Pic";
- }
-
- if (encodingType == JPEG) {
- fileName = fileName + JPEG_EXTENSION;
- } else if (encodingType == PNG) {
- fileName = fileName + PNG_EXTENSION;
- } else {
- throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType);
- }
-
- return new File(getTempDirectoryPath(), fileName);
- }
-
-
- /**
- * Get image from photo library.
- *
- * @param srcType The album to get image from.
- * @param returnType Set the type of image to return.
- * @param encodingType
- */
- // TODO: Images selected from SDCARD don't display correctly, but from CAMERA ALBUM do!
- // TODO: Images from kitkat filechooser not going into crop function
- public void getImage(int srcType, int returnType, int encodingType) {
- Intent intent = new Intent();
- String title = GET_PICTURE;
- croppedUri = null;
- croppedFilePath = null;
- if (this.mediaType == PICTURE) {
- intent.setType("image/*");
- if (this.allowEdit) {
- intent.setAction(Intent.ACTION_PICK);
- intent.putExtra("crop", "true");
- if (targetWidth > 0) {
- intent.putExtra("outputX", targetWidth);
- }
- if (targetHeight > 0) {
- intent.putExtra("outputY", targetHeight);
- }
- if (targetHeight > 0 && targetWidth > 0 && targetWidth == targetHeight) {
- intent.putExtra("aspectX", 1);
- intent.putExtra("aspectY", 1);
- }
- File croppedFile = createCaptureFile(JPEG);
- croppedFilePath = croppedFile.getAbsolutePath();
- croppedUri = Uri.fromFile(croppedFile);
- intent.putExtra(MediaStore.EXTRA_OUTPUT, croppedUri);
- } else {
- intent.setAction(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
- }
- } else if (this.mediaType == VIDEO) {
- intent.setType("video/*");
- title = GET_VIDEO;
- intent.setAction(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
- } else if (this.mediaType == ALLMEDIA) {
- // I wanted to make the type 'image/*, video/*' but this does not work on all versions
- // of android so I had to go with the wildcard search.
- intent.setType("*/*");
- title = GET_All;
- intent.setAction(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
- }
- if (this.cordova != null) {
- this.cordova.startActivityForResult((CordovaPlugin) this, Intent.createChooser(intent,
- new String(title)), (srcType + 1) * 16 + returnType + 1);
- }
- }
-
- /**
- * Brings up the UI to perform crop on passed image URI
- *
- * @param picUri
- */
- private void performCrop(Uri picUri, int destType, Intent cameraIntent) {
- try {
- Intent cropIntent = new Intent("com.android.camera.action.CROP");
- // indicate image type and Uri
- cropIntent.setDataAndType(picUri, "image/*");
- // set crop properties
- cropIntent.putExtra("crop", "true");
-
-
- // indicate output X and Y
- if (targetWidth > 0) {
- cropIntent.putExtra("outputX", targetWidth);
- }
- if (targetHeight > 0) {
- cropIntent.putExtra("outputY", targetHeight);
- }
- if (targetHeight > 0 && targetWidth > 0 && targetWidth == targetHeight) {
- cropIntent.putExtra("aspectX", 1);
- cropIntent.putExtra("aspectY", 1);
- }
- // create new file handle to get full resolution crop
- croppedFilePath = createCaptureFile(this.encodingType, System.currentTimeMillis() + "").getAbsolutePath();
- croppedUri = Uri.parse(croppedFilePath);
- cropIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- cropIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
- cropIntent.putExtra("output", croppedUri);
-
-
- // start the activity - we handle returning in onActivityResult
-
- if (this.cordova != null) {
- this.cordova.startActivityForResult((CordovaPlugin) this,
- cropIntent, CROP_CAMERA + destType);
- }
- } catch (ActivityNotFoundException anfe) {
- LOG.e(LOG_TAG, "Crop operation not supported on this device");
- try {
- processResultFromCamera(destType, cameraIntent);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- LOG.e(LOG_TAG, "Unable to write to file");
- }
- }
- }
-
- /**
- * Applies all needed transformation to the image received from the camera.
- *
- * @param destType In which form should we return the image
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- private void processResultFromCamera(int destType, Intent intent) throws IOException {
- int rotate = 0;
-
- // Create an ExifHelper to save the exif data that is lost during compression
- ExifHelper exif = new ExifHelper();
-
- String sourcePath = (this.allowEdit && this.croppedUri != null) ?
- this.croppedFilePath :
- this.imageFilePath;
-
-
- if (this.encodingType == JPEG) {
- try {
- //We don't support PNG, so let's not pretend we do
- exif.createInFile(sourcePath);
- exif.readExifData();
- rotate = exif.getOrientation();
-
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- Bitmap bitmap = null;
- Uri galleryUri = null;
-
- // CB-5479 When this option is given the unchanged image should be saved
- // in the gallery and the modified image is saved in the temporary
- // directory
- if (this.saveToPhotoAlbum) {
- GalleryPathVO galleryPathVO = getPicturesPath();
- galleryUri = Uri.fromFile(new File(galleryPathVO.getGalleryPath()));
-
- if (this.allowEdit && this.croppedUri != null) {
- writeUncompressedImage(croppedUri, galleryUri);
- } else {
- if (Build.VERSION.SDK_INT <= 28) { // Between LOLLIPOP_MR1 and P, can be changed later to the constant Build.VERSION_CODES.P
- writeTakenPictureToGalleryLowerThanAndroidQ(galleryUri);
- } else { // Android Q or higher
- writeTakenPictureToGalleryStartingFromAndroidQ(galleryPathVO);
- }
- }
- }
-
- // If sending base64 image back
- if (destType == DATA_URL) {
- bitmap = getScaledAndRotatedBitmap(sourcePath);
-
- if (bitmap == null) {
- // Try to get the bitmap from intent.
- bitmap = (Bitmap) intent.getExtras().get("data");
- }
-
- // Double-check the bitmap.
- if (bitmap == null) {
- LOG.d(LOG_TAG, "I either have a null image path or bitmap");
- this.failPicture("Unable to create bitmap!");
- return;
- }
-
-
- this.processPicture(bitmap, this.encodingType);
-
- if (!this.saveToPhotoAlbum) {
- checkForDuplicateImage(DATA_URL);
- }
- }
-
- // If sending filename back
- else if (destType == FILE_URI) {
- // If all this is true we shouldn't compress the image.
- if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
- !this.correctOrientation) {
-
- // If we saved the uncompressed photo to the album, we can just
- // return the URI we already created
- if (this.saveToPhotoAlbum) {
- this.callbackContext.success(galleryUri.toString());
- } else {
- Uri uri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
-
- if (this.allowEdit && this.croppedUri != null) {
- Uri croppedUri = Uri.parse(croppedFilePath);
- writeUncompressedImage(croppedUri, uri);
- } else {
- Uri imageUri = this.imageUri;
- writeUncompressedImage(imageUri, uri);
- }
-
- this.callbackContext.success(uri.toString());
- }
- } else {
- Uri uri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
- bitmap = getScaledAndRotatedBitmap(sourcePath);
-
- // Double-check the bitmap.
- if (bitmap == null) {
- LOG.d(LOG_TAG, "I either have a null image path or bitmap");
- this.failPicture("Unable to create bitmap!");
- return;
- }
-
-
- // Add compressed version of captured image to returned media store Uri
- OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri);
- CompressFormat compressFormat = getCompressFormatForEncodingType(encodingType);
-
- bitmap.compress(compressFormat, this.mQuality, os);
- os.close();
-
- // Restore exif data to file
- if (this.encodingType == JPEG) {
- String exifPath;
- exifPath = uri.getPath();
- //We just finished rotating it by an arbitrary orientation, just make sure it's normal
- if(rotate != ExifInterface.ORIENTATION_NORMAL)
- exif.resetOrientation();
- exif.createOutFile(exifPath);
- exif.writeExifData();
- }
-
- // Send Uri back to JavaScript for viewing image
- this.callbackContext.success(uri.toString());
-
- }
- } else {
- throw new IllegalStateException();
- }
-
- this.cleanup(FILE_URI, this.imageUri, galleryUri, bitmap);
- bitmap = null;
- }
-
- private void writeTakenPictureToGalleryLowerThanAndroidQ(Uri galleryUri) throws IOException {
- writeUncompressedImage(imageUri, galleryUri);
- refreshGallery(galleryUri);
- }
-
- private void writeTakenPictureToGalleryStartingFromAndroidQ(GalleryPathVO galleryPathVO) throws IOException {
- // Starting from Android Q, working with the ACTION_MEDIA_SCANNER_SCAN_FILE intent is deprecated
- // https://developer.android.com/reference/android/content/Intent#ACTION_MEDIA_SCANNER_SCAN_FILE
- // we must start working with the MediaStore from Android Q on.
- ContentResolver resolver = this.cordova.getActivity().getContentResolver();
- ContentValues contentValues = new ContentValues();
- contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, galleryPathVO.getGalleryFileName());
- contentValues.put(MediaStore.MediaColumns.MIME_TYPE, getMimetypeForFormat(encodingType));
- Uri galleryOutputUri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
-
- InputStream fileStream = org.apache.cordova.camera.FileHelper.getInputStreamFromUriString(imageUri.toString(), cordova);
- writeUncompressedImage(fileStream, galleryOutputUri);
- }
-
- private CompressFormat getCompressFormatForEncodingType(int encodingType) {
- return encodingType == JPEG ? CompressFormat.JPEG : CompressFormat.PNG;
- }
-
- private GalleryPathVO getPicturesPath() {
- String timeStamp = new SimpleDateFormat(TIME_FORMAT).format(new Date());
- String imageFileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? JPEG_EXTENSION : PNG_EXTENSION);
- File storageDir = Environment.getExternalStoragePublicDirectory(
- Environment.DIRECTORY_PICTURES);
- storageDir.mkdirs();
- return new GalleryPathVO(storageDir.getAbsolutePath(), imageFileName);
- }
-
- private void refreshGallery(Uri contentUri) {
- Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
- // Starting from Android Q, working with the ACTION_MEDIA_SCANNER_SCAN_FILE intent is deprecated
- mediaScanIntent.setData(contentUri);
- this.cordova.getActivity().sendBroadcast(mediaScanIntent);
- }
-
- /**
- * Converts output image format int value to string value of mime type.
- * @param outputFormat int Output format of camera API.
- * Must be value of either JPEG or PNG constant
- * @return String String value of mime type or empty string if mime type is not supported
- */
- private String getMimetypeForFormat(int outputFormat) {
- if (outputFormat == PNG) return PNG_MIME_TYPE;
- if (outputFormat == JPEG) return JPEG_MIME_TYPE;
- return "";
- }
-
-
- private String outputModifiedBitmap(Bitmap bitmap, Uri uri) throws IOException {
- // Some content: URIs do not map to file paths (e.g. picasa).
- String realPath = FileHelper.getRealPath(uri, this.cordova);
-
- // Get filename from uri
- String fileName = realPath != null ?
- realPath.substring(realPath.lastIndexOf('/') + 1) :
- "modified." + (this.encodingType == JPEG ? JPEG_TYPE : PNG_TYPE);
-
- String timeStamp = new SimpleDateFormat(TIME_FORMAT).format(new Date());
- //String fileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? ".jpg" : ".png");
- String modifiedPath = getTempDirectoryPath() + "/" + fileName;
-
- OutputStream os = new FileOutputStream(modifiedPath);
- CompressFormat compressFormat = getCompressFormatForEncodingType(this.encodingType);
-
- bitmap.compress(compressFormat, this.mQuality, os);
- os.close();
-
- if (exifData != null && this.encodingType == JPEG) {
- try {
- if (this.correctOrientation && this.orientationCorrected) {
- exifData.resetOrientation();
- }
- exifData.createOutFile(modifiedPath);
- exifData.writeExifData();
- exifData = null;
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- return modifiedPath;
- }
-
-
- /**
- * Applies all needed transformation to the image received from the gallery.
- *
- * @param destType In which form should we return the image
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- private void processResultFromGallery(int destType, Intent intent) {
- Uri uri = intent.getData();
- if (uri == null) {
- if (croppedUri != null) {
- uri = croppedUri;
- } else {
- this.failPicture("null data from photo library");
- return;
- }
- }
-
- String fileLocation = FileHelper.getRealPath(uri, this.cordova);
- LOG.d(LOG_TAG, "File location is: " + fileLocation);
-
- String uriString = uri.toString();
- String finalLocation = fileLocation != null ? fileLocation : uriString;
- String mimeType = FileHelper.getMimeType(uriString, this.cordova);
-
- if (finalLocation == null) {
- this.failPicture("Error retrieving result.");
- } else {
-
- // If you ask for video or the selected file doesn't have JPEG or PNG mime type
- // there will be no attempt to resize any returned data
- if (this.mediaType == VIDEO || !(JPEG_MIME_TYPE.equalsIgnoreCase(mimeType) || PNG_MIME_TYPE.equalsIgnoreCase(mimeType))) {
- this.callbackContext.success(finalLocation);
- }
- else {
-
- // This is a special case to just return the path as no scaling,
- // rotating, nor compressing needs to be done
- if (this.targetHeight == -1 && this.targetWidth == -1 &&
- destType == FILE_URI && !this.correctOrientation &&
- mimeType != null && mimeType.equalsIgnoreCase(getMimetypeForFormat(encodingType)))
- {
- this.callbackContext.success(finalLocation);
- } else {
- Bitmap bitmap = null;
- try {
- bitmap = getScaledAndRotatedBitmap(uriString);
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (bitmap == null) {
- LOG.d(LOG_TAG, "I either have a null image path or bitmap");
- this.failPicture("Unable to create bitmap!");
- return;
- }
-
- // If sending base64 image back
- if (destType == DATA_URL) {
- this.processPicture(bitmap, this.encodingType);
- }
-
- // If sending filename back
- else if (destType == FILE_URI) {
- // Did we modify the image?
- if ( (this.targetHeight > 0 && this.targetWidth > 0) ||
- (this.correctOrientation && this.orientationCorrected) ||
- !mimeType.equalsIgnoreCase(getMimetypeForFormat(encodingType)))
- {
- try {
- String modifiedPath = this.outputModifiedBitmap(bitmap, uri);
- // The modified image is cached by the app in order to get around this and not have to delete you
- // application cache I'm adding the current system time to the end of the file url.
- this.callbackContext.success("file://" + modifiedPath + "?" + System.currentTimeMillis());
-
- } catch (Exception e) {
- e.printStackTrace();
- this.failPicture("Error retrieving image.");
- }
- } else {
- this.callbackContext.success(finalLocation);
- }
- }
- if (bitmap != null) {
- bitmap.recycle();
- bitmap = null;
- }
- System.gc();
- }
- }
- }
-
- }
-
- /**
- * Called when the camera view exits.
- *
- * @param requestCode The request code originally supplied to startActivityForResult(),
- * allowing you to identify who this result came from.
- * @param resultCode The integer result code returned by the child activity through its setResult().
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
-
- // Get src and dest types from request code for a Camera Activity
- int srcType = (requestCode / 16) - 1;
- int destType = (requestCode % 16) - 1;
-
- // If Camera Crop
- if (requestCode >= CROP_CAMERA) {
- if (resultCode == Activity.RESULT_OK) {
-
- // Because of the inability to pass through multiple intents, this hack will allow us
- // to pass arcane codes back.
- destType = requestCode - CROP_CAMERA;
- try {
- processResultFromCamera(destType, intent);
- } catch (IOException e) {
- e.printStackTrace();
- LOG.e(LOG_TAG, "Unable to write to file");
- }
-
- }// If cancelled
- else if (resultCode == Activity.RESULT_CANCELED) {
- this.failPicture("No Image Selected");
- }
-
- // If something else
- else {
- this.failPicture("Did not complete!");
- }
- }
- // If CAMERA
- else if (srcType == CAMERA) {
- // If image available
- if (resultCode == Activity.RESULT_OK) {
- try {
- if (this.allowEdit) {
- Uri tmpFile = FileProvider.getUriForFile(cordova.getActivity(),
- applicationId + ".cordova.plugin.camera.provider",
- createCaptureFile(this.encodingType));
- performCrop(tmpFile, destType, intent);
- } else {
- this.processResultFromCamera(destType, intent);
- }
- } catch (IOException e) {
- e.printStackTrace();
- this.failPicture("Error capturing image.");
- }
- }
-
- // If cancelled
- else if (resultCode == Activity.RESULT_CANCELED) {
- this.failPicture("No Image Selected");
- }
-
- // If something else
- else {
- this.failPicture("Did not complete!");
- }
- }
- // If retrieving photo from library
- else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
- if (resultCode == Activity.RESULT_OK && intent != null) {
- final Intent i = intent;
- final int finalDestType = destType;
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- processResultFromGallery(finalDestType, i);
- }
- });
- } else if (resultCode == Activity.RESULT_CANCELED) {
- this.failPicture("No Image Selected");
- } else {
- this.failPicture("Selection did not complete!");
- }
- }
- }
-
- private int exifToDegrees(int exifOrientation) {
- if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
- return 90;
- } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {
- return 180;
- } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {
- return 270;
- } else {
- return 0;
- }
- }
-
- /**
- * Write an inputstream to local disk
- *
- * @param fis - The InputStream to write
- * @param dest - Destination on disk to write to
- * @throws FileNotFoundException
- * @throws IOException
- */
- private void writeUncompressedImage(InputStream fis, Uri dest) throws FileNotFoundException,
- IOException {
- OutputStream os = null;
- try {
- os = this.cordova.getActivity().getContentResolver().openOutputStream(dest);
- byte[] buffer = new byte[4096];
- int len;
- while ((len = fis.read(buffer)) != -1) {
- os.write(buffer, 0, len);
- }
- os.flush();
- } finally {
- if (os != null) {
- try {
- os.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG, "Exception while closing output stream.");
- }
- }
- if (fis != null) {
- try {
- fis.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG, "Exception while closing file input stream.");
- }
- }
- }
- }
- /**
- * In the special case where the default width, height and quality are unchanged
- * we just write the file out to disk saving the expensive Bitmap.compress function.
- *
- * @param src
- * @throws FileNotFoundException
- * @throws IOException
- */
- private void writeUncompressedImage(Uri src, Uri dest) throws FileNotFoundException,
- IOException {
-
- InputStream fis = FileHelper.getInputStreamFromUriString(src.toString(), cordova);
- writeUncompressedImage(fis, dest);
-
- }
-
- /**
- * Return a scaled and rotated bitmap based on the target width and height
- *
- * @param imageUrl
- * @return
- * @throws IOException
- */
- private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
- // If no new width or height were specified, and orientation is not needed return the original bitmap
- if (this.targetWidth <= 0 && this.targetHeight <= 0 && !(this.correctOrientation)) {
- InputStream fileStream = null;
- Bitmap image = null;
- try {
- fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
- image = BitmapFactory.decodeStream(fileStream);
- } catch (OutOfMemoryError e) {
- callbackContext.error(e.getLocalizedMessage());
- } catch (Exception e){
- callbackContext.error(e.getLocalizedMessage());
- }
- finally {
- if (fileStream != null) {
- try {
- fileStream.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG, "Exception while closing file input stream.");
- }
- }
- }
- return image;
- }
-
-
- /* Copy the inputstream to a temporary file on the device.
- We then use this temporary file to determine the width/height/orientation.
- This is the only way to determine the orientation of the photo coming from 3rd party providers (Google Drive, Dropbox,etc)
- This also ensures we create a scaled bitmap with the correct orientation
-
- We delete the temporary file once we are done
- */
- File localFile = null;
- Uri galleryUri = null;
- int rotate = 0;
- try {
- InputStream fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
- if (fileStream != null) {
- // Generate a temporary file
- String timeStamp = new SimpleDateFormat(TIME_FORMAT).format(new Date());
- String fileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? JPEG_EXTENSION : PNG_EXTENSION);
- localFile = new File(getTempDirectoryPath() + fileName);
- galleryUri = Uri.fromFile(localFile);
- writeUncompressedImage(fileStream, galleryUri);
- try {
- String mimeType = FileHelper.getMimeType(imageUrl.toString(), cordova);
- if (JPEG_MIME_TYPE.equalsIgnoreCase(mimeType)) {
- // ExifInterface doesn't like the file:// prefix
- String filePath = galleryUri.toString().replace("file://", "");
- // read exifData of source
- exifData = new ExifHelper();
- exifData.createInFile(filePath);
- exifData.readExifData();
- // Use ExifInterface to pull rotation information
- if (this.correctOrientation) {
- ExifInterface exif = new ExifInterface(filePath);
- rotate = exifToDegrees(exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED));
- }
- }
- } catch (Exception oe) {
- LOG.w(LOG_TAG,"Unable to read Exif data: "+ oe.toString());
- rotate = 0;
- }
- }
- }
- catch (Exception e)
- {
- LOG.e(LOG_TAG,"Exception while getting input stream: "+ e.toString());
- return null;
- }
-
-
-
- try {
- // figure out the original width and height of the image
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inJustDecodeBounds = true;
- InputStream fileStream = null;
- try {
- fileStream = FileHelper.getInputStreamFromUriString(galleryUri.toString(), cordova);
- BitmapFactory.decodeStream(fileStream, null, options);
- } finally {
- if (fileStream != null) {
- try {
- fileStream.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG, "Exception while closing file input stream.");
- }
- }
- }
-
-
- //CB-2292: WTF? Why is the width null?
- if (options.outWidth == 0 || options.outHeight == 0) {
- return null;
- }
-
- // User didn't specify output dimensions, but they need orientation
- if (this.targetWidth <= 0 && this.targetHeight <= 0) {
- this.targetWidth = options.outWidth;
- this.targetHeight = options.outHeight;
- }
-
- // Setup target width/height based on orientation
- int rotatedWidth, rotatedHeight;
- boolean rotated= false;
- if (rotate == 90 || rotate == 270) {
- rotatedWidth = options.outHeight;
- rotatedHeight = options.outWidth;
- rotated = true;
- } else {
- rotatedWidth = options.outWidth;
- rotatedHeight = options.outHeight;
- }
-
- // determine the correct aspect ratio
- int[] widthHeight = calculateAspectRatio(rotatedWidth, rotatedHeight);
-
-
- // Load in the smallest bitmap possible that is closest to the size we want
- options.inJustDecodeBounds = false;
- options.inSampleSize = calculateSampleSize(rotatedWidth, rotatedHeight, widthHeight[0], widthHeight[1]);
- Bitmap unscaledBitmap = null;
- try {
- fileStream = FileHelper.getInputStreamFromUriString(galleryUri.toString(), cordova);
- unscaledBitmap = BitmapFactory.decodeStream(fileStream, null, options);
- } finally {
- if (fileStream != null) {
- try {
- fileStream.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG, "Exception while closing file input stream.");
- }
- }
- }
- if (unscaledBitmap == null) {
- return null;
- }
-
- int scaledWidth = (!rotated) ? widthHeight[0] : widthHeight[1];
- int scaledHeight = (!rotated) ? widthHeight[1] : widthHeight[0];
-
- Bitmap scaledBitmap = Bitmap.createScaledBitmap(unscaledBitmap, scaledWidth, scaledHeight, true);
- if (scaledBitmap != unscaledBitmap) {
- unscaledBitmap.recycle();
- unscaledBitmap = null;
- }
- if (this.correctOrientation && (rotate != 0)) {
- Matrix matrix = new Matrix();
- matrix.setRotate(rotate);
- try {
- scaledBitmap = Bitmap.createBitmap(scaledBitmap, 0, 0, scaledBitmap.getWidth(), scaledBitmap.getHeight(), matrix, true);
- this.orientationCorrected = true;
- } catch (OutOfMemoryError oom) {
- this.orientationCorrected = false;
- }
- }
- return scaledBitmap;
- }
- finally {
- // delete the temporary copy
- if (localFile != null) {
- localFile.delete();
- }
- }
-
- }
-
- /**
- * Maintain the aspect ratio so the resulting image does not look smooshed
- *
- * @param origWidth
- * @param origHeight
- * @return
- */
- public int[] calculateAspectRatio(int origWidth, int origHeight) {
- int newWidth = this.targetWidth;
- int newHeight = this.targetHeight;
-
- // If no new width or height were specified return the original bitmap
- if (newWidth <= 0 && newHeight <= 0) {
- newWidth = origWidth;
- newHeight = origHeight;
- }
- // Only the width was specified
- else if (newWidth > 0 && newHeight <= 0) {
- newHeight = (int)((double)(newWidth / (double)origWidth) * origHeight);
- }
- // only the height was specified
- else if (newWidth <= 0 && newHeight > 0) {
- newWidth = (int)((double)(newHeight / (double)origHeight) * origWidth);
- }
- // If the user specified both a positive width and height
- // (potentially different aspect ratio) then the width or height is
- // scaled so that the image fits while maintaining aspect ratio.
- // Alternatively, the specified width and height could have been
- // kept and Bitmap.SCALE_TO_FIT specified when scaling, but this
- // would result in whitespace in the new image.
- else {
- double newRatio = newWidth / (double) newHeight;
- double origRatio = origWidth / (double) origHeight;
-
- if (origRatio > newRatio) {
- newHeight = (newWidth * origHeight) / origWidth;
- } else if (origRatio < newRatio) {
- newWidth = (newHeight * origWidth) / origHeight;
- }
- }
-
- int[] retval = new int[2];
- retval[0] = newWidth;
- retval[1] = newHeight;
- return retval;
- }
-
- /**
- * Figure out what ratio we can load our image into memory at while still being bigger than
- * our desired width and height
- *
- * @param srcWidth
- * @param srcHeight
- * @param dstWidth
- * @param dstHeight
- * @return
- */
- public static int calculateSampleSize(int srcWidth, int srcHeight, int dstWidth, int dstHeight) {
- final float srcAspect = (float) srcWidth / (float) srcHeight;
- final float dstAspect = (float) dstWidth / (float) dstHeight;
-
- if (srcAspect > dstAspect) {
- return srcWidth / dstWidth;
- } else {
- return srcHeight / dstHeight;
- }
- }
-
- /**
- * Creates a cursor that can be used to determine how many images we have.
- *
- * @return a cursor
- */
- private Cursor queryImgDB(Uri contentStore) {
- return this.cordova.getActivity().getContentResolver().query(
- contentStore,
- new String[]{MediaStore.Images.Media._ID},
- null,
- null,
- null);
- }
-
- /**
- * Cleans up after picture taking. Checking for duplicates and that kind of stuff.
- *
- * @param newImage
- */
- private void cleanup(int imageType, Uri oldImage, Uri newImage, Bitmap bitmap) {
- if (bitmap != null) {
- bitmap.recycle();
- }
-
- // Clean up initial camera-written image file.
- (new File(FileHelper.stripFileProtocol(oldImage.toString()))).delete();
-
- checkForDuplicateImage(imageType);
- // Scan for the gallery to update pic refs in gallery
- if (this.saveToPhotoAlbum && newImage != null) {
- this.scanForGallery(newImage);
- }
-
- System.gc();
- }
-
- /**
- * Used to find out if we are in a situation where the Camera Intent adds to images
- * to the content store. If we are using a FILE_URI and the number of images in the DB
- * increases by 2 we have a duplicate, when using a DATA_URL the number is 1.
- *
- * @param type FILE_URI or DATA_URL
- */
- private void checkForDuplicateImage(int type) {
- int diff = 1;
- Uri contentStore = whichContentStore();
- Cursor cursor = queryImgDB(contentStore);
- int currentNumOfImages = cursor.getCount();
-
- if (type == FILE_URI && this.saveToPhotoAlbum) {
- diff = 2;
- }
-
- // delete the duplicate file if the difference is 2 for file URI or 1 for Data URL
- if ((currentNumOfImages - numPics) == diff) {
- cursor.moveToLast();
- int id = Integer.valueOf(cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media._ID)));
- if (diff == 2) {
- id--;
- }
- Uri uri = Uri.parse(contentStore + "/" + id);
- this.cordova.getActivity().getContentResolver().delete(uri, null, null);
- cursor.close();
- }
- }
-
- /**
- * Determine if we are storing the images in internal or external storage
- *
- * @return Uri
- */
- private Uri whichContentStore() {
- if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- return MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
- } else {
- return MediaStore.Images.Media.INTERNAL_CONTENT_URI;
- }
- }
-
- /**
- * Compress bitmap using jpeg, convert to Base64 encoded string, and return to JavaScript.
- *
- * @param bitmap
- */
- public void processPicture(Bitmap bitmap, int encodingType) {
- ByteArrayOutputStream jpeg_data = new ByteArrayOutputStream();
- CompressFormat compressFormat = getCompressFormatForEncodingType(encodingType);
-
- try {
- if (bitmap.compress(compressFormat, mQuality, jpeg_data)) {
- byte[] code = jpeg_data.toByteArray();
- byte[] output = Base64.encode(code, Base64.NO_WRAP);
- String js_out = new String(output);
- this.callbackContext.success(js_out);
- js_out = null;
- output = null;
- code = null;
- }
- } catch (Exception e) {
- this.failPicture("Error compressing image.");
- }
- jpeg_data = null;
- }
-
- /**
- * Send error message to JavaScript.
- *
- * @param err
- */
- public void failPicture(String err) {
- this.callbackContext.error(err);
- }
-
- private void scanForGallery(Uri newImage) {
- this.scanMe = newImage;
- if (this.conn != null) {
- this.conn.disconnect();
- }
- this.conn = new MediaScannerConnection(this.cordova.getActivity().getApplicationContext(), this);
- conn.connect();
- }
-
- public void onMediaScannerConnected() {
- try {
- this.conn.scanFile(this.scanMe.toString(), "image/*");
- } catch (IllegalStateException e) {
- LOG.e(LOG_TAG, "Can't scan file in MediaScanner after taking picture");
- }
-
- }
-
- public void onScanCompleted(String path, Uri uri) {
- this.conn.disconnect();
- }
-
-
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException {
- for (int r : grantResults) {
- if (r == PackageManager.PERMISSION_DENIED) {
- this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, PERMISSION_DENIED_ERROR));
- return;
- }
- }
- switch (requestCode) {
- case TAKE_PIC_SEC:
- takePicture(this.destType, this.encodingType);
- break;
- case SAVE_TO_ALBUM_SEC:
- this.getImage(this.srcType, this.destType, this.encodingType);
- break;
- }
- }
-
- /**
- * Taking or choosing a picture launches another Activity, so we need to implement the
- * save/restore APIs to handle the case where the CordovaActivity is killed by the OS
- * before we get the launched Activity's result.
- */
- public Bundle onSaveInstanceState() {
- Bundle state = new Bundle();
- state.putInt("destType", this.destType);
- state.putInt("srcType", this.srcType);
- state.putInt("mQuality", this.mQuality);
- state.putInt("targetWidth", this.targetWidth);
- state.putInt("targetHeight", this.targetHeight);
- state.putInt("encodingType", this.encodingType);
- state.putInt("mediaType", this.mediaType);
- state.putInt("numPics", this.numPics);
- state.putBoolean("allowEdit", this.allowEdit);
- state.putBoolean("correctOrientation", this.correctOrientation);
- state.putBoolean("saveToPhotoAlbum", this.saveToPhotoAlbum);
-
- if (this.croppedUri != null) {
- state.putString(CROPPED_URI_KEY, this.croppedFilePath);
- }
-
- if (this.imageUri != null) {
- state.putString(IMAGE_URI_KEY, this.imageFilePath);
- }
-
- return state;
- }
-
- public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {
- this.destType = state.getInt("destType");
- this.srcType = state.getInt("srcType");
- this.mQuality = state.getInt("mQuality");
- this.targetWidth = state.getInt("targetWidth");
- this.targetHeight = state.getInt("targetHeight");
- this.encodingType = state.getInt("encodingType");
- this.mediaType = state.getInt("mediaType");
- this.numPics = state.getInt("numPics");
- this.allowEdit = state.getBoolean("allowEdit");
- this.correctOrientation = state.getBoolean("correctOrientation");
- this.saveToPhotoAlbum = state.getBoolean("saveToPhotoAlbum");
-
- if (state.containsKey(CROPPED_URI_KEY)) {
- this.croppedUri = Uri.parse(state.getString(CROPPED_URI_KEY));
- }
-
- if (state.containsKey(IMAGE_URI_KEY)) {
- //I have no idea what type of URI is being passed in
- this.imageUri = Uri.parse(state.getString(IMAGE_URI_KEY));
- }
-
- this.callbackContext = callbackContext;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/ExifHelper.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/ExifHelper.java
deleted file mode 100644
index 5160a2f6a..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/ExifHelper.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.camera;
-
-import java.io.IOException;
-
-import android.media.ExifInterface;
-
-public class ExifHelper {
- private String aperture = null;
- private String datetime = null;
- private String exposureTime = null;
- private String flash = null;
- private String focalLength = null;
- private String gpsAltitude = null;
- private String gpsAltitudeRef = null;
- private String gpsDateStamp = null;
- private String gpsLatitude = null;
- private String gpsLatitudeRef = null;
- private String gpsLongitude = null;
- private String gpsLongitudeRef = null;
- private String gpsProcessingMethod = null;
- private String gpsTimestamp = null;
- private String iso = null;
- private String make = null;
- private String model = null;
- private String orientation = null;
- private String whiteBalance = null;
-
- private ExifInterface inFile = null;
- private ExifInterface outFile = null;
-
- /**
- * The file before it is compressed
- *
- * @param filePath
- * @throws IOException
- */
- public void createInFile(String filePath) throws IOException {
- this.inFile = new ExifInterface(filePath);
- }
-
- /**
- * The file after it has been compressed
- *
- * @param filePath
- * @throws IOException
- */
- public void createOutFile(String filePath) throws IOException {
- this.outFile = new ExifInterface(filePath);
- }
-
- /**
- * Reads all the EXIF data from the input file.
- */
- public void readExifData() {
- this.aperture = inFile.getAttribute(ExifInterface.TAG_APERTURE);
- this.datetime = inFile.getAttribute(ExifInterface.TAG_DATETIME);
- this.exposureTime = inFile.getAttribute(ExifInterface.TAG_EXPOSURE_TIME);
- this.flash = inFile.getAttribute(ExifInterface.TAG_FLASH);
- this.focalLength = inFile.getAttribute(ExifInterface.TAG_FOCAL_LENGTH);
- this.gpsAltitude = inFile.getAttribute(ExifInterface.TAG_GPS_ALTITUDE);
- this.gpsAltitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF);
- this.gpsDateStamp = inFile.getAttribute(ExifInterface.TAG_GPS_DATESTAMP);
- this.gpsLatitude = inFile.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
- this.gpsLatitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
- this.gpsLongitude = inFile.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
- this.gpsLongitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);
- this.gpsProcessingMethod = inFile.getAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD);
- this.gpsTimestamp = inFile.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP);
- this.iso = inFile.getAttribute(ExifInterface.TAG_ISO);
- this.make = inFile.getAttribute(ExifInterface.TAG_MAKE);
- this.model = inFile.getAttribute(ExifInterface.TAG_MODEL);
- this.orientation = inFile.getAttribute(ExifInterface.TAG_ORIENTATION);
- this.whiteBalance = inFile.getAttribute(ExifInterface.TAG_WHITE_BALANCE);
- }
-
- /**
- * Writes the previously stored EXIF data to the output file.
- *
- * @throws IOException
- */
- public void writeExifData() throws IOException {
- // Don't try to write to a null file
- if (this.outFile == null) {
- return;
- }
-
- if (this.aperture != null) {
- this.outFile.setAttribute(ExifInterface.TAG_APERTURE, this.aperture);
- }
- if (this.datetime != null) {
- this.outFile.setAttribute(ExifInterface.TAG_DATETIME, this.datetime);
- }
- if (this.exposureTime != null) {
- this.outFile.setAttribute(ExifInterface.TAG_EXPOSURE_TIME, this.exposureTime);
- }
- if (this.flash != null) {
- this.outFile.setAttribute(ExifInterface.TAG_FLASH, this.flash);
- }
- if (this.focalLength != null) {
- this.outFile.setAttribute(ExifInterface.TAG_FOCAL_LENGTH, this.focalLength);
- }
- if (this.gpsAltitude != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_ALTITUDE, this.gpsAltitude);
- }
- if (this.gpsAltitudeRef != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF, this.gpsAltitudeRef);
- }
- if (this.gpsDateStamp != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_DATESTAMP, this.gpsDateStamp);
- }
- if (this.gpsLatitude != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LATITUDE, this.gpsLatitude);
- }
- if (this.gpsLatitudeRef != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, this.gpsLatitudeRef);
- }
- if (this.gpsLongitude != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, this.gpsLongitude);
- }
- if (this.gpsLongitudeRef != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, this.gpsLongitudeRef);
- }
- if (this.gpsProcessingMethod != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD, this.gpsProcessingMethod);
- }
- if (this.gpsTimestamp != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_TIMESTAMP, this.gpsTimestamp);
- }
- if (this.iso != null) {
- this.outFile.setAttribute(ExifInterface.TAG_ISO, this.iso);
- }
- if (this.make != null) {
- this.outFile.setAttribute(ExifInterface.TAG_MAKE, this.make);
- }
- if (this.model != null) {
- this.outFile.setAttribute(ExifInterface.TAG_MODEL, this.model);
- }
- if (this.orientation != null) {
- this.outFile.setAttribute(ExifInterface.TAG_ORIENTATION, this.orientation);
- }
- if (this.whiteBalance != null) {
- this.outFile.setAttribute(ExifInterface.TAG_WHITE_BALANCE, this.whiteBalance);
- }
-
- this.outFile.saveAttributes();
- }
-
- public int getOrientation() {
- int o = Integer.parseInt(this.orientation);
-
- if (o == ExifInterface.ORIENTATION_NORMAL) {
- return 0;
- } else if (o == ExifInterface.ORIENTATION_ROTATE_90) {
- return 90;
- } else if (o == ExifInterface.ORIENTATION_ROTATE_180) {
- return 180;
- } else if (o == ExifInterface.ORIENTATION_ROTATE_270) {
- return 270;
- } else {
- return 0;
- }
- }
-
- public void resetOrientation() {
- this.orientation = "" + ExifInterface.ORIENTATION_NORMAL;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileHelper.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileHelper.java
deleted file mode 100644
index 7a5524b8d..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileHelper.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.camera;
-
-import android.annotation.SuppressLint;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.CursorLoader;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Environment;
-import android.provider.DocumentsContract;
-import android.provider.MediaStore;
-import android.webkit.MimeTypeMap;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.LOG;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Locale;
-
-public class FileHelper {
- private static final String LOG_TAG = "FileUtils";
- private static final String _DATA = "_data";
-
- /**
- * Returns the real path of the given URI string.
- * If the given URI string represents a content:// URI, the real path is retrieved from the media store.
- *
- * @param uriString the URI string of the audio/image/video
- * @param cordova the current application context
- * @return the full path to the file
- */
- @SuppressWarnings("deprecation")
- public static String getRealPath(Uri uri, CordovaInterface cordova) {
- return FileHelper.getRealPathFromURI(cordova.getActivity(), uri);
- }
-
- /**
- * Returns the real path of the given URI.
- * If the given URI is a content:// URI, the real path is retrieved from the media store.
- *
- * @param uri the URI of the audio/image/video
- * @param cordova the current application context
- * @return the full path to the file
- */
- public static String getRealPath(String uriString, CordovaInterface cordova) {
- return FileHelper.getRealPath(Uri.parse(uriString), cordova);
- }
-
- @SuppressLint("NewApi")
- public static String getRealPathFromURI(final Context context, final Uri uri) {
- // DocumentProvider
- if (DocumentsContract.isDocumentUri(context, uri)) {
-
- // ExternalStorageProvider
- if (isExternalStorageDocument(uri)) {
- final String docId = DocumentsContract.getDocumentId(uri);
- final String[] split = docId.split(":");
- final String type = split[0];
-
- if ("primary".equalsIgnoreCase(type)) {
- return Environment.getExternalStorageDirectory() + "/" + split[1];
- }
-
- // TODO handle non-primary volumes
- }
- // DownloadsProvider
- else if (isDownloadsDocument(uri)) {
-
- final String id = DocumentsContract.getDocumentId(uri);
- if (id != null && id.length() > 0) {
- if (id.startsWith("raw:")) {
- return id.replaceFirst("raw:", "");
- }
- try {
- final Uri contentUri = ContentUris.withAppendedId(
- Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
-
- return getDataColumn(context, contentUri, null, null);
- } catch (NumberFormatException e) {
- return null;
- }
- } else {
- return null;
- }
- }
- // MediaProvider
- else if (isMediaDocument(uri)) {
- final String docId = DocumentsContract.getDocumentId(uri);
- final String[] split = docId.split(":");
- final String type = split[0];
-
- Uri contentUri = null;
- if ("image".equals(type)) {
- contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
- } else if ("video".equals(type)) {
- contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
- } else if ("audio".equals(type)) {
- contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
- }
-
- final String selection = "_id=?";
- final String[] selectionArgs = new String[] {
- split[1]
- };
-
- return getDataColumn(context, contentUri, selection, selectionArgs);
- }
- }
- // MediaStore (and general)
- else if ("content".equalsIgnoreCase(uri.getScheme())) {
-
- // Return the remote address
- if (isGooglePhotosUri(uri))
- return uri.getLastPathSegment();
-
- return getDataColumn(context, uri, null, null);
- }
- // File
- else if ("file".equalsIgnoreCase(uri.getScheme())) {
- return uri.getPath();
- }
-
- return null;
- }
-
- public static String getRealPathFromURI_BelowAPI11(Context context, Uri contentUri) {
- String[] proj = { MediaStore.Images.Media.DATA };
- String result = null;
-
- try {
- Cursor cursor = context.getContentResolver().query(contentUri, proj, null, null, null);
- int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
- cursor.moveToFirst();
- result = cursor.getString(column_index);
-
- } catch (Exception e) {
- result = null;
- }
- return result;
- }
-
- /**
- * Returns an input stream based on given URI string.
- *
- * @param uriString the URI string from which to obtain the input stream
- * @param cordova the current application context
- * @return an input stream into the data at the given URI or null if given an invalid URI string
- * @throws IOException
- */
- public static InputStream getInputStreamFromUriString(String uriString, CordovaInterface cordova)
- throws IOException {
- InputStream returnValue = null;
- if (uriString.startsWith("content")) {
- Uri uri = Uri.parse(uriString);
- returnValue = cordova.getActivity().getContentResolver().openInputStream(uri);
- } else if (uriString.startsWith("file://")) {
- int question = uriString.indexOf("?");
- if (question > -1) {
- uriString = uriString.substring(0, question);
- }
- if (uriString.startsWith("file:///android_asset/")) {
- Uri uri = Uri.parse(uriString);
- String relativePath = uri.getPath().substring(15);
- returnValue = cordova.getActivity().getAssets().open(relativePath);
- } else {
- // might still be content so try that first
- try {
- returnValue = cordova.getActivity().getContentResolver().openInputStream(Uri.parse(uriString));
- } catch (Exception e) {
- returnValue = null;
- }
- if (returnValue == null) {
- returnValue = new FileInputStream(getRealPath(uriString, cordova));
- }
- }
- } else {
- returnValue = new FileInputStream(uriString);
- }
- return returnValue;
- }
-
- /**
- * Removes the "file://" prefix from the given URI string, if applicable.
- * If the given URI string doesn't have a "file://" prefix, it is returned unchanged.
- *
- * @param uriString the URI string to operate on
- * @return a path without the "file://" prefix
- */
- public static String stripFileProtocol(String uriString) {
- if (uriString.startsWith("file://")) {
- uriString = uriString.substring(7);
- }
- return uriString;
- }
-
- public static String getMimeTypeForExtension(String path) {
- String extension = path;
- int lastDot = extension.lastIndexOf('.');
- if (lastDot != -1) {
- extension = extension.substring(lastDot + 1);
- }
- // Convert the URI string to lower case to ensure compatibility with MimeTypeMap (see CB-2185).
- extension = extension.toLowerCase(Locale.getDefault());
- if (extension.equals("3ga")) {
- return "audio/3gpp";
- }
- return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
- }
-
- /**
- * Returns the mime type of the data specified by the given URI string.
- *
- * @param uriString the URI string of the data
- * @return the mime type of the specified data
- */
- public static String getMimeType(String uriString, CordovaInterface cordova) {
- String mimeType = null;
-
- Uri uri = Uri.parse(uriString);
- if (uriString.startsWith("content://")) {
- mimeType = cordova.getActivity().getContentResolver().getType(uri);
- } else {
- mimeType = getMimeTypeForExtension(uri.getPath());
- }
-
- return mimeType;
- }
-
- /**
- * Get the value of the data column for this Uri. This is useful for
- * MediaStore Uris, and other file-based ContentProviders.
- *
- * @param context The context.
- * @param uri The Uri to query.
- * @param selection (Optional) Filter used in the query.
- * @param selectionArgs (Optional) Selection arguments used in the query.
- * @return The value of the _data column, which is typically a file path.
- * @author paulburke
- */
- public static String getDataColumn(Context context, Uri uri, String selection,
- String[] selectionArgs) {
-
- Cursor cursor = null;
- final String column = "_data";
- final String[] projection = {
- column
- };
-
- try {
- cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
- null);
- if (cursor != null && cursor.moveToFirst()) {
-
- final int column_index = cursor.getColumnIndexOrThrow(column);
- return cursor.getString(column_index);
- }
- } catch (Exception e) {
- return null;
- } finally {
- if (cursor != null)
- cursor.close();
- }
- return null;
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is ExternalStorageProvider.
- * @author paulburke
- */
- public static boolean isExternalStorageDocument(Uri uri) {
- return "com.android.externalstorage.documents".equals(uri.getAuthority());
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is DownloadsProvider.
- * @author paulburke
- */
- public static boolean isDownloadsDocument(Uri uri) {
- return "com.android.providers.downloads.documents".equals(uri.getAuthority());
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is MediaProvider.
- * @author paulburke
- */
- public static boolean isMediaDocument(Uri uri) {
- return "com.android.providers.media.documents".equals(uri.getAuthority());
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is Google Photos.
- */
- public static boolean isGooglePhotosUri(Uri uri) {
- return "com.google.android.apps.photos.content".equals(uri.getAuthority());
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileProvider.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileProvider.java
deleted file mode 100644
index 67c214c32..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileProvider.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.camera;
-
-public class FileProvider extends androidx.core.content.FileProvider {}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/GalleryPathVO.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/GalleryPathVO.java
deleted file mode 100644
index 579044327..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/GalleryPathVO.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.camera;
-
-public class GalleryPathVO {
- private final String galleryPath;
- private String picturesDirectory;
- private String galleryFileName;
-
- public GalleryPathVO(String picturesDirectory, String galleryFileName) {
- this.picturesDirectory = picturesDirectory;
- this.galleryFileName = galleryFileName;
- this.galleryPath = this.picturesDirectory + "/" + this.galleryFileName;
- }
-
- public String getGalleryPath() {
- return galleryPath;
- }
-
- public String getPicturesDirectory() {
- return picturesDirectory;
- }
-
- public String getGalleryFileName() {
- return galleryFileName;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/device/Device.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/device/Device.java
deleted file mode 100644
index e9efcb49b..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/device/Device.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.device;
-
-import java.util.TimeZone;
-
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaInterface;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.provider.Settings;
-
-public class Device extends CordovaPlugin {
- public static final String TAG = "Device";
-
- public static String platform; // Device OS
- public static String uuid; // Device UUID
-
- private static final String ANDROID_PLATFORM = "Android";
- private static final String AMAZON_PLATFORM = "amazon-fireos";
- private static final String AMAZON_DEVICE = "Amazon";
-
- /**
- * Constructor.
- */
- public Device() {
- }
-
- /**
- * Sets the context of the Command. This can then be used to do things like
- * get file paths associated with the Activity.
- *
- * @param cordova The context of the main Activity.
- * @param webView The CordovaWebView Cordova is running in.
- */
- public void initialize(CordovaInterface cordova, CordovaWebView webView) {
- super.initialize(cordova, webView);
- Device.uuid = getUuid();
- }
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArry of arguments for the plugin.
- * @param callbackContext The callback id used when calling back into JavaScript.
- * @return True if the action was valid, false if not.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- if ("getDeviceInfo".equals(action)) {
- JSONObject r = new JSONObject();
- r.put("uuid", Device.uuid);
- r.put("version", this.getOSVersion());
- r.put("platform", this.getPlatform());
- r.put("model", this.getModel());
- r.put("manufacturer", this.getManufacturer());
- r.put("isVirtual", this.isVirtual());
- r.put("serial", this.getSerialNumber());
- callbackContext.success(r);
- }
- else {
- return false;
- }
- return true;
- }
-
- //--------------------------------------------------------------------------
- // LOCAL METHODS
- //--------------------------------------------------------------------------
-
- /**
- * Get the OS name.
- *
- * @return
- */
- public String getPlatform() {
- String platform;
- if (isAmazonDevice()) {
- platform = AMAZON_PLATFORM;
- } else {
- platform = ANDROID_PLATFORM;
- }
- return platform;
- }
-
- /**
- * Get the device's Universally Unique Identifier (UUID).
- *
- * @return
- */
- public String getUuid() {
- String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
- return uuid;
- }
-
- public String getModel() {
- String model = android.os.Build.MODEL;
- return model;
- }
-
- public String getProductName() {
- String productname = android.os.Build.PRODUCT;
- return productname;
- }
-
- public String getManufacturer() {
- String manufacturer = android.os.Build.MANUFACTURER;
- return manufacturer;
- }
-
- public String getSerialNumber() {
- String serial = android.os.Build.SERIAL;
- return serial;
- }
-
- /**
- * Get the OS version.
- *
- * @return
- */
- public String getOSVersion() {
- String osversion = android.os.Build.VERSION.RELEASE;
- return osversion;
- }
-
- public String getSDKVersion() {
- @SuppressWarnings("deprecation")
- String sdkversion = android.os.Build.VERSION.SDK;
- return sdkversion;
- }
-
- public String getTimeZoneID() {
- TimeZone tz = TimeZone.getDefault();
- return (tz.getID());
- }
-
- /**
- * Function to check if the device is manufactured by Amazon
- *
- * @return
- */
- public boolean isAmazonDevice() {
- if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) {
- return true;
- }
- return false;
- }
-
- public boolean isVirtual() {
- return android.os.Build.FINGERPRINT.contains("generic") ||
- android.os.Build.PRODUCT.contains("sdk");
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java
deleted file mode 100644
index b035c40e6..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.file;
-
-import android.content.res.AssetManager;
-import android.net.Uri;
-
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.LOG;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-public class AssetFilesystem extends Filesystem {
-
- private final AssetManager assetManager;
-
- // A custom gradle hook creates the cdvasset.manifest file, which speeds up asset listing a tonne.
- // See: http://stackoverflow.com/questions/16911558/android-assetmanager-list-incredibly-slow
- private static Object listCacheLock = new Object();
- private static boolean listCacheFromFile;
- private static Map<String, String[]> listCache;
- private static Map<String, Long> lengthCache;
-
- private static final String LOG_TAG = "AssetFilesystem";
-
- private void lazyInitCaches() {
- synchronized (listCacheLock) {
- if (listCache == null) {
- ObjectInputStream ois = null;
- try {
- ois = new ObjectInputStream(assetManager.open("cdvasset.manifest"));
- listCache = (Map<String, String[]>) ois.readObject();
- lengthCache = (Map<String, Long>) ois.readObject();
- listCacheFromFile = true;
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- // Asset manifest won't exist if the gradle hook isn't set up correctly.
- } finally {
- if (ois != null) {
- try {
- ois.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG, e.getLocalizedMessage());
- }
- }
- }
- if (listCache == null) {
- LOG.w("AssetFilesystem", "Asset manifest not found. Recursive copies and directory listing will be slow.");
- listCache = new HashMap<String, String[]>();
- }
- }
- }
- }
-
- private String[] listAssets(String assetPath) throws IOException {
- if (assetPath.startsWith("/")) {
- assetPath = assetPath.substring(1);
- }
- if (assetPath.endsWith("/")) {
- assetPath = assetPath.substring(0, assetPath.length() - 1);
- }
- lazyInitCaches();
- String[] ret = listCache.get(assetPath);
- if (ret == null) {
- if (listCacheFromFile) {
- ret = new String[0];
- } else {
- ret = assetManager.list(assetPath);
- listCache.put(assetPath, ret);
- }
- }
- return ret;
- }
-
- private long getAssetSize(String assetPath) throws FileNotFoundException {
- if (assetPath.startsWith("/")) {
- assetPath = assetPath.substring(1);
- }
- lazyInitCaches();
- if (lengthCache != null) {
- Long ret = lengthCache.get(assetPath);
- if (ret == null) {
- throw new FileNotFoundException("Asset not found: " + assetPath);
- }
- return ret;
- }
- CordovaResourceApi.OpenForReadResult offr = null;
- try {
- offr = resourceApi.openForRead(nativeUriForFullPath(assetPath));
- long length = offr.length;
- if (length < 0) {
- // available() doesn't always yield the file size, but for assets it does.
- length = offr.inputStream.available();
- }
- return length;
- } catch (IOException e) {
- FileNotFoundException fnfe = new FileNotFoundException("File not found: " + assetPath);
- fnfe.initCause(e);
- throw fnfe;
- } finally {
- if (offr != null) {
- try {
- offr.inputStream.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG, e.getLocalizedMessage());
- }
- }
- }
- }
-
- public AssetFilesystem(AssetManager assetManager, CordovaResourceApi resourceApi) {
- super(Uri.parse("file:///android_asset/"), "assets", resourceApi);
- this.assetManager = assetManager;
- }
-
- @Override
- public Uri toNativeUri(LocalFilesystemURL inputURL) {
- return nativeUriForFullPath(inputURL.path);
- }
-
- @Override
- public LocalFilesystemURL toLocalUri(Uri inputURL) {
- if (!"file".equals(inputURL.getScheme())) {
- return null;
- }
- File f = new File(inputURL.getPath());
- // Removes and duplicate /s (e.g. file:///a//b/c)
- Uri resolvedUri = Uri.fromFile(f);
- String rootUriNoTrailingSlash = rootUri.getEncodedPath();
- rootUriNoTrailingSlash = rootUriNoTrailingSlash.substring(0, rootUriNoTrailingSlash.length() - 1);
- if (!resolvedUri.getEncodedPath().startsWith(rootUriNoTrailingSlash)) {
- return null;
- }
- String subPath = resolvedUri.getEncodedPath().substring(rootUriNoTrailingSlash.length());
- // Strip leading slash
- if (!subPath.isEmpty()) {
- subPath = subPath.substring(1);
- }
- Uri.Builder b = new Uri.Builder()
- .scheme(LocalFilesystemURL.FILESYSTEM_PROTOCOL)
- .authority("localhost")
- .path(name);
- if (!subPath.isEmpty()) {
- b.appendEncodedPath(subPath);
- }
- if (isDirectory(subPath) || inputURL.getPath().endsWith("/")) {
- // Add trailing / for directories.
- b.appendEncodedPath("");
- }
- return LocalFilesystemURL.parse(b.build());
- }
-
- private boolean isDirectory(String assetPath) {
- try {
- return listAssets(assetPath).length != 0;
- } catch (IOException e) {
- return false;
- }
- }
-
- @Override
- public LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException {
- String pathNoSlashes = inputURL.path.substring(1);
- if (pathNoSlashes.endsWith("/")) {
- pathNoSlashes = pathNoSlashes.substring(0, pathNoSlashes.length() - 1);
- }
-
- String[] files;
- try {
- files = listAssets(pathNoSlashes);
- } catch (IOException e) {
- FileNotFoundException fnfe = new FileNotFoundException();
- fnfe.initCause(e);
- throw fnfe;
- }
-
- LocalFilesystemURL[] entries = new LocalFilesystemURL[files.length];
- for (int i = 0; i < files.length; ++i) {
- entries[i] = localUrlforFullPath(new File(inputURL.path, files[i]).getPath());
- }
- return entries;
- }
-
- @Override
- public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
- String path, JSONObject options, boolean directory)
- throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
- if (options != null && options.optBoolean("create")) {
- throw new UnsupportedOperationException("Assets are read-only");
- }
-
- // Check whether the supplied path is absolute or relative
- if (directory && !path.endsWith("/")) {
- path += "/";
- }
-
- LocalFilesystemURL requestedURL;
- if (path.startsWith("/")) {
- requestedURL = localUrlforFullPath(normalizePath(path));
- } else {
- requestedURL = localUrlforFullPath(normalizePath(inputURL.path + "/" + path));
- }
-
- // Throws a FileNotFoundException if it doesn't exist.
- getFileMetadataForLocalURL(requestedURL);
-
- boolean isDir = isDirectory(requestedURL.path);
- if (directory && !isDir) {
- throw new TypeMismatchException("path doesn't exist or is file");
- } else if (!directory && isDir) {
- throw new TypeMismatchException("path doesn't exist or is directory");
- }
-
- // Return the directory
- return makeEntryForURL(requestedURL);
- }
-
- @Override
- public JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
- JSONObject metadata = new JSONObject();
- long size = inputURL.isDirectory ? 0 : getAssetSize(inputURL.path);
- try {
- metadata.put("size", size);
- metadata.put("type", inputURL.isDirectory ? "text/directory" : resourceApi.getMimeType(toNativeUri(inputURL)));
- metadata.put("name", new File(inputURL.path).getName());
- metadata.put("fullPath", inputURL.path);
- metadata.put("lastModifiedDate", 0);
- } catch (JSONException e) {
- return null;
- }
- return metadata;
- }
-
- @Override
- public boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL) {
- return false;
- }
-
- @Override
- long writeToFileAtURL(LocalFilesystemURL inputURL, String data, int offset, boolean isBinary) throws NoModificationAllowedException, IOException {
- throw new NoModificationAllowedException("Assets are read-only");
- }
-
- @Override
- long truncateFileAtURL(LocalFilesystemURL inputURL, long size) throws IOException, NoModificationAllowedException {
- throw new NoModificationAllowedException("Assets are read-only");
- }
-
- @Override
- String filesystemPathForURL(LocalFilesystemURL url) {
- return new File(rootUri.getPath(), url.path).toString();
- }
-
- @Override
- LocalFilesystemURL URLforFilesystemPath(String path) {
- return null;
- }
-
- @Override
- boolean removeFileAtLocalURL(LocalFilesystemURL inputURL) throws InvalidModificationException, NoModificationAllowedException {
- throw new NoModificationAllowedException("Assets are read-only");
- }
-
- @Override
- boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL) throws NoModificationAllowedException {
- throw new NoModificationAllowedException("Assets are read-only");
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/ContentFilesystem.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/ContentFilesystem.java
deleted file mode 100644
index 6b983c089..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/ContentFilesystem.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.file;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.database.Cursor;
-import android.net.Uri;
-import android.provider.DocumentsContract;
-import android.provider.MediaStore;
-import android.provider.OpenableColumns;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import org.apache.cordova.CordovaResourceApi;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public class ContentFilesystem extends Filesystem {
-
- private final Context context;
-
- public ContentFilesystem(Context context, CordovaResourceApi resourceApi) {
- super(Uri.parse("content://"), "content", resourceApi);
- this.context = context;
- }
-
- @Override
- public Uri toNativeUri(LocalFilesystemURL inputURL) {
- String authorityAndPath = inputURL.uri.getEncodedPath().substring(this.name.length() + 2);
- if (authorityAndPath.length() < 2) {
- return null;
- }
- String ret = "content://" + authorityAndPath;
- String query = inputURL.uri.getEncodedQuery();
- if (query != null) {
- ret += '?' + query;
- }
- String frag = inputURL.uri.getEncodedFragment();
- if (frag != null) {
- ret += '#' + frag;
- }
- return Uri.parse(ret);
- }
-
- @Override
- public LocalFilesystemURL toLocalUri(Uri inputURL) {
- if (!"content".equals(inputURL.getScheme())) {
- return null;
- }
- String subPath = inputURL.getEncodedPath();
- if (subPath.length() > 0) {
- subPath = subPath.substring(1);
- }
- Uri.Builder b = new Uri.Builder()
- .scheme(LocalFilesystemURL.FILESYSTEM_PROTOCOL)
- .authority("localhost")
- .path(name)
- .appendPath(inputURL.getAuthority());
- if (subPath.length() > 0) {
- b.appendEncodedPath(subPath);
- }
- Uri localUri = b.encodedQuery(inputURL.getEncodedQuery())
- .encodedFragment(inputURL.getEncodedFragment())
- .build();
- return LocalFilesystemURL.parse(localUri);
- }
-
- @Override
- public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
- String fileName, JSONObject options, boolean directory) throws IOException, TypeMismatchException, JSONException {
- throw new UnsupportedOperationException("getFile() not supported for content:. Use resolveLocalFileSystemURL instead.");
- }
-
- @Override
- public boolean removeFileAtLocalURL(LocalFilesystemURL inputURL)
- throws NoModificationAllowedException {
- Uri contentUri = toNativeUri(inputURL);
- try {
- context.getContentResolver().delete(contentUri, null, null);
- } catch (UnsupportedOperationException t) {
- // Was seeing this on the File mobile-spec tests on 4.0.3 x86 emulator.
- // The ContentResolver applies only when the file was registered in the
- // first case, which is generally only the case with images.
- NoModificationAllowedException nmae = new NoModificationAllowedException("Deleting not supported for content uri: " + contentUri);
- nmae.initCause(t);
- throw nmae;
- }
- return true;
- }
-
- @Override
- public boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL)
- throws NoModificationAllowedException {
- throw new NoModificationAllowedException("Cannot remove content url");
- }
-
- @Override
- public LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException {
- throw new UnsupportedOperationException("readEntriesAtLocalURL() not supported for content:. Use resolveLocalFileSystemURL instead.");
- }
-
- @Override
- public JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
- long size = -1;
- long lastModified = 0;
- Uri nativeUri = toNativeUri(inputURL);
- String mimeType = resourceApi.getMimeType(nativeUri);
- Cursor cursor = openCursorForURL(nativeUri);
- try {
- if (cursor != null && cursor.moveToFirst()) {
- Long sizeForCursor = resourceSizeForCursor(cursor);
- if (sizeForCursor != null) {
- size = sizeForCursor.longValue();
- }
- Long modified = lastModifiedDateForCursor(cursor);
- if (modified != null)
- lastModified = modified.longValue();
- } else {
- // Some content providers don't support cursors at all!
- CordovaResourceApi.OpenForReadResult offr = resourceApi.openForRead(nativeUri);
- size = offr.length;
- }
- } catch (IOException e) {
- FileNotFoundException fnfe = new FileNotFoundException();
- fnfe.initCause(e);
- throw fnfe;
- } finally {
- if (cursor != null)
- cursor.close();
- }
-
- JSONObject metadata = new JSONObject();
- try {
- metadata.put("size", size);
- metadata.put("type", mimeType);
- metadata.put("name", name);
- metadata.put("fullPath", inputURL.path);
- metadata.put("lastModifiedDate", lastModified);
- } catch (JSONException e) {
- return null;
- }
- return metadata;
- }
-
- @Override
- public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
- int offset, boolean isBinary) throws NoModificationAllowedException {
- throw new NoModificationAllowedException("Couldn't write to file given its content URI");
- }
- @Override
- public long truncateFileAtURL(LocalFilesystemURL inputURL, long size)
- throws NoModificationAllowedException {
- throw new NoModificationAllowedException("Couldn't truncate file given its content URI");
- }
-
- protected Cursor openCursorForURL(Uri nativeUri) {
- ContentResolver contentResolver = context.getContentResolver();
- try {
- return contentResolver.query(nativeUri, null, null, null, null);
- } catch (UnsupportedOperationException e) {
- return null;
- }
- }
-
- private Long resourceSizeForCursor(Cursor cursor) {
- int columnIndex = cursor.getColumnIndex(OpenableColumns.SIZE);
- if (columnIndex != -1) {
- String sizeStr = cursor.getString(columnIndex);
- if (sizeStr != null) {
- return Long.parseLong(sizeStr);
- }
- }
- return null;
- }
-
- protected Long lastModifiedDateForCursor(Cursor cursor) {
- int columnIndex = cursor.getColumnIndex(MediaStore.MediaColumns.DATE_MODIFIED);
- if (columnIndex == -1) {
- columnIndex = cursor.getColumnIndex(DocumentsContract.Document.COLUMN_LAST_MODIFIED);
- }
- if (columnIndex != -1) {
- String dateStr = cursor.getString(columnIndex);
- if (dateStr != null) {
- return Long.parseLong(dateStr);
- }
- }
- return null;
- }
-
- @Override
- public String filesystemPathForURL(LocalFilesystemURL url) {
- File f = resourceApi.mapUriToFile(toNativeUri(url));
- return f == null ? null : f.getAbsolutePath();
- }
-
- @Override
- public LocalFilesystemURL URLforFilesystemPath(String path) {
- // Returns null as we don't support reverse mapping back to content:// URLs
- return null;
- }
-
- @Override
- public boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL) {
- return true;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/DirectoryManager.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/DirectoryManager.java
deleted file mode 100644
index 07af5ea20..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/DirectoryManager.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.file;
-
-import android.os.Environment;
-import android.os.StatFs;
-
-import java.io.File;
-
-/**
- * This class provides file directory utilities.
- * All file operations are performed on the SD card.
- *
- * It is used by the FileUtils class.
- */
-public class DirectoryManager {
-
- @SuppressWarnings("unused")
- private static final String LOG_TAG = "DirectoryManager";
-
- /**
- * Determine if a file or directory exists.
- * @param name The name of the file to check.
- * @return T=exists, F=not found
- */
- public static boolean testFileExists(String name) {
- boolean status;
-
- // If SD card exists
- if ((testSaveLocationExists()) && (!name.equals(""))) {
- File path = Environment.getExternalStorageDirectory();
- File newPath = constructFilePaths(path.toString(), name);
- status = newPath.exists();
- }
- // If no SD card
- else {
- status = false;
- }
- return status;
- }
-
- /**
- * Get the free space in external storage
- *
- * @return Size in KB or -1 if not available
- */
- public static long getFreeExternalStorageSpace() {
- String status = Environment.getExternalStorageState();
- long freeSpaceInBytes = 0;
-
- // Check if external storage exists
- if (status.equals(Environment.MEDIA_MOUNTED)) {
- freeSpaceInBytes = getFreeSpaceInBytes(Environment.getExternalStorageDirectory().getPath());
- } else {
- // If no external storage then return -1
- return -1;
- }
-
- return freeSpaceInBytes / 1024;
- }
-
- /**
- * Given a path return the number of free bytes in the filesystem containing the path.
- *
- * @param path to the file system
- * @return free space in bytes
- */
- public static long getFreeSpaceInBytes(String path) {
- try {
- StatFs stat = new StatFs(path);
- long blockSize = stat.getBlockSize();
- long availableBlocks = stat.getAvailableBlocks();
- return availableBlocks * blockSize;
- } catch (IllegalArgumentException e) {
- // The path was invalid. Just return 0 free bytes.
- return 0;
- }
- }
-
- /**
- * Determine if SD card exists.
- *
- * @return T=exists, F=not found
- */
- public static boolean testSaveLocationExists() {
- String sDCardStatus = Environment.getExternalStorageState();
- boolean status;
-
- // If SD card is mounted
- if (sDCardStatus.equals(Environment.MEDIA_MOUNTED)) {
- status = true;
- }
-
- // If no SD card
- else {
- status = false;
- }
- return status;
- }
-
- /**
- * Create a new file object from two file paths.
- *
- * @param file1 Base file path
- * @param file2 Remaining file path
- * @return File object
- */
- private static File constructFilePaths (String file1, String file2) {
- File newPath;
- if (file2.startsWith(file1)) {
- newPath = new File(file2);
- }
- else {
- newPath = new File(file1 + "/" + file2);
- }
- return newPath;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/EncodingException.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/EncodingException.java
deleted file mode 100644
index e9e1653bd..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/EncodingException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.file;
-
-@SuppressWarnings("serial")
-public class EncodingException extends Exception {
-
- public EncodingException(String message) {
- super(message);
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/FileExistsException.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/FileExistsException.java
deleted file mode 100644
index 5c4d83dc4..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/FileExistsException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.file;
-
-@SuppressWarnings("serial")
-public class FileExistsException extends Exception {
-
- public FileExistsException(String msg) {
- super(msg);
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/FileUtils.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/FileUtils.java
deleted file mode 100644
index 1d6e61fa3..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/FileUtils.java
+++ /dev/null
@@ -1,1225 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.file;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Environment;
-import android.util.Base64;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.LOG;
-import org.apache.cordova.PermissionHelper;
-import org.apache.cordova.PluginResult;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.security.Permission;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-
-/**
- * This class provides file and directory services to JavaScript.
- */
-public class FileUtils extends CordovaPlugin {
- private static final String LOG_TAG = "FileUtils";
-
- public static int NOT_FOUND_ERR = 1;
- public static int SECURITY_ERR = 2;
- public static int ABORT_ERR = 3;
-
- public static int NOT_READABLE_ERR = 4;
- public static int ENCODING_ERR = 5;
- public static int NO_MODIFICATION_ALLOWED_ERR = 6;
- public static int INVALID_STATE_ERR = 7;
- public static int SYNTAX_ERR = 8;
- public static int INVALID_MODIFICATION_ERR = 9;
- public static int QUOTA_EXCEEDED_ERR = 10;
- public static int TYPE_MISMATCH_ERR = 11;
- public static int PATH_EXISTS_ERR = 12;
-
- /*
- * Permission callback codes
- */
-
- public static final int ACTION_GET_FILE = 0;
- public static final int ACTION_WRITE = 1;
- public static final int ACTION_GET_DIRECTORY = 2;
-
- public static final int WRITE = 3;
- public static final int READ = 4;
-
- public static int UNKNOWN_ERR = 1000;
-
- private boolean configured = false;
-
- private PendingRequests pendingRequests;
-
-
-
- /*
- * We need both read and write when accessing the storage, I think.
- */
-
- private String [] permissions = {
- Manifest.permission.READ_EXTERNAL_STORAGE,
- Manifest.permission.WRITE_EXTERNAL_STORAGE };
-
- // This field exists only to support getEntry, below, which has been deprecated
- private static FileUtils filePlugin;
-
- private interface FileOp {
- void run(JSONArray args) throws Exception;
- }
-
- private ArrayList<Filesystem> filesystems;
-
- public void registerFilesystem(Filesystem fs) {
- if (fs != null && filesystemForName(fs.name)== null) {
- this.filesystems.add(fs);
- }
- }
-
- private Filesystem filesystemForName(String name) {
- for (Filesystem fs:filesystems) {
- if (fs != null && fs.name != null && fs.name.equals(name)) {
- return fs;
- }
- }
- return null;
- }
-
- protected String[] getExtraFileSystemsPreference(Activity activity) {
- String fileSystemsStr = preferences.getString("androidextrafilesystems", "files,files-external,documents,sdcard,cache,cache-external,assets,root");
- return fileSystemsStr.split(",");
- }
-
- protected void registerExtraFileSystems(String[] filesystems, HashMap<String, String> availableFileSystems) {
- HashSet<String> installedFileSystems = new HashSet<String>();
-
- /* Register filesystems in order */
- for (String fsName : filesystems) {
- if (!installedFileSystems.contains(fsName)) {
- String fsRoot = availableFileSystems.get(fsName);
- if (fsRoot != null) {
- File newRoot = new File(fsRoot);
- if (newRoot.mkdirs() || newRoot.isDirectory()) {
- registerFilesystem(new LocalFilesystem(fsName, webView.getContext(), webView.getResourceApi(), newRoot));
- installedFileSystems.add(fsName);
- } else {
- LOG.d(LOG_TAG, "Unable to create root dir for filesystem \"" + fsName + "\", skipping");
- }
- } else {
- LOG.d(LOG_TAG, "Unrecognized extra filesystem identifier: " + fsName);
- }
- }
- }
- }
-
- protected HashMap<String, String> getAvailableFileSystems(Activity activity) {
- Context context = activity.getApplicationContext();
- HashMap<String, String> availableFileSystems = new HashMap<String,String>();
-
- availableFileSystems.put("files", context.getFilesDir().getAbsolutePath());
- availableFileSystems.put("documents", new File(context.getFilesDir(), "Documents").getAbsolutePath());
- availableFileSystems.put("cache", context.getCacheDir().getAbsolutePath());
- availableFileSystems.put("root", "/");
- if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- try {
- availableFileSystems.put("files-external", context.getExternalFilesDir(null).getAbsolutePath());
- availableFileSystems.put("sdcard", Environment.getExternalStorageDirectory().getAbsolutePath());
- availableFileSystems.put("cache-external", context.getExternalCacheDir().getAbsolutePath());
- }
- catch(NullPointerException e) {
- LOG.d(LOG_TAG, "External storage unavailable, check to see if USB Mass Storage Mode is on");
- }
- }
-
- return availableFileSystems;
- }
-
- @Override
- public void initialize(CordovaInterface cordova, CordovaWebView webView) {
- super.initialize(cordova, webView);
- this.filesystems = new ArrayList<Filesystem>();
- this.pendingRequests = new PendingRequests();
-
- String tempRoot = null;
- String persistentRoot = null;
-
- Activity activity = cordova.getActivity();
- String packageName = activity.getPackageName();
-
- String location = preferences.getString("androidpersistentfilelocation", "internal");
-
- tempRoot = activity.getCacheDir().getAbsolutePath();
- if ("internal".equalsIgnoreCase(location)) {
- persistentRoot = activity.getFilesDir().getAbsolutePath() + "/files/";
- this.configured = true;
- } else if ("compatibility".equalsIgnoreCase(location)) {
- /*
- * Fall-back to compatibility mode -- this is the logic implemented in
- * earlier versions of this plugin, and should be maintained here so
- * that apps which were originally deployed with older versions of the
- * plugin can continue to provide access to files stored under those
- * versions.
- */
- if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- persistentRoot = Environment.getExternalStorageDirectory().getAbsolutePath();
- tempRoot = Environment.getExternalStorageDirectory().getAbsolutePath() +
- "/Android/data/" + packageName + "/cache/";
- } else {
- persistentRoot = "/data/data/" + packageName;
- }
- this.configured = true;
- }
-
- if (this.configured) {
- // Create the directories if they don't exist.
- File tmpRootFile = new File(tempRoot);
- File persistentRootFile = new File(persistentRoot);
- tmpRootFile.mkdirs();
- persistentRootFile.mkdirs();
-
- // Register initial filesystems
- // Note: The temporary and persistent filesystems need to be the first two
- // registered, so that they will match window.TEMPORARY and window.PERSISTENT,
- // per spec.
- this.registerFilesystem(new LocalFilesystem("temporary", webView.getContext(), webView.getResourceApi(), tmpRootFile));
- this.registerFilesystem(new LocalFilesystem("persistent", webView.getContext(), webView.getResourceApi(), persistentRootFile));
- this.registerFilesystem(new ContentFilesystem(webView.getContext(), webView.getResourceApi()));
- this.registerFilesystem(new AssetFilesystem(webView.getContext().getAssets(), webView.getResourceApi()));
-
- registerExtraFileSystems(getExtraFileSystemsPreference(activity), getAvailableFileSystems(activity));
-
- // Initialize static plugin reference for deprecated getEntry method
- if (filePlugin == null) {
- FileUtils.filePlugin = this;
- }
- } else {
- LOG.e(LOG_TAG, "File plugin configuration error: Please set AndroidPersistentFileLocation in config.xml to one of \"internal\" (for new applications) or \"compatibility\" (for compatibility with previous versions)");
- activity.finish();
- }
- }
-
- public static FileUtils getFilePlugin() {
- return filePlugin;
- }
-
- private Filesystem filesystemForURL(LocalFilesystemURL localURL) {
- if (localURL == null) return null;
- return filesystemForName(localURL.fsName);
- }
-
- @Override
- public Uri remapUri(Uri uri) {
- // Remap only cdvfile: URLs (not content:).
- if (!LocalFilesystemURL.FILESYSTEM_PROTOCOL.equals(uri.getScheme())) {
- return null;
- }
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(uri);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- return null;
- }
- String path = fs.filesystemPathForURL(inputURL);
- if (path != null) {
- return Uri.parse("file://" + fs.filesystemPathForURL(inputURL));
- }
- return null;
- } catch (IllegalArgumentException e) {
- return null;
- }
- }
-
- public boolean execute(String action, final String rawArgs, final CallbackContext callbackContext) {
- if (!configured) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, "File plugin is not configured. Please see the README.md file for details on how to update config.xml"));
- return true;
- }
- if (action.equals("testSaveLocationExists")) {
- threadhelper(new FileOp() {
- public void run(JSONArray args) {
- boolean b = DirectoryManager.testSaveLocationExists();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, b));
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("getFreeDiskSpace")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) {
- // The getFreeDiskSpace plugin API is not documented, but some apps call it anyway via exec().
- // For compatibility it always returns free space in the primary external storage, and
- // does NOT fallback to internal store if external storage is unavailable.
- long l = DirectoryManager.getFreeExternalStorageSpace();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, l));
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("testFileExists")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException {
- String fname=args.getString(0);
- boolean b = DirectoryManager.testFileExists(fname);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, b));
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("testDirectoryExists")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException {
- String fname=args.getString(0);
- boolean b = DirectoryManager.testFileExists(fname);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, b));
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("readAsText")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, MalformedURLException {
- String encoding = args.getString(1);
- int start = args.getInt(2);
- int end = args.getInt(3);
- String fname=args.getString(0);
- readFileAs(fname, start, end, callbackContext, encoding, PluginResult.MESSAGE_TYPE_STRING);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("readAsDataURL")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, MalformedURLException {
- int start = args.getInt(1);
- int end = args.getInt(2);
- String fname=args.getString(0);
- readFileAs(fname, start, end, callbackContext, null, -1);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("readAsArrayBuffer")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, MalformedURLException {
- int start = args.getInt(1);
- int end = args.getInt(2);
- String fname=args.getString(0);
- readFileAs(fname, start, end, callbackContext, null, PluginResult.MESSAGE_TYPE_ARRAYBUFFER);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("readAsBinaryString")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, MalformedURLException {
- int start = args.getInt(1);
- int end = args.getInt(2);
- String fname=args.getString(0);
- readFileAs(fname, start, end, callbackContext, null, PluginResult.MESSAGE_TYPE_BINARYSTRING);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("write")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, FileNotFoundException, IOException, NoModificationAllowedException {
- String fname=args.getString(0);
- String nativeURL = resolveLocalFileSystemURI(fname).getString("nativeURL");
- String data=args.getString(1);
- int offset=args.getInt(2);
- Boolean isBinary=args.getBoolean(3);
-
- if(needPermission(nativeURL, WRITE)) {
- getWritePermission(rawArgs, ACTION_WRITE, callbackContext);
- }
- else {
- long fileSize = write(fname, data, offset, isBinary);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, fileSize));
- }
-
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("truncate")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, FileNotFoundException, IOException, NoModificationAllowedException {
- String fname=args.getString(0);
- int offset=args.getInt(1);
- long fileSize = truncateFile(fname, offset);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, fileSize));
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("requestAllFileSystems")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws IOException, JSONException {
- callbackContext.success(requestAllFileSystems());
- }
- }, rawArgs, callbackContext);
- } else if (action.equals("requestAllPaths")) {
- cordova.getThreadPool().execute(
- new Runnable() {
- public void run() {
- try {
- callbackContext.success(requestAllPaths());
- } catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- );
- } else if (action.equals("requestFileSystem")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException {
- int fstype = args.getInt(0);
- long requiredSize = args.optLong(1);
- requestFileSystem(fstype, requiredSize, callbackContext);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("resolveLocalFileSystemURI")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws IOException, JSONException {
- String fname=args.getString(0);
- JSONObject obj = resolveLocalFileSystemURI(fname);
- callbackContext.success(obj);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("getFileMetadata")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws FileNotFoundException, JSONException, MalformedURLException {
- String fname=args.getString(0);
- JSONObject obj = getFileMetadata(fname);
- callbackContext.success(obj);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("getParent")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, IOException {
- String fname=args.getString(0);
- JSONObject obj = getParent(fname);
- callbackContext.success(obj);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("getDirectory")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
- String dirname = args.getString(0);
- String path = args.getString(1);
- String nativeURL = resolveLocalFileSystemURI(dirname).getString("nativeURL");
- boolean containsCreate = (args.isNull(2)) ? false : args.getJSONObject(2).optBoolean("create", false);
-
- if(containsCreate && needPermission(nativeURL, WRITE)) {
- getWritePermission(rawArgs, ACTION_GET_DIRECTORY, callbackContext);
- }
- else if(!containsCreate && needPermission(nativeURL, READ)) {
- getReadPermission(rawArgs, ACTION_GET_DIRECTORY, callbackContext);
- }
- else {
- JSONObject obj = getFile(dirname, path, args.optJSONObject(2), true);
- callbackContext.success(obj);
- }
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("getFile")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
- String dirname = args.getString(0);
- String path = args.getString(1);
- String nativeURL = resolveLocalFileSystemURI(dirname).getString("nativeURL");
- boolean containsCreate = (args.isNull(2)) ? false : args.getJSONObject(2).optBoolean("create", false);
-
- if(containsCreate && needPermission(nativeURL, WRITE)) {
- getWritePermission(rawArgs, ACTION_GET_FILE, callbackContext);
- }
- else if(!containsCreate && needPermission(nativeURL, READ)) {
- getReadPermission(rawArgs, ACTION_GET_FILE, callbackContext);
- }
- else {
- JSONObject obj = getFile(dirname, path, args.optJSONObject(2), false);
- callbackContext.success(obj);
- }
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("remove")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, NoModificationAllowedException, InvalidModificationException, MalformedURLException {
- String fname=args.getString(0);
- boolean success = remove(fname);
- if (success) {
- callbackContext.success();
- } else {
- callbackContext.error(FileUtils.NO_MODIFICATION_ALLOWED_ERR);
- }
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("removeRecursively")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, FileExistsException, MalformedURLException, NoModificationAllowedException {
- String fname=args.getString(0);
- boolean success = removeRecursively(fname);
- if (success) {
- callbackContext.success();
- } else {
- callbackContext.error(FileUtils.NO_MODIFICATION_ALLOWED_ERR);
- }
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("moveTo")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, NoModificationAllowedException, IOException, InvalidModificationException, EncodingException, FileExistsException {
- String fname=args.getString(0);
- String newParent=args.getString(1);
- String newName=args.getString(2);
- JSONObject entry = transferTo(fname, newParent, newName, true);
- callbackContext.success(entry);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("copyTo")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, NoModificationAllowedException, IOException, InvalidModificationException, EncodingException, FileExistsException {
- String fname=args.getString(0);
- String newParent=args.getString(1);
- String newName=args.getString(2);
- JSONObject entry = transferTo(fname, newParent, newName, false);
- callbackContext.success(entry);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("readEntries")) {
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws FileNotFoundException, JSONException, MalformedURLException {
- String fname=args.getString(0);
- JSONArray entries = readEntries(fname);
- callbackContext.success(entries);
- }
- }, rawArgs, callbackContext);
- }
- else if (action.equals("_getLocalFilesystemPath")) {
- // Internal method for testing: Get the on-disk location of a local filesystem url.
- // [Currently used for testing file-transfer]
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws FileNotFoundException, JSONException, MalformedURLException {
- String localURLstr = args.getString(0);
- String fname = filesystemPathForURL(localURLstr);
- callbackContext.success(fname);
- }
- }, rawArgs, callbackContext);
- }
- else {
- return false;
- }
- return true;
- }
-
- private void getReadPermission(String rawArgs, int action, CallbackContext callbackContext) {
- int requestCode = pendingRequests.createRequest(rawArgs, action, callbackContext);
- PermissionHelper.requestPermission(this, requestCode, Manifest.permission.READ_EXTERNAL_STORAGE);
- }
-
- private void getWritePermission(String rawArgs, int action, CallbackContext callbackContext) {
- int requestCode = pendingRequests.createRequest(rawArgs, action, callbackContext);
- PermissionHelper.requestPermission(this, requestCode, Manifest.permission.WRITE_EXTERNAL_STORAGE);
- }
-
- private boolean hasReadPermission() {
- return PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
- }
-
- private boolean hasWritePermission() {
- return PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
- }
-
- private boolean needPermission(String nativeURL, int permissionType) throws JSONException {
- JSONObject j = requestAllPaths();
- ArrayList<String> allowedStorageDirectories = new ArrayList<String>();
- allowedStorageDirectories.add(j.getString("applicationDirectory"));
- allowedStorageDirectories.add(j.getString("applicationStorageDirectory"));
- if(j.has("externalApplicationStorageDirectory")) {
- allowedStorageDirectories.add(j.getString("externalApplicationStorageDirectory"));
- }
-
- if(permissionType == READ && hasReadPermission()) {
- return false;
- }
- else if(permissionType == WRITE && hasWritePermission()) {
- return false;
- }
-
- // Permission required if the native url lies outside the allowed storage directories
- for(String directory : allowedStorageDirectories) {
- if(nativeURL.startsWith(directory)) {
- return false;
- }
- }
- return true;
- }
-
-
- public LocalFilesystemURL resolveNativeUri(Uri nativeUri) {
- LocalFilesystemURL localURL = null;
-
- // Try all installed filesystems. Return the best matching URL
- // (determined by the shortest resulting URL)
- for (Filesystem fs : filesystems) {
- LocalFilesystemURL url = fs.toLocalUri(nativeUri);
- if (url != null) {
- // A shorter fullPath implies that the filesystem is a better
- // match for the local path than the previous best.
- if (localURL == null || (url.uri.toString().length() < localURL.toString().length())) {
- localURL = url;
- }
- }
- }
- return localURL;
- }
-
- /*
- * These two native-only methods can be used by other plugins to translate between
- * device file system paths and URLs. By design, there is no direct JavaScript
- * interface to these methods.
- */
-
- public String filesystemPathForURL(String localURLstr) throws MalformedURLException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(localURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- return fs.filesystemPathForURL(inputURL);
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- }
-
- public LocalFilesystemURL filesystemURLforLocalPath(String localPath) {
- LocalFilesystemURL localURL = null;
- int shortestFullPath = 0;
-
- // Try all installed filesystems. Return the best matching URL
- // (determined by the shortest resulting URL)
- for (Filesystem fs: filesystems) {
- LocalFilesystemURL url = fs.URLforFilesystemPath(localPath);
- if (url != null) {
- // A shorter fullPath implies that the filesystem is a better
- // match for the local path than the previous best.
- if (localURL == null || (url.path.length() < shortestFullPath)) {
- localURL = url;
- shortestFullPath = url.path.length();
- }
- }
- }
- return localURL;
- }
-
-
- /* helper to execute functions async and handle the result codes
- *
- */
- private void threadhelper(final FileOp f, final String rawArgs, final CallbackContext callbackContext){
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- try {
- JSONArray args = new JSONArray(rawArgs);
- f.run(args);
- } catch ( Exception e) {
- if( e instanceof EncodingException){
- callbackContext.error(FileUtils.ENCODING_ERR);
- } else if(e instanceof FileNotFoundException) {
- callbackContext.error(FileUtils.NOT_FOUND_ERR);
- } else if(e instanceof FileExistsException) {
- callbackContext.error(FileUtils.PATH_EXISTS_ERR);
- } else if(e instanceof NoModificationAllowedException ) {
- callbackContext.error(FileUtils.NO_MODIFICATION_ALLOWED_ERR);
- } else if(e instanceof InvalidModificationException ) {
- callbackContext.error(FileUtils.INVALID_MODIFICATION_ERR);
- } else if(e instanceof MalformedURLException ) {
- callbackContext.error(FileUtils.ENCODING_ERR);
- } else if(e instanceof IOException ) {
- callbackContext.error(FileUtils.INVALID_MODIFICATION_ERR);
- } else if(e instanceof EncodingException ) {
- callbackContext.error(FileUtils.ENCODING_ERR);
- } else if(e instanceof TypeMismatchException ) {
- callbackContext.error(FileUtils.TYPE_MISMATCH_ERR);
- } else if(e instanceof JSONException ) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- } else if (e instanceof SecurityException) {
- callbackContext.error(FileUtils.SECURITY_ERR);
- } else {
- e.printStackTrace();
- callbackContext.error(FileUtils.UNKNOWN_ERR);
- }
- }
- }
- });
- }
-
- /**
- * Allows the user to look up the Entry for a file or directory referred to by a local URI.
- *
- * @param uriString of the file/directory to look up
- * @return a JSONObject representing a Entry from the filesystem
- * @throws MalformedURLException if the url is not valid
- * @throws FileNotFoundException if the file does not exist
- * @throws IOException if the user can't read the file
- * @throws JSONException
- */
- private JSONObject resolveLocalFileSystemURI(String uriString) throws IOException, JSONException {
- if (uriString == null) {
- throw new MalformedURLException("Unrecognized filesystem URL");
- }
- Uri uri = Uri.parse(uriString);
- boolean isNativeUri = false;
-
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(uri);
- if (inputURL == null) {
- /* Check for file://, content:// urls */
- inputURL = resolveNativeUri(uri);
- isNativeUri = true;
- }
-
- try {
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- if (fs.exists(inputURL)) {
- if (!isNativeUri) {
- // If not already resolved as native URI, resolve to a native URI and back to
- // fix the terminating slash based on whether the entry is a directory or file.
- inputURL = fs.toLocalUri(fs.toNativeUri(inputURL));
- }
-
- return fs.getEntryForLocalURL(inputURL);
- }
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- throw new FileNotFoundException();
- }
-
- /**
- * Read the list of files from this directory.
- *
- * @return a JSONArray containing JSONObjects that represent Entry objects.
- * @throws FileNotFoundException if the directory is not found.
- * @throws JSONException
- * @throws MalformedURLException
- */
- private JSONArray readEntries(String baseURLstr) throws FileNotFoundException, JSONException, MalformedURLException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(baseURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- return fs.readEntriesAtLocalURL(inputURL);
-
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- }
-
- /**
- * A setup method that handles the move/copy of files/directories
- *
- * @param newName for the file directory to be called, if null use existing file name
- * @param move if false do a copy, if true do a move
- * @return a Entry object
- * @throws NoModificationAllowedException
- * @throws IOException
- * @throws InvalidModificationException
- * @throws EncodingException
- * @throws JSONException
- * @throws FileExistsException
- */
- private JSONObject transferTo(String srcURLstr, String destURLstr, String newName, boolean move) throws JSONException, NoModificationAllowedException, IOException, InvalidModificationException, EncodingException, FileExistsException {
- if (srcURLstr == null || destURLstr == null) {
- // either no source or no destination provided
- throw new FileNotFoundException();
- }
-
- LocalFilesystemURL srcURL = LocalFilesystemURL.parse(srcURLstr);
- LocalFilesystemURL destURL = LocalFilesystemURL.parse(destURLstr);
-
- Filesystem srcFs = this.filesystemForURL(srcURL);
- Filesystem destFs = this.filesystemForURL(destURL);
-
- // Check for invalid file name
- if (newName != null && newName.contains(":")) {
- throw new EncodingException("Bad file name");
- }
-
- return destFs.copyFileToURL(destURL, newName, srcFs, srcURL, move);
- }
-
- /**
- * Deletes a directory and all of its contents, if any. In the event of an error
- * [e.g. trying to delete a directory that contains a file that cannot be removed],
- * some of the contents of the directory may be deleted.
- * It is an error to attempt to delete the root directory of a filesystem.
- *
- * @return a boolean representing success of failure
- * @throws FileExistsException
- * @throws NoModificationAllowedException
- * @throws MalformedURLException
- */
- private boolean removeRecursively(String baseURLstr) throws FileExistsException, NoModificationAllowedException, MalformedURLException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(baseURLstr);
- // You can't delete the root directory.
- if ("".equals(inputURL.path) || "/".equals(inputURL.path)) {
- throw new NoModificationAllowedException("You can't delete the root directory");
- }
-
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- return fs.recursiveRemoveFileAtLocalURL(inputURL);
-
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- }
-
-
- /**
- * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty.
- * It is an error to attempt to delete the root directory of a filesystem.
- *
- * @return a boolean representing success of failure
- * @throws NoModificationAllowedException
- * @throws InvalidModificationException
- * @throws MalformedURLException
- */
- private boolean remove(String baseURLstr) throws NoModificationAllowedException, InvalidModificationException, MalformedURLException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(baseURLstr);
- // You can't delete the root directory.
- if ("".equals(inputURL.path) || "/".equals(inputURL.path)) {
-
- throw new NoModificationAllowedException("You can't delete the root directory");
- }
-
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- return fs.removeFileAtLocalURL(inputURL);
-
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- }
-
- /**
- * Creates or looks up a file.
- *
- * @param baseURLstr base directory
- * @param path file/directory to lookup or create
- * @param options specify whether to create or not
- * @param directory if true look up directory, if false look up file
- * @return a Entry object
- * @throws FileExistsException
- * @throws IOException
- * @throws TypeMismatchException
- * @throws EncodingException
- * @throws JSONException
- */
- private JSONObject getFile(String baseURLstr, String path, JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(baseURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- return fs.getFileForLocalURL(inputURL, path, options, directory);
-
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
-
- }
-
- /**
- * Look up the parent DirectoryEntry containing this Entry.
- * If this Entry is the root of its filesystem, its parent is itself.
- */
- private JSONObject getParent(String baseURLstr) throws JSONException, IOException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(baseURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- return fs.getParentForLocalURL(inputURL);
-
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- }
-
- /**
- * Returns a File that represents the current state of the file that this FileEntry represents.
- *
- * @return returns a JSONObject represent a W3C File object
- */
- private JSONObject getFileMetadata(String baseURLstr) throws FileNotFoundException, JSONException, MalformedURLException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(baseURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
- return fs.getFileMetadataForLocalURL(inputURL);
-
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- }
-
- /**
- * Requests a filesystem in which to store application data.
- *
- * @param type of file system requested
- * @param requiredSize required free space in the file system in bytes
- * @param callbackContext context for returning the result or error
- * @throws JSONException
- */
- private void requestFileSystem(int type, long requiredSize, final CallbackContext callbackContext) throws JSONException {
- Filesystem rootFs = null;
- try {
- rootFs = this.filesystems.get(type);
- } catch (ArrayIndexOutOfBoundsException e) {
- // Pass null through
- }
- if (rootFs == null) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, FileUtils.NOT_FOUND_ERR));
- } else {
- // If a nonzero required size was specified, check that the retrieved filesystem has enough free space.
- long availableSize = 0;
- if (requiredSize > 0) {
- availableSize = rootFs.getFreeSpaceInBytes();
- }
-
- if (availableSize < requiredSize) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, FileUtils.QUOTA_EXCEEDED_ERR));
- } else {
- JSONObject fs = new JSONObject();
- fs.put("name", rootFs.name);
- fs.put("root", rootFs.getRootEntry());
- callbackContext.success(fs);
- }
- }
- }
-
- /**
- * Requests a filesystem in which to store application data.
- *
- * @return a JSONObject representing the file system
- */
- private JSONArray requestAllFileSystems() throws IOException, JSONException {
- JSONArray ret = new JSONArray();
- for (Filesystem fs : filesystems) {
- ret.put(fs.getRootEntry());
- }
- return ret;
- }
-
- private static String toDirUrl(File f) {
- return Uri.fromFile(f).toString() + '/';
- }
-
- private JSONObject requestAllPaths() throws JSONException {
- Context context = cordova.getActivity();
- JSONObject ret = new JSONObject();
- ret.put("applicationDirectory", "file:///android_asset/");
- ret.put("applicationStorageDirectory", toDirUrl(context.getFilesDir().getParentFile()));
- ret.put("dataDirectory", toDirUrl(context.getFilesDir()));
- ret.put("cacheDirectory", toDirUrl(context.getCacheDir()));
- if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- try {
- ret.put("externalApplicationStorageDirectory", toDirUrl(context.getExternalFilesDir(null).getParentFile()));
- ret.put("externalDataDirectory", toDirUrl(context.getExternalFilesDir(null)));
- ret.put("externalCacheDirectory", toDirUrl(context.getExternalCacheDir()));
- ret.put("externalRootDirectory", toDirUrl(Environment.getExternalStorageDirectory()));
- }
- catch(NullPointerException e) {
- /* If external storage is unavailable, context.getExternal* returns null */
- LOG.d(LOG_TAG, "Unable to access these paths, most liklely due to USB storage");
- }
- }
- return ret;
- }
-
- /**
- * Returns a JSON object representing the given File. Internal APIs should be modified
- * to use URLs instead of raw FS paths wherever possible, when interfacing with this plugin.
- *
- * @param file the File to convert
- * @return a JSON representation of the given File
- * @throws JSONException
- */
- public JSONObject getEntryForFile(File file) throws JSONException {
- JSONObject entry;
-
- for (Filesystem fs : filesystems) {
- entry = fs.makeEntryForFile(file);
- if (entry != null) {
- return entry;
- }
- }
- return null;
- }
-
- /**
- * Returns a JSON object representing the given File. Deprecated, as this is only used by
- * FileTransfer, and because it is a static method that should really be an instance method,
- * since it depends on the actual filesystem roots in use. Internal APIs should be modified
- * to use URLs instead of raw FS paths wherever possible, when interfacing with this plugin.
- *
- * @param file the File to convert
- * @return a JSON representation of the given File
- * @throws JSONException
- */
- @Deprecated
- public static JSONObject getEntry(File file) throws JSONException {
- if (getFilePlugin() != null) {
- return getFilePlugin().getEntryForFile(file);
- }
- return null;
- }
-
- /**
- * Read the contents of a file.
- * This is done in a background thread; the result is sent to the callback.
- *
- * @param start Start position in the file.
- * @param end End position to stop at (exclusive).
- * @param callbackContext The context through which to send the result.
- * @param encoding The encoding to return contents as. Typical value is UTF-8. (see http://www.iana.org/assignments/character-sets)
- * @param resultType The desired type of data to send to the callback.
- * @return Contents of file.
- */
- public void readFileAs(final String srcURLstr, final int start, final int end, final CallbackContext callbackContext, final String encoding, final int resultType) throws MalformedURLException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(srcURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
-
- fs.readFileAtURL(inputURL, start, end, new Filesystem.ReadFileCallback() {
- public void handleData(InputStream inputStream, String contentType) {
- try {
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- final int BUFFER_SIZE = 8192;
- byte[] buffer = new byte[BUFFER_SIZE];
-
- for (;;) {
- int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE);
-
- if (bytesRead <= 0) {
- break;
- }
- os.write(buffer, 0, bytesRead);
- }
-
- PluginResult result;
- switch (resultType) {
- case PluginResult.MESSAGE_TYPE_STRING:
- result = new PluginResult(PluginResult.Status.OK, os.toString(encoding));
- break;
- case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
- result = new PluginResult(PluginResult.Status.OK, os.toByteArray());
- break;
- case PluginResult.MESSAGE_TYPE_BINARYSTRING:
- result = new PluginResult(PluginResult.Status.OK, os.toByteArray(), true);
- break;
- default: // Base64.
- byte[] base64 = Base64.encode(os.toByteArray(), Base64.NO_WRAP);
- String s = "data:" + contentType + ";base64," + new String(base64, "US-ASCII");
- result = new PluginResult(PluginResult.Status.OK, s);
- }
-
- callbackContext.sendPluginResult(result);
- } catch (IOException e) {
- LOG.d(LOG_TAG, e.getLocalizedMessage());
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, NOT_READABLE_ERR));
- }
- }
- });
-
-
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- } catch (FileNotFoundException e) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, NOT_FOUND_ERR));
- } catch (IOException e) {
- LOG.d(LOG_TAG, e.getLocalizedMessage());
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, NOT_READABLE_ERR));
- }
- }
-
-
- /**
- * Write contents of file.
- *
- * @param data The contents of the file.
- * @param offset The position to begin writing the file.
- * @param isBinary True if the file contents are base64-encoded binary data
- */
- /**/
- public long write(String srcURLstr, String data, int offset, boolean isBinary) throws FileNotFoundException, IOException, NoModificationAllowedException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(srcURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
-
- long x = fs.writeToFileAtURL(inputURL, data, offset, isBinary); LOG.d("TEST",srcURLstr + ": "+x); return x;
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
-
- }
-
- /**
- * Truncate the file to size
- */
- private long truncateFile(String srcURLstr, long size) throws FileNotFoundException, IOException, NoModificationAllowedException {
- try {
- LocalFilesystemURL inputURL = LocalFilesystemURL.parse(srcURLstr);
- Filesystem fs = this.filesystemForURL(inputURL);
- if (fs == null) {
- throw new MalformedURLException("No installed handlers for this URL");
- }
-
- return fs.truncateFileAtURL(inputURL, size);
- } catch (IllegalArgumentException e) {
- MalformedURLException mue = new MalformedURLException("Unrecognized filesystem URL");
- mue.initCause(e);
- throw mue;
- }
- }
-
-
- /*
- * Handle the response
- */
-
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException {
-
- final PendingRequests.Request req = pendingRequests.getAndRemove(requestCode);
- if (req != null) {
- for(int r:grantResults)
- {
- if(r == PackageManager.PERMISSION_DENIED)
- {
- req.getCallbackContext().sendPluginResult(new PluginResult(PluginResult.Status.ERROR, SECURITY_ERR));
- return;
- }
- }
- switch(req.getAction())
- {
- case ACTION_GET_FILE:
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
- String dirname = args.getString(0);
-
- String path = args.getString(1);
- JSONObject obj = getFile(dirname, path, args.optJSONObject(2), false);
- req.getCallbackContext().success(obj);
- }
- }, req.getRawArgs(), req.getCallbackContext());
- break;
- case ACTION_GET_DIRECTORY:
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
- String dirname = args.getString(0);
-
- String path = args.getString(1);
- JSONObject obj = getFile(dirname, path, args.optJSONObject(2), true);
- req.getCallbackContext().success(obj);
- }
- }, req.getRawArgs(), req.getCallbackContext());
- break;
- case ACTION_WRITE:
- threadhelper( new FileOp( ){
- public void run(JSONArray args) throws JSONException, FileNotFoundException, IOException, NoModificationAllowedException {
- String fname=args.getString(0);
- String data=args.getString(1);
- int offset=args.getInt(2);
- Boolean isBinary=args.getBoolean(3);
- long fileSize = write(fname, data, offset, isBinary);
- req.getCallbackContext().sendPluginResult(new PluginResult(PluginResult.Status.OK, fileSize));
- }
- }, req.getRawArgs(), req.getCallbackContext());
- break;
- }
- } else {
- LOG.d(LOG_TAG, "Received permission callback for unknown request code");
- }
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/Filesystem.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/Filesystem.java
deleted file mode 100644
index c69d3bdd0..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/Filesystem.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.file;
-
-import android.net.Uri;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.apache.cordova.CordovaResourceApi;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public abstract class Filesystem {
-
- protected final Uri rootUri;
- protected final CordovaResourceApi resourceApi;
- public final String name;
- private JSONObject rootEntry;
-
- public Filesystem(Uri rootUri, String name, CordovaResourceApi resourceApi) {
- this.rootUri = rootUri;
- this.name = name;
- this.resourceApi = resourceApi;
- }
-
- public interface ReadFileCallback {
- public void handleData(InputStream inputStream, String contentType) throws IOException;
- }
-
- public static JSONObject makeEntryForURL(LocalFilesystemURL inputURL, Uri nativeURL) {
- try {
- String path = inputURL.path;
- int end = path.endsWith("/") ? 1 : 0;
- String[] parts = path.substring(0, path.length() - end).split("/+");
- String fileName = parts[parts.length - 1];
-
- JSONObject entry = new JSONObject();
- entry.put("isFile", !inputURL.isDirectory);
- entry.put("isDirectory", inputURL.isDirectory);
- entry.put("name", fileName);
- entry.put("fullPath", path);
- // The file system can't be specified, as it would lead to an infinite loop,
- // but the filesystem name can be.
- entry.put("filesystemName", inputURL.fsName);
- // Backwards compatibility
- entry.put("filesystem", "temporary".equals(inputURL.fsName) ? 0 : 1);
-
- String nativeUrlStr = nativeURL.toString();
- if (inputURL.isDirectory && !nativeUrlStr.endsWith("/")) {
- nativeUrlStr += "/";
- }
- entry.put("nativeURL", nativeUrlStr);
- return entry;
- } catch (JSONException e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- public JSONObject makeEntryForURL(LocalFilesystemURL inputURL) {
- Uri nativeUri = toNativeUri(inputURL);
- return nativeUri == null ? null : makeEntryForURL(inputURL, nativeUri);
- }
-
- public JSONObject makeEntryForNativeUri(Uri nativeUri) {
- LocalFilesystemURL inputUrl = toLocalUri(nativeUri);
- return inputUrl == null ? null : makeEntryForURL(inputUrl, nativeUri);
- }
-
- public JSONObject getEntryForLocalURL(LocalFilesystemURL inputURL) throws IOException {
- return makeEntryForURL(inputURL);
- }
-
- public JSONObject makeEntryForFile(File file) {
- return makeEntryForNativeUri(Uri.fromFile(file));
- }
-
- abstract JSONObject getFileForLocalURL(LocalFilesystemURL inputURL, String path,
- JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException;
-
- abstract boolean removeFileAtLocalURL(LocalFilesystemURL inputURL) throws InvalidModificationException, NoModificationAllowedException;
-
- abstract boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL) throws FileExistsException, NoModificationAllowedException;
-
- abstract LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException;
-
- public final JSONArray readEntriesAtLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
- LocalFilesystemURL[] children = listChildren(inputURL);
- JSONArray entries = new JSONArray();
- if (children != null) {
- for (LocalFilesystemURL url : children) {
- entries.put(makeEntryForURL(url));
- }
- }
- return entries;
- }
-
- abstract JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException;
-
- public Uri getRootUri() {
- return rootUri;
- }
-
- public boolean exists(LocalFilesystemURL inputURL) {
- try {
- getFileMetadataForLocalURL(inputURL);
- } catch (FileNotFoundException e) {
- return false;
- }
- return true;
- }
-
- public Uri nativeUriForFullPath(String fullPath) {
- Uri ret = null;
- if (fullPath != null) {
- String encodedPath = Uri.fromFile(new File(fullPath)).getEncodedPath();
- if (encodedPath.startsWith("/")) {
- encodedPath = encodedPath.substring(1);
- }
- ret = rootUri.buildUpon().appendEncodedPath(encodedPath).build();
- }
- return ret;
- }
-
- public LocalFilesystemURL localUrlforFullPath(String fullPath) {
- Uri nativeUri = nativeUriForFullPath(fullPath);
- if (nativeUri != null) {
- return toLocalUri(nativeUri);
- }
- return null;
- }
-
- /**
- * Removes multiple repeated //s, and collapses processes ../s.
- */
- protected static String normalizePath(String rawPath) {
- // If this is an absolute path, trim the leading "/" and replace it later
- boolean isAbsolutePath = rawPath.startsWith("/");
- if (isAbsolutePath) {
- rawPath = rawPath.replaceFirst("/+", "");
- }
- ArrayList<String> components = new ArrayList<String>(Arrays.asList(rawPath.split("/+")));
- for (int index = 0; index < components.size(); ++index) {
- if (components.get(index).equals("..")) {
- components.remove(index);
- if (index > 0) {
- components.remove(index-1);
- --index;
- }
- }
- }
- StringBuilder normalizedPath = new StringBuilder();
- for(String component: components) {
- normalizedPath.append("/");
- normalizedPath.append(component);
- }
- if (isAbsolutePath) {
- return normalizedPath.toString();
- } else {
- return normalizedPath.toString().substring(1);
- }
- }
-
- /**
- * Gets the free space in bytes available on this filesystem.
- * Subclasses may override this method to return nonzero free space.
- */
- public long getFreeSpaceInBytes() {
- return 0;
- }
-
- public abstract Uri toNativeUri(LocalFilesystemURL inputURL);
- public abstract LocalFilesystemURL toLocalUri(Uri inputURL);
-
- public JSONObject getRootEntry() {
- if (rootEntry == null) {
- rootEntry = makeEntryForNativeUri(rootUri);
- }
- return rootEntry;
- }
-
- public JSONObject getParentForLocalURL(LocalFilesystemURL inputURL) throws IOException {
- Uri parentUri = inputURL.uri;
- String parentPath = new File(inputURL.uri.getPath()).getParent();
- if (!"/".equals(parentPath)) {
- parentUri = inputURL.uri.buildUpon().path(parentPath + '/').build();
- }
- return getEntryForLocalURL(LocalFilesystemURL.parse(parentUri));
- }
-
- protected LocalFilesystemURL makeDestinationURL(String newName, LocalFilesystemURL srcURL, LocalFilesystemURL destURL, boolean isDirectory) {
- // I know this looks weird but it is to work around a JSON bug.
- if ("null".equals(newName) || "".equals(newName)) {
- newName = srcURL.uri.getLastPathSegment();;
- }
-
- String newDest = destURL.uri.toString();
- if (newDest.endsWith("/")) {
- newDest = newDest + newName;
- } else {
- newDest = newDest + "/" + newName;
- }
- if (isDirectory) {
- newDest += '/';
- }
- return LocalFilesystemURL.parse(newDest);
- }
-
- /* Read a source URL (possibly from a different filesystem, srcFs,) and copy it to
- * the destination URL on this filesystem, optionally with a new filename.
- * If move is true, then this method should either perform an atomic move operation
- * or remove the source file when finished.
- */
- public JSONObject copyFileToURL(LocalFilesystemURL destURL, String newName,
- Filesystem srcFs, LocalFilesystemURL srcURL, boolean move) throws IOException, InvalidModificationException, JSONException, NoModificationAllowedException, FileExistsException {
- // First, check to see that we can do it
- if (move && !srcFs.canRemoveFileAtLocalURL(srcURL)) {
- throw new NoModificationAllowedException("Cannot move file at source URL");
- }
- final LocalFilesystemURL destination = makeDestinationURL(newName, srcURL, destURL, srcURL.isDirectory);
-
- Uri srcNativeUri = srcFs.toNativeUri(srcURL);
-
- CordovaResourceApi.OpenForReadResult ofrr = resourceApi.openForRead(srcNativeUri);
- OutputStream os = null;
- try {
- os = getOutputStreamForURL(destination);
- } catch (IOException e) {
- ofrr.inputStream.close();
- throw e;
- }
- // Closes streams.
- resourceApi.copyResource(ofrr, os);
-
- if (move) {
- srcFs.removeFileAtLocalURL(srcURL);
- }
- return getEntryForLocalURL(destination);
- }
-
- public OutputStream getOutputStreamForURL(LocalFilesystemURL inputURL) throws IOException {
- return resourceApi.openOutputStream(toNativeUri(inputURL));
- }
-
- public void readFileAtURL(LocalFilesystemURL inputURL, long start, long end,
- ReadFileCallback readFileCallback) throws IOException {
- CordovaResourceApi.OpenForReadResult ofrr = resourceApi.openForRead(toNativeUri(inputURL));
- if (end < 0) {
- end = ofrr.length;
- }
- long numBytesToRead = end - start;
- try {
- if (start > 0) {
- ofrr.inputStream.skip(start);
- }
- InputStream inputStream = ofrr.inputStream;
- if (end < ofrr.length) {
- inputStream = new LimitedInputStream(inputStream, numBytesToRead);
- }
- readFileCallback.handleData(inputStream, ofrr.mimeType);
- } finally {
- ofrr.inputStream.close();
- }
- }
-
- abstract long writeToFileAtURL(LocalFilesystemURL inputURL, String data, int offset,
- boolean isBinary) throws NoModificationAllowedException, IOException;
-
- abstract long truncateFileAtURL(LocalFilesystemURL inputURL, long size)
- throws IOException, NoModificationAllowedException;
-
- // This method should return null if filesystem urls cannot be mapped to paths
- abstract String filesystemPathForURL(LocalFilesystemURL url);
-
- abstract LocalFilesystemURL URLforFilesystemPath(String path);
-
- abstract boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL);
-
- protected class LimitedInputStream extends FilterInputStream {
- long numBytesToRead;
- public LimitedInputStream(InputStream in, long numBytesToRead) {
- super(in);
- this.numBytesToRead = numBytesToRead;
- }
- @Override
- public int read() throws IOException {
- if (numBytesToRead <= 0) {
- return -1;
- }
- numBytesToRead--;
- return in.read();
- }
- @Override
- public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {
- if (numBytesToRead <= 0) {
- return -1;
- }
- int bytesToRead = byteCount;
- if (byteCount > numBytesToRead) {
- bytesToRead = (int)numBytesToRead; // Cast okay; long is less than int here.
- }
- int numBytesRead = in.read(buffer, byteOffset, bytesToRead);
- numBytesToRead -= numBytesRead;
- return numBytesRead;
- }
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/InvalidModificationException.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/InvalidModificationException.java
deleted file mode 100644
index 8f6bec59c..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/InvalidModificationException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-
-package org.apache.cordova.file;
-
-@SuppressWarnings("serial")
-public class InvalidModificationException extends Exception {
-
- public InvalidModificationException(String message) {
- super(message);
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystem.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystem.java
deleted file mode 100644
index 051f99496..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystem.java
+++ /dev/null
@@ -1,513 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.file;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
-import org.apache.cordova.CordovaResourceApi;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.os.Build;
-import android.os.Environment;
-import android.util.Base64;
-import android.net.Uri;
-import android.content.Context;
-import android.content.Intent;
-
-import java.nio.charset.Charset;
-
-public class LocalFilesystem extends Filesystem {
- private final Context context;
-
- public LocalFilesystem(String name, Context context, CordovaResourceApi resourceApi, File fsRoot) {
- super(Uri.fromFile(fsRoot).buildUpon().appendEncodedPath("").build(), name, resourceApi);
- this.context = context;
- }
-
- public String filesystemPathForFullPath(String fullPath) {
- return new File(rootUri.getPath(), fullPath).toString();
- }
-
- @Override
- public String filesystemPathForURL(LocalFilesystemURL url) {
- return filesystemPathForFullPath(url.path);
- }
-
- private String fullPathForFilesystemPath(String absolutePath) {
- if (absolutePath != null && absolutePath.startsWith(rootUri.getPath())) {
- return absolutePath.substring(rootUri.getPath().length() - 1);
- }
- return null;
- }
-
- @Override
- public Uri toNativeUri(LocalFilesystemURL inputURL) {
- return nativeUriForFullPath(inputURL.path);
- }
-
- @Override
- public LocalFilesystemURL toLocalUri(Uri inputURL) {
- if (!"file".equals(inputURL.getScheme())) {
- return null;
- }
- File f = new File(inputURL.getPath());
- // Removes and duplicate /s (e.g. file:///a//b/c)
- Uri resolvedUri = Uri.fromFile(f);
- String rootUriNoTrailingSlash = rootUri.getEncodedPath();
- rootUriNoTrailingSlash = rootUriNoTrailingSlash.substring(0, rootUriNoTrailingSlash.length() - 1);
- if (!resolvedUri.getEncodedPath().startsWith(rootUriNoTrailingSlash)) {
- return null;
- }
- String subPath = resolvedUri.getEncodedPath().substring(rootUriNoTrailingSlash.length());
- // Strip leading slash
- if (!subPath.isEmpty()) {
- subPath = subPath.substring(1);
- }
- Uri.Builder b = new Uri.Builder()
- .scheme(LocalFilesystemURL.FILESYSTEM_PROTOCOL)
- .authority("localhost")
- .path(name);
- if (!subPath.isEmpty()) {
- b.appendEncodedPath(subPath);
- }
- if (f.isDirectory()) {
- // Add trailing / for directories.
- b.appendEncodedPath("");
- }
- return LocalFilesystemURL.parse(b.build());
- }
-
- @Override
- public LocalFilesystemURL URLforFilesystemPath(String path) {
- return localUrlforFullPath(fullPathForFilesystemPath(path));
- }
-
- @Override
- public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
- String path, JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
- boolean create = false;
- boolean exclusive = false;
-
- if (options != null) {
- create = options.optBoolean("create");
- if (create) {
- exclusive = options.optBoolean("exclusive");
- }
- }
-
- // Check for a ":" character in the file to line up with BB and iOS
- if (path.contains(":")) {
- throw new EncodingException("This path has an invalid \":\" in it.");
- }
-
- LocalFilesystemURL requestedURL;
-
- // Check whether the supplied path is absolute or relative
- if (directory && !path.endsWith("/")) {
- path += "/";
- }
- if (path.startsWith("/")) {
- requestedURL = localUrlforFullPath(normalizePath(path));
- } else {
- requestedURL = localUrlforFullPath(normalizePath(inputURL.path + "/" + path));
- }
-
- File fp = new File(this.filesystemPathForURL(requestedURL));
-
- if (create) {
- if (exclusive && fp.exists()) {
- throw new FileExistsException("create/exclusive fails");
- }
- if (directory) {
- fp.mkdir();
- } else {
- fp.createNewFile();
- }
- if (!fp.exists()) {
- throw new FileExistsException("create fails");
- }
- }
- else {
- if (!fp.exists()) {
- throw new FileNotFoundException("path does not exist");
- }
- if (directory) {
- if (fp.isFile()) {
- throw new TypeMismatchException("path doesn't exist or is file");
- }
- } else {
- if (fp.isDirectory()) {
- throw new TypeMismatchException("path doesn't exist or is directory");
- }
- }
- }
-
- // Return the directory
- return makeEntryForURL(requestedURL);
- }
-
- @Override
- public boolean removeFileAtLocalURL(LocalFilesystemURL inputURL) throws InvalidModificationException {
-
- File fp = new File(filesystemPathForURL(inputURL));
-
- // You can't delete a directory that is not empty
- if (fp.isDirectory() && fp.list().length > 0) {
- throw new InvalidModificationException("You can't delete a directory that is not empty.");
- }
-
- return fp.delete();
- }
-
- @Override
- public boolean exists(LocalFilesystemURL inputURL) {
- File fp = new File(filesystemPathForURL(inputURL));
- return fp.exists();
- }
-
- @Override
- public long getFreeSpaceInBytes() {
- return DirectoryManager.getFreeSpaceInBytes(rootUri.getPath());
- }
-
- @Override
- public boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL) throws FileExistsException {
- File directory = new File(filesystemPathForURL(inputURL));
- return removeDirRecursively(directory);
- }
-
- protected boolean removeDirRecursively(File directory) throws FileExistsException {
- if (directory.isDirectory()) {
- for (File file : directory.listFiles()) {
- removeDirRecursively(file);
- }
- }
-
- if (!directory.delete()) {
- throw new FileExistsException("could not delete: " + directory.getName());
- } else {
- return true;
- }
- }
-
- @Override
- public LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException {
- File fp = new File(filesystemPathForURL(inputURL));
-
- if (!fp.exists()) {
- // The directory we are listing doesn't exist so we should fail.
- throw new FileNotFoundException();
- }
-
- File[] files = fp.listFiles();
- if (files == null) {
- // inputURL is a directory
- return null;
- }
- LocalFilesystemURL[] entries = new LocalFilesystemURL[files.length];
- for (int i = 0; i < files.length; i++) {
- entries[i] = URLforFilesystemPath(files[i].getPath());
- }
-
- return entries;
- }
-
- @Override
- public JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
- File file = new File(filesystemPathForURL(inputURL));
-
- if (!file.exists()) {
- throw new FileNotFoundException("File at " + inputURL.uri + " does not exist.");
- }
-
- JSONObject metadata = new JSONObject();
- try {
- // Ensure that directories report a size of 0
- metadata.put("size", file.isDirectory() ? 0 : file.length());
- metadata.put("type", resourceApi.getMimeType(Uri.fromFile(file)));
- metadata.put("name", file.getName());
- metadata.put("fullPath", inputURL.path);
- metadata.put("lastModifiedDate", file.lastModified());
- } catch (JSONException e) {
- return null;
- }
- return metadata;
- }
-
- private void copyFile(Filesystem srcFs, LocalFilesystemURL srcURL, File destFile, boolean move) throws IOException, InvalidModificationException, NoModificationAllowedException {
- if (move) {
- String realSrcPath = srcFs.filesystemPathForURL(srcURL);
- if (realSrcPath != null) {
- File srcFile = new File(realSrcPath);
- if (srcFile.renameTo(destFile)) {
- return;
- }
- // Trying to rename the file failed. Possibly because we moved across file system on the device.
- }
- }
-
- CordovaResourceApi.OpenForReadResult offr = resourceApi.openForRead(srcFs.toNativeUri(srcURL));
- copyResource(offr, new FileOutputStream(destFile));
-
- if (move) {
- srcFs.removeFileAtLocalURL(srcURL);
- }
- }
-
- private void copyDirectory(Filesystem srcFs, LocalFilesystemURL srcURL, File dstDir, boolean move) throws IOException, NoModificationAllowedException, InvalidModificationException, FileExistsException {
- if (move) {
- String realSrcPath = srcFs.filesystemPathForURL(srcURL);
- if (realSrcPath != null) {
- File srcDir = new File(realSrcPath);
- // If the destination directory already exists and is empty then delete it. This is according to spec.
- if (dstDir.exists()) {
- if (dstDir.list().length > 0) {
- throw new InvalidModificationException("directory is not empty");
- }
- dstDir.delete();
- }
- // Try to rename the directory
- if (srcDir.renameTo(dstDir)) {
- return;
- }
- // Trying to rename the file failed. Possibly because we moved across file system on the device.
- }
- }
-
- if (dstDir.exists()) {
- if (dstDir.list().length > 0) {
- throw new InvalidModificationException("directory is not empty");
- }
- } else {
- if (!dstDir.mkdir()) {
- // If we can't create the directory then fail
- throw new NoModificationAllowedException("Couldn't create the destination directory");
- }
- }
-
- LocalFilesystemURL[] children = srcFs.listChildren(srcURL);
- for (LocalFilesystemURL childLocalUrl : children) {
- File target = new File(dstDir, new File(childLocalUrl.path).getName());
- if (childLocalUrl.isDirectory) {
- copyDirectory(srcFs, childLocalUrl, target, false);
- } else {
- copyFile(srcFs, childLocalUrl, target, false);
- }
- }
-
- if (move) {
- srcFs.recursiveRemoveFileAtLocalURL(srcURL);
- }
- }
-
- @Override
- public JSONObject copyFileToURL(LocalFilesystemURL destURL, String newName,
- Filesystem srcFs, LocalFilesystemURL srcURL, boolean move) throws IOException, InvalidModificationException, JSONException, NoModificationAllowedException, FileExistsException {
-
- // Check to see if the destination directory exists
- String newParent = this.filesystemPathForURL(destURL);
- File destinationDir = new File(newParent);
- if (!destinationDir.exists()) {
- // The destination does not exist so we should fail.
- throw new FileNotFoundException("The source does not exist");
- }
-
- // Figure out where we should be copying to
- final LocalFilesystemURL destinationURL = makeDestinationURL(newName, srcURL, destURL, srcURL.isDirectory);
-
- Uri dstNativeUri = toNativeUri(destinationURL);
- Uri srcNativeUri = srcFs.toNativeUri(srcURL);
- // Check to see if source and destination are the same file
- if (dstNativeUri.equals(srcNativeUri)) {
- throw new InvalidModificationException("Can't copy onto itself");
- }
-
- if (move && !srcFs.canRemoveFileAtLocalURL(srcURL)) {
- throw new InvalidModificationException("Source URL is read-only (cannot move)");
- }
-
- File destFile = new File(dstNativeUri.getPath());
- if (destFile.exists()) {
- if (!srcURL.isDirectory && destFile.isDirectory()) {
- throw new InvalidModificationException("Can't copy/move a file to an existing directory");
- } else if (srcURL.isDirectory && destFile.isFile()) {
- throw new InvalidModificationException("Can't copy/move a directory to an existing file");
- }
- }
-
- if (srcURL.isDirectory) {
- // E.g. Copy /sdcard/myDir to /sdcard/myDir/backup
- if (dstNativeUri.toString().startsWith(srcNativeUri.toString() + '/')) {
- throw new InvalidModificationException("Can't copy directory into itself");
- }
- copyDirectory(srcFs, srcURL, destFile, move);
- } else {
- copyFile(srcFs, srcURL, destFile, move);
- }
- return makeEntryForURL(destinationURL);
- }
-
- @Override
- public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
- int offset, boolean isBinary) throws IOException, NoModificationAllowedException {
-
- boolean append = false;
- if (offset > 0) {
- this.truncateFileAtURL(inputURL, offset);
- append = true;
- }
-
- byte[] rawData;
- if (isBinary) {
- rawData = Base64.decode(data, Base64.DEFAULT);
- } else {
- rawData = data.getBytes(Charset.defaultCharset());
- }
- ByteArrayInputStream in = new ByteArrayInputStream(rawData);
- try
- {
- byte buff[] = new byte[rawData.length];
- String absolutePath = filesystemPathForURL(inputURL);
- FileOutputStream out = new FileOutputStream(absolutePath, append);
- try {
- in.read(buff, 0, buff.length);
- out.write(buff, 0, rawData.length);
- out.flush();
- } finally {
- // Always close the output
- out.close();
- }
- if (isPublicDirectory(absolutePath)) {
- broadcastNewFile(Uri.fromFile(new File(absolutePath)));
- }
- }
- catch (NullPointerException e)
- {
- // This is a bug in the Android implementation of the Java Stack
- NoModificationAllowedException realException = new NoModificationAllowedException(inputURL.toString());
- realException.initCause(e);
- throw realException;
- }
-
- return rawData.length;
- }
-
- private boolean isPublicDirectory(String absolutePath) {
- // TODO: should expose a way to scan app's private files (maybe via a flag).
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- // Lollipop has a bug where SD cards are null.
- for (File f : context.getExternalMediaDirs()) {
- if(f != null && absolutePath.startsWith(f.getAbsolutePath())) {
- return true;
- }
- }
- }
-
- String extPath = Environment.getExternalStorageDirectory().getAbsolutePath();
- return absolutePath.startsWith(extPath);
- }
-
- /**
- * Send broadcast of new file so files appear over MTP
- */
- private void broadcastNewFile(Uri nativeUri) {
- Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, nativeUri);
- context.sendBroadcast(intent);
- }
-
- @Override
- public long truncateFileAtURL(LocalFilesystemURL inputURL, long size) throws IOException {
- File file = new File(filesystemPathForURL(inputURL));
-
- if (!file.exists()) {
- throw new FileNotFoundException("File at " + inputURL.uri + " does not exist.");
- }
-
- RandomAccessFile raf = new RandomAccessFile(filesystemPathForURL(inputURL), "rw");
- try {
- if (raf.length() >= size) {
- FileChannel channel = raf.getChannel();
- channel.truncate(size);
- return size;
- }
-
- return raf.length();
- } finally {
- raf.close();
- }
-
-
- }
-
- @Override
- public boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL) {
- String path = filesystemPathForURL(inputURL);
- File file = new File(path);
- return file.exists();
- }
-
- // This is a copy & paste from CordovaResource API that is required since CordovaResourceApi
- // has a bug pre-4.0.0.
- // TODO: Once [email protected] is released, delete this copy and make the plugin depend on
- // 4.0.0 with an engine tag.
- private static void copyResource(CordovaResourceApi.OpenForReadResult input, OutputStream outputStream) throws IOException {
- try {
- InputStream inputStream = input.inputStream;
- if (inputStream instanceof FileInputStream && outputStream instanceof FileOutputStream) {
- FileChannel inChannel = ((FileInputStream)input.inputStream).getChannel();
- FileChannel outChannel = ((FileOutputStream)outputStream).getChannel();
- long offset = 0;
- long length = input.length;
- if (input.assetFd != null) {
- offset = input.assetFd.getStartOffset();
- }
- // transferFrom()'s 2nd arg is a relative position. Need to set the absolute
- // position first.
- inChannel.position(offset);
- outChannel.transferFrom(inChannel, 0, length);
- } else {
- final int BUFFER_SIZE = 8192;
- byte[] buffer = new byte[BUFFER_SIZE];
-
- for (;;) {
- int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE);
-
- if (bytesRead <= 0) {
- break;
- }
- outputStream.write(buffer, 0, bytesRead);
- }
- }
- } finally {
- input.inputStream.close();
- if (outputStream != null) {
- outputStream.close();
- }
- }
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystemURL.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystemURL.java
deleted file mode 100644
index b96b6ee49..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/LocalFilesystemURL.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.file;
-
-import android.net.Uri;
-
-public class LocalFilesystemURL {
-
- public static final String FILESYSTEM_PROTOCOL = "cdvfile";
-
- public final Uri uri;
- public final String fsName;
- public final String path;
- public final boolean isDirectory;
-
- private LocalFilesystemURL(Uri uri, String fsName, String fsPath, boolean isDirectory) {
- this.uri = uri;
- this.fsName = fsName;
- this.path = fsPath;
- this.isDirectory = isDirectory;
- }
-
- public static LocalFilesystemURL parse(Uri uri) {
- if (!FILESYSTEM_PROTOCOL.equals(uri.getScheme())) {
- return null;
- }
- String path = uri.getPath();
- if (path.length() < 1) {
- return null;
- }
- int firstSlashIdx = path.indexOf('/', 1);
- if (firstSlashIdx < 0) {
- return null;
- }
- String fsName = path.substring(1, firstSlashIdx);
- path = path.substring(firstSlashIdx);
- boolean isDirectory = path.charAt(path.length() - 1) == '/';
- return new LocalFilesystemURL(uri, fsName, path, isDirectory);
- }
-
- public static LocalFilesystemURL parse(String uri) {
- return parse(Uri.parse(uri));
- }
-
- public String toString() {
- return uri.toString();
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/NoModificationAllowedException.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/NoModificationAllowedException.java
deleted file mode 100644
index 627eafb56..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/NoModificationAllowedException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.file;
-
-@SuppressWarnings("serial")
-public class NoModificationAllowedException extends Exception {
-
- public NoModificationAllowedException(String message) {
- super(message);
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/PendingRequests.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/PendingRequests.java
deleted file mode 100644
index 4c75f4231..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/PendingRequests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.file;
-
-import android.util.SparseArray;
-
-import org.apache.cordova.CallbackContext;
-
-/**
- * Holds pending runtime permission requests
- */
-class PendingRequests {
- private int currentReqId = 0;
- private SparseArray<Request> requests = new SparseArray<Request>();
-
- /**
- * Creates a request and adds it to the array of pending requests. Each created request gets a
- * unique result code for use with requestPermission()
- * @param rawArgs The raw arguments passed to the plugin
- * @param action The action this request corresponds to (get file, etc.)
- * @param callbackContext The CallbackContext for this plugin call
- * @return The request code that can be used to retrieve the Request object
- */
- public synchronized int createRequest(String rawArgs, int action, CallbackContext callbackContext) {
- Request req = new Request(rawArgs, action, callbackContext);
- requests.put(req.requestCode, req);
- return req.requestCode;
- }
-
- /**
- * Gets the request corresponding to this request code and removes it from the pending requests
- * @param requestCode The request code for the desired request
- * @return The request corresponding to the given request code or null if such a
- * request is not found
- */
- public synchronized Request getAndRemove(int requestCode) {
- Request result = requests.get(requestCode);
- requests.remove(requestCode);
- return result;
- }
-
- /**
- * Holds the options and CallbackContext for a call made to the plugin.
- */
- public class Request {
-
- // Unique int used to identify this request in any Android permission callback
- private int requestCode;
-
- // Action to be performed after permission request result
- private int action;
-
- // Raw arguments passed to plugin
- private String rawArgs;
-
- // The callback context for this plugin request
- private CallbackContext callbackContext;
-
- private Request(String rawArgs, int action, CallbackContext callbackContext) {
- this.rawArgs = rawArgs;
- this.action = action;
- this.callbackContext = callbackContext;
- this.requestCode = currentReqId ++;
- }
-
- public int getAction() {
- return this.action;
- }
-
- public String getRawArgs() {
- return rawArgs;
- }
-
- public CallbackContext getCallbackContext() {
- return callbackContext;
- }
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/TypeMismatchException.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/TypeMismatchException.java
deleted file mode 100644
index 1315f9a9e..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/TypeMismatchException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-
-package org.apache.cordova.file;
-
-@SuppressWarnings("serial")
-public class TypeMismatchException extends Exception {
-
- public TypeMismatchException(String message) {
- super(message);
- }
-
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/whitelist/WhitelistPlugin.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/whitelist/WhitelistPlugin.java
deleted file mode 100644
index 365678864..000000000
--- a/cordova/platforms/android/app/src/main/java/org/apache/cordova/whitelist/WhitelistPlugin.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.whitelist;
-
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.ConfigXmlParser;
-import org.apache.cordova.LOG;
-import org.apache.cordova.Whitelist;
-import org.xmlpull.v1.XmlPullParser;
-
-import android.content.Context;
-
-public class WhitelistPlugin extends CordovaPlugin {
- private static final String LOG_TAG = "WhitelistPlugin";
- private Whitelist allowedNavigations;
- private Whitelist allowedIntents;
- private Whitelist allowedRequests;
-
- // Used when instantiated via reflection by PluginManager
- public WhitelistPlugin() {
- }
- // These can be used by embedders to allow Java-configuration of whitelists.
- public WhitelistPlugin(Context context) {
- this(new Whitelist(), new Whitelist(), null);
- new CustomConfigXmlParser().parse(context);
- }
- public WhitelistPlugin(XmlPullParser xmlParser) {
- this(new Whitelist(), new Whitelist(), null);
- new CustomConfigXmlParser().parse(xmlParser);
- }
- public WhitelistPlugin(Whitelist allowedNavigations, Whitelist allowedIntents, Whitelist allowedRequests) {
- if (allowedRequests == null) {
- allowedRequests = new Whitelist();
- allowedRequests.addWhiteListEntry("file:///*", false);
- allowedRequests.addWhiteListEntry("data:*", false);
- }
- this.allowedNavigations = allowedNavigations;
- this.allowedIntents = allowedIntents;
- this.allowedRequests = allowedRequests;
- }
- @Override
- public void pluginInitialize() {
- if (allowedNavigations == null) {
- allowedNavigations = new Whitelist();
- allowedIntents = new Whitelist();
- allowedRequests = new Whitelist();
- new CustomConfigXmlParser().parse(webView.getContext());
- }
- }
-
- private class CustomConfigXmlParser extends ConfigXmlParser {
- @Override
- public void handleStartTag(XmlPullParser xml) {
- String strNode = xml.getName();
- if (strNode.equals("content")) {
- String startPage = xml.getAttributeValue(null, "src");
- allowedNavigations.addWhiteListEntry(startPage, false);
- } else if (strNode.equals("allow-navigation")) {
- String origin = xml.getAttributeValue(null, "href");
- if ("*".equals(origin)) {
- allowedNavigations.addWhiteListEntry("http://*/*", false);
- allowedNavigations.addWhiteListEntry("https://*/*", false);
- allowedNavigations.addWhiteListEntry("data:*", false);
- } else {
- allowedNavigations.addWhiteListEntry(origin, false);
- }
- } else if (strNode.equals("allow-intent")) {
- String origin = xml.getAttributeValue(null, "href");
- allowedIntents.addWhiteListEntry(origin, false);
- } else if (strNode.equals("access")) {
- String origin = xml.getAttributeValue(null, "origin");
- String subdomains = xml.getAttributeValue(null, "subdomains");
- boolean external = (xml.getAttributeValue(null, "launch-external") != null);
- if (origin != null) {
- if (external) {
- LOG.w(LOG_TAG, "Found <access launch-external> within config.xml. Please use <allow-intent> instead.");
- allowedIntents.addWhiteListEntry(origin, (subdomains != null) && (subdomains.compareToIgnoreCase("true") == 0));
- } else {
- if ("*".equals(origin)) {
- allowedRequests.addWhiteListEntry("http://*/*", false);
- allowedRequests.addWhiteListEntry("https://*/*", false);
- } else {
- allowedRequests.addWhiteListEntry(origin, (subdomains != null) && (subdomains.compareToIgnoreCase("true") == 0));
- }
- }
- }
- }
- }
- @Override
- public void handleEndTag(XmlPullParser xml) {
- }
- }
-
- @Override
- public Boolean shouldAllowNavigation(String url) {
- if (allowedNavigations.isUrlWhiteListed(url)) {
- return true;
- }
- return null; // Default policy
- }
-
- @Override
- public Boolean shouldAllowRequest(String url) {
- if (Boolean.TRUE == shouldAllowNavigation(url)) {
- return true;
- }
- if (allowedRequests.isUrlWhiteListed(url)) {
- return true;
- }
- return null; // Default policy
- }
-
- @Override
- public Boolean shouldOpenExternalUrl(String url) {
- if (allowedIntents.isUrlWhiteListed(url)) {
- return true;
- }
- return null; // Default policy
- }
-
- public Whitelist getAllowedNavigations() {
- return allowedNavigations;
- }
-
- public void setAllowedNavigations(Whitelist allowedNavigations) {
- this.allowedNavigations = allowedNavigations;
- }
-
- public Whitelist getAllowedIntents() {
- return allowedIntents;
- }
-
- public void setAllowedIntents(Whitelist allowedIntents) {
- this.allowedIntents = allowedIntents;
- }
-
- public Whitelist getAllowedRequests() {
- return allowedRequests;
- }
-
- public void setAllowedRequests(Whitelist allowedRequests) {
- this.allowedRequests = allowedRequests;
- }
-}
diff --git a/cordova/platforms/android/app/src/main/java/org/tagspaces/mobileapp/MainActivity.java b/cordova/platforms/android/app/src/main/java/org/tagspaces/mobileapp/MainActivity.java
deleted file mode 100644
index 2fa774b44..000000000
--- a/cordova/platforms/android/app/src/main/java/org/tagspaces/mobileapp/MainActivity.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package org.tagspaces.mobileapp;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class MainActivity extends CordovaActivity
-{
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
-
- // enable Cordova apps to be started in the background
- Bundle extras = getIntent().getExtras();
- if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
- moveTaskToBack(true);
- }
-
- // Set by <content src="index.html" /> in config.xml
- loadUrl(launchUrl);
- }
-}
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/cordova/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index e3bed1585..000000000
Binary files a/cordova/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/cordova/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 4b21439ec..000000000
Binary files a/cordova/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 880675c81..000000000
Binary files a/cordova/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 83533ff4e..000000000
Binary files a/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index dc90c2575..000000000
Binary files a/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/platforms/android/app/src/main/res/values/strings.xml b/cordova/platforms/android/app/src/main/res/values/strings.xml
deleted file mode 100644
index ec1771c8d..000000000
--- a/cordova/platforms/android/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<resources>
- <string name="app_name">TagSpaces</string>
- <string name="launcher_name">@string/app_name</string>
- <string name="activity_name">@string/launcher_name</string>
-</resources>
diff --git a/cordova/platforms/android/app/src/main/res/values/styles.xml b/cordova/platforms/android/app/src/main/res/values/styles.xml
deleted file mode 100644
index a7e342362..000000000
--- a/cordova/platforms/android/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <style name="FilePickerTheme" parent="android:Theme.Material.Light" />
-</resources>
diff --git a/cordova/platforms/android/app/src/main/res/xml/camera_provider_paths.xml b/cordova/platforms/android/app/src/main/res/xml/camera_provider_paths.xml
deleted file mode 100644
index 326674847..000000000
--- a/cordova/platforms/android/app/src/main/res/xml/camera_provider_paths.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<paths xmlns:android="http://schemas.android.com/apk/res/android">
- <cache-path name="cache_files" path="." />
-</paths>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/xml/config.xml b/cordova/platforms/android/app/src/main/res/xml/config.xml
deleted file mode 100644
index b34a5f792..000000000
--- a/cordova/platforms/android/app/src/main/res/xml/config.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<widget id="org.tagspaces.mobileapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
- <feature name="IntentShim">
- <param name="android-package" value="com.darryncampbell.cordova.plugin.intent.IntentShim" />
- <param name="onload" value="true" />
- </feature>
- <feature name="Filebrowser">
- <param name="android-package" value="com.ourcodeworld.plugins.filebrowser.Filebrowser" />
- </feature>
- <feature name="Downloader">
- <param name="android-package" value="com.whebcraft.android.plugin.Downloader" />
- </feature>
- <feature name="Device">
- <param name="android-package" value="org.apache.cordova.device.Device" />
- </feature>
- <feature name="BackgroundMode">
- <param name="android-package" value="de.appplant.cordova.plugin.background.BackgroundMode" />
- </feature>
- <feature name="BackgroundModeExt">
- <param name="android-package" value="de.appplant.cordova.plugin.background.BackgroundModeExt" />
- </feature>
- <feature name="Camera">
- <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
- </feature>
- <feature name="File">
- <param name="android-package" value="org.apache.cordova.file.FileUtils" />
- <param name="onload" value="true" />
- </feature>
- <allow-navigation href="cdvfile:*" />
- <feature name="FileOpener2">
- <param name="android-package" value="io.github.pwlin.cordova.plugins.fileopener2.FileOpener2" />
- </feature>
- <feature name="Whitelist">
- <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
- <param name="onload" value="true" />
- </feature>
- <feature name="SocialSharing">
- <param name="android-package" value="nl.xservices.plugins.SocialSharing" />
- </feature>
- <name>TagSpaces</name>
- <description>
- Offline file organizer and browser with tagging support.
- </description>
- <author email="[email protected]" href="https://tagspaces.org">
- TagSpaces GmbH
- </author>
- <content src="index.html" />
- <access origin="*" />
- <allow-intent href="http://*/*" />
- <allow-intent href="https://*/*" />
- <allow-intent href="tel:*" />
- <allow-intent href="sms:*" />
- <allow-intent href="mailto:*" />
- <allow-intent href="geo:*" />
- <allow-intent href="market:*" />
- <icon density="mdpi" src="res/icon/android/mipmap-mdpi/ic_launcher.png" />
- <icon density="hdpi" src="res/icon/android/mipmap-hdpi/ic_launcher.png" />
- <icon density="xhdpi" src="res/icon/android/mipmap-xhdpi/ic_launcher.png" />
- <icon density="xxhdpi" src="res/icon/android/mipmap-xxhdpi/ic_launcher.png" />
- <icon density="xxxhdpi" src="res/icon/android/mipmap-xxxhdpi/ic_launcher.png" />
- <config-file mode="merge" parent="/manifest/application/activity" platform="android" target="AndroidManifest.xml">
- <intent-filter>
- <data android:mimeType="application/pdf" android:scheme="file" />
- <data android:mimeType="text/plain" android:scheme="file" />
- <data android:mimeType="image/x-windows-bmp" android:scheme="file" />
- <data android:mimeType="image/gif" android:scheme="file" />
- <data android:mimeType="image/png" android:scheme="file" />
- <data android:mimeType="image/jpeg" android:scheme="file" />
- <data android:mimeType="image/webp" android:scheme="file" />
- <data android:mimeType="video/webm" android:scheme="file" />
- <data android:mimeType="video/ogg" android:scheme="file" />
- <data android:mimeType="text/html" android:scheme="file" />
- <data android:mimeType="application/json" android:scheme="file" />
- <action android:name="android.intent.action.VIEW" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.BROWSABLE" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..json" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..mht" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..mhtml" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..md" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..md.txt" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..markdown" android:scheme="file" />
- <data android:host="*" android:mimeType="*/*" android:pathPattern="..ogv" android:scheme="file" />
- </intent-filter>
- </config-file>
- <config-file parent="/manifest/application" target="AndroidManifest.xml">
- <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
- <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/mnk_file_path" />
- </provider>
- </config-file>
- <resource-file src="res/android/mnk_file_path.xml" target="app/src/main/res/xml/mnk_file_path.xml" />
- <preference name="loglevel" value="DEBUG" />
- <preference name="KeepRunning" value="true" />
- <preference name="AndroidPersistentFileLocation" value="Compatibility" />
- <preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
- <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
- <preference name="android-minSdkVersion" value="25" />
- <preference name="android-targetSdkVersion" value="29" />
- <preference name="AndroidXEnabled" value="true" />
-</widget>
diff --git a/cordova/platforms/android/app/src/main/res/xml/mnk_file_path.xml b/cordova/platforms/android/app/src/main/res/xml/mnk_file_path.xml
deleted file mode 100644
index 24212697f..000000000
--- a/cordova/platforms/android/app/src/main/res/xml/mnk_file_path.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<paths xmlns:android="http://schemas.android.com/apk/res/android">
- <root-path
- name="root"
- path="." />
-</paths>
diff --git a/cordova/platforms/android/app/src/main/res/xml/opener_paths.xml b/cordova/platforms/android/app/src/main/res/xml/opener_paths.xml
deleted file mode 100644
index 0ffc88ec9..000000000
--- a/cordova/platforms/android/app/src/main/res/xml/opener_paths.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- https://developer.android.com/reference/android/support/v4/content/FileProvider.html#SpecifyFiles -->
-<paths xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- cordova.file.dataDirectory -->
- <files-path name="files" path="." />
- <!-- cordova.file.cacheDirectory -->
- <cache-path name="cache" path="." />
- <!-- cordova.file.externalDataDirectory -->
- <external-files-path name="external-files" path="." />
- <!-- cordova.file.externalCacheDirectory -->
- <external-cache-path name="external-cache" path="." />
- <!-- cordova.file.externalRootDirectory -->
- <external-path name="external" path="." />
-</paths>
diff --git a/cordova/platforms/android/app/src/main/res/xml/provider_paths.xml b/cordova/platforms/android/app/src/main/res/xml/provider_paths.xml
deleted file mode 100644
index 6077b3992..000000000
--- a/cordova/platforms/android/app/src/main/res/xml/provider_paths.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<paths xmlns:android='http://schemas.android.com/apk/res/android'>
- <external-path name='external_files' path='.' />
-</paths>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/xml/sharing_paths.xml b/cordova/platforms/android/app/src/main/res/xml/sharing_paths.xml
deleted file mode 100644
index 278084a21..000000000
--- a/cordova/platforms/android/app/src/main/res/xml/sharing_paths.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<paths>
- <external-path
- name="Android/data/${applicationId}/socialsharing_downloads"
- path="./socialsharing-downloads"/>
-
- <root-path
- name="root"
- path="/"/>
-
-</paths>
\ No newline at end of file
diff --git a/cordova/platforms/android/build.gradle b/cordova/platforms/android/build.gradle
deleted file mode 100644
index d09805de4..000000000
--- a/cordova/platforms/android/build.gradle
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- ext.kotlin_version = '1.3.50'
- apply from: 'repositories.gradle'
- repositories repos
-
- dependencies {
- classpath 'com.android.tools.build:gradle:4.0.0'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- apply from: 'repositories.gradle'
- repositories repos
-
- //This replaces project.properties w.r.t. build settings
- project.ext {
- defaultBuildToolsVersion="29.0.2" //String
- defaultMinSdkVersion=22 //Integer - Minimum requirement is Android 5.1
- defaultTargetSdkVersion=29 //Integer - We ALWAYS target the latest by default
- defaultCompileSdkVersion=29 //Integer - We ALWAYS compile with the latest by default
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/cordova/platforms/android/com.ourcodeworld.plugins.Filebrowser/mobileapp-plugin.gradle b/cordova/platforms/android/com.ourcodeworld.plugins.Filebrowser/mobileapp-plugin.gradle
deleted file mode 100644
index 78fbb3e9f..000000000
--- a/cordova/platforms/android/com.ourcodeworld.plugins.Filebrowser/mobileapp-plugin.gradle
+++ /dev/null
@@ -1,3 +0,0 @@
-dependencies {
- implementation 'androidx.core:core:1.0.0'
-}
diff --git a/cordova/platforms/android/cordova/Api.js b/cordova/platforms/android/cordova/Api.js
deleted file mode 100644
index 0c70d3260..000000000
--- a/cordova/platforms/android/cordova/Api.js
+++ /dev/null
@@ -1,386 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-/**
- * @todo update coho to update this line.
- * @todo use `package.json` instead but first
- * figure out how this fit in with the platform-centered workflow structure.
- * This workflow would not have the `package.json` file.
- */
-// Coho updates this line
-const VERSION = '9.1.0';
-
-var path = require('path');
-
-var AndroidProject = require('./lib/AndroidProject');
-var PluginManager = require('cordova-common').PluginManager;
-
-var CordovaLogger = require('cordova-common').CordovaLogger;
-var selfEvents = require('cordova-common').events;
-var ConfigParser = require('cordova-common').ConfigParser;
-const prepare = require('./lib/prepare').prepare;
-
-var PLATFORM = 'android';
-
-function setupEvents (externalEventEmitter) {
- if (externalEventEmitter) {
- // This will make the platform internal events visible outside
- selfEvents.forwardEventsTo(externalEventEmitter);
- return externalEventEmitter;
- }
-
- // There is no logger if external emitter is not present,
- // so attach a console logger
- CordovaLogger.get().subscribe(selfEvents);
- return selfEvents;
-}
-
-/**
- * Class, that acts as abstraction over particular platform. Encapsulates the
- * platform's properties and methods.
- *
- * Platform that implements own PlatformApi instance _should implement all
- * prototype methods_ of this class to be fully compatible with cordova-lib.
- *
- * The PlatformApi instance also should define the following field:
- *
- * * platform: String that defines a platform name.
- * @class Api
- */
-class Api {
- constructor (platform, platformRootDir, events) {
- this.platform = PLATFORM;
- this.root = path.resolve(__dirname, '..');
-
- setupEvents(events);
-
- const appMain = path.join(this.root, 'app', 'src', 'main');
- const appRes = path.join(appMain, 'res');
-
- this.locations = {
- root: this.root,
- www: path.join(appMain, 'assets', 'www'),
- res: appRes,
- platformWww: path.join(this.root, 'platform_www'),
- configXml: path.join(appRes, 'xml', 'config.xml'),
- defaultConfigXml: path.join(this.root, 'cordova', 'defaults.xml'),
- strings: path.join(appRes, 'values', 'strings.xml'),
- manifest: path.join(appMain, 'AndroidManifest.xml'),
- build: path.join(this.root, 'build'),
- javaSrc: path.join(appMain, 'java')
- };
-
- this._builder = require('./lib/builders/builders').getBuilder(this.root);
- }
-
- /**
- * Gets a CordovaPlatform object, that represents the platform structure.
- *
- * @return {CordovaPlatform} A structure that contains the description of
- * platform's file structure and other properties of platform.
- */
- getPlatformInfo () {
- var result = {};
- result.locations = this.locations;
- result.root = this.root;
- result.name = this.platform;
- result.version = Api.version();
- result.projectConfig = this._config;
-
- return result;
- }
-
- /**
- * Updates installed platform with provided www assets and new app
- * configuration. This method is required for CLI workflow and will be called
- * each time before build, so the changes, made to app configuration and www
- * code, will be applied to platform.
- *
- * @param {CordovaProject} cordovaProject A CordovaProject instance, that defines a
- * project structure and configuration, that should be applied to platform
- * (contains project's www location and ConfigParser instance for project's
- * config).
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError instance.
- */
- prepare (cordovaProject, prepareOptions) {
- cordovaProject.projectConfig = new ConfigParser(cordovaProject.locations.rootConfigXml || cordovaProject.projectConfig.path);
-
- return prepare.call(this, cordovaProject, prepareOptions);
- }
-
- /**
- * Installs a new plugin into platform. This method only copies non-www files
- * (sources, libs, etc.) to platform. It also doesn't resolves the
- * dependencies of plugin. Both of handling of www files, such as assets and
- * js-files and resolving dependencies are the responsibility of caller.
- *
- * @param {PluginInfo} plugin A PluginInfo instance that represents plugin
- * that will be installed.
- * @param {Object} installOptions An options object. Possible options below:
- * @param {Boolean} installOptions.link: Flag that specifies that plugin
- * sources will be symlinked to app's directory instead of copying (if
- * possible).
- * @param {Object} installOptions.variables An object that represents
- * variables that will be used to install plugin. See more details on plugin
- * variables in documentation:
- * https://cordova.apache.org/docs/en/4.0.0/plugin_ref_spec.md.html
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError instance.
- */
- addPlugin (plugin, installOptions) {
- var project = AndroidProject.getProjectFile(this.root);
- var self = this;
-
- installOptions = installOptions || {};
- installOptions.variables = installOptions.variables || {};
- // Add PACKAGE_NAME variable into vars
- if (!installOptions.variables.PACKAGE_NAME) {
- installOptions.variables.PACKAGE_NAME = project.getPackageName();
- }
-
- return Promise.resolve().then(function () {
- return PluginManager.get(self.platform, self.locations, project).addPlugin(plugin, installOptions);
- }).then(function () {
- if (plugin.getFrameworks(this.platform).length === 0) return;
- selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
- // This should pick the correct builder, not just get gradle
- this._builder.prepBuildFiles();
- }.bind(this))
- // CB-11022 Return truthy value to prevent running prepare after
- .then(() => true);
- }
-
- /**
- * Removes an installed plugin from platform.
- *
- * Since method accepts PluginInfo instance as input parameter instead of plugin
- * id, caller shoud take care of managing/storing PluginInfo instances for
- * future uninstalls.
- *
- * @param {PluginInfo} plugin A PluginInfo instance that represents plugin
- * that will be installed.
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError instance.
- */
- removePlugin (plugin, uninstallOptions) {
- var project = AndroidProject.getProjectFile(this.root);
-
- if (uninstallOptions && uninstallOptions.usePlatformWww === true) {
- uninstallOptions.usePlatformWww = false;
- }
-
- return PluginManager.get(this.platform, this.locations, project)
- .removePlugin(plugin, uninstallOptions)
- .then(function () {
- if (plugin.getFrameworks(this.platform).length === 0) return;
-
- selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
- this._builder.prepBuildFiles();
- }.bind(this))
- // CB-11022 Return truthy value to prevent running prepare after
- .then(() => true);
- }
-
- /**
- * Builds an application package for current platform.
- *
- * @param {Object} buildOptions A build options. This object's structure is
- * highly depends on platform's specific. The most common options are:
- * @param {Boolean} buildOptions.debug Indicates that packages should be
- * built with debug configuration. This is set to true by default unless the
- * 'release' option is not specified.
- * @param {Boolean} buildOptions.release Indicates that packages should be
- * built with release configuration. If not set to true, debug configuration
- * will be used.
- * @param {Boolean} buildOptions.device Specifies that built app is intended
- * to run on device
- * @param {Boolean} buildOptions.emulator: Specifies that built app is
- * intended to run on emulator
- * @param {String} buildOptions.target Specifies the device id that will be
- * used to run built application.
- * @param {Boolean} buildOptions.nobuild Indicates that this should be a
- * dry-run call, so no build artifacts will be produced.
- * @param {String[]} buildOptions.archs Specifies chip architectures which
- * app packages should be built for. List of valid architectures is depends on
- * platform.
- * @param {String} buildOptions.buildConfig The path to build configuration
- * file. The format of this file is depends on platform.
- * @param {String[]} buildOptions.argv Raw array of command-line arguments,
- * passed to `build` command. The purpose of this property is to pass a
- * platform-specific arguments, and eventually let platform define own
- * arguments processing logic.
- *
- * @return {Promise<Object[]>} A promise either fulfilled with an array of build
- * artifacts (application packages) if package was built successfully,
- * or rejected with CordovaError. The resultant build artifact objects is not
- * strictly typed and may conatin arbitrary set of fields as in sample below.
- *
- * {
- * architecture: 'x86',
- * buildType: 'debug',
- * path: '/path/to/build',
- * type: 'app'
- * }
- *
- * The return value in most cases will contain only one item but in some cases
- * there could be multiple items in output array, e.g. when multiple
- * arhcitectures is specified.
- */
- build (buildOptions) {
- var self = this;
-
- return require('./lib/check_reqs').run().then(function () {
- return require('./lib/build').run.call(self, buildOptions);
- }).then(function (buildResults) {
- // Cast build result to array of build artifacts
- return buildResults.paths.map(function (apkPath) {
- return {
- buildType: buildResults.buildType,
- buildMethod: buildResults.buildMethod,
- path: apkPath,
- type: path.extname(apkPath).replace(/\./g, '')
- };
- });
- });
- }
-
- /**
- * Builds an application package for current platform and runs it on
- * specified/default device. If no 'device'/'emulator'/'target' options are
- * specified, then tries to run app on default device if connected, otherwise
- * runs the app on emulator.
- *
- * @param {Object} runOptions An options object. The structure is the same
- * as for build options.
- *
- * @return {Promise} A promise either fulfilled if package was built and ran
- * successfully, or rejected with CordovaError.
- */
- run (runOptions) {
- var self = this;
- return require('./lib/check_reqs').run().then(function () {
- return require('./lib/run').run.call(self, runOptions);
- });
- }
-
- /**
- * Cleans out the build artifacts from platform's directory, and also
- * cleans out the platform www directory if called without options specified.
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError.
- */
- clean (cleanOptions) {
- var self = this;
- // This will lint, checking for null won't
- if (typeof cleanOptions === 'undefined') {
- cleanOptions = {};
- }
-
- return require('./lib/check_reqs').run().then(function () {
- return require('./lib/build').runClean.call(self, cleanOptions);
- }).then(function () {
- return require('./lib/prepare').clean.call(self, cleanOptions);
- });
- }
-
- /**
- * Performs a requirements check for current platform. Each platform defines its
- * own set of requirements, which should be resolved before platform can be
- * built successfully.
- *
- * @return {Promise<Requirement[]>} Promise, resolved with set of Requirement
- * objects for current platform.
- */
- requirements () {
- return require('./lib/check_reqs').check_all();
- }
-
- /**
- * Installs platform to specified directory and creates a platform project.
- *
- * @param {String} destination Destination directory, where insatll platform to
- * @param {ConfigParser} [config] ConfgiParser instance, used to retrieve
- * project creation options, such as package id and project name.
- * @param {Object} [options] An options object. The most common options are:
- * @param {String} [options.customTemplate] A path to custom template, that
- * should override the default one from platform.
- * @param {Boolean} [options.link] Flag that indicates that platform's
- * sources will be linked to installed platform instead of copying.
- * @param {EventEmitter} [events] An EventEmitter instance that will be used for
- * logging purposes. If no EventEmitter provided, all events will be logged to
- * console
- *
- * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
- * instance or rejected with CordovaError.
- */
- static createPlatform (destination, config, options, events) {
- events = setupEvents(events);
- var result;
- try {
- result = require('../../lib/create').create(destination, config, options, events).then(function (destination) {
- return new Api(PLATFORM, destination, events);
- });
- } catch (e) {
- events.emit('error', 'createPlatform is not callable from the android project API.');
- throw (e);
- }
- return result;
- }
-
- /**
- * Updates already installed platform.
- *
- * @param {String} destination Destination directory, where platform installed
- * @param {Object} [options] An options object. The most common options are:
- * @param {String} [options.customTemplate] A path to custom template, that
- * should override the default one from platform.
- * @param {Boolean} [options.link] Flag that indicates that platform's
- * sources will be linked to installed platform instead of copying.
- * @param {EventEmitter} [events] An EventEmitter instance that will be used for
- * logging purposes. If no EventEmitter provided, all events will be logged to
- * console
- *
- * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
- * instance or rejected with CordovaError.
- */
- static updatePlatform (destination, options, events) {
- events = setupEvents(events);
- var result;
- try {
- result = require('../../lib/create').update(destination, options, events).then(function (destination) {
- return new Api(PLATFORM, destination, events);
- });
- } catch (e) {
- events.emit('error', 'updatePlatform is not callable from the android project API, you will need to do this manually.');
- throw (e);
- }
- return result;
- }
-
- static version () {
- return VERSION;
- }
-}
-
-module.exports = Api;
diff --git a/cordova/platforms/android/cordova/android_sdk_version b/cordova/platforms/android/cordova/android_sdk_version
deleted file mode 100755
index c4aa8b865..000000000
--- a/cordova/platforms/android/cordova/android_sdk_version
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var android_sdk = require('./lib/android_sdk');
-
-android_sdk.print_newest_available_sdk_target().catch(err => {
- console.error(err);
- process.exit(2);
-});
diff --git a/cordova/platforms/android/cordova/android_sdk_version.bat b/cordova/platforms/android/cordova/android_sdk_version.bat
deleted file mode 100644
index 65173a8f8..000000000
--- a/cordova/platforms/android/cordova/android_sdk_version.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0android_sdk_version"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'android_sdk_version' script in 'bin' folder, aborting...>&2
- EXIT /B 1
-)
diff --git a/cordova/platforms/android/cordova/build b/cordova/platforms/android/cordova/build
deleted file mode 100755
index b4e160ebe..000000000
--- a/cordova/platforms/android/cordova/build
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var args = process.argv;
-var Api = require('./Api');
-var nopt = require('nopt');
-var path = require('path');
-
-// Support basic help commands
-if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) >= 0) {
- require('./lib/build').help();
-}
-
-// Do some basic argument parsing
-var buildOpts = nopt({
- verbose: Boolean,
- silent: Boolean,
- debug: Boolean,
- release: Boolean,
- nobuild: Boolean,
- buildConfig: path
-}, { d: '--verbose' });
-
-// Make buildOptions compatible with PlatformApi build method spec
-buildOpts.argv = buildOpts.argv.original;
-
-require('./loggingHelper').adjustLoggerLevel(buildOpts);
-
-new Api().build(buildOpts)
- .catch(function (err) {
- console.error(err.stack);
- process.exit(2);
- });
diff --git a/cordova/platforms/android/cordova/build.bat b/cordova/platforms/android/cordova/build.bat
deleted file mode 100644
index 46e966afb..000000000
--- a/cordova/platforms/android/cordova/build.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0build"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/check_reqs b/cordova/platforms/android/cordova/check_reqs
deleted file mode 100755
index faed86f10..000000000
--- a/cordova/platforms/android/cordova/check_reqs
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var check_reqs = require('./lib/check_reqs');
-
-check_reqs.run().then(
- function success () {
- console.log('Looks like your environment fully supports cordova-android development!');
- },
- function fail (err) {
- console.log(err);
- process.exit(2);
- }
-);
diff --git a/cordova/platforms/android/cordova/check_reqs.bat b/cordova/platforms/android/cordova/check_reqs.bat
deleted file mode 100644
index 84d66ad20..000000000
--- a/cordova/platforms/android/cordova/check_reqs.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0check_reqs"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2
- EXIT /B 1
-)
diff --git a/cordova/platforms/android/cordova/clean b/cordova/platforms/android/cordova/clean
deleted file mode 100755
index 5173d14b2..000000000
--- a/cordova/platforms/android/cordova/clean
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var Api = require('./Api');
-var path = require('path');
-var nopt = require('nopt');
-
-// Support basic help commands
-if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
- console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]));
- console.log('Cleans the project directory.');
- process.exit(0);
-}
-
-// Do some basic argument parsing
-var opts = nopt({
- verbose: Boolean,
- silent: Boolean
-}, { d: '--verbose' });
-
-// Make buildOptions compatible with PlatformApi clean method spec
-opts.argv = opts.argv.original;
-
-// Skip cleaning prepared files when not invoking via cordova CLI.
-opts.noPrepare = true;
-
-require('./loggingHelper').adjustLoggerLevel(opts);
-
-new Api().clean(opts)
- .catch(function (err) {
- console.error(err.stack);
- process.exit(2);
- });
diff --git a/cordova/platforms/android/cordova/clean.bat b/cordova/platforms/android/cordova/clean.bat
deleted file mode 100644
index 445ef6e12..000000000
--- a/cordova/platforms/android/cordova/clean.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0clean"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/defaults.xml b/cordova/platforms/android/cordova/defaults.xml
deleted file mode 100644
index 5286ab9c1..000000000
--- a/cordova/platforms/android/cordova/defaults.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<widget xmlns = "http://www.w3.org/ns/widgets"
- id = "io.cordova.helloCordova"
- version = "2.0.0">
-
- <!-- Preferences for Android -->
- <preference name="loglevel" value="DEBUG" />
-</widget>
diff --git a/cordova/platforms/android/cordova/lib/Adb.js b/cordova/platforms/android/cordova/lib/Adb.js
deleted file mode 100644
index 932626986..000000000
--- a/cordova/platforms/android/cordova/lib/Adb.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var os = require('os');
-var execa = require('execa');
-var events = require('cordova-common').events;
-var CordovaError = require('cordova-common').CordovaError;
-
-var Adb = {};
-
-/**
- * Lists available/connected devices and emulators
- *
- * @return {Promise<String[]>} list of available/connected
- * devices/emulators
- */
-Adb.devices = async function () {
- const { stdout } = await execa('adb', ['devices'], { cwd: os.tmpdir() });
-
- // Split into lines & drop first one (header)
- const rawDeviceLines = stdout.trim().split(/\r?\n/).slice(1);
-
- return rawDeviceLines
- .map(line => line.split('\t'))
-
- // We are only interested in fully booted devices & emulators. These
- // have a state of `device`. For a list of all the other possible states
- // see https://github.com/aosp-mirror/platform_system_core/blob/2abdb1eb5b83c8f39874644af576c869815f5c5b/adb/transport.cpp#L1129
- .filter(([, state]) => state === 'device')
-
- .map(([id]) => id);
-};
-
-Adb.install = function (target, packagePath, { replace = false, execOptions = {} } = {}) {
- events.emit('verbose', 'Installing apk ' + packagePath + ' on target ' + target + '...');
-
- var args = ['-s', target, 'install'];
- if (replace) args.push('-r');
-
- const opts = { cwd: os.tmpdir(), ...execOptions };
-
- return execa('adb', args.concat(packagePath), opts).then(({ stdout: output }) => {
- // adb does not return an error code even if installation fails. Instead it puts a specific
- // message to stdout, so we have to use RegExp matching to detect installation failure.
- if (output.match(/Failure/)) {
- if (output.match(/INSTALL_PARSE_FAILED_NO_CERTIFICATES/)) {
- output += '\n\n' + 'Sign the build using \'-- --keystore\' or \'--buildConfig\'' +
- ' or sign and deploy the unsigned apk manually using Android tools.';
- } else if (output.match(/INSTALL_FAILED_VERSION_DOWNGRADE/)) {
- output += '\n\n' + 'You\'re trying to install apk with a lower versionCode that is already installed.' +
- '\nEither uninstall an app or increment the versionCode.';
- }
-
- throw new CordovaError('Failed to install apk to target: ' + output);
- }
- });
-};
-
-Adb.uninstall = function (target, packageId) {
- events.emit('verbose', 'Uninstalling package ' + packageId + ' from target ' + target + '...');
- return execa('adb', ['-s', target, 'uninstall', packageId], { cwd: os.tmpdir() }).then(({ stdout }) => stdout);
-};
-
-Adb.shell = function (target, shellCommand) {
- events.emit('verbose', 'Running adb shell command "' + shellCommand + '" on target ' + target + '...');
- var args = ['-s', target, 'shell'];
- shellCommand = shellCommand.split(/\s+/);
- return execa('adb', args.concat(shellCommand), { cwd: os.tmpdir() })
- .then(({ stdout }) => stdout)
- .catch(error => Promise.reject(new CordovaError(`Failed to execute shell command "${shellCommand}" on device: ${error}`)));
-};
-
-Adb.start = function (target, activityName) {
- events.emit('verbose', 'Starting application "' + activityName + '" on target ' + target + '...');
- return Adb.shell(target, 'am start -W -a android.intent.action.MAIN -n' + activityName).catch((error) => {
- return Promise.reject(new CordovaError('Failed to start application "' +
- activityName + '"" on device: ' + error));
- });
-};
-
-module.exports = Adb;
diff --git a/cordova/platforms/android/cordova/lib/AndroidManifest.js b/cordova/platforms/android/cordova/lib/AndroidManifest.js
deleted file mode 100644
index be4fecc08..000000000
--- a/cordova/platforms/android/cordova/lib/AndroidManifest.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var fs = require('fs');
-var xml = require('cordova-common').xmlHelpers;
-
-var DEFAULT_ORIENTATION = 'default';
-
-/** Wraps an AndroidManifest file */
-class AndroidManifest {
- constructor (path) {
- this.path = path;
- this.doc = xml.parseElementtreeSync(path);
- if (this.doc.getroot().tag !== 'manifest') {
- throw new Error('AndroidManifest at ' + path + ' has incorrect root node name (expected "manifest")');
- }
- }
-
- getVersionName () {
- return this.doc.getroot().attrib['android:versionName'];
- }
-
- setVersionName (versionName) {
- this.doc.getroot().attrib['android:versionName'] = versionName;
- return this;
- }
-
- getVersionCode () {
- return this.doc.getroot().attrib['android:versionCode'];
- }
-
- setVersionCode (versionCode) {
- this.doc.getroot().attrib['android:versionCode'] = versionCode;
- return this;
- }
-
- getPackageId () {
- return this.doc.getroot().attrib.package;
- }
-
- setPackageId (pkgId) {
- this.doc.getroot().attrib.package = pkgId;
- return this;
- }
-
- getActivity () {
- var activity = this.doc.getroot().find('./application/activity');
- return {
- getName: function () {
- return activity.attrib['android:name'];
- },
- setName: function (name) {
- if (!name) {
- delete activity.attrib['android:name'];
- } else {
- activity.attrib['android:name'] = name;
- }
- return this;
- },
- getOrientation: function () {
- return activity.attrib['android:screenOrientation'];
- },
- setOrientation: function (orientation) {
- if (!orientation || orientation.toLowerCase() === DEFAULT_ORIENTATION) {
- delete activity.attrib['android:screenOrientation'];
- } else {
- activity.attrib['android:screenOrientation'] = orientation;
- }
- return this;
- },
- getLaunchMode: function () {
- return activity.attrib['android:launchMode'];
- },
- setLaunchMode: function (launchMode) {
- if (!launchMode) {
- delete activity.attrib['android:launchMode'];
- } else {
- activity.attrib['android:launchMode'] = launchMode;
- }
- return this;
- }
- };
- }
-
- getDebuggable () {
- return this.doc.getroot().find('./application').attrib['android:debuggable'] === 'true';
- }
-
- setDebuggable (value) {
- var application = this.doc.getroot().find('./application');
- if (value) {
- application.attrib['android:debuggable'] = 'true';
- } else {
- // The default value is "false", so we can remove attribute at all.
- delete application.attrib['android:debuggable'];
- }
- return this;
- }
-
- /**
- * Writes manifest to disk syncronously. If filename is specified, then manifest
- * will be written to that file
- *
- * @param {String} [destPath] File to write manifest to. If omitted,
- * manifest will be written to file it has been read from.
- */
- write (destPath) {
- fs.writeFileSync(destPath || this.path, this.doc.write({ indent: 4 }), 'utf-8');
- }
-}
-
-module.exports = AndroidManifest;
diff --git a/cordova/platforms/android/cordova/lib/AndroidProject.js b/cordova/platforms/android/cordova/lib/AndroidProject.js
deleted file mode 100644
index 5d1c3c32d..000000000
--- a/cordova/platforms/android/cordova/lib/AndroidProject.js
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var fs = require('fs');
-var path = require('path');
-var properties_parser = require('properties-parser');
-var AndroidManifest = require('./AndroidManifest');
-var pluginHandlers = require('./pluginHandlers');
-
-var projectFileCache = {};
-
-function addToPropertyList (projectProperties, key, value) {
- var i = 1;
- while (projectProperties.get(key + '.' + i)) { i++; }
-
- projectProperties.set(key + '.' + i, value);
- projectProperties.dirty = true;
-}
-
-function removeFromPropertyList (projectProperties, key, value) {
- var i = 1;
- var currentValue;
- while ((currentValue = projectProperties.get(key + '.' + i))) {
- if (currentValue === value) {
- while ((currentValue = projectProperties.get(key + '.' + (i + 1)))) {
- projectProperties.set(key + '.' + i, currentValue);
- i++;
- }
- projectProperties.set(key + '.' + i);
- break;
- }
- i++;
- }
- projectProperties.dirty = true;
-}
-
-function getRelativeLibraryPath (parentDir, subDir) {
- var libraryPath = path.relative(parentDir, subDir);
- return (path.sep === '\\') ? libraryPath.replace(/\\/g, '/') : libraryPath;
-}
-
-class AndroidProject {
- constructor (projectDir) {
- this._propertiesEditors = {};
- this._subProjectDirs = {};
- this._dirty = false;
- this.projectDir = projectDir;
- this.platformWww = path.join(this.projectDir, 'platform_www');
- this.www = path.join(this.projectDir, 'app/src/main/assets/www');
- }
-
- /**
- * Reads the package name out of the Android Manifest file
- *
- * @param {String} projectDir The absolute path to the directory containing the project
- * @return {String} The name of the package
- */
- getPackageName () {
- var manifestPath = path.join(this.projectDir, 'app/src/main/AndroidManifest.xml');
- return new AndroidManifest(manifestPath).getPackageId();
- }
-
- getCustomSubprojectRelativeDir (plugin_id, src) {
- // All custom subprojects are prefixed with the last portion of the package id.
- // This is to avoid collisions when opening multiple projects in Eclipse that have subprojects with the same name.
- var packageName = this.getPackageName();
- var lastDotIndex = packageName.lastIndexOf('.');
- var prefix = packageName.substring(lastDotIndex + 1);
- var subRelativeDir = path.join(plugin_id, prefix + '-' + path.basename(src));
- return subRelativeDir;
- }
-
- addSubProject (parentDir, subDir) {
- var parentProjectFile = path.resolve(parentDir, 'project.properties');
- var subProjectFile = path.resolve(subDir, 'project.properties');
- var parentProperties = this._getPropertiesFile(parentProjectFile);
- // TODO: Setting the target needs to happen only for pre-3.7.0 projects
- if (fs.existsSync(subProjectFile)) {
- var subProperties = this._getPropertiesFile(subProjectFile);
- subProperties.set('target', parentProperties.get('target'));
- subProperties.dirty = true;
- this._subProjectDirs[subDir] = true;
- }
- addToPropertyList(parentProperties, 'android.library.reference', getRelativeLibraryPath(parentDir, subDir));
-
- this._dirty = true;
- }
-
- removeSubProject (parentDir, subDir) {
- var parentProjectFile = path.resolve(parentDir, 'project.properties');
- var parentProperties = this._getPropertiesFile(parentProjectFile);
- removeFromPropertyList(parentProperties, 'android.library.reference', getRelativeLibraryPath(parentDir, subDir));
- delete this._subProjectDirs[subDir];
- this._dirty = true;
- }
-
- addGradleReference (parentDir, subDir) {
- var parentProjectFile = path.resolve(parentDir, 'project.properties');
- var parentProperties = this._getPropertiesFile(parentProjectFile);
- addToPropertyList(parentProperties, 'cordova.gradle.include', getRelativeLibraryPath(parentDir, subDir));
- this._dirty = true;
- }
-
- removeGradleReference (parentDir, subDir) {
- var parentProjectFile = path.resolve(parentDir, 'project.properties');
- var parentProperties = this._getPropertiesFile(parentProjectFile);
- removeFromPropertyList(parentProperties, 'cordova.gradle.include', getRelativeLibraryPath(parentDir, subDir));
- this._dirty = true;
- }
-
- addSystemLibrary (parentDir, value) {
- var parentProjectFile = path.resolve(parentDir, 'project.properties');
- var parentProperties = this._getPropertiesFile(parentProjectFile);
- addToPropertyList(parentProperties, 'cordova.system.library', value);
- this._dirty = true;
- }
-
- removeSystemLibrary (parentDir, value) {
- var parentProjectFile = path.resolve(parentDir, 'project.properties');
- var parentProperties = this._getPropertiesFile(parentProjectFile);
- removeFromPropertyList(parentProperties, 'cordova.system.library', value);
- this._dirty = true;
- }
-
- write () {
- if (!this._dirty) {
- return;
- }
- this._dirty = false;
-
- for (var filename in this._propertiesEditors) {
- var editor = this._propertiesEditors[filename];
- if (editor.dirty) {
- fs.writeFileSync(filename, editor.toString());
- editor.dirty = false;
- }
- }
- }
-
- getInstaller (type) {
- return pluginHandlers.getInstaller(type);
- }
-
- getUninstaller (type) {
- return pluginHandlers.getUninstaller(type);
- }
-
- /*
- * This checks if an Android project is clean or has old build artifacts
- */
- isClean () {
- var build_path = path.join(this.projectDir, 'build');
- // If the build directory doesn't exist, it's clean
- return !(fs.existsSync(build_path));
- }
-
- _getPropertiesFile (filename) {
- if (!this._propertiesEditors[filename]) {
- if (fs.existsSync(filename)) {
- this._propertiesEditors[filename] = properties_parser.createEditor(filename);
- } else {
- this._propertiesEditors[filename] = properties_parser.createEditor();
- }
- }
-
- return this._propertiesEditors[filename];
- }
-
- static getProjectFile (projectDir) {
- if (!projectFileCache[projectDir]) {
- projectFileCache[projectDir] = new AndroidProject(projectDir);
- }
-
- return projectFileCache[projectDir];
- }
-
- static purgeCache (projectDir) {
- if (projectDir) {
- delete projectFileCache[projectDir];
- } else {
- projectFileCache = {};
- }
- }
-}
-
-module.exports = AndroidProject;
diff --git a/cordova/platforms/android/cordova/lib/PackageType.js b/cordova/platforms/android/cordova/lib/PackageType.js
deleted file mode 100644
index fd129f134..000000000
--- a/cordova/platforms/android/cordova/lib/PackageType.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const PackageType = {
- APK: 'apk',
- BUNDLE: 'bundle'
-};
-
-module.exports = PackageType;
diff --git a/cordova/platforms/android/cordova/lib/android_sdk.js b/cordova/platforms/android/cordova/lib/android_sdk.js
deleted file mode 100755
index 963d7f1da..000000000
--- a/cordova/platforms/android/cordova/lib/android_sdk.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const execa = require('execa');
-
-var suffix_number_regex = /(\d+)$/;
-// Used for sorting Android targets, example strings to sort:
-// android-19
-// android-L
-// Google Inc.:Google APIs:20
-// Google Inc.:Glass Development Kit Preview:20
-// The idea is to sort based on largest "suffix" number - meaning the bigger
-// the number at the end, the more recent the target, the closer to the
-// start of the array.
-function sort_by_largest_numerical_suffix (a, b) {
- let suffix_a = a.match(suffix_number_regex);
- let suffix_b = b.match(suffix_number_regex);
- // If no number is detected (eg: preview version like android-R),
- // designate a suffix of 0 so it gets moved to the end
- suffix_a = suffix_a || ['0', '0'];
- suffix_b = suffix_b || ['0', '0'];
- // Return < zero, or > zero, based on which suffix is larger.
- return (parseInt(suffix_a[1]) > parseInt(suffix_b[1]) ? -1 : 1);
-}
-
-module.exports.print_newest_available_sdk_target = function () {
- return module.exports.list_targets().then(function (targets) {
- targets.sort(sort_by_largest_numerical_suffix);
- console.log(targets[0]);
- });
-};
-
-// Versions should not be represented as float, so we disable quote-props here
-/* eslint-disable quote-props */
-module.exports.version_string_to_api_level = {
- '4.0': 14,
- '4.0.3': 15,
- '4.1': 16,
- '4.2': 17,
- '4.3': 18,
- '4.4': 19,
- '4.4W': 20,
- '5.0': 21,
- '5.1': 22,
- '6.0': 23,
- '7.0': 24,
- '7.1.1': 25,
- '8.0': 26
-};
-/* eslint-enable quote-props */
-
-function parse_targets (output) {
- var target_out = output.split('\n');
- var targets = [];
- for (var i = target_out.length - 1; i >= 0; i--) {
- if (target_out[i].match(/id:/)) { // if "id:" is in the line...
- targets.push(target_out[i].match(/"(.+)"/)[1]); // .. match whatever is in quotes.
- }
- }
- return targets;
-}
-
-module.exports.list_targets_with_android = function () {
- return execa('android', ['list', 'target']).then(result => parse_targets(result.stdout));
-};
-
-module.exports.list_targets_with_avdmanager = function () {
- return execa('avdmanager', ['list', 'target']).then(result => parse_targets(result.stdout));
-};
-
-module.exports.list_targets = function () {
- return module.exports.list_targets_with_avdmanager().catch(function (err) {
- // If there's an error, like avdmanager could not be found, we can try
- // as a last resort, to run `android`, in case this is a super old
- // SDK installation.
- if (err && (err.code === 'ENOENT' || (err.stderr && err.stderr.match(/not recognized/)))) {
- return module.exports.list_targets_with_android();
- } else throw err;
- }).then(function (targets) {
- if (targets.length === 0) {
- return Promise.reject(new Error('No android targets (SDKs) installed!'));
- }
- return targets;
- });
-};
diff --git a/cordova/platforms/android/cordova/lib/build.js b/cordova/platforms/android/cordova/lib/build.js
deleted file mode 100644
index 71b93cc55..000000000
--- a/cordova/platforms/android/cordova/lib/build.js
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var path = require('path');
-var fs = require('fs');
-var nopt = require('nopt');
-
-var Adb = require('./Adb');
-
-var events = require('cordova-common').events;
-var PackageType = require('./PackageType');
-
-module.exports.parseBuildOptions = parseOpts;
-function parseOpts (options, resolvedTarget, projectRoot) {
- options = options || {};
- options.argv = nopt({
- prepenv: Boolean,
- versionCode: String,
- minSdkVersion: String,
- maxSdkVersion: String,
- targetSdkVersion: String,
- gradleArg: [String, Array],
- keystore: path,
- alias: String,
- storePassword: String,
- password: String,
- keystoreType: String,
- packageType: String
- }, {}, options.argv, 0);
-
- // Android Studio Build method is the default
- var ret = {
- buildType: options.release ? 'release' : 'debug',
- prepEnv: options.argv.prepenv,
- arch: resolvedTarget && resolvedTarget.arch,
- extraArgs: []
- };
-
- if (options.argv.versionCode) { ret.extraArgs.push('-PcdvVersionCode=' + options.argv.versionCode); }
- if (options.argv.minSdkVersion) { ret.extraArgs.push('-PcdvMinSdkVersion=' + options.argv.minSdkVersion); }
- if (options.argv.maxSdkVersion) { ret.extraArgs.push('-PcdvMaxSdkVersion=' + options.argv.maxSdkVersion); }
- if (options.argv.targetSdkVersion) { ret.extraArgs.push('-PcdvTargetSdkVersion=' + options.argv.targetSdkVersion); }
- if (options.argv.gradleArg) {
- ret.extraArgs = ret.extraArgs.concat(options.argv.gradleArg);
- }
-
- var packageArgs = {};
-
- if (options.argv.keystore) { packageArgs.keystore = path.relative(projectRoot, path.resolve(options.argv.keystore)); }
-
- ['alias', 'storePassword', 'password', 'keystoreType', 'packageType'].forEach(function (flagName) {
- if (options.argv[flagName]) { packageArgs[flagName] = options.argv[flagName]; }
- });
-
- var buildConfig = options.buildConfig;
-
- // If some values are not specified as command line arguments - use build config to supplement them.
- // Command line arguments have precedence over build config.
- if (buildConfig) {
- if (!fs.existsSync(buildConfig)) {
- throw new Error('Specified build config file does not exist: ' + buildConfig);
- }
- events.emit('log', 'Reading build config file: ' + path.resolve(buildConfig));
- var buildjson = fs.readFileSync(buildConfig, 'utf8');
- var config = JSON.parse(buildjson.replace(/^\ufeff/, '')); // Remove BOM
- if (config.android && config.android[ret.buildType]) {
- var androidInfo = config.android[ret.buildType];
- if (androidInfo.keystore && !packageArgs.keystore) {
- if (androidInfo.keystore.substr(0, 1) === '~') {
- androidInfo.keystore = process.env.HOME + androidInfo.keystore.substr(1);
- }
- packageArgs.keystore = path.resolve(path.dirname(buildConfig), androidInfo.keystore);
- events.emit('log', 'Reading the keystore from: ' + packageArgs.keystore);
- }
-
- ['alias', 'storePassword', 'password', 'keystoreType', 'packageType'].forEach(function (key) {
- packageArgs[key] = packageArgs[key] || androidInfo[key];
- });
- }
- }
-
- if (packageArgs.keystore && packageArgs.alias) {
- ret.packageInfo = new PackageInfo(packageArgs.keystore, packageArgs.alias, packageArgs.storePassword,
- packageArgs.password, packageArgs.keystoreType);
- }
-
- if (!ret.packageInfo) {
- // The following loop is to decide whether to print a warning about generating a signed archive
- // We only want to produce a warning if they are using a config property that is related to signing, but
- // missing the required properties for signing. We don't want to produce a warning if they are simply
- // using a build property that isn't related to signing, such as --packageType
- let shouldWarn = false;
- const signingKeys = ['keystore', 'alias', 'storePassword', 'password', 'keystoreType'];
-
- for (const key in packageArgs) {
- if (!shouldWarn && signingKeys.indexOf(key) > -1) {
- // If we enter this condition, we have a key used for signing a build,
- // but we are missing some required signing properties
- shouldWarn = true;
- }
- }
-
- if (shouldWarn) {
- events.emit('warn', '\'keystore\' and \'alias\' need to be specified to generate a signed archive.');
- }
- }
-
- if (packageArgs.packageType) {
- const VALID_PACKAGE_TYPES = [PackageType.APK, PackageType.BUNDLE];
- if (VALID_PACKAGE_TYPES.indexOf(packageArgs.packageType) === -1) {
- events.emit('warn', '"' + packageArgs.packageType + '" is an invalid packageType. Valid values are: ' + VALID_PACKAGE_TYPES.join(', ') + '\nDefaulting packageType to ' + PackageType.APK);
- ret.packageType = PackageType.APK;
- } else {
- ret.packageType = packageArgs.packageType;
- }
- } else {
- ret.packageType = PackageType.APK;
- }
-
- return ret;
-}
-
-/*
- * Builds the project with the specifed options
- * Returns a promise.
- */
-module.exports.runClean = function (options) {
- var opts = parseOpts(options, null, this.root);
- var builder = this._builder;
-
- return builder.prepEnv(opts).then(function () {
- return builder.clean(opts);
- });
-};
-
-/**
- * Builds the project with the specifed options.
- *
- * @param {BuildOptions} options A set of options. See PlatformApi.build
- * method documentation for reference.
- * @param {Object} optResolvedTarget A deployment target. Used to pass
- * target architecture from upstream 'run' call. TODO: remove this option in
- * favor of setting buildOptions.archs field.
- *
- * @return {Promise<Object>} Promise, resolved with built packages
- * information.
- */
-module.exports.run = function (options, optResolvedTarget) {
- var opts = parseOpts(options, optResolvedTarget, this.root);
- var builder = this._builder;
-
- return builder.prepEnv(opts).then(function () {
- if (opts.prepEnv) {
- events.emit('verbose', 'Build file successfully prepared.');
- return;
- }
- return builder.build(opts).then(function () {
- var paths;
- if (opts.packageType === PackageType.BUNDLE) {
- paths = builder.findOutputBundles(opts.buildType);
- events.emit('log', 'Built the following bundle(s): \n\t' + paths.join('\n\t'));
- } else {
- paths = builder.findOutputApks(opts.buildType, opts.arch);
- events.emit('log', 'Built the following apk(s): \n\t' + paths.join('\n\t'));
- }
-
- return {
- paths: paths,
- buildType: opts.buildType
- };
- });
- });
-};
-
-/*
- * Detects the architecture of a device/emulator
- * Returns "arm" or "x86".
- */
-module.exports.detectArchitecture = function (target) {
- return Adb.shell(target, 'cat /proc/cpuinfo').then(function (output) {
- return /intel/i.exec(output) ? 'x86' : 'arm';
- });
-};
-
-module.exports.findBestApkForArchitecture = function (buildResults, arch) {
- var paths = buildResults.apkPaths.filter(function (p) {
- var apkName = path.basename(p);
- if (buildResults.buildType === 'debug') {
- return /-debug/.exec(apkName);
- }
- return !/-debug/.exec(apkName);
- });
- var archPattern = new RegExp('-' + arch);
- var hasArchPattern = /-x86|-arm/;
- for (var i = 0; i < paths.length; ++i) {
- var apkName = path.basename(paths[i]);
- if (hasArchPattern.exec(apkName)) {
- if (archPattern.exec(apkName)) {
- return paths[i];
- }
- } else {
- return paths[i];
- }
- }
- throw new Error('Could not find apk architecture: ' + arch + ' build-type: ' + buildResults.buildType);
-};
-
-function PackageInfo (keystore, alias, storePassword, password, keystoreType) {
- const createNameKeyObject = (name, value) => ({ name, value: value.replace(/\\/g, '\\\\') });
-
- this.data = [
- createNameKeyObject('key.store', keystore),
- createNameKeyObject('key.alias', alias)
- ];
-
- if (storePassword) this.data.push(createNameKeyObject('key.store.password', storePassword));
- if (password) this.data.push(createNameKeyObject('key.alias.password', password));
- if (keystoreType) this.data.push(createNameKeyObject('key.store.type', keystoreType));
-}
-
-PackageInfo.prototype = {
- appendToProperties: function (propertiesParser) {
- for (const { name, value } of this.data) propertiesParser.set(name, value);
-
- propertiesParser.save();
- }
-};
-
-module.exports.help = function () {
- console.log('Usage: ' + path.relative(process.cwd(), path.join('../build')) + ' [flags] [Signed APK flags]');
- console.log('Flags:');
- console.log(' \'--debug\': will build project in debug mode (default)');
- console.log(' \'--release\': will build project for release');
- console.log(' \'--nobuild\': will skip build process (useful when using run command)');
- console.log(' \'--prepenv\': don\'t build, but copy in build scripts where necessary');
- console.log(' \'--versionCode=#\': Override versionCode for this build. Useful for uploading multiple APKs.');
- console.log(' \'--minSdkVersion=#\': Override minSdkVersion for this build.');
- console.log(' \'--maxSdkVersion=#\': Override maxSdkVersion for this build. (Not Recommended)');
- console.log(' \'--targetSdkVersion=#\': Override targetSdkVersion for this build.');
- console.log(' \'--gradleArg=<gradle command line arg>\': Extra args to pass to the gradle command. Use one flag per arg. Ex. --gradleArg=-PcdvBuildMultipleApks=true');
- console.log(' \'--packageType=<apk|bundle>\': Builds an APK or a bundle');
- console.log('');
- console.log('Signed APK flags (overwrites debug/release-signing.proprties) :');
- console.log(' \'--keystore=<path to keystore>\': Key store used to build a signed archive. (Required)');
- console.log(' \'--alias=\': Alias for the key store. (Required)');
- console.log(' \'--storePassword=\': Password for the key store. (Optional - prompted)');
- console.log(' \'--password=\': Password for the key. (Optional - prompted)');
- console.log(' \'--keystoreType\': Type of the keystore. (Optional)');
- process.exit(0);
-};
diff --git a/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js b/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js
deleted file mode 100644
index 71cc86d1b..000000000
--- a/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var fs = require('fs-extra');
-var path = require('path');
-const execa = require('execa');
-const glob = require('fast-glob');
-var events = require('cordova-common').events;
-var CordovaError = require('cordova-common').CordovaError;
-var check_reqs = require('../check_reqs');
-var PackageType = require('../PackageType');
-const { compareByAll } = require('../utils');
-const { createEditor } = require('properties-parser');
-
-const MARKER = 'YOUR CHANGES WILL BE ERASED!';
-const SIGNING_PROPERTIES = '-signing.properties';
-const TEMPLATE =
- '# This file is automatically generated.\n' +
- '# Do not modify this file -- ' + MARKER + '\n';
-
-const isPathArchSpecific = p => /-x86|-arm/.test(path.basename(p));
-
-const outputFileComparator = compareByAll([
- // Sort arch specific builds after generic ones
- isPathArchSpecific,
-
- // Sort unsigned builds after signed ones
- filePath => /-unsigned/.test(path.basename(filePath)),
-
- // Sort by file modification time, latest first
- filePath => -fs.statSync(filePath).mtime.getTime(),
-
- // Sort by file name length, ascending
- filePath => filePath.length
-]);
-
-/**
- * @param {'apk' | 'aab'} bundleType
- * @param {'debug' | 'release'} buildType
- * @param {{arch?: string}} options
- */
-function findOutputFiles (bundleType, buildType, { arch } = {}) {
- let files = glob.sync(`**/*.${bundleType}`, {
- absolute: true,
- cwd: path.resolve(this[`${bundleType}Dir`], buildType)
- }).map(path.normalize);
-
- if (files.length === 0) return files;
-
- // Assume arch-specific build if newest apk has -x86 or -arm.
- const archSpecific = isPathArchSpecific(files[0]);
-
- // And show only arch-specific ones (or non-arch-specific)
- files = files.filter(p => isPathArchSpecific(p) === archSpecific);
-
- if (archSpecific && files.length > 1 && arch) {
- files = files.filter(p => path.basename(p).includes('-' + arch));
- }
-
- return files.sort(outputFileComparator);
-}
-
-class ProjectBuilder {
- constructor (rootDirectory) {
- this.root = rootDirectory || path.resolve(__dirname, '../../..');
- this.apkDir = path.join(this.root, 'app', 'build', 'outputs', 'apk');
- this.aabDir = path.join(this.root, 'app', 'build', 'outputs', 'bundle');
- }
-
- getArgs (cmd, opts) {
- let args;
- let buildCmd = cmd;
- if (opts.packageType === PackageType.BUNDLE) {
- if (cmd === 'release') {
- buildCmd = ':app:bundleRelease';
- } else if (cmd === 'debug') {
- buildCmd = ':app:bundleDebug';
- }
-
- args = [buildCmd, '-b', path.join(this.root, 'build.gradle')];
- } else {
- if (cmd === 'release') {
- buildCmd = 'cdvBuildRelease';
- } else if (cmd === 'debug') {
- buildCmd = 'cdvBuildDebug';
- }
-
- args = [buildCmd, '-b', path.join(this.root, 'build.gradle')];
-
- if (opts.arch) {
- args.push('-PcdvBuildArch=' + opts.arch);
- }
- }
-
- args.push.apply(args, opts.extraArgs);
-
- return args;
- }
-
- /*
- * This returns a promise
- */
- runGradleWrapper (gradle_cmd) {
- var gradlePath = path.join(this.root, 'gradlew');
- var wrapperGradle = path.join(this.root, 'wrapper.gradle');
- if (fs.existsSync(gradlePath)) {
- // Literally do nothing, for some reason this works, while !fs.existsSync didn't on Windows
- } else {
- return execa(gradle_cmd, ['-p', this.root, 'wrapper', '-b', wrapperGradle], { stdio: 'inherit' });
- }
- }
-
- readProjectProperties () {
- function findAllUniq (data, r) {
- var s = {};
- var m;
- while ((m = r.exec(data))) {
- s[m[1]] = 1;
- }
- return Object.keys(s);
- }
-
- var data = fs.readFileSync(path.join(this.root, 'project.properties'), 'utf8');
- return {
- libs: findAllUniq(data, /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg),
- gradleIncludes: findAllUniq(data, /^\s*cordova\.gradle\.include\.\d+=(.*)(?:\s|$)/mg),
- systemLibs: findAllUniq(data, /^\s*cordova\.system\.library\.\d+=(.*)(?:\s|$)/mg)
- };
- }
-
- extractRealProjectNameFromManifest () {
- var manifestPath = path.join(this.root, 'app', 'src', 'main', 'AndroidManifest.xml');
- var manifestData = fs.readFileSync(manifestPath, 'utf8');
- var m = /<manifest[\s\S]*?package\s*=\s*"(.*?)"/i.exec(manifestData);
- if (!m) {
- throw new CordovaError('Could not find package name in ' + manifestPath);
- }
-
- var packageName = m[1];
- var lastDotIndex = packageName.lastIndexOf('.');
- return packageName.substring(lastDotIndex + 1);
- }
-
- // Makes the project buildable, minus the gradle wrapper.
- prepBuildFiles () {
- // Update the version of build.gradle in each dependent library.
- var pluginBuildGradle = path.join(this.root, 'cordova', 'lib', 'plugin-build.gradle');
- var propertiesObj = this.readProjectProperties();
- var subProjects = propertiesObj.libs;
-
- // Check and copy the gradle file into the subproject
- // Called by the loop before this function def
-
- var checkAndCopy = function (subProject, root) {
- var subProjectGradle = path.join(root, subProject, 'build.gradle');
- // This is the future-proof way of checking if a file exists
- // This must be synchronous to satisfy a Travis test
- try {
- fs.accessSync(subProjectGradle, fs.F_OK);
- } catch (e) {
- fs.copySync(pluginBuildGradle, subProjectGradle);
- }
- };
-
- for (var i = 0; i < subProjects.length; ++i) {
- if (subProjects[i] !== 'CordovaLib') {
- checkAndCopy(subProjects[i], this.root);
- }
- }
- var name = this.extractRealProjectNameFromManifest();
- // Remove the proj.id/name- prefix from projects: https://issues.apache.org/jira/browse/CB-9149
- var settingsGradlePaths = subProjects.map(function (p) {
- var realDir = p.replace(/[/\\]/g, ':');
- var libName = realDir.replace(name + '-', '');
- var str = 'include ":' + libName + '"\n';
- if (realDir.indexOf(name + '-') !== -1) {
- str += 'project(":' + libName + '").projectDir = new File("' + p + '")\n';
- }
- return str;
- });
-
- fs.writeFileSync(path.join(this.root, 'settings.gradle'),
- '// GENERATED FILE - DO NOT EDIT\n' +
- 'include ":"\n' + settingsGradlePaths.join(''));
-
- // Update dependencies within build.gradle.
- var buildGradle = fs.readFileSync(path.join(this.root, 'app', 'build.gradle'), 'utf8');
- var depsList = '';
- var root = this.root;
- var insertExclude = function (p) {
- var gradlePath = path.join(root, p, 'build.gradle');
- var projectGradleFile = fs.readFileSync(gradlePath, 'utf-8');
- if (projectGradleFile.indexOf('CordovaLib') !== -1) {
- depsList += '{\n exclude module:("CordovaLib")\n }\n';
- } else {
- depsList += '\n';
- }
- };
- subProjects.forEach(function (p) {
- events.emit('log', 'Subproject Path: ' + p);
- var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
- if (libName !== 'app') {
- depsList += ' implementation(project(path: ":' + libName + '"))';
- insertExclude(p);
- }
- });
- // For why we do this mapping: https://issues.apache.org/jira/browse/CB-8390
- var SYSTEM_LIBRARY_MAPPINGS = [
- [/^\/?extras\/android\/support\/(.*)$/, 'com.android.support:support-$1:+'],
- [/^\/?google\/google_play_services\/libproject\/google-play-services_lib\/?$/, 'com.google.android.gms:play-services:+']
- ];
-
- propertiesObj.systemLibs.forEach(function (p) {
- var mavenRef;
- // It's already in gradle form if it has two ':'s
- if (/:.*:/.exec(p)) {
- mavenRef = p;
- } else {
- for (var i = 0; i < SYSTEM_LIBRARY_MAPPINGS.length; ++i) {
- var pair = SYSTEM_LIBRARY_MAPPINGS[i];
- if (pair[0].exec(p)) {
- mavenRef = p.replace(pair[0], pair[1]);
- break;
- }
- }
- if (!mavenRef) {
- throw new CordovaError('Unsupported system library (does not work with gradle): ' + p);
- }
- }
- depsList += ' implementation "' + mavenRef + '"\n';
- });
-
- buildGradle = buildGradle.replace(/(SUB-PROJECT DEPENDENCIES START)[\s\S]*(\/\/ SUB-PROJECT DEPENDENCIES END)/, '$1\n' + depsList + ' $2');
- var includeList = '';
-
- propertiesObj.gradleIncludes.forEach(function (includePath) {
- includeList += 'apply from: "../' + includePath + '"\n';
- });
- buildGradle = buildGradle.replace(/(PLUGIN GRADLE EXTENSIONS START)[\s\S]*(\/\/ PLUGIN GRADLE EXTENSIONS END)/, '$1\n' + includeList + '$2');
- // This needs to be stored in the app gradle, not the root grade
- fs.writeFileSync(path.join(this.root, 'app', 'build.gradle'), buildGradle);
- }
-
- prepEnv (opts) {
- var self = this;
- return check_reqs.check_gradle()
- .then(function (gradlePath) {
- return self.runGradleWrapper(gradlePath);
- }).then(function () {
- return self.prepBuildFiles();
- }).then(() => {
- // update/set the distributionUrl in the gradle-wrapper.properties
- const gradleWrapperPropertiesPath = path.join(self.root, 'gradle/wrapper/gradle-wrapper.properties');
- const gradleWrapperProperties = createEditor(gradleWrapperPropertiesPath);
- const distributionUrl = process.env.CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL || 'https://services.gradle.org/distributions/gradle-6.5-all.zip';
- gradleWrapperProperties.set('distributionUrl', distributionUrl);
- gradleWrapperProperties.save();
-
- events.emit('verbose', `Gradle Distribution URL: ${distributionUrl}`);
- })
- .then(() => {
- const signingPropertiesPath = path.join(self.root, `${opts.buildType}${SIGNING_PROPERTIES}`);
-
- if (fs.existsSync(signingPropertiesPath)) fs.removeSync(signingPropertiesPath);
- if (opts.packageInfo) {
- fs.ensureFileSync(signingPropertiesPath);
- const signingProperties = createEditor(signingPropertiesPath);
- signingProperties.addHeadComment(TEMPLATE);
- opts.packageInfo.appendToProperties(signingProperties);
- }
- });
- }
-
- /*
- * Builds the project with gradle.
- * Returns a promise.
- */
- build (opts) {
- var wrapper = path.join(this.root, 'gradlew');
- var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts);
-
- return execa(wrapper, args, { stdio: 'inherit', cwd: path.resolve(this.root) })
- .catch(function (error) {
- if (error.toString().indexOf('failed to find target with hash string') >= 0) {
- return check_reqs.check_android_target(error).then(function () {
- // If due to some odd reason - check_android_target succeeds
- // we should still fail here.
- throw error;
- });
- }
- throw error;
- });
- }
-
- clean (opts) {
- const wrapper = path.join(this.root, 'gradlew');
- const args = this.getArgs('clean', opts);
- return execa(wrapper, args, { stdio: 'inherit', cwd: path.resolve(this.root) })
- .then(() => {
- fs.removeSync(path.join(this.root, 'out'));
-
- ['debug', 'release'].map(config => path.join(this.root, `${config}${SIGNING_PROPERTIES}`))
- .forEach(file => {
- const hasFile = fs.existsSync(file);
- const hasMarker = hasFile && fs.readFileSync(file, 'utf8')
- .includes(MARKER);
-
- if (hasFile && hasMarker) fs.removeSync(file);
- });
- });
- }
-
- findOutputApks (build_type, arch) {
- return findOutputFiles.call(this, 'apk', build_type, { arch });
- }
-
- findOutputBundles (build_type) {
- return findOutputFiles.call(this, 'aab', build_type);
- }
-
- fetchBuildResults (build_type, arch) {
- return {
- apkPaths: this.findOutputApks(build_type, arch),
- buildType: build_type
- };
- }
-}
-
-module.exports = ProjectBuilder;
diff --git a/cordova/platforms/android/cordova/lib/builders/builders.js b/cordova/platforms/android/cordova/lib/builders/builders.js
deleted file mode 100644
index edc1a5255..000000000
--- a/cordova/platforms/android/cordova/lib/builders/builders.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const CordovaError = require('cordova-common').CordovaError;
-
-/**
- * Helper method that instantiates and returns a builder for specified build type.
- *
- * @return {Builder} A builder instance for specified build type.
- */
-module.exports.getBuilder = function (projectPath) {
- try {
- const Builder = require('./ProjectBuilder');
- return new Builder(projectPath);
- } catch (err) {
- throw new CordovaError('Failed to instantiate ProjectBuilder builder: ' + err);
- }
-};
diff --git a/cordova/platforms/android/cordova/lib/check_reqs.js b/cordova/platforms/android/cordova/lib/check_reqs.js
deleted file mode 100644
index 82827ac05..000000000
--- a/cordova/platforms/android/cordova/lib/check_reqs.js
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const execa = require('execa');
-var path = require('path');
-var fs = require('fs-extra');
-const { forgivingWhichSync, isWindows, isDarwin } = require('./utils');
-const java = require('./env/java');
-var REPO_ROOT = path.join(__dirname, '..', '..', '..', '..');
-var PROJECT_ROOT = path.join(__dirname, '..', '..');
-const { CordovaError, ConfigParser, events } = require('cordova-common');
-var android_sdk = require('./android_sdk');
-const { createEditor } = require('properties-parser');
-const semver = require('semver');
-
-const EXPECTED_JAVA_VERSION = '1.8.x';
-
-// Re-exporting these for backwards compatibility and for unit testing.
-// TODO: Remove uses and use the ./utils module directly.
-Object.assign(module.exports, { isWindows, isDarwin });
-
-/**
- * @description Get valid target from framework/project.properties if run from this repo
- * Otherwise get target from project.properties file within a generated cordova-android project
- * @returns {string} The android target in format "android-${target}"
- */
-module.exports.get_target = function () {
- const projectPropertiesPaths = [
- path.join(REPO_ROOT, 'framework', 'project.properties'),
- path.join(PROJECT_ROOT, 'project.properties')
- ];
-
- // Get the minimum required target API from the framework.
- let target = projectPropertiesPaths.filter(filePath => fs.existsSync(filePath))
- .map(filePath => createEditor(filePath).get('target'))
- .pop();
-
- if (!target) {
- throw new Error(`We could not locate the target from the "project.properties" at either "${projectPropertiesPaths.join('", "')}".`);
- }
-
- // If the repo config.xml file exists, find the desired targetSdkVersion.
- const configFile = path.join(REPO_ROOT, 'config.xml');
- if (!fs.existsSync(configFile)) return target;
-
- const configParser = new ConfigParser(configFile);
- const desiredAPI = parseInt(configParser.getPreference('android-targetSdkVersion', 'android'), 10);
-
- if (!isNaN(desiredAPI)) {
- const minimumAPI = parseInt(target.split('-').pop(), 10);
-
- if (desiredAPI >= minimumAPI) {
- target = `android-${desiredAPI}`;
- } else {
- events.emit('warn', `android-targetSdkVersion should be greater than or equal to ${minimumAPI}.`);
- }
- }
-
- return target;
-};
-
-module.exports.get_gradle_wrapper = function () {
- var androidStudioPath;
- var i = 0;
- var foundStudio = false;
- var program_dir;
- // OK, This hack only works on Windows, not on Mac OS or Linux. We will be deleting this eventually!
- if (module.exports.isWindows()) {
- var result = execa.sync(path.join(__dirname, 'getASPath.bat'));
- // console.log('result.stdout =' + result.stdout.toString());
- // console.log('result.stderr =' + result.stderr.toString());
-
- if (result.stderr.toString().length > 0) {
- var androidPath = path.join(process.env.ProgramFiles, 'Android') + '/';
- if (fs.existsSync(androidPath)) {
- program_dir = fs.readdirSync(androidPath);
- while (i < program_dir.length && !foundStudio) {
- if (program_dir[i].startsWith('Android Studio')) {
- foundStudio = true;
- androidStudioPath = path.join(process.env.ProgramFiles, 'Android', program_dir[i], 'gradle');
- } else { ++i; }
- }
- }
- } else {
- // console.log('got android studio path from registry');
- // remove the (os independent) new line char at the end of stdout
- // add gradle to match the above.
- androidStudioPath = path.join(result.stdout.toString().split('\r\n')[0], 'gradle');
- }
- }
-
- if (androidStudioPath !== null && fs.existsSync(androidStudioPath)) {
- var dirs = fs.readdirSync(androidStudioPath);
- if (dirs[0].split('-')[0] === 'gradle') {
- return path.join(androidStudioPath, dirs[0], 'bin', 'gradle');
- }
- } else {
- // OK, let's try to check for Gradle!
- return forgivingWhichSync('gradle');
- }
-};
-
-// Returns a promise. Called only by build and clean commands.
-module.exports.check_gradle = function () {
- var sdkDir = process.env.ANDROID_SDK_ROOT || process.env.ANDROID_HOME;
- if (!sdkDir) {
- return Promise.reject(new CordovaError('Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.\n' +
- 'Might need to install Android SDK or set up \'ANDROID_SDK_ROOT\' env variable.'));
- }
-
- var gradlePath = module.exports.get_gradle_wrapper();
-
- if (gradlePath.length !== 0) return Promise.resolve(gradlePath);
-
- return Promise.reject(new CordovaError('Could not find an installed version of Gradle either in Android Studio,\n' +
- 'or on your system to install the gradle wrapper. Please include gradle \n' +
- 'in your path, or install Android Studio'));
-};
-
-/**
- * Checks for the java installation and correct version
- *
- * Despite the name, it should return the Java version value, it's used by the Cordova CLI.
- */
-module.exports.check_java = async function () {
- const javaVersion = await java.getVersion();
-
- if (!semver.satisfies(javaVersion.version, EXPECTED_JAVA_VERSION)) {
- throw new CordovaError(
- `Requirements check failed for JDK ${EXPECTED_JAVA_VERSION}! Detected version: ${javaVersion.version}\n` +
- 'Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.'
- );
- }
-
- return javaVersion;
-};
-
-// Returns a promise.
-module.exports.check_android = function () {
- return Promise.resolve().then(function () {
- function maybeSetAndroidHome (value) {
- if (!hasAndroidHome && fs.existsSync(value)) {
- hasAndroidHome = true;
- process.env.ANDROID_SDK_ROOT = value;
- }
- }
-
- var androidCmdPath = forgivingWhichSync('android');
- var adbInPath = forgivingWhichSync('adb');
- var avdmanagerInPath = forgivingWhichSync('avdmanager');
- var hasAndroidHome = false;
-
- if (process.env.ANDROID_SDK_ROOT) {
- maybeSetAndroidHome(path.resolve(process.env.ANDROID_SDK_ROOT));
- }
-
- // First ensure ANDROID_HOME is set
- // If we have no hints (nothing in PATH), try a few default locations
- if (!hasAndroidHome && !androidCmdPath && !adbInPath && !avdmanagerInPath) {
- if (process.env.ANDROID_HOME) {
- // Fallback to deprecated `ANDROID_HOME` variable
- maybeSetAndroidHome(path.join(process.env.ANDROID_HOME));
- }
- if (module.exports.isWindows()) {
- // Android Studio 1.0 installer
- if (process.env.LOCALAPPDATA) {
- maybeSetAndroidHome(path.join(process.env.LOCALAPPDATA, 'Android', 'sdk'));
- }
- if (process.env.ProgramFiles) {
- maybeSetAndroidHome(path.join(process.env.ProgramFiles, 'Android', 'sdk'));
- }
-
- // Android Studio pre-1.0 installer
- if (process.env.LOCALAPPDATA) {
- maybeSetAndroidHome(path.join(process.env.LOCALAPPDATA, 'Android', 'android-studio', 'sdk'));
- }
- if (process.env.ProgramFiles) {
- maybeSetAndroidHome(path.join(process.env.ProgramFiles, 'Android', 'android-studio', 'sdk'));
- }
-
- // Stand-alone installer
- if (process.env.LOCALAPPDATA) {
- maybeSetAndroidHome(path.join(process.env.LOCALAPPDATA, 'Android', 'android-sdk'));
- }
- if (process.env.ProgramFiles) {
- maybeSetAndroidHome(path.join(process.env.ProgramFiles, 'Android', 'android-sdk'));
- }
- } else if (module.exports.isDarwin()) {
- // Android Studio 1.0 installer
- if (process.env.HOME) {
- maybeSetAndroidHome(path.join(process.env.HOME, 'Library', 'Android', 'sdk'));
- }
- // Android Studio pre-1.0 installer
- maybeSetAndroidHome('/Applications/Android Studio.app/sdk');
- // Stand-alone zip file that user might think to put under /Applications
- maybeSetAndroidHome('/Applications/android-sdk-macosx');
- maybeSetAndroidHome('/Applications/android-sdk');
- }
- if (process.env.HOME) {
- // Stand-alone zip file that user might think to put under their home directory
- maybeSetAndroidHome(path.join(process.env.HOME, 'android-sdk-macosx'));
- maybeSetAndroidHome(path.join(process.env.HOME, 'android-sdk'));
- }
- }
-
- if (!hasAndroidHome) {
- // If we dont have ANDROID_SDK_ROOT, but we do have some tools on the PATH, try to infer from the tooling PATH.
- var parentDir, grandParentDir;
- if (androidCmdPath) {
- parentDir = path.dirname(androidCmdPath);
- grandParentDir = path.dirname(parentDir);
- if (path.basename(parentDir) === 'tools' || fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) {
- maybeSetAndroidHome(grandParentDir);
- } else {
- throw new CordovaError('Failed to find \'ANDROID_SDK_ROOT\' environment variable. Try setting it manually.\n' +
- 'Detected \'android\' command at ' + parentDir + ' but no \'tools\' directory found near.\n' +
- 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools directory.');
- }
- }
- if (adbInPath) {
- parentDir = path.dirname(adbInPath);
- grandParentDir = path.dirname(parentDir);
- if (path.basename(parentDir) === 'platform-tools') {
- maybeSetAndroidHome(grandParentDir);
- } else {
- throw new CordovaError('Failed to find \'ANDROID_SDK_ROOT\' environment variable. Try setting it manually.\n' +
- 'Detected \'adb\' command at ' + parentDir + ' but no \'platform-tools\' directory found near.\n' +
- 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'platform-tools directory.');
- }
- }
- if (avdmanagerInPath) {
- parentDir = path.dirname(avdmanagerInPath);
- grandParentDir = path.dirname(parentDir);
- if (path.basename(parentDir) === 'bin' && path.basename(grandParentDir) === 'tools') {
- maybeSetAndroidHome(path.dirname(grandParentDir));
- } else {
- throw new CordovaError('Failed to find \'ANDROID_SDK_ROOT\' environment variable. Try setting it manually.\n' +
- 'Detected \'avdmanager\' command at ' + parentDir + ' but no \'tools' + path.sep + 'bin\' directory found near.\n' +
- 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools' + path.sep + 'bin directory.');
- }
- }
- }
- if (!process.env.ANDROID_SDK_ROOT) {
- throw new CordovaError('Failed to find \'ANDROID_SDK_ROOT\' environment variable. Try setting it manually.\n' +
- 'Failed to find \'android\' command in your \'PATH\'. Try update your \'PATH\' to include path to valid SDK directory.');
- }
- if (!fs.existsSync(process.env.ANDROID_SDK_ROOT)) {
- throw new CordovaError('\'ANDROID_SDK_ROOT\' environment variable is set to non-existent path: ' + process.env.ANDROID_SDK_ROOT +
- '\nTry update it manually to point to valid SDK directory.');
- }
- // Next let's make sure relevant parts of the SDK tooling is in our PATH
- if (hasAndroidHome && !androidCmdPath) {
- process.env.PATH += path.delimiter + path.join(process.env.ANDROID_SDK_ROOT, 'tools');
- }
- if (hasAndroidHome && !adbInPath) {
- process.env.PATH += path.delimiter + path.join(process.env.ANDROID_SDK_ROOT, 'platform-tools');
- }
- if (hasAndroidHome && !avdmanagerInPath) {
- process.env.PATH += path.delimiter + path.join(process.env.ANDROID_SDK_ROOT, 'tools', 'bin');
- }
- return hasAndroidHome;
- });
-};
-
-// TODO: is this actually needed?
-module.exports.getAbsoluteAndroidCmd = function () {
- var cmd = forgivingWhichSync('android');
- if (cmd.length === 0) {
- cmd = forgivingWhichSync('sdkmanager');
- }
- if (module.exports.isWindows()) {
- return '"' + cmd + '"';
- }
- return cmd.replace(/(\s)/g, '\\$1');
-};
-
-module.exports.check_android_target = function (originalError) {
- // valid_target can look like:
- // android-19
- // android-L
- // Google Inc.:Google APIs:20
- // Google Inc.:Glass Development Kit Preview:20
- var desired_api_level = module.exports.get_target();
- return android_sdk.list_targets().then(function (targets) {
- if (targets.indexOf(desired_api_level) >= 0) {
- return targets;
- }
- var androidCmd = module.exports.getAbsoluteAndroidCmd();
- var msg = 'Please install Android target / API level: "' + desired_api_level + '".\n\n' +
- 'Hint: Open the SDK manager by running: ' + androidCmd + '\n' +
- 'You will require:\n' +
- '1. "SDK Platform" for API level ' + desired_api_level + '\n' +
- '2. "Android SDK Platform-tools (latest)\n' +
- '3. "Android SDK Build-tools" (latest)';
- if (originalError) {
- msg = originalError + '\n' + msg;
- }
- throw new CordovaError(msg);
- });
-};
-
-// Returns a promise.
-module.exports.run = function () {
- console.log('Checking Java JDK and Android SDK versions');
- console.log('ANDROID_SDK_ROOT=' + process.env.ANDROID_SDK_ROOT + ' (recommended setting)');
- console.log('ANDROID_HOME=' + process.env.ANDROID_HOME + ' (DEPRECATED)');
-
- return Promise.all([this.check_java(), this.check_android()]).then(function (values) {
- console.log('Using Android SDK: ' + process.env.ANDROID_SDK_ROOT);
-
- if (!values[1]) {
- throw new CordovaError('Requirements check failed for Android SDK! Android SDK was not detected.');
- }
- });
-};
-
-/**
- * Object thar represents one of requirements for current platform.
- * @param {String} id The unique identifier for this requirements.
- * @param {String} name The name of requirements. Human-readable field.
- * @param {String} version The version of requirement installed. In some cases could be an array of strings
- * (for example, check_android_target returns an array of android targets installed)
- * @param {Boolean} installed Indicates whether the requirement is installed or not
- */
-var Requirement = function (id, name, version, installed) {
- this.id = id;
- this.name = name;
- this.installed = installed || false;
- this.metadata = {
- version: version
- };
-};
-
-/**
- * Methods that runs all checks one by one and returns a result of checks
- * as an array of Requirement objects. This method intended to be used by cordova-lib check_reqs method
- *
- * @return Promise<Requirement[]> Array of requirements. Due to implementation, promise is always fulfilled.
- */
-module.exports.check_all = function () {
- var requirements = [
- new Requirement('java', 'Java JDK'),
- new Requirement('androidSdk', 'Android SDK'),
- new Requirement('androidTarget', 'Android target'),
- new Requirement('gradle', 'Gradle')
- ];
-
- var checkFns = [
- this.check_java,
- this.check_android,
- this.check_android_target,
- this.check_gradle
- ];
-
- // Then execute requirement checks one-by-one
- return checkFns.reduce(function (promise, checkFn, idx) {
- // Update each requirement with results
- var requirement = requirements[idx];
- return promise.then(checkFn).then(function (version) {
- requirement.installed = true;
- requirement.metadata.version = version;
- }, function (err) {
- requirement.metadata.reason = err instanceof Error ? err.message : err;
- });
- }, Promise.resolve()).then(function () {
- // When chain is completed, return requirements array to upstream API
- return requirements;
- });
-};
diff --git a/cordova/platforms/android/cordova/lib/config/GradlePropertiesParser.js b/cordova/platforms/android/cordova/lib/config/GradlePropertiesParser.js
deleted file mode 100644
index 8955aa946..000000000
--- a/cordova/platforms/android/cordova/lib/config/GradlePropertiesParser.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const fs = require('fs');
-const path = require('path');
-const propertiesParser = require('properties-parser');
-const events = require('cordova-common').events;
-
-class GradlePropertiesParser {
- /**
- * Loads and Edits Gradle Properties File.
- *
- * @param {String} platformDir is the path of the Android platform directory
- */
- constructor (platformDir) {
- this._defaults = {
- // 10 seconds -> 6 seconds
- 'org.gradle.daemon': 'true',
-
- // to allow dex in process
- 'org.gradle.jvmargs': '-Xmx2048m',
-
- // Android X
- 'android.useAndroidX': 'false',
- 'android.enableJetifier': 'false'
-
- // Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
- // 'org.gradle.parallel': 'true'
- };
-
- this.gradleFilePath = path.join(platformDir, 'gradle.properties');
- }
-
- configure (userConfigs) {
- events.emit('verbose', '[Gradle Properties] Preparing Configuration');
-
- this._initializeEditor();
-
- events.emit('verbose', '[Gradle Properties] Appending default configuration properties');
- this._configureProperties(this._defaults);
-
- events.emit('verbose', '[Gradle Properties] Appending custom configuration properties');
- this._configureProperties(userConfigs);
-
- this._save();
- }
-
- /**
- * Initialize the properties editor for parsing, setting, etc.
- */
- _initializeEditor () {
- // Touch empty gradle.properties file if missing.
- if (!fs.existsSync(this.gradleFilePath)) {
- events.emit('verbose', '[Gradle Properties] File missing, creating file with Cordova defaults.');
- fs.writeFileSync(this.gradleFilePath, '', 'utf-8');
- }
-
- // Create an editor for parsing, getting, and setting configurations.
- this.gradleFile = propertiesParser.createEditor(this.gradleFilePath);
- }
-
- /**
- * Validate that defaults or user configuration properties are set and
- * set the missing items.
- */
- _configureProperties (properties) {
- // Iterate though the properties and set only if missing.
- Object.keys(properties).forEach(key => {
- const value = this.gradleFile.get(key);
-
- if (!value) {
- // Handles the case of adding missing defaults or new properties that are missing.
- events.emit('verbose', `[Gradle Properties] Appending configuration item: ${key}=${properties[key]}`);
- this.gradleFile.set(key, properties[key]);
- } else if (value !== properties[key]) {
- if (this._defaults[key] && this._defaults[key] !== properties[key]) {
- let shouldEmit = true;
- if (key === 'org.gradle.jvmargs') {
- shouldEmit = this._isJVMMemoryLessThanRecommended(properties[key], this._defaults[key]);
- }
-
- if (shouldEmit) {
- // Since the value does not match default, we will notify the discrepancy with Cordova's recommended value.
- events.emit('info', `[Gradle Properties] Detected Gradle property "${key}" with the value of "${properties[key]}", Cordova's recommended value is "${this._defaults[key]}"`);
- }
- } else {
- // When the current value exists but does not match the new value or does matches the default key value, the new value it set.
- events.emit('verbose', `[Gradle Properties] Updating Gradle property "${key}" with the value of "${properties[key]}"`);
- }
-
- // We will set the new value in either case.
- this.gradleFile.set(key, properties[key]);
- }
- });
- }
-
- _isJVMMemoryLessThanRecommended (memoryValue, recommendedMemoryValue) {
- const UNIT = 2;
- const SIZE = 1;
- const regex = /-Xmx+([0-9]+)+([mMgGkK])/;
-
- const recommendedCapture = regex.exec(recommendedMemoryValue);
- const recommendedBase = this._getBaseJVMSize(recommendedCapture[SIZE], recommendedCapture[UNIT]);
- const memoryCapture = regex.exec(memoryValue);
- const memoryBase = this._getBaseJVMSize(memoryCapture[SIZE], memoryCapture[UNIT]);
-
- return memoryBase < recommendedBase;
- }
-
- _getBaseJVMSize (size, unit) {
- const KILOBYTE = 1024;
- const MEGABYTE = 1048576;
- const GIGABYTE = 1073741824;
-
- switch (unit.toLowerCase()) {
- case 'k': return size * KILOBYTE;
- case 'm': return size * MEGABYTE;
- case 'g': return size * GIGABYTE;
- }
-
- events.emit('warn', `[Gradle Properties] Unknown memory size unit (${unit})`);
- return null;
- }
-
- /**
- * Saves any changes that has been made to the properties file.
- */
- _save () {
- events.emit('verbose', '[Gradle Properties] Updating and Saving File');
- this.gradleFile.save();
- }
-}
-
-module.exports = GradlePropertiesParser;
diff --git a/cordova/platforms/android/cordova/lib/emulator.js b/cordova/platforms/android/cordova/lib/emulator.js
deleted file mode 100644
index 7a5fbd170..000000000
--- a/cordova/platforms/android/cordova/lib/emulator.js
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const execa = require('execa');
-const fs = require('fs-extra');
-var android_versions = require('android-versions');
-var path = require('path');
-var Adb = require('./Adb');
-var events = require('cordova-common').events;
-var CordovaError = require('cordova-common').CordovaError;
-var android_sdk = require('./android_sdk');
-var check_reqs = require('./check_reqs');
-var which = require('which');
-
-// constants
-const ONE_SECOND = 1000; // in milliseconds
-const CHECK_BOOTED_INTERVAL = 3 * ONE_SECOND; // in milliseconds
-
-function forgivingWhichSync (cmd) {
- const whichResult = which.sync(cmd, { nothrow: true });
-
- // On null, returns empty string to maintain backwards compatibility
- // realpathSync follows symlinks
- return whichResult === null ? '' : fs.realpathSync(whichResult);
-}
-
-module.exports.list_images_using_avdmanager = function () {
- return execa('avdmanager', ['list', 'avd']).then(({ stdout: output }) => {
- var response = output.split('\n');
- var emulator_list = [];
- for (var i = 1; i < response.length; i++) {
- // To return more detailed information use img_obj
- var img_obj = {};
- if (response[i].match(/Name:\s/)) {
- img_obj.name = response[i].split('Name: ')[1].replace('\r', '');
- if (response[i + 1].match(/Device:\s/)) {
- i++;
- img_obj.device = response[i].split('Device: ')[1].replace('\r', '');
- }
- if (response[i + 1].match(/Path:\s/)) {
- i++;
- img_obj.path = response[i].split('Path: ')[1].replace('\r', '');
- }
- if (response[i + 1].match(/Target:\s/)) {
- i++;
- if (response[i + 1].match(/ABI:\s/)) {
- img_obj.abi = response[i + 1].split('ABI: ')[1].replace('\r', '');
- }
- // This next conditional just aims to match the old output of `android list avd`
- // We do so so that we don't have to change the logic when parsing for the
- // best emulator target to spawn (see below in `best_image`)
- // This allows us to transitionally support both `android` and `avdmanager` binaries,
- // depending on what SDK version the user has
- if (response[i + 1].match(/Based\son:\s/)) {
- img_obj.target = response[i + 1].split('Based on:')[1];
- if (img_obj.target.match(/Tag\/ABI:\s/)) {
- img_obj.target = img_obj.target.split('Tag/ABI:')[0].replace('\r', '').trim();
- if (img_obj.target.indexOf('(') > -1) {
- img_obj.target = img_obj.target.substr(0, img_obj.target.indexOf('(') - 1).trim();
- }
- }
- var version_string = img_obj.target.replace(/Android\s+/, '');
-
- var api_level = android_sdk.version_string_to_api_level[version_string];
- if (api_level) {
- img_obj.target += ' (API level ' + api_level + ')';
- }
- }
- }
- if (response[i + 1].match(/Skin:\s/)) {
- i++;
- img_obj.skin = response[i].split('Skin: ')[1].replace('\r', '');
- }
-
- emulator_list.push(img_obj);
- }
- /* To just return a list of names use this
- if (response[i].match(/Name:\s/)) {
- emulator_list.push(response[i].split('Name: ')[1].replace('\r', '');
- } */
- }
- return emulator_list;
- });
-};
-
-module.exports.list_images_using_android = function () {
- return execa('android', ['list', 'avd']).then(({ stdout: output }) => {
- var response = output.split('\n');
- var emulator_list = [];
- for (var i = 1; i < response.length; i++) {
- // To return more detailed information use img_obj
- var img_obj = {};
- if (response[i].match(/Name:\s/)) {
- img_obj.name = response[i].split('Name: ')[1].replace('\r', '');
- if (response[i + 1].match(/Device:\s/)) {
- i++;
- img_obj.device = response[i].split('Device: ')[1].replace('\r', '');
- }
- if (response[i + 1].match(/Path:\s/)) {
- i++;
- img_obj.path = response[i].split('Path: ')[1].replace('\r', '');
- }
- if (response[i + 1].match(/\(API\slevel\s/) || (response[i + 2] && response[i + 2].match(/\(API\slevel\s/))) {
- i++;
- var secondLine = response[i + 1].match(/\(API\slevel\s/) ? response[i + 1] : '';
- img_obj.target = (response[i] + secondLine).split('Target: ')[1].replace('\r', '');
- }
- if (response[i + 1].match(/ABI:\s/)) {
- i++;
- img_obj.abi = response[i].split('ABI: ')[1].replace('\r', '');
- }
- if (response[i + 1].match(/Skin:\s/)) {
- i++;
- img_obj.skin = response[i].split('Skin: ')[1].replace('\r', '');
- }
-
- emulator_list.push(img_obj);
- }
- /* To just return a list of names use this
- if (response[i].match(/Name:\s/)) {
- emulator_list.push(response[i].split('Name: ')[1].replace('\r', '');
- } */
- }
- return emulator_list;
- });
-};
-
-/**
- * Returns a Promise for a list of emulator images in the form of objects
- * {
- name : <emulator_name>,
- device : <device>,
- path : <path_to_emulator_image>,
- target : <api_target>,
- abi : <cpu>,
- skin : <skin>
- }
- */
-module.exports.list_images = function () {
- return Promise.resolve().then(function () {
- if (forgivingWhichSync('avdmanager')) {
- return module.exports.list_images_using_avdmanager();
- } else if (forgivingWhichSync('android')) {
- return module.exports.list_images_using_android();
- } else {
- return Promise.reject(new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?'));
- }
- }).then(function (avds) {
- // In case we're missing the Android OS version string from the target description, add it.
- return avds.map(function (avd) {
- if (avd.target && avd.target.indexOf('Android API') > -1 && avd.target.indexOf('API level') < 0) {
- var api_level = avd.target.match(/\d+/);
- if (api_level) {
- var level = android_versions.get(api_level);
- if (level) {
- avd.target = 'Android ' + level.semver + ' (API level ' + api_level + ')';
- }
- }
- }
- return avd;
- });
- });
-};
-
-/**
- * Will return the closest avd to the projects target
- * or undefined if no avds exist.
- * Returns a promise.
- */
-module.exports.best_image = function () {
- return this.list_images().then(function (images) {
- // Just return undefined if there is no images
- if (images.length === 0) return;
-
- var closest = 9999;
- var best = images[0];
- var project_target = parseInt(check_reqs.get_target().replace('android-', ''));
- for (var i in images) {
- var target = images[i].target;
- if (target && target.indexOf('API level') > -1) {
- var num = parseInt(target.split('(API level ')[1].replace(')', ''));
- if (num === project_target) {
- return images[i];
- } else if (project_target - num < closest && project_target > num) {
- closest = project_target - num;
- best = images[i];
- }
- }
- }
- return best;
- });
-};
-
-exports.list_started = async () => {
- return (await Adb.devices())
- .filter(id => id.startsWith('emulator-'));
-};
-
-/*
- * Gets unused port for android emulator, between 5554 and 5584
- * Returns a promise.
- */
-module.exports.get_available_port = function () {
- var self = this;
-
- return self.list_started().then(function (emulators) {
- for (var p = 5584; p >= 5554; p -= 2) {
- if (emulators.indexOf('emulator-' + p) === -1) {
- events.emit('verbose', 'Found available port: ' + p);
- return p;
- }
- }
- throw new CordovaError('Could not find an available avd port');
- });
-};
-
-/*
- * Starts an emulator with the given ID,
- * and returns the started ID of that emulator.
- * If no ID is given it will use the first image available,
- * if no image is available it will error out (maybe create one?).
- * If no boot timeout is given or the value is negative it will wait forever for
- * the emulator to boot
- *
- * Returns a promise.
- */
-module.exports.start = function (emulator_ID, boot_timeout) {
- var self = this;
-
- return Promise.resolve().then(function () {
- if (emulator_ID) return Promise.resolve(emulator_ID);
-
- return self.best_image().then(function (best) {
- if (best && best.name) {
- events.emit('warn', 'No emulator specified, defaulting to ' + best.name);
- return best.name;
- }
-
- var androidCmd = check_reqs.getAbsoluteAndroidCmd();
- return Promise.reject(new CordovaError('No emulator images (avds) found.\n' +
- '1. Download desired System Image by running: ' + androidCmd + ' sdk\n' +
- '2. Create an AVD by running: ' + androidCmd + ' avd\n' +
- 'HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver\n'));
- });
- }).then(function (emulatorId) {
- return self.get_available_port().then(function (port) {
- // Figure out the directory the emulator binary runs in, and set the cwd to that directory.
- // Workaround for https://code.google.com/p/android/issues/detail?id=235461
- var emulator_dir = path.dirname(which.sync('emulator'));
- var args = ['-avd', emulatorId, '-port', port];
- // Don't wait for it to finish, since the emulator will probably keep running for a long time.
- execa('emulator', args, { stdio: 'inherit', detached: true, cwd: emulator_dir })
- .unref();
-
- // wait for emulator to start
- events.emit('log', 'Waiting for emulator to start...');
- return self.wait_for_emulator(port);
- });
- }).then(function (emulatorId) {
- if (!emulatorId) { return Promise.reject(new CordovaError('Failed to start emulator')); }
-
- // wait for emulator to boot up
- process.stdout.write('Waiting for emulator to boot (this may take a while)...');
- return self.wait_for_boot(emulatorId, boot_timeout).then(function (success) {
- if (success) {
- events.emit('log', 'BOOT COMPLETE');
- // unlock screen
- return Adb.shell(emulatorId, 'input keyevent 82').then(function () {
- // return the new emulator id for the started emulators
- return emulatorId;
- });
- } else {
- // We timed out waiting for the boot to happen
- return null;
- }
- });
- });
-};
-
-/*
- * Waits for an emulator to boot on a given port.
- * Returns this emulator's ID in a promise.
- */
-module.exports.wait_for_emulator = function (port) {
- var self = this;
- return Promise.resolve().then(function () {
- var emulator_id = 'emulator-' + port;
- return Adb.shell(emulator_id, 'getprop dev.bootcomplete').then(function (output) {
- if (output.indexOf('1') >= 0) {
- return emulator_id;
- }
- return self.wait_for_emulator(port);
- }, function (error) {
- if ((error && error.message &&
- (error.message.indexOf('not found') > -1)) ||
- (error.message.indexOf('device offline') > -1) ||
- (error.message.indexOf('device still connecting') > -1) ||
- (error.message.indexOf('device still authorizing') > -1)) {
- // emulator not yet started, continue waiting
- return self.wait_for_emulator(port);
- } else {
- // something unexpected has happened
- throw error;
- }
- });
- });
-};
-
-/*
- * Waits for the core android process of the emulator to start. Returns a
- * promise that resolves to a boolean indicating success. Not specifying a
- * time_remaining or passing a negative value will cause it to wait forever
- */
-module.exports.wait_for_boot = function (emulator_id, time_remaining) {
- var self = this;
- return Adb.shell(emulator_id, 'getprop sys.boot_completed').then(function (output) {
- if (output.match(/1/)) {
- return true;
- } else if (time_remaining === 0) {
- return false;
- } else {
- process.stdout.write('.');
-
- return new Promise(resolve => {
- const delay = time_remaining < CHECK_BOOTED_INTERVAL ? time_remaining : CHECK_BOOTED_INTERVAL;
-
- setTimeout(() => {
- const updated_time = time_remaining >= 0 ? Math.max(time_remaining - CHECK_BOOTED_INTERVAL, 0) : time_remaining;
- resolve(self.wait_for_boot(emulator_id, updated_time));
- }, delay);
- });
- }
- });
-};
diff --git a/cordova/platforms/android/cordova/lib/env/java.js b/cordova/platforms/android/cordova/lib/env/java.js
deleted file mode 100644
index 6eed6f600..000000000
--- a/cordova/platforms/android/cordova/lib/env/java.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const execa = require('execa');
-const fs = require('fs-extra');
-const path = require('path');
-const glob = require('fast-glob');
-const { CordovaError, events } = require('cordova-common');
-const utils = require('../utils');
-const semver = require('semver');
-
-/**
- * Will be set to true on successful ensureness.
- * If true, skips the expensive java checks.
- */
-let javaIsEnsured = false;
-
-const java = {
- /**
- * Gets the version from the javac executable.
- *
- * @returns {semver.SemVer}
- */
- getVersion: async () => {
- await java._ensure(process.env);
-
- // Java <= 8 writes version info to stderr, Java >= 9 to stdout
- let version = null;
- try {
- version = (await execa('javac', ['-version'], { all: true })).all;
- } catch (ex) {
- events.emit('verbose', ex.shortMessage);
-
- let msg =
- 'Failed to run "javac -version", make sure that you have a JDK version 8 installed.\n' +
- 'You can get it from the following location:\n' +
- 'https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html';
- if (process.env.JAVA_HOME) {
- msg += '\n\n';
- msg += 'Your JAVA_HOME is invalid: ' + process.env.JAVA_HOME;
- }
- throw new CordovaError(msg);
- }
-
- return semver.coerce(version);
- },
-
- /**
- * Ensures that Java is installed. Will throw exception if not.
- * Will set JAVA_HOME and PATH environment variables.
- *
- * This function becomes a no-op if already ran previously.
- */
- _ensure: async (environment) => {
- if (javaIsEnsured) {
- return;
- }
-
- const javacPath = utils.forgivingWhichSync('javac');
- const hasJavaHome = !!environment.JAVA_HOME;
- if (hasJavaHome) {
- // Windows java installer doesn't add javac to PATH, nor set JAVA_HOME (ugh).
- if (!javacPath) {
- environment.PATH += path.delimiter + path.join(environment.JAVA_HOME, 'bin');
- }
- } else {
- if (javacPath) {
- // OS X has a command for finding JAVA_HOME.
- const find_java = '/usr/libexec/java_home';
- const default_java_error_msg = 'Failed to find \'JAVA_HOME\' environment variable. Try setting it manually.';
- if (fs.existsSync(find_java)) {
- try {
- environment.JAVA_HOME = (await execa(find_java)).stdout;
- } catch (ex) {
- events.emit('verbose', ex.shortMessage);
- throw new CordovaError(default_java_error_msg);
- }
- } else {
- // See if we can derive it from javac's location.
- var maybeJavaHome = path.dirname(path.dirname(javacPath));
- if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) {
- environment.JAVA_HOME = maybeJavaHome;
- } else {
- throw new CordovaError(default_java_error_msg);
- }
- }
- } else if (utils.isWindows()) {
- const baseDirs = [environment.ProgramFiles, environment['ProgramFiles(x86)']];
- const globOpts = { absolute: true, onlyDirectories: true };
- const flatMap = (arr, f) => [].concat(...arr.map(f));
- const jdkDir = flatMap(baseDirs, cwd => {
- return glob.sync('java/jdk*', { cwd, ...globOpts });
- }
- )[0];
-
- if (jdkDir) {
- environment.PATH += path.delimiter + path.join(jdkDir, 'bin');
- environment.JAVA_HOME = path.normalize(jdkDir);
- }
- }
- }
-
- javaIsEnsured = true;
- }
-};
-
-module.exports = java;
diff --git a/cordova/platforms/android/cordova/lib/getASPath.bat b/cordova/platforms/android/cordova/lib/getASPath.bat
deleted file mode 100644
index 14dad4394..000000000
--- a/cordova/platforms/android/cordova/lib/getASPath.bat
+++ /dev/null
@@ -1,3 +0,0 @@
-@ECHO OFF
-for /f "tokens=2*" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Android Studio" /v Path') do set "ASPath=%%~b"
-ECHO %ASPath%
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/lib/install-device b/cordova/platforms/android/cordova/lib/install-device
deleted file mode 100755
index 1340a4d52..000000000
--- a/cordova/platforms/android/cordova/lib/install-device
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { resolve, install } = require('./target');
-
-var args = process.argv;
-const targetSpec = { type: 'device' };
-
-if (args.length > 2) {
- if (args[2].substring(0, 9) === '--target=') {
- targetSpec.id = args[2].substring(9, args[2].length);
- } else {
- console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
- process.exit(2);
- }
-}
-
-resolve(targetSpec).then(install).catch(err => {
- console.error('ERROR: ' + err);
- process.exit(2);
-});
diff --git a/cordova/platforms/android/cordova/lib/install-device.bat b/cordova/platforms/android/cordova/lib/install-device.bat
deleted file mode 100644
index 0be9ebd03..000000000
--- a/cordova/platforms/android/cordova/lib/install-device.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0install-device"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'install-device' script in 'cordova\lib' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/lib/install-emulator b/cordova/platforms/android/cordova/lib/install-emulator
deleted file mode 100755
index f73cd050b..000000000
--- a/cordova/platforms/android/cordova/lib/install-emulator
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { resolve, install } = require('./target');
-
-var args = process.argv;
-const targetSpec = { type: 'emulator' };
-
-if (args.length > 2) {
- if (args[2].substring(0, 9) === '--target=') {
- targetSpec.id = args[2].substring(9, args[2].length);
- } else {
- console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
- process.exit(2);
- }
-}
-
-resolve(targetSpec).then(install).catch(err => {
- console.error('ERROR: ' + err);
- process.exit(2);
-});
diff --git a/cordova/platforms/android/cordova/lib/install-emulator.bat b/cordova/platforms/android/cordova/lib/install-emulator.bat
deleted file mode 100644
index 21e88c530..000000000
--- a/cordova/platforms/android/cordova/lib/install-emulator.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0install-emulator"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'install-emulator' script in 'cordova\lib' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/lib/list-devices b/cordova/platforms/android/cordova/lib/list-devices
deleted file mode 100755
index ed8e111f3..000000000
--- a/cordova/platforms/android/cordova/lib/list-devices
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { list } = require('./target');
-
-// Usage support for when args are given
-require('./check_reqs').check_android().then(function () {
- list().then(targets => {
- const deviceIds = targets
- .filter(({ type }) => type === 'device')
- .map(({ id }) => id);
-
- console.log(deviceIds.join('\n'));
- }, function (err) {
- console.error('ERROR: ' + err);
- process.exit(2);
- });
-});
diff --git a/cordova/platforms/android/cordova/lib/list-devices.bat b/cordova/platforms/android/cordova/lib/list-devices.bat
deleted file mode 100644
index 7e04cf946..000000000
--- a/cordova/platforms/android/cordova/lib/list-devices.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0list-devices"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'list-devices' script in 'cordova\lib' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/lib/list-emulator-images b/cordova/platforms/android/cordova/lib/list-emulator-images
deleted file mode 100755
index 03cfb190c..000000000
--- a/cordova/platforms/android/cordova/lib/list-emulator-images
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var emulators = require('./emulator');
-
-// Usage support for when args are given
-require('./check_reqs').check_android().then(function () {
- emulators.list_images().then(function (emulator_list) {
- emulator_list && emulator_list.forEach(function (emu) {
- console.log(emu.name);
- });
- }, function (err) {
- console.error('ERROR: ' + err);
- process.exit(2);
- });
-});
diff --git a/cordova/platforms/android/cordova/lib/list-emulator-images.bat b/cordova/platforms/android/cordova/lib/list-emulator-images.bat
deleted file mode 100644
index 55c399d7a..000000000
--- a/cordova/platforms/android/cordova/lib/list-emulator-images.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0list-emulator-images"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'list-emulator-images' script in 'cordova\lib' folder, aborting...>&2
- EXIT /B 1
-)
diff --git a/cordova/platforms/android/cordova/lib/list-started-emulators b/cordova/platforms/android/cordova/lib/list-started-emulators
deleted file mode 100755
index 2a83e03a1..000000000
--- a/cordova/platforms/android/cordova/lib/list-started-emulators
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var emulators = require('./emulator');
-
-// Usage support for when args are given
-require('./check_reqs').check_android().then(function () {
- emulators.list_started().then(function (emulator_list) {
- emulator_list && emulator_list.forEach(function (emu) {
- console.log(emu);
- });
- }, function (err) {
- console.error('ERROR: ' + err);
- process.exit(2);
- });
-});
diff --git a/cordova/platforms/android/cordova/lib/list-started-emulators.bat b/cordova/platforms/android/cordova/lib/list-started-emulators.bat
deleted file mode 100644
index 99547aa4d..000000000
--- a/cordova/platforms/android/cordova/lib/list-started-emulators.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0list-started-emulators"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'list-started-emulators' script in 'cordova\lib' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/lib/log.js b/cordova/platforms/android/cordova/lib/log.js
deleted file mode 100644
index 4e087651b..000000000
--- a/cordova/platforms/android/cordova/lib/log.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var path = require('path');
-var os = require('os');
-var execa = require('execa');
-var ROOT = path.join(__dirname, '..', '..');
-
-/*
- * Starts running logcat in the shell.
- * Returns a promise.
- */
-module.exports.run = function () {
- var adb = execa('adb', ['logcat'], { cwd: os.tmpdir(), stderr: 'inherit' });
-
- adb.stdout.on('data', function (data) {
- var lines = data ? data.toString().split('\n') : [];
- var out = lines.filter(function (x) { return x.indexOf('nativeGetEnabledTags') < 0; });
- console.log(out.join('\n'));
- });
-
- return adb;
-};
-
-module.exports.help = function () {
- console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'cordova', 'log')));
- console.log('Gives the logcat output on the command line.');
- process.exit(0);
-};
diff --git a/cordova/platforms/android/cordova/lib/plugin-build.gradle b/cordova/platforms/android/cordova/lib/plugin-build.gradle
deleted file mode 100644
index 032b870e1..000000000
--- a/cordova/platforms/android/cordova/lib/plugin-build.gradle
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-// GENERATED FILE! DO NOT EDIT!
-
-buildscript {
- repositories {
- google()
- jcenter()
- }
-
- // Switch the Android Gradle plugin version requirement depending on the
- // installed version of Gradle. This dependency is documented at
- // http://tools.android.com/tech-docs/new-build-system/version-compatibility
- // and https://issues.apache.org/jira/browse/CB-8143
- dependencies {
- classpath 'com.android.tools.build:gradle:1.0.0+'
- }
-}
-
-apply plugin: 'com.android.library'
-
-dependencies {
- implementation fileTree(dir: 'libs', include: '*.jar')
- debugCompile project(path: ":CordovaLib", configuration: "debug")
- releaseCompile project(path: ":CordovaLib", configuration: "release")
-}
-
-android {
- compileSdkVersion cdvCompileSdkVersion
- buildToolsVersion cdvBuildToolsVersion
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_6
- targetCompatibility JavaVersion.VERSION_1_6
- }
-
- sourceSets {
- main {
- manifest.srcFile 'AndroidManifest.xml'
- java.srcDirs = ['src']
- resources.srcDirs = ['src']
- aidl.srcDirs = ['src']
- renderscript.srcDirs = ['src']
- res.srcDirs = ['res']
- assets.srcDirs = ['assets']
- jniLibs.srcDirs = ['libs']
- }
- }
-}
-
-if (file('build-extras.gradle').exists()) {
- apply from: 'build-extras.gradle'
-}
diff --git a/cordova/platforms/android/cordova/lib/pluginHandlers.js b/cordova/platforms/android/cordova/lib/pluginHandlers.js
deleted file mode 100644
index 617c30ea1..000000000
--- a/cordova/platforms/android/cordova/lib/pluginHandlers.js
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var fs = require('fs-extra');
-var path = require('path');
-var isPathInside = require('is-path-inside');
-var events = require('cordova-common').events;
-var CordovaError = require('cordova-common').CordovaError;
-
-var handlers = {
- 'source-file': {
- install: function (obj, plugin, project, options) {
- if (!obj.src) throw new CordovaError(generateAttributeError('src', 'source-file', plugin.id));
- if (!obj.targetDir) throw new CordovaError(generateAttributeError('target-dir', 'source-file', plugin.id));
-
- var dest = getInstallDestination(obj);
-
- if (options && options.force) {
- copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
- } else {
- copyNewFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
- }
- },
- uninstall: function (obj, plugin, project, options) {
- var dest = getInstallDestination(obj);
-
- // TODO: Add Koltin extension to uninstall, since they are handled like Java files
- if (obj.src.endsWith('java')) {
- deleteJava(project.projectDir, dest);
- } else {
- // Just remove the file, not the whole parent directory
- removeFile(path.resolve(project.projectDir, dest));
- }
- }
- },
- 'lib-file': {
- install: function (obj, plugin, project, options) {
- var dest = path.join('app/libs', path.basename(obj.src));
- copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
- },
- uninstall: function (obj, plugin, project, options) {
- var dest = path.join('app/libs', path.basename(obj.src));
- removeFile(path.resolve(project.projectDir, dest));
- }
- },
- 'resource-file': {
- install: function (obj, plugin, project, options) {
- var dest = path.join('app', 'src', 'main', obj.target);
- copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
- },
- uninstall: function (obj, plugin, project, options) {
- var dest = path.join('app', 'src', 'main', obj.target);
- removeFile(path.resolve(project.projectDir, dest));
- }
- },
- framework: {
- install: function (obj, plugin, project, options) {
- var src = obj.src;
- if (!src) throw new CordovaError(generateAttributeError('src', 'framework', plugin.id));
-
- events.emit('verbose', 'Installing Android library: ' + src);
- var parentDir = obj.parent ? path.resolve(project.projectDir, obj.parent) : project.projectDir;
- var subDir;
-
- if (obj.custom) {
- var subRelativeDir = project.getCustomSubprojectRelativeDir(plugin.id, src);
- copyNewFile(plugin.dir, src, project.projectDir, subRelativeDir, !!(options && options.link));
- subDir = path.resolve(project.projectDir, subRelativeDir);
- } else {
- obj.type = 'sys';
- subDir = src;
- }
-
- if (obj.type === 'gradleReference') {
- project.addGradleReference(parentDir, subDir);
- } else if (obj.type === 'sys') {
- project.addSystemLibrary(parentDir, subDir);
- } else {
- project.addSubProject(parentDir, subDir);
- }
- },
- uninstall: function (obj, plugin, project, options) {
- var src = obj.src;
- if (!src) throw new CordovaError(generateAttributeError('src', 'framework', plugin.id));
-
- events.emit('verbose', 'Uninstalling Android library: ' + src);
- var parentDir = obj.parent ? path.resolve(project.projectDir, obj.parent) : project.projectDir;
- var subDir;
-
- if (obj.custom) {
- var subRelativeDir = project.getCustomSubprojectRelativeDir(plugin.id, src);
- removeFile(path.resolve(project.projectDir, subRelativeDir));
- subDir = path.resolve(project.projectDir, subRelativeDir);
- // If it's the last framework in the plugin, remove the parent directory.
- var parDir = path.dirname(subDir);
- if (fs.existsSync(parDir) && fs.readdirSync(parDir).length === 0) {
- fs.rmdirSync(parDir);
- }
- } else {
- obj.type = 'sys';
- subDir = src;
- }
-
- if (obj.type === 'gradleReference') {
- project.removeGradleReference(parentDir, subDir);
- } else if (obj.type === 'sys') {
- project.removeSystemLibrary(parentDir, subDir);
- } else {
- project.removeSubProject(parentDir, subDir);
- }
- }
- },
- asset: {
- install: function (obj, plugin, project, options) {
- if (!obj.src) {
- throw new CordovaError(generateAttributeError('src', 'asset', plugin.id));
- }
- if (!obj.target) {
- throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
- }
-
- copyFile(plugin.dir, obj.src, project.www, obj.target);
- if (options && options.usePlatformWww) {
- // CB-11022 copy file to both directories if usePlatformWww is specified
- copyFile(plugin.dir, obj.src, project.platformWww, obj.target);
- }
- },
- uninstall: function (obj, plugin, project, options) {
- var target = obj.target || obj.src;
-
- if (!target) throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
-
- removeFile(path.resolve(project.www, target));
- removeFile(path.resolve(project.www, 'plugins', plugin.id));
- if (options && options.usePlatformWww) {
- // CB-11022 remove file from both directories if usePlatformWww is specified
- removeFile(path.resolve(project.platformWww, target));
- removeFile(path.resolve(project.platformWww, 'plugins', plugin.id));
- }
- }
- },
- 'js-module': {
- install: function (obj, plugin, project, options) {
- // Copy the plugin's files into the www directory.
- var moduleSource = path.resolve(plugin.dir, obj.src);
- var moduleName = plugin.id + '.' + (obj.name || path.basename(obj.src, path.extname(obj.src)));
-
- // Read in the file, prepend the cordova.define, and write it back out.
- var scriptContent = fs.readFileSync(moduleSource, 'utf-8').replace(/^\ufeff/, ''); // Window BOM
- if (moduleSource.match(/.*\.json$/)) {
- scriptContent = 'module.exports = ' + scriptContent;
- }
- scriptContent = 'cordova.define("' + moduleName + '", function(require, exports, module) {\n' + scriptContent + '\n});\n';
-
- var wwwDest = path.resolve(project.www, 'plugins', plugin.id, obj.src);
- fs.ensureDirSync(path.dirname(wwwDest));
- fs.writeFileSync(wwwDest, scriptContent, 'utf-8');
-
- if (options && options.usePlatformWww) {
- // CB-11022 copy file to both directories if usePlatformWww is specified
- var platformWwwDest = path.resolve(project.platformWww, 'plugins', plugin.id, obj.src);
- fs.ensureDirSync(path.dirname(platformWwwDest));
- fs.writeFileSync(platformWwwDest, scriptContent, 'utf-8');
- }
- },
- uninstall: function (obj, plugin, project, options) {
- var pluginRelativePath = path.join('plugins', plugin.id, obj.src);
- removeFileAndParents(project.www, pluginRelativePath);
- if (options && options.usePlatformWww) {
- // CB-11022 remove file from both directories if usePlatformWww is specified
- removeFileAndParents(project.platformWww, pluginRelativePath);
- }
- }
- }
-};
-
-module.exports.getInstaller = function (type) {
- if (handlers[type] && handlers[type].install) {
- return handlers[type].install;
- }
-
- events.emit('verbose', '<' + type + '> is not supported for android plugins');
-};
-
-module.exports.getUninstaller = function (type) {
- if (handlers[type] && handlers[type].uninstall) {
- return handlers[type].uninstall;
- }
-
- events.emit('verbose', '<' + type + '> is not supported for android plugins');
-};
-
-function copyFile (plugin_dir, src, project_dir, dest, link) {
- src = path.resolve(plugin_dir, src);
- if (!fs.existsSync(src)) throw new CordovaError('"' + src + '" not found!');
-
- // check that src path is inside plugin directory
- var real_path = fs.realpathSync(src);
- var real_plugin_path = fs.realpathSync(plugin_dir);
- if (!isPathInside(real_path, real_plugin_path)) { throw new CordovaError('File "' + src + '" is located outside the plugin directory "' + plugin_dir + '"'); }
-
- dest = path.resolve(project_dir, dest);
-
- // check that dest path is located in project directory
- if (!isPathInside(dest, project_dir)) { throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project'); }
-
- fs.ensureDirSync(path.dirname(dest));
- if (link) {
- symlinkFileOrDirTree(src, dest);
- } else {
- fs.copySync(src, dest);
- }
-}
-
-// Same as copy file but throws error if target exists
-function copyNewFile (plugin_dir, src, project_dir, dest, link) {
- var target_path = path.resolve(project_dir, dest);
- if (fs.existsSync(target_path)) { throw new CordovaError('"' + target_path + '" already exists!'); }
-
- copyFile(plugin_dir, src, project_dir, dest, !!link);
-}
-
-function symlinkFileOrDirTree (src, dest) {
- if (fs.existsSync(dest)) {
- fs.removeSync(dest);
- }
-
- if (fs.statSync(src).isDirectory()) {
- fs.ensureDirSync(path.dirname(dest));
- fs.readdirSync(src).forEach(function (entry) {
- symlinkFileOrDirTree(path.join(src, entry), path.join(dest, entry));
- });
- } else {
- fs.symlinkSync(path.relative(fs.realpathSync(path.dirname(dest)), src), dest);
- }
-}
-
-function removeFile (file) {
- fs.removeSync(file);
-}
-
-// Sometimes we want to remove some java, and prune any unnecessary empty directories
-function deleteJava (project_dir, destFile) {
- removeFileAndParents(project_dir, destFile, 'src');
-}
-
-function removeFileAndParents (baseDir, destFile, stopper) {
- stopper = stopper || '.';
- var file = path.resolve(baseDir, destFile);
- if (!fs.existsSync(file)) return;
-
- removeFile(file);
-
- // check if directory is empty
- var curDir = path.dirname(file);
-
- while (curDir !== path.resolve(baseDir, stopper)) {
- if (fs.existsSync(curDir) && fs.readdirSync(curDir).length === 0) {
- fs.rmdirSync(curDir);
- curDir = path.resolve(curDir, '..');
- } else {
- // directory not empty...do nothing
- break;
- }
- }
-}
-
-function generateAttributeError (attribute, element, id) {
- return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
-}
-
-function getInstallDestination (obj) {
- var APP_MAIN_PREFIX = 'app/src/main';
- var PATH_SEPARATOR = '/';
-
- var PATH_SEP_MATCH = '\\' + PATH_SEPARATOR;
- var PATH_SEP_OR_EOL_MATCH = '(\\' + PATH_SEPARATOR + '|$)';
-
- var appReg = new RegExp('^app' + PATH_SEP_OR_EOL_MATCH);
- var libsReg = new RegExp('^libs' + PATH_SEP_OR_EOL_MATCH);
- var srcReg = new RegExp('^src' + PATH_SEP_OR_EOL_MATCH);
- var srcMainReg = new RegExp('^src' + PATH_SEP_MATCH + 'main' + PATH_SEP_OR_EOL_MATCH);
-
- if (appReg.test(obj.targetDir)) {
- // If any source file is using the new app directory structure,
- // don't penalize it
- return path.join(obj.targetDir, path.basename(obj.src));
- } else {
- // Plugin using deprecated target directory structure (GH-580)
- if (obj.src.endsWith('.java')) {
- return path.join(APP_MAIN_PREFIX, 'java', obj.targetDir.replace(srcReg, ''),
- path.basename(obj.src));
- } else if (obj.src.endsWith('.aidl')) {
- return path.join(APP_MAIN_PREFIX, 'aidl', obj.targetDir.replace(srcReg, ''),
- path.basename(obj.src));
- } else if (libsReg.test(obj.targetDir)) {
- if (obj.src.endsWith('.so')) {
- return path.join(APP_MAIN_PREFIX, 'jniLibs', obj.targetDir.replace(libsReg, ''),
- path.basename(obj.src));
- } else {
- return path.join('app', obj.targetDir, path.basename(obj.src));
- }
- } else if (srcMainReg.test(obj.targetDir)) {
- return path.join('app', obj.targetDir, path.basename(obj.src));
- }
-
- // For all other source files not using the new app directory structure,
- // add 'app/src/main' to the targetDir
- return path.join(APP_MAIN_PREFIX, obj.targetDir, path.basename(obj.src));
- }
-}
diff --git a/cordova/platforms/android/cordova/lib/prepare.js b/cordova/platforms/android/cordova/lib/prepare.js
deleted file mode 100644
index 17cbf6f2e..000000000
--- a/cordova/platforms/android/cordova/lib/prepare.js
+++ /dev/null
@@ -1,761 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var fs = require('fs-extra');
-var path = require('path');
-const nopt = require('nopt');
-const glob = require('fast-glob');
-var events = require('cordova-common').events;
-var AndroidManifest = require('./AndroidManifest');
-var checkReqs = require('./check_reqs');
-var xmlHelpers = require('cordova-common').xmlHelpers;
-var CordovaError = require('cordova-common').CordovaError;
-var ConfigParser = require('cordova-common').ConfigParser;
-var FileUpdater = require('cordova-common').FileUpdater;
-var PlatformJson = require('cordova-common').PlatformJson;
-var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger;
-var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
-const utils = require('./utils');
-
-const GradlePropertiesParser = require('./config/GradlePropertiesParser');
-
-function parseArguments (argv) {
- return nopt({
- // `jvmargs` is a valid option however, we don't actually want to parse it because we want the entire string as is.
- // jvmargs: String
- }, {}, argv || [], 0);
-}
-
-module.exports.prepare = function (cordovaProject, options) {
- var self = this;
-
- let args = {};
- if (options && options.options) {
- args = parseArguments(options.options.argv);
- }
-
- var platformJson = PlatformJson.load(this.locations.root, this.platform);
- var munger = new PlatformMunger(this.platform, this.locations.root, platformJson, new PluginInfoProvider());
-
- this._config = updateConfigFilesFrom(cordovaProject.projectConfig, munger, this.locations);
-
- // Get the min SDK version from config.xml
- const minSdkVersion = this._config.getPreference('android-minSdkVersion', 'android');
- const maxSdkVersion = this._config.getPreference('android-maxSdkVersion', 'android');
- const targetSdkVersion = this._config.getPreference('android-targetSdkVersion', 'android');
- const androidXEnabled = this._config.getPreference('AndroidXEnabled', 'android');
- const isGradlePluginKotlinEnabled = this._config.getPreference('GradlePluginKotlinEnabled', 'android');
- const gradlePluginKotlinCodeStyle = this._config.getPreference('GradlePluginKotlinCodeStyle', 'android');
-
- const gradlePropertiesUserConfig = {};
- if (minSdkVersion) gradlePropertiesUserConfig.cdvMinSdkVersion = minSdkVersion;
- if (maxSdkVersion) gradlePropertiesUserConfig.cdvMaxSdkVersion = maxSdkVersion;
- if (targetSdkVersion) gradlePropertiesUserConfig.cdvTargetSdkVersion = targetSdkVersion;
- if (args.jvmargs) gradlePropertiesUserConfig['org.gradle.jvmargs'] = args.jvmargs;
- if (isGradlePluginKotlinEnabled) {
- gradlePropertiesUserConfig['kotlin.code.style'] = gradlePluginKotlinCodeStyle || 'official';
- }
-
- // Both 'useAndroidX' and 'enableJetifier' are linked together.
- if (androidXEnabled) {
- gradlePropertiesUserConfig['android.useAndroidX'] = androidXEnabled;
- gradlePropertiesUserConfig['android.enableJetifier'] = androidXEnabled;
- }
-
- const gradlePropertiesParser = new GradlePropertiesParser(this.locations.root);
- gradlePropertiesParser.configure(gradlePropertiesUserConfig);
-
- // Update own www dir with project's www assets and plugins' assets and js-files
- return Promise.resolve(updateWww(cordovaProject, this.locations)).then(function () {
- // update project according to config.xml changes.
- return updateProjectAccordingTo(self._config, self.locations);
- }).then(function () {
- updateIcons(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
- updateSplashes(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
- updateFileResources(cordovaProject, path.relative(cordovaProject.root, self.locations.root));
- }).then(function () {
- events.emit('verbose', 'Prepared android project successfully');
- });
-};
-
-module.exports.clean = function (options) {
- // A cordovaProject isn't passed into the clean() function, because it might have
- // been called from the platform shell script rather than the CLI. Check for the
- // noPrepare option passed in by the non-CLI clean script. If that's present, or if
- // there's no config.xml found at the project root, then don't clean prepared files.
- var projectRoot = path.resolve(this.root, '../..');
- if ((options && options.noPrepare) || !fs.existsSync(this.locations.configXml) ||
- !fs.existsSync(this.locations.configXml)) {
- return Promise.resolve();
- }
-
- var projectConfig = new ConfigParser(this.locations.configXml);
-
- var self = this;
- return Promise.resolve().then(function () {
- cleanWww(projectRoot, self.locations);
- cleanIcons(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
- cleanSplashes(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
- cleanFileResources(projectRoot, projectConfig, path.relative(projectRoot, self.locations.root));
- });
-};
-
-/**
- * Updates config files in project based on app's config.xml and config munge,
- * generated by plugins.
- *
- * @param {ConfigParser} sourceConfig A project's configuration that will
- * be merged into platform's config.xml
- * @param {ConfigChanges} configMunger An initialized ConfigChanges instance
- * for this platform.
- * @param {Object} locations A map of locations for this platform
- *
- * @return {ConfigParser} An instance of ConfigParser, that
- * represents current project's configuration. When returned, the
- * configuration is already dumped to appropriate config.xml file.
- */
-function updateConfigFilesFrom (sourceConfig, configMunger, locations) {
- events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml);
-
- // First cleanup current config and merge project's one into own
- // Overwrite platform config.xml with defaults.xml.
- fs.copySync(locations.defaultConfigXml, locations.configXml);
-
- // Then apply config changes from global munge to all config files
- // in project (including project's config)
- configMunger.reapply_global_munge().save_all();
-
- events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml');
- // Merge changes from app's config.xml into platform's one
- var config = new ConfigParser(locations.configXml);
- xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
- config.doc.getroot(), 'android', /* clobber= */true);
-
- config.write();
- return config;
-}
-
-/**
- * Logs all file operations via the verbose event stream, indented.
- */
-function logFileOp (message) {
- events.emit('verbose', ' ' + message);
-}
-
-/**
- * Updates platform 'www' directory by replacing it with contents of
- * 'platform_www' and app www. Also copies project's overrides' folder into
- * the platform 'www' folder
- *
- * @param {Object} cordovaProject An object which describes cordova project.
- * @param {Object} destinations An object that contains destination
- * paths for www files.
- */
-function updateWww (cordovaProject, destinations) {
- var sourceDirs = [
- path.relative(cordovaProject.root, cordovaProject.locations.www),
- path.relative(cordovaProject.root, destinations.platformWww)
- ];
-
- // If project contains 'merges' for our platform, use them as another overrides
- var merges_path = path.join(cordovaProject.root, 'merges', 'android');
- if (fs.existsSync(merges_path)) {
- events.emit('verbose', 'Found "merges/android" folder. Copying its contents into the android project.');
- sourceDirs.push(path.join('merges', 'android'));
- }
-
- var targetDir = path.relative(cordovaProject.root, destinations.www);
- events.emit(
- 'verbose', 'Merging and updating files from [' + sourceDirs.join(', ') + '] to ' + targetDir);
- FileUpdater.mergeAndUpdateDir(
- sourceDirs, targetDir, { rootDir: cordovaProject.root }, logFileOp);
-}
-
-/**
- * Cleans all files from the platform 'www' directory.
- */
-function cleanWww (projectRoot, locations) {
- var targetDir = path.relative(projectRoot, locations.www);
- events.emit('verbose', 'Cleaning ' + targetDir);
-
- // No source paths are specified, so mergeAndUpdateDir() will clear the target directory.
- FileUpdater.mergeAndUpdateDir(
- [], targetDir, { rootDir: projectRoot, all: true }, logFileOp);
-}
-
-/**
- * Updates project structure and AndroidManifest according to project's configuration.
- *
- * @param {ConfigParser} platformConfig A project's configuration that will
- * be used to update project
- * @param {Object} locations A map of locations for this platform
- */
-function updateProjectAccordingTo (platformConfig, locations) {
- // Update app name by editing res/values/strings.xml
- var strings = xmlHelpers.parseElementtreeSync(locations.strings);
-
- var name = platformConfig.name();
- strings.find('string[@name="app_name"]').text = name.replace(/'/g, '\\\'');
-
- var shortName = platformConfig.shortName && platformConfig.shortName();
- if (shortName && shortName !== name) {
- strings.find('string[@name="launcher_name"]').text = shortName.replace(/'/g, '\\\'');
- }
-
- fs.writeFileSync(locations.strings, strings.write({ indent: 4 }), 'utf-8');
- events.emit('verbose', 'Wrote out android application name "' + name + '" to ' + locations.strings);
-
- // Java packages cannot support dashes
- var androidPkgName = (platformConfig.android_packageName() || platformConfig.packageName()).replace(/-/g, '_');
-
- var manifest = new AndroidManifest(locations.manifest);
- var manifestId = manifest.getPackageId();
-
- manifest.getActivity()
- .setOrientation(platformConfig.getPreference('orientation'))
- .setLaunchMode(findAndroidLaunchModePreference(platformConfig));
-
- manifest.setVersionName(platformConfig.version())
- .setVersionCode(platformConfig.android_versionCode() || default_versionCode(platformConfig.version()))
- .setPackageId(androidPkgName)
- .write();
-
- // Java file paths shouldn't be hard coded
- const javaDirectory = path.join(locations.javaSrc, manifestId.replace(/\./g, '/'));
- const java_files = glob.sync('**/*.java', { cwd: javaDirectory, absolute: true }).filter(f => {
- const contents = fs.readFileSync(f, 'utf-8');
- return /extends\s+CordovaActivity/.test(contents);
- });
-
- if (java_files.length === 0) {
- throw new CordovaError('No Java files found that extend CordovaActivity.');
- } else if (java_files.length > 1) {
- events.emit('log', 'Multiple candidate Java files that extend CordovaActivity found. Guessing at the first one, ' + java_files[0]);
- }
-
- const destFile = java_files[0];
-
- // var destFile = path.join(locations.root, 'app', 'src', 'main', 'java', androidPkgName.replace(/\./g, '/'), path.basename(java_files[0]));
- // fs.ensureDirSync(path.dirname(destFile));
- // events.emit('verbose', java_files[0]);
- // events.emit('verbose', destFile);
- // console.log(locations);
- // fs.copySync(java_files[0], destFile);
- utils.replaceFileContents(destFile, /package [\w.]*;/, 'package ' + androidPkgName + ';');
- events.emit('verbose', 'Wrote out Android package name "' + androidPkgName + '" to ' + destFile);
-
- var removeOrigPkg = checkReqs.isWindows() || checkReqs.isDarwin()
- ? manifestId.toUpperCase() !== androidPkgName.toUpperCase()
- : manifestId !== androidPkgName;
-
- if (removeOrigPkg) {
- // If package was name changed we need to remove old java with main activity
- fs.removeSync(java_files[0]);
- // remove any empty directories
- var currentDir = path.dirname(java_files[0]);
- var sourcesRoot = path.resolve(locations.root, 'src');
- while (currentDir !== sourcesRoot) {
- if (fs.existsSync(currentDir) && fs.readdirSync(currentDir).length === 0) {
- fs.rmdirSync(currentDir);
- currentDir = path.resolve(currentDir, '..');
- } else {
- break;
- }
- }
- }
-}
-
-// Consturct the default value for versionCode as
-// PATCH + MINOR * 100 + MAJOR * 10000
-// see http://developer.android.com/tools/publishing/versioning.html
-function default_versionCode (version) {
- var nums = version.split('-')[0].split('.');
- var versionCode = 0;
- if (+nums[0]) {
- versionCode += +nums[0] * 10000;
- }
- if (+nums[1]) {
- versionCode += +nums[1] * 100;
- }
- if (+nums[2]) {
- versionCode += +nums[2];
- }
-
- events.emit('verbose', 'android-versionCode not found in config.xml. Generating a code based on version in config.xml (' + version + '): ' + versionCode);
- return versionCode;
-}
-
-function getImageResourcePath (resourcesDir, type, density, name, sourceName) {
- // Use same extension as source with special case for 9-Patch files
- const ext = sourceName.endsWith('.9.png')
- ? '.9.png' : path.extname(sourceName).toLowerCase();
-
- const subDir = density ? `${type}-${density}` : type;
- return path.join(resourcesDir, subDir, name + ext);
-}
-
-function getAdaptiveImageResourcePath (resourcesDir, type, density, name, sourceName) {
- if (/\.9\.png$/.test(sourceName)) {
- name = name.replace(/\.png$/, '.9.png');
- }
- var resourcePath = path.join(resourcesDir, (density ? type + '-' + density + '-v26' : type), name);
- return resourcePath;
-}
-
-function makeSplashCleanupMap (projectRoot, resourcesDir) {
- // Build an initial resource map that deletes all existing splash screens
- const existingSplashPaths = glob.sync(
- `${resourcesDir.replace(/\\/g, '/')}/drawable-*/screen.{png,9.png,webp,jpg,jpeg}`,
- { cwd: projectRoot }
- );
- return makeCleanResourceMap(existingSplashPaths);
-}
-
-function updateSplashes (cordovaProject, platformResourcesDir) {
- var resources = cordovaProject.projectConfig.getSplashScreens('android');
-
- // if there are "splash" elements in config.xml
- if (resources.length === 0) {
- events.emit('verbose', 'This app does not have splash screens defined');
- return;
- }
-
- // Build an initial resource map that deletes all existing splash screens
- const resourceMap = makeSplashCleanupMap(cordovaProject.root, platformResourcesDir);
-
- var hadMdpi = false;
- resources.forEach(function (resource) {
- if (!resource.density) {
- return;
- }
- if (resource.density === 'mdpi') {
- hadMdpi = true;
- }
- var targetPath = getImageResourcePath(
- platformResourcesDir, 'drawable', resource.density, 'screen', path.basename(resource.src));
- resourceMap[targetPath] = resource.src;
- });
-
- // There's no "default" drawable, so assume default == mdpi.
- if (!hadMdpi && resources.defaultResource) {
- var targetPath = getImageResourcePath(
- platformResourcesDir, 'drawable', 'mdpi', 'screen', path.basename(resources.defaultResource.src));
- resourceMap[targetPath] = resources.defaultResource.src;
- }
-
- events.emit('verbose', 'Updating splash screens at ' + platformResourcesDir);
- FileUpdater.updatePaths(
- resourceMap, { rootDir: cordovaProject.root }, logFileOp);
-}
-
-function cleanSplashes (projectRoot, projectConfig, platformResourcesDir) {
- var resources = projectConfig.getSplashScreens('android');
- if (resources.length > 0) {
- const resourceMap = makeSplashCleanupMap(projectRoot, platformResourcesDir);
-
- events.emit('verbose', 'Cleaning splash screens at ' + platformResourcesDir);
-
- // No source paths are specified in the map, so updatePaths() will delete the target files.
- FileUpdater.updatePaths(
- resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
- }
-}
-
-function updateIcons (cordovaProject, platformResourcesDir) {
- const icons = cordovaProject.projectConfig.getIcons('android');
-
- // Skip if there are no app defined icons in config.xml
- if (icons.length === 0) {
- events.emit('verbose', 'This app does not have launcher icons defined');
- return;
- }
-
- // 1. loop icons determin if there is an error in the setup.
- // 2. during initial loop, also setup for legacy support.
- const errorMissingAttributes = [];
- const errorLegacyIconNeeded = [];
- let hasAdaptive = false;
- icons.forEach((icon, key) => {
- if (
- (icon.background && !icon.foreground) ||
- (!icon.background && icon.foreground) ||
- (!icon.background && !icon.foreground && !icon.src)
- ) {
- errorMissingAttributes.push(icon.density ? icon.density : 'size=' + (icon.height || icon.width));
- }
-
- if (icon.foreground) {
- hasAdaptive = true;
-
- if (
- !icon.src &&
- (
- icon.foreground.startsWith('@color') ||
- path.extname(path.basename(icon.foreground)) === '.xml'
- )
- ) {
- errorLegacyIconNeeded.push(icon.density ? icon.density : 'size=' + (icon.height || icon.width));
- } else if (!icon.src) {
- icons[key].src = icon.foreground;
- }
- }
- });
-
- const errorMessage = [];
- if (errorMissingAttributes.length > 0) {
- errorMessage.push('One of the following attributes are set but missing the other for the density type: ' + errorMissingAttributes.join(', ') + '. Please ensure that all require attributes are defined.');
- }
-
- if (errorLegacyIconNeeded.length > 0) {
- errorMessage.push('For the following icons with the density of: ' + errorLegacyIconNeeded.join(', ') + ', adaptive foreground with a defined color or vector can not be used as a standard fallback icon for older Android devices. To support older Android environments, please provide a value for the src attribute.');
- }
-
- if (errorMessage.length > 0) {
- throw new CordovaError(errorMessage.join(' '));
- }
-
- let resourceMap = Object.assign(
- {},
- mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher.png'),
- mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.png'),
- mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_background.png'),
- mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.xml'),
- mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_background.xml'),
- mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher.xml')
- );
-
- const preparedIcons = prepareIcons(icons);
-
- if (hasAdaptive) {
- resourceMap = updateIconResourceForAdaptive(preparedIcons, resourceMap, platformResourcesDir);
- }
-
- resourceMap = updateIconResourceForLegacy(preparedIcons, resourceMap, platformResourcesDir);
-
- events.emit('verbose', 'Updating icons at ' + platformResourcesDir);
- FileUpdater.updatePaths(resourceMap, { rootDir: cordovaProject.root }, logFileOp);
-}
-
-function updateIconResourceForAdaptive (preparedIcons, resourceMap, platformResourcesDir) {
- const android_icons = preparedIcons.android_icons;
- const default_icon = preparedIcons.default_icon;
-
- // The source paths for icons and splashes are relative to
- // project's config.xml location, so we use it as base path.
- let background;
- let foreground;
- let targetPathBackground;
- let targetPathForeground;
-
- for (const density in android_icons) {
- let backgroundVal = '@mipmap/ic_launcher_background';
- let foregroundVal = '@mipmap/ic_launcher_foreground';
-
- background = android_icons[density].background;
- foreground = android_icons[density].foreground;
-
- if (!background || !foreground) {
- // This icon isn't an adaptive icon, so skip it
- continue;
- }
-
- if (background.startsWith('@color')) {
- // Colors Use Case
- backgroundVal = background; // Example: @color/background_foobar_1
- } else if (path.extname(path.basename(background)) === '.xml') {
- // Vector Use Case
- targetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_background.xml', path.basename(android_icons[density].background));
- resourceMap[targetPathBackground] = android_icons[density].background;
- } else if (path.extname(path.basename(background)) === '.png') {
- // Images Use Case
- targetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_background.png', path.basename(android_icons[density].background));
- resourceMap[targetPathBackground] = android_icons[density].background;
- }
-
- if (foreground.startsWith('@color')) {
- // Colors Use Case
- foregroundVal = foreground;
- } else if (path.extname(path.basename(foreground)) === '.xml') {
- // Vector Use Case
- targetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_foreground.xml', path.basename(android_icons[density].foreground));
- resourceMap[targetPathForeground] = android_icons[density].foreground;
- } else if (path.extname(path.basename(foreground)) === '.png') {
- // Images Use Case
- targetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_foreground.png', path.basename(android_icons[density].foreground));
- resourceMap[targetPathForeground] = android_icons[density].foreground;
- }
-
- // create an XML for DPI and set color
- const icLauncherTemplate = `<?xml version="1.0" encoding="utf-8"?>
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
- <background android:drawable="` + backgroundVal + `" />
- <foreground android:drawable="` + foregroundVal + `" />
-</adaptive-icon>`;
-
- const launcherXmlPath = path.join(platformResourcesDir, 'mipmap-' + density + '-v26', 'ic_launcher.xml');
-
- // Remove the XML from the resourceMap so the file does not get removed.
- delete resourceMap[launcherXmlPath];
-
- fs.writeFileSync(path.resolve(launcherXmlPath), icLauncherTemplate);
- }
-
- // There's no "default" drawable, so assume default == mdpi.
- if (default_icon && !android_icons.mdpi) {
- let defaultTargetPathBackground;
- let defaultTargetPathForeground;
-
- if (background.startsWith('@color')) {
- // Colors Use Case
- targetPathBackground = default_icon.background;
- } else if (path.extname(path.basename(background)) === '.xml') {
- // Vector Use Case
- defaultTargetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_background.xml', path.basename(default_icon.background));
- resourceMap[defaultTargetPathBackground] = default_icon.background;
- } else if (path.extname(path.basename(background)) === '.png') {
- // Images Use Case
- defaultTargetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_background.png', path.basename(default_icon.background));
- resourceMap[defaultTargetPathBackground] = default_icon.background;
- }
-
- if (foreground.startsWith('@color')) {
- // Colors Use Case
- targetPathForeground = default_icon.foreground;
- } else if (path.extname(path.basename(foreground)) === '.xml') {
- // Vector Use Case
- defaultTargetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_foreground.xml', path.basename(default_icon.foreground));
- resourceMap[defaultTargetPathForeground] = default_icon.foreground;
- } else if (path.extname(path.basename(foreground)) === '.png') {
- // Images Use Case
- defaultTargetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_foreground.png', path.basename(default_icon.foreground));
- resourceMap[defaultTargetPathForeground] = default_icon.foreground;
- }
- }
-
- return resourceMap;
-}
-
-function updateIconResourceForLegacy (preparedIcons, resourceMap, platformResourcesDir) {
- const android_icons = preparedIcons.android_icons;
- const default_icon = preparedIcons.default_icon;
-
- // The source paths for icons and splashes are relative to
- // project's config.xml location, so we use it as base path.
- for (var density in android_icons) {
- var targetPath = getImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher', path.basename(android_icons[density].src));
- resourceMap[targetPath] = android_icons[density].src;
- }
-
- // There's no "default" drawable, so assume default == mdpi.
- if (default_icon && !android_icons.mdpi) {
- var defaultTargetPath = getImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher', path.basename(default_icon.src));
- resourceMap[defaultTargetPath] = default_icon.src;
- }
-
- return resourceMap;
-}
-
-function prepareIcons (icons) {
- // http://developer.android.com/design/style/iconography.html
- const SIZE_TO_DENSITY_MAP = {
- 36: 'ldpi',
- 48: 'mdpi',
- 72: 'hdpi',
- 96: 'xhdpi',
- 144: 'xxhdpi',
- 192: 'xxxhdpi'
- };
-
- const android_icons = {};
- let default_icon;
-
- // find the best matching icon for a given density or size
- // @output android_icons
- var parseIcon = function (icon, icon_size) {
- // do I have a platform icon for that density already
- var density = icon.density || SIZE_TO_DENSITY_MAP[icon_size];
- if (!density) {
- // invalid icon defition ( or unsupported size)
- return;
- }
- var previous = android_icons[density];
- if (previous && previous.platform) {
- return;
- }
- android_icons[density] = icon;
- };
-
- // iterate over all icon elements to find the default icon and call parseIcon
- for (var i = 0; i < icons.length; i++) {
- var icon = icons[i];
- var size = icon.width;
-
- if (!size) {
- size = icon.height;
- }
-
- if (!size && !icon.density) {
- if (default_icon) {
- const found = {};
- const favor = {};
-
- // populating found icon.
- if (icon.background && icon.foreground) {
- found.background = icon.background;
- found.foreground = icon.foreground;
- }
- if (icon.src) {
- found.src = icon.src;
- }
-
- if (default_icon.background && default_icon.foreground) {
- favor.background = default_icon.background;
- favor.foreground = default_icon.foreground;
- }
- if (default_icon.src) {
- favor.src = default_icon.src;
- }
-
- events.emit('verbose', 'Found extra default icon: ' + JSON.stringify(found) + ' and ignoring in favor of ' + JSON.stringify(favor) + '.');
- } else {
- default_icon = icon;
- }
- } else {
- parseIcon(icon, size);
- }
- }
-
- return {
- android_icons: android_icons,
- default_icon: default_icon
- };
-}
-
-function cleanIcons (projectRoot, projectConfig, platformResourcesDir) {
- var icons = projectConfig.getIcons('android');
-
- // Skip if there are no app defined icons in config.xml
- if (icons.length === 0) {
- events.emit('verbose', 'This app does not have launcher icons defined');
- return;
- }
-
- const resourceMap = Object.assign(
- {},
- mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher.png'),
- mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.png'),
- mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_background.png'),
- mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.xml'),
- mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_background.xml'),
- mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher.xml')
- );
-
- events.emit('verbose', 'Cleaning icons at ' + platformResourcesDir);
-
- // No source paths are specified in the map, so updatePaths() will delete the target files.
- FileUpdater.updatePaths(resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
-}
-
-/**
- * Gets a map containing resources of a specified name from all drawable folders in a directory.
- */
-function mapImageResources (rootDir, subDir, type, resourceName) {
- const pathMap = {};
- const globOptions = { cwd: path.join(rootDir, subDir), onlyDirectories: true };
- glob.sync(type + '-*', globOptions).forEach(drawableFolder => {
- const imagePath = path.join(subDir, drawableFolder, resourceName);
- pathMap[imagePath] = null;
- });
- return pathMap;
-}
-
-/** Returns resource map that deletes all given paths */
-function makeCleanResourceMap (resourcePaths) {
- const pathMap = {};
- resourcePaths.map(path.normalize)
- .forEach(resourcePath => {
- pathMap[resourcePath] = null;
- });
- return pathMap;
-}
-
-function updateFileResources (cordovaProject, platformDir) {
- var files = cordovaProject.projectConfig.getFileResources('android');
-
- // if there are resource-file elements in config.xml
- if (files.length === 0) {
- events.emit('verbose', 'This app does not have additional resource files defined');
- return;
- }
-
- var resourceMap = {};
- files.forEach(function (res) {
- var targetPath = path.join(platformDir, res.target);
- resourceMap[targetPath] = res.src;
- });
-
- events.emit('verbose', 'Updating resource files at ' + platformDir);
- FileUpdater.updatePaths(
- resourceMap, { rootDir: cordovaProject.root }, logFileOp);
-}
-
-function cleanFileResources (projectRoot, projectConfig, platformDir) {
- var files = projectConfig.getFileResources('android', true);
- if (files.length > 0) {
- events.emit('verbose', 'Cleaning resource files at ' + platformDir);
-
- var resourceMap = {};
- files.forEach(function (res) {
- var filePath = path.join(platformDir, res.target);
- resourceMap[filePath] = null;
- });
-
- FileUpdater.updatePaths(
- resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
- }
-}
-
-/**
- * Gets and validates 'AndroidLaunchMode' prepference from config.xml. Returns
- * preference value and warns if it doesn't seems to be valid
- *
- * @param {ConfigParser} platformConfig A configParser instance for
- * platform.
- *
- * @return {String} Preference's value from config.xml or
- * default value, if there is no such preference. The default value is
- * 'singleTop'
- */
-function findAndroidLaunchModePreference (platformConfig) {
- var launchMode = platformConfig.getPreference('AndroidLaunchMode');
- if (!launchMode) {
- // Return a default value
- return 'singleTop';
- }
-
- var expectedValues = ['standard', 'singleTop', 'singleTask', 'singleInstance'];
- var valid = expectedValues.indexOf(launchMode) >= 0;
- if (!valid) {
- // Note: warn, but leave the launch mode as developer wanted, in case the list of options changes in the future
- events.emit('warn', 'Unrecognized value for AndroidLaunchMode preference: ' +
- launchMode + '. Expected values are: ' + expectedValues.join(', '));
- }
-
- return launchMode;
-}
diff --git a/cordova/platforms/android/cordova/lib/retry.js b/cordova/platforms/android/cordova/lib/retry.js
deleted file mode 100644
index 6806422af..000000000
--- a/cordova/platforms/android/cordova/lib/retry.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-'use strict';
-
-var events = require('cordova-common').events;
-
-/**
- * Retry a promise-returning function a number of times, propagating its
- * results on success or throwing its error on a failed final attempt.
- *
- * @arg {Number} attemptsLeft - The number of times to retry the passed call.
- * @arg {Function} promiseFunction - A function that returns a promise.
- * @arg {...} - Arguments to pass to promiseFunction.
- *
- * @returns {Promise}
- */
-module.exports.retryPromise = async function (attemptsLeft, promiseFunction, ...args) {
- while (true) {
- try {
- return await promiseFunction(...args);
- } catch (error) {
- if (--attemptsLeft < 1) throw error;
- events.emit('verbose', 'A retried call failed. Retrying ' + attemptsLeft + ' more time(s).');
- }
- }
-};
diff --git a/cordova/platforms/android/cordova/lib/run.js b/cordova/platforms/android/cordova/lib/run.js
deleted file mode 100644
index 174165926..000000000
--- a/cordova/platforms/android/cordova/lib/run.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var path = require('path');
-var emulator = require('./emulator');
-const target = require('./target');
-var PackageType = require('./PackageType');
-const { events } = require('cordova-common');
-
-/**
- * Builds a target spec from a runOptions object
- *
- * @param {{target?: string, device?: boolean, emulator?: boolean}} runOptions
- * @return {target.TargetSpec}
- */
-function buildTargetSpec (runOptions) {
- const spec = {};
- if (runOptions.target) {
- spec.id = runOptions.target;
- } else if (runOptions.device) {
- spec.type = 'device';
- } else if (runOptions.emulator) {
- spec.type = 'emulator';
- }
- return spec;
-}
-
-function formatResolvedTarget ({ id, type }) {
- return `${type} ${id}`;
-}
-
-/**
- * Runs the application on a device if available. If no device is found, it will
- * use a started emulator. If no started emulators are found it will attempt
- * to start an avd. If no avds are found it will error out.
- *
- * @param {Object} runOptions various run/build options. See Api.js build/run
- * methods for reference.
- *
- * @return {Promise}
- */
-module.exports.run = function (runOptions) {
- runOptions = runOptions || {};
-
- var self = this;
- const spec = buildTargetSpec(runOptions);
-
- return target.resolve(spec).then(function (resolvedTarget) {
- events.emit('log', `Deploying to ${formatResolvedTarget(resolvedTarget)}`);
-
- return new Promise((resolve) => {
- const buildOptions = require('./build').parseBuildOptions(runOptions, null, self.root);
-
- // Android app bundles cannot be deployed directly to the device
- if (buildOptions.packageType === PackageType.BUNDLE) {
- const packageTypeErrorMessage = 'Package type "bundle" is not supported during cordova run.';
- events.emit('error', packageTypeErrorMessage);
- throw packageTypeErrorMessage;
- }
-
- resolve(self._builder.fetchBuildResults(buildOptions.buildType, buildOptions.arch));
- }).then(async function (buildResults) {
- if (resolvedTarget.type === 'emulator') {
- await emulator.wait_for_boot(resolvedTarget.id);
- }
-
- return target.install(resolvedTarget, buildResults);
- });
- });
-};
-
-module.exports.help = function () {
- console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]) + ' [options]');
- console.log('Build options :');
- console.log(' --debug : Builds project in debug mode');
- console.log(' --release : Builds project in release mode');
- console.log(' --nobuild : Runs the currently built project without recompiling');
- console.log('Deploy options :');
- console.log(' --device : Will deploy the built project to a device');
- console.log(' --emulator : Will deploy the built project to an emulator if one exists');
- console.log(' --target=<target_id> : Installs to the target with the specified id.');
- process.exit(0);
-};
diff --git a/cordova/platforms/android/cordova/lib/start-emulator b/cordova/platforms/android/cordova/lib/start-emulator
deleted file mode 100755
index 20c92b70b..000000000
--- a/cordova/platforms/android/cordova/lib/start-emulator
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var emulator = require('./emulator');
-var args = process.argv;
-
-var install_target;
-if (args.length > 2) {
- if (args[2].substring(0, 9) === '--target=') {
- install_target = args[2].substring(9, args[2].length);
- } else {
- console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
- process.exit(2);
- }
-}
-
-emulator.start(install_target).catch(function (err) {
- console.error('ERROR: ' + err);
- process.exit(2);
-});
diff --git a/cordova/platforms/android/cordova/lib/start-emulator.bat b/cordova/platforms/android/cordova/lib/start-emulator.bat
deleted file mode 100644
index 82c6f8908..000000000
--- a/cordova/platforms/android/cordova/lib/start-emulator.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0start-emulator"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'start-emulator' script in 'cordova\lib' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/lib/target.js b/cordova/platforms/android/cordova/lib/target.js
deleted file mode 100644
index ea0364010..000000000
--- a/cordova/platforms/android/cordova/lib/target.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const path = require('path');
-const { inspect } = require('util');
-const Adb = require('./Adb');
-const build = require('./build');
-const emulator = require('./emulator');
-const AndroidManifest = require('./AndroidManifest');
-const { compareBy } = require('./utils');
-const { retryPromise } = require('./retry');
-const { events, CordovaError } = require('cordova-common');
-
-const INSTALL_COMMAND_TIMEOUT = 5 * 60 * 1000;
-const NUM_INSTALL_RETRIES = 3;
-const EXEC_KILL_SIGNAL = 'SIGKILL';
-
-/**
- * @typedef { 'device' | 'emulator' } TargetType
- * @typedef { { id: string, type: TargetType } } Target
- * @typedef { { id?: string, type?: TargetType } } TargetSpec
- */
-
-/**
- * Returns a list of available targets (connected devices & started emulators)
- *
- * @return {Promise<Target[]>}
- */
-exports.list = async () => {
- return (await Adb.devices())
- .map(id => ({
- id,
- type: id.startsWith('emulator-') ? 'emulator' : 'device'
- }));
-};
-
-/**
- * @param {TargetSpec?} spec
- * @return {Promise<Target>}
- */
-async function resolveToOnlineTarget (spec = {}) {
- const targetList = await exports.list();
- if (targetList.length === 0) return null;
-
- // Sort by type: devices first, then emulators.
- targetList.sort(compareBy(t => t.type));
-
- // Find first matching target for spec. {} matches any target.
- return targetList.find(target =>
- Object.keys(spec).every(k => spec[k] === target[k])
- ) || null;
-}
-
-async function isEmulatorName (name) {
- const emus = await emulator.list_images();
- return emus.some(avd => avd.name === name);
-}
-
-/**
- * @param {TargetSpec?} spec
- * @return {Promise<Target>}
- */
-async function resolveToOfflineEmulator (spec = {}) {
- if (spec.type === 'device') return null;
- if (spec.id && !(await isEmulatorName(spec.id))) return null;
-
- // try to start an emulator with name spec.id
- // if spec.id is undefined, picks best match regarding target API
- const emulatorId = await emulator.start(spec.id);
-
- return { id: emulatorId, type: 'emulator' };
-}
-
-/**
- * @param {TargetSpec?} spec
- * @return {Promise<Target & {arch: string}>}
- */
-exports.resolve = async (spec = {}) => {
- events.emit('verbose', `Trying to find target matching ${inspect(spec)}`);
-
- const resolvedTarget =
- (await resolveToOnlineTarget(spec)) ||
- (await resolveToOfflineEmulator(spec));
-
- if (!resolvedTarget) {
- throw new CordovaError(`Could not find target matching ${inspect(spec)}`);
- }
-
- return {
- ...resolvedTarget,
- arch: await build.detectArchitecture(resolvedTarget.id)
- };
-};
-
-exports.install = async function ({ id: target, arch, type }, buildResults) {
- const apk_path = build.findBestApkForArchitecture(buildResults, arch);
- const manifest = new AndroidManifest(path.join(__dirname, '../../app/src/main/AndroidManifest.xml'));
- const pkgName = manifest.getPackageId();
- const launchName = pkgName + '/.' + manifest.getActivity().getName();
-
- events.emit('log', 'Using apk: ' + apk_path);
- events.emit('log', 'Package name: ' + pkgName);
- events.emit('verbose', `Installing app on target ${target}`);
-
- async function doInstall (execOptions = {}) {
- try {
- await Adb.install(target, apk_path, { replace: true, execOptions });
- } catch (error) {
- // CB-9557 CB-10157 only uninstall and reinstall app if the one that
- // is already installed on device was signed w/different certificate
- if (!/INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES/.test(error.toString())) throw error;
-
- events.emit('warn', 'Uninstalling app from device and reinstalling it again because the ' +
- 'installed app already signed with different key');
-
- // This promise is always resolved, even if 'adb uninstall' fails to uninstall app
- // or the app doesn't installed at all, so no error catching needed.
- await Adb.uninstall(target, pkgName);
- await Adb.install(target, apk_path, { replace: true });
- }
- }
-
- if (type === 'emulator') {
- // Work around sporadic emulator hangs: http://issues.apache.org/jira/browse/CB-9119
- await retryPromise(NUM_INSTALL_RETRIES, () => doInstall({
- timeout: INSTALL_COMMAND_TIMEOUT,
- killSignal: EXEC_KILL_SIGNAL
- }));
- } else {
- await doInstall();
- }
- events.emit('log', 'INSTALL SUCCESS');
-
- events.emit('verbose', 'Unlocking screen...');
- await Adb.shell(target, 'input keyevent 82');
-
- await Adb.start(target, launchName);
- events.emit('log', 'LAUNCH SUCCESS');
-};
diff --git a/cordova/platforms/android/cordova/lib/utils.js b/cordova/platforms/android/cordova/lib/utils.js
deleted file mode 100644
index 7436cac50..000000000
--- a/cordova/platforms/android/cordova/lib/utils.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-/*
- Provides a set of utility methods, which can also be spied on during unit tests.
-*/
-
-// TODO: Perhaps this should live in cordova-common?
-
-const fs = require('fs-extra');
-const which = require('which');
-const os = require('os');
-
-/**
- * Reads, searches, and replaces the found occurences with replacementString and then writes the file back out.
- * A backup is not made.
- *
- * @param {string} file A file path to a readable & writable file
- * @param {RegExp} searchRegex The search regex
- * @param {string} replacementString The string to replace the found occurences
- * @returns void
- */
-exports.replaceFileContents = function (file, searchRegex, replacementString) {
- let contents = fs.readFileSync(file).toString();
- contents = contents.replace(searchRegex, replacementString);
- fs.writeFileSync(file, contents);
-};
-
-// Some helpers for easier sorting
-exports.compare = (a, b) => (a < b && -1) || +(a > b);
-exports.compareBy = f => (a, b) => exports.compare(f(a), f(b));
-exports.compareByAll = fns => {
- const comparators = fns.map(exports.compareBy);
- return (a, b) => {
- for (const cmp of comparators) {
- const result = cmp(a, b);
- if (result) return result;
- }
- return 0;
- };
-};
-
-exports.forgivingWhichSync = (cmd) => {
- const whichResult = which.sync(cmd, { nothrow: true });
-
- // On null, returns empty string to maintain backwards compatibility
- // realpathSync follows symlinks
- return whichResult === null ? '' : fs.realpathSync(whichResult);
-};
-
-exports.isWindows = () => os.platform() === 'win32';
-exports.isDarwin = () => os.platform() === 'darwin';
diff --git a/cordova/platforms/android/cordova/log b/cordova/platforms/android/cordova/log
deleted file mode 100755
index 216c8d767..000000000
--- a/cordova/platforms/android/cordova/log
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var log = require('./lib/log');
-var reqs = require('./lib/check_reqs');
-var args = process.argv;
-
-// Usage support for when args are given
-if (args.length > 2) {
- log.help();
-} else {
- reqs.run().then(function () {
- return log.run();
- }, function (err) {
- console.error('ERROR: ' + err);
- process.exit(2);
- });
-}
diff --git a/cordova/platforms/android/cordova/log.bat b/cordova/platforms/android/cordova/log.bat
deleted file mode 100644
index 4b2b434e5..000000000
--- a/cordova/platforms/android/cordova/log.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0log"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'log' script in 'cordova' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/loggingHelper.js b/cordova/platforms/android/cordova/loggingHelper.js
deleted file mode 100644
index 32b2ee0ad..000000000
--- a/cordova/platforms/android/cordova/loggingHelper.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var CordovaLogger = require('cordova-common').CordovaLogger;
-
-module.exports = {
- adjustLoggerLevel: function (opts) {
- if (opts instanceof Array) {
- opts.silent = opts.indexOf('--silent') !== -1;
- opts.verbose = opts.indexOf('--verbose') !== -1;
- }
-
- if (opts.silent) {
- CordovaLogger.get().setLevel('error');
- }
-
- if (opts.verbose) {
- CordovaLogger.get().setLevel('verbose');
- }
- }
-};
diff --git a/cordova/platforms/android/cordova/run b/cordova/platforms/android/cordova/run
deleted file mode 100755
index 2e7efe269..000000000
--- a/cordova/platforms/android/cordova/run
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var Api = require('./Api');
-var nopt = require('nopt');
-var path = require('path');
-
-// Support basic help commands
-if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
- require('./lib/run').help();
-}
-
-// Do some basic argument parsing
-var runOpts = nopt({
- verbose: Boolean,
- silent: Boolean,
- debug: Boolean,
- release: Boolean,
- nobuild: Boolean,
- buildConfig: path,
- archs: String,
- device: Boolean,
- emulator: Boolean,
- target: String
-}, { d: '--verbose' });
-
-// Make runOptions compatible with PlatformApi run method spec
-runOpts.argv = runOpts.argv.remain;
-
-require('./loggingHelper').adjustLoggerLevel(runOpts);
-
-new Api().run(runOpts)
- .catch(function (err) {
- console.error(err, err.stack);
- process.exit(2);
- });
diff --git a/cordova/platforms/android/cordova/run.bat b/cordova/platforms/android/cordova/run.bat
deleted file mode 100644
index b0bc28b26..000000000
--- a/cordova/platforms/android/cordova/run.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0run"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
- EXIT /B 1
-)
\ No newline at end of file
diff --git a/cordova/platforms/android/cordova/version b/cordova/platforms/android/cordova/version
deleted file mode 100755
index 00f44bbb7..000000000
--- a/cordova/platforms/android/cordova/version
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const Api = require('./Api');
-
-console.log(Api.version());
diff --git a/cordova/platforms/android/cordova/version.bat b/cordova/platforms/android/cordova/version.bat
deleted file mode 100644
index 3610c17be..000000000
--- a/cordova/platforms/android/cordova/version.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script_path="%~dp0version"
-IF EXIST %script_path% (
- node %script_path% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
- EXIT /B 1
-)
diff --git a/cordova/platforms/android/gradle.properties b/cordova/platforms/android/gradle.properties
deleted file mode 100644
index f9bb3cc65..000000000
--- a/cordova/platforms/android/gradle.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-org.gradle.daemon=true
-org.gradle.jvmargs=-Xmx2048m
-android.useAndroidX=true
-android.enableJetifier=true
-cdvMinSdkVersion=25
-cdvTargetSdkVersion=29
\ No newline at end of file
diff --git a/cordova/platforms/android/gradle/wrapper/gradle-wrapper.jar b/cordova/platforms/android/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 7454180f2..000000000
Binary files a/cordova/platforms/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties b/cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 4154807e5..000000000
--- a/cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/cordova/platforms/android/gradlew b/cordova/platforms/android/gradlew
deleted file mode 100755
index 744e882ed..000000000
--- a/cordova/platforms/android/gradlew
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/env sh
-
-#
-# Copyright 2015 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn () {
- echo "$*"
-}
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MSYS* | MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=`expr $i + 1`
- done
- case $i in
- 0) set -- ;;
- 1) set -- "$args0" ;;
- 2) set -- "$args0" "$args1" ;;
- 3) set -- "$args0" "$args1" "$args2" ;;
- 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=`save "$@"`
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-exec "$JAVACMD" "$@"
diff --git a/cordova/platforms/android/gradlew.bat b/cordova/platforms/android/gradlew.bat
deleted file mode 100644
index 107acd32c..000000000
--- a/cordova/platforms/android/gradlew.bat
+++ /dev/null
@@ -1,89 +0,0 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/cordova/platforms/android/platform_www/cordova-js-src/android/nativeapiprovider.js b/cordova/platforms/android/platform_www/cordova-js-src/android/nativeapiprovider.js
deleted file mode 100644
index 44f4aacf3..000000000
--- a/cordova/platforms/android/platform_www/cordova-js-src/android/nativeapiprovider.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/**
- * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
- */
-
-var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
-var currentApi = nativeApi;
-
-module.exports = {
- get: function () { return currentApi; },
- setPreferPrompt: function (value) {
- currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
- },
- // Used only by tests.
- set: function (value) {
- currentApi = value;
- }
-};
diff --git a/cordova/platforms/android/platform_www/cordova-js-src/android/promptbasednativeapi.js b/cordova/platforms/android/platform_www/cordova-js-src/android/promptbasednativeapi.js
deleted file mode 100644
index 86fc1d9fe..000000000
--- a/cordova/platforms/android/platform_www/cordova-js-src/android/promptbasednativeapi.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/**
- * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
- */
-
-module.exports = {
- exec: function (bridgeSecret, service, action, callbackId, argsJson) {
- return prompt(argsJson, 'gap:' + JSON.stringify([bridgeSecret, service, action, callbackId]));
- },
- setNativeToJsBridgeMode: function (bridgeSecret, value) {
- prompt(value, 'gap_bridge_mode:' + bridgeSecret);
- },
- retrieveJsMessages: function (bridgeSecret, fromOnlineEvent) {
- return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
- }
-};
diff --git a/cordova/platforms/android/platform_www/cordova-js-src/exec.js b/cordova/platforms/android/platform_www/cordova-js-src/exec.js
deleted file mode 100644
index c98212ee2..000000000
--- a/cordova/platforms/android/platform_www/cordova-js-src/exec.js
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Execute a cordova command. It is up to the native side whether this action
- * is synchronous or asynchronous. The native side can return:
- * Synchronous: PluginResult object as a JSON string
- * Asynchronous: Empty string ""
- * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
- * depending upon the result of the action.
- *
- * @param {Function} success The success callback
- * @param {Function} fail The fail callback
- * @param {String} service The name of the service to use
- * @param {String} action Action to be run in cordova
- * @param {String[]} [args] Zero or more arguments to pass to the method
- */
-var cordova = require('cordova');
-var nativeApiProvider = require('cordova/android/nativeapiprovider');
-var utils = require('cordova/utils');
-var base64 = require('cordova/base64');
-var channel = require('cordova/channel');
-var jsToNativeModes = {
- PROMPT: 0,
- JS_OBJECT: 1
-};
-var nativeToJsModes = {
- // Polls for messages using the JS->Native bridge.
- POLLING: 0,
- // For LOAD_URL to be viable, it would need to have a work-around for
- // the bug where the soft-keyboard gets dismissed when a message is sent.
- LOAD_URL: 1,
- // For the ONLINE_EVENT to be viable, it would need to intercept all event
- // listeners (both through addEventListener and window.ononline) as well
- // as set the navigator property itself.
- ONLINE_EVENT: 2,
- EVAL_BRIDGE: 3
-};
-var jsToNativeBridgeMode; // Set lazily.
-var nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE;
-var pollEnabled = false;
-var bridgeSecret = -1;
-
-var messagesFromNative = [];
-var isProcessing = false;
-var resolvedPromise = typeof Promise === 'undefined' ? null : Promise.resolve();
-var nextTick = resolvedPromise ? function (fn) { resolvedPromise.then(fn); } : function (fn) { setTimeout(fn); };
-
-function androidExec (success, fail, service, action, args) {
- if (bridgeSecret < 0) {
- // If we ever catch this firing, we'll need to queue up exec()s
- // and fire them once we get a secret. For now, I don't think
- // it's possible for exec() to be called since plugins are parsed but
- // not run until until after onNativeReady.
- throw new Error('exec() called without bridgeSecret');
- }
- // Set default bridge modes if they have not already been set.
- // By default, we use the failsafe, since addJavascriptInterface breaks too often
- if (jsToNativeBridgeMode === undefined) {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- }
-
- // If args is not provided, default to an empty array
- args = args || [];
-
- // Process any ArrayBuffers in the args into a string.
- for (var i = 0; i < args.length; i++) {
- if (utils.typeName(args[i]) === 'ArrayBuffer') {
- args[i] = base64.fromArrayBuffer(args[i]);
- }
- }
-
- var callbackId = service + cordova.callbackId++;
- var argsJson = JSON.stringify(args);
- if (success || fail) {
- cordova.callbacks[callbackId] = { success: success, fail: fail };
- }
-
- var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
- // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
- // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
- if (jsToNativeBridgeMode === jsToNativeModes.JS_OBJECT && msgs === '@Null arguments.') {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
- androidExec(success, fail, service, action, args);
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- } else if (msgs) {
- messagesFromNative.push(msgs);
- // Always process async to avoid exceptions messing up stack.
- nextTick(processMessages);
- }
-}
-
-androidExec.init = function () {
- bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
- channel.onNativeReady.fire();
-};
-
-function pollOnceFromOnlineEvent () {
- pollOnce(true);
-}
-
-function pollOnce (opt_fromOnlineEvent) {
- if (bridgeSecret < 0) {
- // This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
- // We know there's nothing to retrieve, so no need to poll.
- return;
- }
- var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
- if (msgs) {
- messagesFromNative.push(msgs);
- // Process sync since we know we're already top-of-stack.
- processMessages();
- }
-}
-
-function pollingTimerFunc () {
- if (pollEnabled) {
- pollOnce();
- setTimeout(pollingTimerFunc, 50);
- }
-}
-
-function hookOnlineApis () {
- function proxyEvent (e) {
- cordova.fireWindowEvent(e.type);
- }
- // The network module takes care of firing online and offline events.
- // It currently fires them only on document though, so we bridge them
- // to window here (while first listening for exec()-releated online/offline
- // events).
- window.addEventListener('online', pollOnceFromOnlineEvent, false);
- window.addEventListener('offline', pollOnceFromOnlineEvent, false);
- cordova.addWindowEventHandler('online');
- cordova.addWindowEventHandler('offline');
- document.addEventListener('online', proxyEvent, false);
- document.addEventListener('offline', proxyEvent, false);
-}
-
-hookOnlineApis();
-
-androidExec.jsToNativeModes = jsToNativeModes;
-androidExec.nativeToJsModes = nativeToJsModes;
-
-androidExec.setJsToNativeBridgeMode = function (mode) {
- if (mode === jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
- mode = jsToNativeModes.PROMPT;
- }
- nativeApiProvider.setPreferPrompt(mode === jsToNativeModes.PROMPT);
- jsToNativeBridgeMode = mode;
-};
-
-androidExec.setNativeToJsBridgeMode = function (mode) {
- if (mode === nativeToJsBridgeMode) {
- return;
- }
- if (nativeToJsBridgeMode === nativeToJsModes.POLLING) {
- pollEnabled = false;
- }
-
- nativeToJsBridgeMode = mode;
- // Tell the native side to switch modes.
- // Otherwise, it will be set by androidExec.init()
- if (bridgeSecret >= 0) {
- nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
- }
-
- if (mode === nativeToJsModes.POLLING) {
- pollEnabled = true;
- setTimeout(pollingTimerFunc, 1);
- }
-};
-
-function buildPayload (payload, message) {
- var payloadKind = message.charAt(0);
- if (payloadKind === 's') {
- payload.push(message.slice(1));
- } else if (payloadKind === 't') {
- payload.push(true);
- } else if (payloadKind === 'f') {
- payload.push(false);
- } else if (payloadKind === 'N') {
- payload.push(null);
- } else if (payloadKind === 'n') {
- payload.push(+message.slice(1));
- } else if (payloadKind === 'A') {
- var data = message.slice(1);
- payload.push(base64.toArrayBuffer(data));
- } else if (payloadKind === 'S') {
- payload.push(window.atob(message.slice(1)));
- } else if (payloadKind === 'M') {
- var multipartMessages = message.slice(1);
- while (multipartMessages !== '') {
- var spaceIdx = multipartMessages.indexOf(' ');
- var msgLen = +multipartMessages.slice(0, spaceIdx);
- var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
- multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
- buildPayload(payload, multipartMessage);
- }
- } else {
- payload.push(JSON.parse(message));
- }
-}
-
-// Processes a single message, as encoded by NativeToJsMessageQueue.java.
-function processMessage (message) {
- var firstChar = message.charAt(0);
- if (firstChar === 'J') {
- // This is deprecated on the .java side. It doesn't work with CSP enabled.
- // eslint-disable-next-line no-eval
- eval(message.slice(1));
- } else if (firstChar === 'S' || firstChar === 'F') {
- var success = firstChar === 'S';
- var keepCallback = message.charAt(1) === '1';
- var spaceIdx = message.indexOf(' ', 2);
- var status = +message.slice(2, spaceIdx);
- var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
- var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
- var payloadMessage = message.slice(nextSpaceIdx + 1);
- var payload = [];
- buildPayload(payload, payloadMessage);
- cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
- } else {
- console.log('processMessage failed: invalid message: ' + JSON.stringify(message));
- }
-}
-
-function processMessages () {
- // Check for the reentrant case.
- if (isProcessing) {
- return;
- }
- if (messagesFromNative.length === 0) {
- return;
- }
- isProcessing = true;
- try {
- var msg = popMessageFromQueue();
- // The Java side can send a * message to indicate that it
- // still has messages waiting to be retrieved.
- if (msg === '*' && messagesFromNative.length === 0) {
- nextTick(pollOnce);
- return;
- }
- processMessage(msg);
- } finally {
- isProcessing = false;
- if (messagesFromNative.length > 0) {
- nextTick(processMessages);
- }
- }
-}
-
-function popMessageFromQueue () {
- var messageBatch = messagesFromNative.shift();
- if (messageBatch === '*') {
- return '*';
- }
-
- var spaceIdx = messageBatch.indexOf(' ');
- var msgLen = +messageBatch.slice(0, spaceIdx);
- var message = messageBatch.substr(spaceIdx + 1, msgLen);
- messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
- if (messageBatch) {
- messagesFromNative.unshift(messageBatch);
- }
- return message;
-}
-
-module.exports = androidExec;
diff --git a/cordova/platforms/android/platform_www/cordova-js-src/platform.js b/cordova/platforms/android/platform_www/cordova-js-src/platform.js
deleted file mode 100644
index 14eddd7f7..000000000
--- a/cordova/platforms/android/platform_www/cordova-js-src/platform.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// The last resume event that was received that had the result of a plugin call.
-var lastResumeEvent = null;
-
-module.exports = {
- id: 'android',
- bootstrap: function () {
- var channel = require('cordova/channel');
- var cordova = require('cordova');
- var exec = require('cordova/exec');
- var modulemapper = require('cordova/modulemapper');
-
- // Get the shared secret needed to use the bridge.
- exec.init();
-
- // TODO: Extract this as a proper plugin.
- modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
-
- var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
- // Inject a listener for the backbutton on the document.
- var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
- backButtonChannel.onHasSubscribersChange = function () {
- // If we just attached the first handler or detached the last handler,
- // let native know we need to override the back button.
- exec(null, null, APP_PLUGIN_NAME, 'overrideBackbutton', [this.numHandlers === 1]);
- };
-
- // Add hardware MENU and SEARCH button handlers
- cordova.addDocumentEventHandler('menubutton');
- cordova.addDocumentEventHandler('searchbutton');
-
- function bindButtonChannel (buttonName) {
- // generic button bind used for volumeup/volumedown buttons
- var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
- volumeButtonChannel.onHasSubscribersChange = function () {
- exec(null, null, APP_PLUGIN_NAME, 'overrideButton', [buttonName, this.numHandlers === 1]);
- };
- }
- // Inject a listener for the volume buttons on the document.
- bindButtonChannel('volumeup');
- bindButtonChannel('volumedown');
-
- // The resume event is not "sticky", but it is possible that the event
- // will contain the result of a plugin call. We need to ensure that the
- // plugin result is delivered even after the event is fired (CB-10498)
- var cordovaAddEventListener = document.addEventListener;
-
- document.addEventListener = function (evt, handler, capture) {
- cordovaAddEventListener(evt, handler, capture);
-
- if (evt === 'resume' && lastResumeEvent) {
- handler(lastResumeEvent);
- }
- };
-
- // Let native code know we are all done on the JS side.
- // Native code will then un-hide the WebView.
- channel.onCordovaReady.subscribe(function () {
- exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
- exec(null, null, APP_PLUGIN_NAME, 'show', []);
- });
- }
-};
-
-function onMessageFromNative (msg) {
- var cordova = require('cordova');
- var action = msg.action;
-
- switch (action) {
- // pause and resume are Android app life cycle events
- case 'backbutton':
- case 'menubutton':
- case 'searchbutton':
- case 'pause':
- case 'volumedownbutton':
- case 'volumeupbutton':
- cordova.fireDocumentEvent(action);
- break;
- case 'resume':
- if (arguments.length > 1 && msg.pendingResult) {
- if (arguments.length === 2) {
- msg.pendingResult.result = arguments[1];
- } else {
- // The plugin returned a multipart message
- var res = [];
- for (var i = 1; i < arguments.length; i++) {
- res.push(arguments[i]);
- }
- msg.pendingResult.result = res;
- }
-
- // Save the plugin result so that it can be delivered to the js
- // even if they miss the initial firing of the event
- lastResumeEvent = msg;
- }
- cordova.fireDocumentEvent(action, msg);
- break;
- default:
- throw new Error('Unknown event action ' + action);
- }
-}
diff --git a/cordova/platforms/android/platform_www/cordova-js-src/plugin/android/app.js b/cordova/platforms/android/platform_www/cordova-js-src/plugin/android/app.js
deleted file mode 100644
index 027ce31b1..000000000
--- a/cordova/platforms/android/platform_www/cordova-js-src/plugin/android/app.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
-module.exports = {
- /**
- * Clear the resource cache.
- */
- clearCache: function () {
- exec(null, null, APP_PLUGIN_NAME, 'clearCache', []);
- },
-
- /**
- * Load the url into the webview or into new browser instance.
- *
- * @param url The URL to load
- * @param props Properties that can be passed in to the activity:
- * wait: int => wait msec before loading URL
- * loadingDialog: "Title,Message" => display a native loading dialog
- * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
- * clearHistory: boolean => clear webview history (default=false)
- * openExternal: boolean => open in a new browser (default=false)
- *
- * Example:
- * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
- */
- loadUrl: function (url, props) {
- exec(null, null, APP_PLUGIN_NAME, 'loadUrl', [url, props]);
- },
-
- /**
- * Cancel loadUrl that is waiting to be loaded.
- */
- cancelLoadUrl: function () {
- exec(null, null, APP_PLUGIN_NAME, 'cancelLoadUrl', []);
- },
-
- /**
- * Clear web history in this web view.
- * Instead of BACK button loading the previous web page, it will exit the app.
- */
- clearHistory: function () {
- exec(null, null, APP_PLUGIN_NAME, 'clearHistory', []);
- },
-
- /**
- * Go to previous page displayed.
- * This is the same as pressing the backbutton on Android device.
- */
- backHistory: function () {
- exec(null, null, APP_PLUGIN_NAME, 'backHistory', []);
- },
-
- /**
- * Override the default behavior of the Android back button.
- * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "backbutton" event, this is automatically done.
- *
- * @param override T=override, F=cancel override
- */
- overrideBackbutton: function (override) {
- exec(null, null, APP_PLUGIN_NAME, 'overrideBackbutton', [override]);
- },
-
- /**
- * Override the default behavior of the Android volume button.
- * If overridden, when the volume button is pressed, the "volume[up|down]button"
- * JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "volume[up|down]button" event, this is automatically done.
- *
- * @param button volumeup, volumedown
- * @param override T=override, F=cancel override
- */
- overrideButton: function (button, override) {
- exec(null, null, APP_PLUGIN_NAME, 'overrideButton', [button, override]);
- },
-
- /**
- * Exit and terminate the application.
- */
- exitApp: function () {
- return exec(null, null, APP_PLUGIN_NAME, 'exitApp', []);
- }
-};
diff --git a/cordova/platforms/android/platform_www/cordova.js b/cordova/platforms/android/platform_www/cordova.js
deleted file mode 100644
index 4154b29c2..000000000
--- a/cordova/platforms/android/platform_www/cordova.js
+++ /dev/null
@@ -1,1904 +0,0 @@
-// Platform: android
-// cordova-js rel/6.0.0-10-g07379820
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '9.1.0';
-// file: src/scripts/require.js
-var require;
-var define;
-
-(function () {
- var modules = {};
- // Stack of moduleIds currently being built.
- var requireStack = [];
- // Map of module ID -> index into requireStack of modules currently being built.
- var inProgressModules = {};
- var SEPARATOR = '.';
-
- function build (module) {
- var factory = module.factory;
- var localRequire = function (id) {
- var resultantId = id;
- // Its a relative path, so lop off the last portion and add the id (minus "./")
- if (id.charAt(0) === '.') {
- resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
- }
- return require(resultantId);
- };
- module.exports = {};
- delete module.factory;
- factory(localRequire, module.exports, module);
- return module.exports;
- }
-
- require = function (id) {
- if (!modules[id]) {
- throw new Error('module ' + id + ' not found');
- } else if (id in inProgressModules) {
- var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
- throw new Error('Cycle in require graph: ' + cycle);
- }
- if (modules[id].factory) {
- try {
- inProgressModules[id] = requireStack.length;
- requireStack.push(id);
- return build(modules[id]);
- } finally {
- delete inProgressModules[id];
- requireStack.pop();
- }
- }
- return modules[id].exports;
- };
-
- define = function (id, factory) {
- if (Object.prototype.hasOwnProperty.call(modules, id)) {
- throw new Error('module ' + id + ' already defined');
- }
-
- modules[id] = {
- id: id,
- factory: factory
- };
- };
-
- define.remove = function (id) {
- delete modules[id];
- };
-
- define.moduleMap = modules;
-})();
-
-// Export for use in node
-if (typeof module === 'object' && typeof require === 'function') {
- module.exports.require = require;
- module.exports.define = define;
-}
-
-// file: src/cordova.js
-define("cordova", function(require, exports, module) {
-
-// Workaround for Windows 10 in hosted environment case
-// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
-if (window.cordova && !(window.cordova instanceof HTMLElement)) {
- throw new Error('cordova already defined');
-}
-
-var channel = require('cordova/channel');
-var platform = require('cordova/platform');
-
-/**
- * Intercept calls to addEventListener + removeEventListener and handle deviceready,
- * resume, and pause events.
- */
-var m_document_addEventListener = document.addEventListener;
-var m_document_removeEventListener = document.removeEventListener;
-var m_window_addEventListener = window.addEventListener;
-var m_window_removeEventListener = window.removeEventListener;
-
-/**
- * Houses custom event handlers to intercept on document + window event listeners.
- */
-var documentEventHandlers = {};
-var windowEventHandlers = {};
-
-document.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].subscribe(handler);
- } else {
- m_document_addEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].subscribe(handler);
- } else {
- m_window_addEventListener.call(window, evt, handler, capture);
- }
-};
-
-document.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].unsubscribe(handler);
- } else {
- m_document_removeEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].unsubscribe(handler);
- } else {
- m_window_removeEventListener.call(window, evt, handler, capture);
- }
-};
-
-function createEvent (type, data) {
- var event = document.createEvent('Events');
- event.initEvent(type, false, false);
- if (data) {
- for (var i in data) {
- if (Object.prototype.hasOwnProperty.call(data, i)) {
- event[i] = data[i];
- }
- }
- }
- return event;
-}
-
-var cordova = {
- define: define,
- require: require,
- version: PLATFORM_VERSION_BUILD_LABEL,
- platformVersion: PLATFORM_VERSION_BUILD_LABEL,
- platformId: platform.id,
-
- /**
- * Methods to add/remove your own addEventListener hijacking on document + window.
- */
- addWindowEventHandler: function (event) {
- return (windowEventHandlers[event] = channel.create(event));
- },
- addStickyDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.createSticky(event));
- },
- addDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.create(event));
- },
- removeWindowEventHandler: function (event) {
- delete windowEventHandlers[event];
- },
- removeDocumentEventHandler: function (event) {
- delete documentEventHandlers[event];
- },
-
- /**
- * Retrieve original event handlers that were replaced by Cordova
- *
- * @return object
- */
- getOriginalHandlers: function () {
- return {
- document: {
- addEventListener: m_document_addEventListener,
- removeEventListener: m_document_removeEventListener
- },
- window: {
- addEventListener: m_window_addEventListener,
- removeEventListener: m_window_removeEventListener
- }
- };
- },
-
- /**
- * Method to fire event from native code
- * bNoDetach is required for events which cause an exception which needs to be caught in native code
- */
- fireDocumentEvent: function (type, data, bNoDetach) {
- var evt = createEvent(type, data);
- if (typeof documentEventHandlers[type] !== 'undefined') {
- if (bNoDetach) {
- documentEventHandlers[type].fire(evt);
- } else {
- setTimeout(function () {
- // Fire deviceready on listeners that were registered before cordova.js was loaded.
- if (type === 'deviceready') {
- document.dispatchEvent(evt);
- }
- documentEventHandlers[type].fire(evt);
- }, 0);
- }
- } else {
- document.dispatchEvent(evt);
- }
- },
-
- fireWindowEvent: function (type, data) {
- var evt = createEvent(type, data);
- if (typeof windowEventHandlers[type] !== 'undefined') {
- setTimeout(function () {
- windowEventHandlers[type].fire(evt);
- }, 0);
- } else {
- window.dispatchEvent(evt);
- }
- },
-
- /**
- * Plugin callback mechanism.
- */
- // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
- // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
- callbackId: Math.floor(Math.random() * 2000000000),
- callbacks: {},
- callbackStatus: {
- NO_RESULT: 0,
- OK: 1,
- CLASS_NOT_FOUND_EXCEPTION: 2,
- ILLEGAL_ACCESS_EXCEPTION: 3,
- INSTANTIATION_EXCEPTION: 4,
- MALFORMED_URL_EXCEPTION: 5,
- IO_EXCEPTION: 6,
- INVALID_ACTION: 7,
- JSON_EXCEPTION: 8,
- ERROR: 9
- },
-
- /**
- * Called by native code when returning successful result from an action.
- */
- callbackSuccess: function (callbackId, args) {
- cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning error result from an action.
- */
- callbackError: function (callbackId, args) {
- // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
- // Derive success from status.
- cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning the result from an action.
- */
- callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) {
- try {
- var callback = cordova.callbacks[callbackId];
- if (callback) {
- if (isSuccess && status === cordova.callbackStatus.OK) {
- callback.success && callback.success.apply(null, args);
- } else if (!isSuccess) {
- callback.fail && callback.fail.apply(null, args);
- }
- /*
- else
- Note, this case is intentionally not caught.
- this can happen if isSuccess is true, but callbackStatus is NO_RESULT
- which is used to remove a callback from the list without calling the callbacks
- typically keepCallback is false in this case
- */
- // Clear callback if not expecting any more results
- if (!keepCallback) {
- delete cordova.callbacks[callbackId];
- }
- }
- } catch (err) {
- var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
- cordova.fireWindowEvent('cordovacallbackerror', { message: msg, error: err });
- throw err;
- }
- },
-
- addConstructor: function (func) {
- channel.onCordovaReady.subscribe(function () {
- try {
- func();
- } catch (e) {
- console.log('Failed to run constructor: ' + e);
- }
- });
- }
-};
-
-module.exports = cordova;
-
-});
-
-// file: ../cordova-android/cordova-js-src/android/nativeapiprovider.js
-define("cordova/android/nativeapiprovider", function(require, exports, module) {
-
-/**
- * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
- */
-
-var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
-var currentApi = nativeApi;
-
-module.exports = {
- get: function () { return currentApi; },
- setPreferPrompt: function (value) {
- currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
- },
- // Used only by tests.
- set: function (value) {
- currentApi = value;
- }
-};
-
-});
-
-// file: ../cordova-android/cordova-js-src/android/promptbasednativeapi.js
-define("cordova/android/promptbasednativeapi", function(require, exports, module) {
-
-/**
- * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
- */
-
-module.exports = {
- exec: function (bridgeSecret, service, action, callbackId, argsJson) {
- return prompt(argsJson, 'gap:' + JSON.stringify([bridgeSecret, service, action, callbackId]));
- },
- setNativeToJsBridgeMode: function (bridgeSecret, value) {
- prompt(value, 'gap_bridge_mode:' + bridgeSecret);
- },
- retrieveJsMessages: function (bridgeSecret, fromOnlineEvent) {
- return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
- }
-};
-
-});
-
-// file: src/common/argscheck.js
-define("cordova/argscheck", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-var moduleExports = module.exports;
-
-var typeMap = {
- A: 'Array',
- D: 'Date',
- N: 'Number',
- S: 'String',
- F: 'Function',
- O: 'Object'
-};
-
-function extractParamName (callee, argIndex) {
- return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex];
-}
-
-/**
- * Checks the given arguments' types and throws if they are not as expected.
- *
- * `spec` is a string where each character stands for the required type of the
- * argument at the same position. In other words: the character at `spec[i]`
- * specifies the required type for `args[i]`. The characters in `spec` are the
- * first letter of the required type's name. The supported types are:
- *
- * Array, Date, Number, String, Function, Object
- *
- * Lowercase characters specify arguments that must not be `null` or `undefined`
- * while uppercase characters allow those values to be passed.
- *
- * Finally, `*` can be used to allow any type at the corresponding position.
- *
- * @example
- * function foo (arr, opts) {
- * // require `arr` to be an Array and `opts` an Object, null or undefined
- * checkArgs('aO', 'my.package.foo', arguments);
- * // ...
- * }
- * @param {String} spec - the type specification for `args` as described above
- * @param {String} functionName - full name of the callee.
- * Used in the error message
- * @param {Array|arguments} args - the arguments to be checked against `spec`
- * @param {Function} [opt_callee=args.callee] - the recipient of `args`.
- * Used to extract parameter names for the error message
- * @throws {TypeError} if args do not satisfy spec
- */
-function checkArgs (spec, functionName, args, opt_callee) {
- if (!moduleExports.enableChecks) {
- return;
- }
- var errMsg = null;
- var typeName;
- for (var i = 0; i < spec.length; ++i) {
- var c = spec.charAt(i);
- var cUpper = c.toUpperCase();
- var arg = args[i];
- // Asterix means allow anything.
- if (c === '*') {
- continue;
- }
- typeName = utils.typeName(arg);
- if ((arg === null || arg === undefined) && c === cUpper) {
- continue;
- }
- if (typeName !== typeMap[cUpper]) {
- errMsg = 'Expected ' + typeMap[cUpper];
- break;
- }
- }
- if (errMsg) {
- errMsg += ', but got ' + typeName + '.';
- errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
- // Don't log when running unit tests.
- if (typeof jasmine === 'undefined') {
- console.error(errMsg);
- }
- throw TypeError(errMsg);
- }
-}
-
-function getValue (value, defaultValue) {
- return value === undefined ? defaultValue : value;
-}
-
-moduleExports.checkArgs = checkArgs;
-moduleExports.getValue = getValue;
-moduleExports.enableChecks = true;
-
-});
-
-// file: src/common/base64.js
-define("cordova/base64", function(require, exports, module) {
-
-var base64 = exports;
-
-base64.fromArrayBuffer = function (arrayBuffer) {
- var array = new Uint8Array(arrayBuffer);
- return uint8ToBase64(array);
-};
-
-base64.toArrayBuffer = function (str) {
- var decodedStr = atob(str);
- var arrayBuffer = new ArrayBuffer(decodedStr.length);
- var array = new Uint8Array(arrayBuffer);
- for (var i = 0, len = decodedStr.length; i < len; i++) {
- array[i] = decodedStr.charCodeAt(i);
- }
- return arrayBuffer;
-};
-
-// ------------------------------------------------------------------------------
-
-/* This code is based on the performance tests at http://jsperf.com/b64tests
- * This 12-bit-at-a-time algorithm was the best performing version on all
- * platforms tested.
- */
-
-var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
-var b64_12bit;
-
-var b64_12bitTable = function () {
- b64_12bit = [];
- for (var i = 0; i < 64; i++) {
- for (var j = 0; j < 64; j++) {
- b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j];
- }
- }
- b64_12bitTable = function () { return b64_12bit; };
- return b64_12bit;
-};
-
-function uint8ToBase64 (rawData) {
- var numBytes = rawData.byteLength;
- var output = '';
- var segment;
- var table = b64_12bitTable();
- for (var i = 0; i < numBytes - 2; i += 3) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2];
- output += table[segment >> 12];
- output += table[segment & 0xfff];
- }
- if (numBytes - i === 2) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8);
- output += table[segment >> 12];
- output += b64_6bit[(segment & 0xfff) >> 6];
- output += '=';
- } else if (numBytes - i === 1) {
- segment = (rawData[i] << 16);
- output += table[segment >> 12];
- output += '==';
- }
- return output;
-}
-
-});
-
-// file: src/common/builder.js
-define("cordova/builder", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-function each (objects, func, context) {
- for (var prop in objects) {
- if (Object.prototype.hasOwnProperty.call(objects, prop)) {
- func.apply(context, [objects[prop], prop]);
- }
- }
-}
-
-function clobber (obj, key, value) {
- var needsProperty = false;
- try {
- obj[key] = value;
- } catch (e) {
- needsProperty = true;
- }
- // Getters can only be overridden by getters.
- if (needsProperty || obj[key] !== value) {
- utils.defineGetter(obj, key, function () {
- return value;
- });
- }
-}
-
-function assignOrWrapInDeprecateGetter (obj, key, value, message) {
- if (message) {
- utils.defineGetter(obj, key, function () {
- console.log(message);
- delete obj[key];
- clobber(obj, key, value);
- return value;
- });
- } else {
- clobber(obj, key, value);
- }
-}
-
-function include (parent, objects, clobber, merge) {
- each(objects, function (obj, key) {
- try {
- var result = obj.path ? require(obj.path) : {};
-
- if (clobber) {
- // Clobber if it doesn't exist.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (typeof obj.path !== 'undefined') {
- // If merging, merge properties onto parent, otherwise, clobber.
- if (merge) {
- recursiveMerge(parent[key], result);
- } else {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- }
- }
- result = parent[key];
- } else {
- // Overwrite if not currently defined.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else {
- // Set result to what already exists, so we can build children into it if they exist.
- result = parent[key];
- }
- }
-
- if (obj.children) {
- include(result, obj.children, clobber, merge);
- }
- } catch (e) {
- utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
- }
- });
-}
-
-/**
- * Merge properties from one object onto another recursively. Properties from
- * the src object will overwrite existing target property.
- *
- * @param target Object to merge properties into.
- * @param src Object to merge properties from.
- */
-function recursiveMerge (target, src) {
- for (var prop in src) {
- if (Object.prototype.hasOwnProperty.call(src, prop)) {
- if (target.prototype && target.prototype.constructor === target) {
- // If the target object is a constructor override off prototype.
- clobber(target.prototype, prop, src[prop]);
- } else {
- if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
- recursiveMerge(target[prop], src[prop]);
- } else {
- clobber(target, prop, src[prop]);
- }
- }
- }
- }
-}
-
-exports.buildIntoButDoNotClobber = function (objects, target) {
- include(target, objects, false, false);
-};
-exports.buildIntoAndClobber = function (objects, target) {
- include(target, objects, true, false);
-};
-exports.buildIntoAndMerge = function (objects, target) {
- include(target, objects, true, true);
-};
-exports.recursiveMerge = recursiveMerge;
-exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
-
-});
-
-// file: src/common/channel.js
-define("cordova/channel", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-var nextGuid = 1;
-
-/**
- * Custom pub-sub "channel" that can have functions subscribed to it
- * This object is used to define and control firing of events for
- * cordova initialization, as well as for custom events thereafter.
- *
- * The order of events during page load and Cordova startup is as follows:
- *
- * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed.
- * onNativeReady* Internal event that indicates the Cordova native side is ready.
- * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created.
- * onDeviceReady* User event fired to indicate that Cordova is ready
- * onResume User event fired to indicate a start/resume lifecycle event
- * onPause User event fired to indicate a pause lifecycle event
- *
- * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
- * All listeners that subscribe after the event is fired will be executed right away.
- *
- * The only Cordova events that user code should register for are:
- * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
- * pause App has moved to background
- * resume App has returned to foreground
- *
- * Listeners can be registered as:
- * document.addEventListener("deviceready", myDeviceReadyListener, false);
- * document.addEventListener("resume", myResumeListener, false);
- * document.addEventListener("pause", myPauseListener, false);
- *
- * The DOM lifecycle events should be used for saving and restoring state
- * window.onload
- * window.onunload
- *
- */
-
-/**
- * Channel
- * @constructor
- * @param type String the channel name
- */
-var Channel = function (type, sticky) {
- this.type = type;
- // Map of guid -> function.
- this.handlers = {};
- // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
- this.state = sticky ? 1 : 0;
- // Used in sticky mode to remember args passed to fire().
- this.fireArgs = null;
- // Used by onHasSubscribersChange to know if there are any listeners.
- this.numHandlers = 0;
- // Function that is called when the first listener is subscribed, or when
- // the last listener is unsubscribed.
- this.onHasSubscribersChange = null;
-};
-var channel = {
- /**
- * Calls the provided function only after all of the channels specified
- * have been fired. All channels must be sticky channels.
- */
- join: function (h, c) {
- var len = c.length;
- var i = len;
- var f = function () {
- if (!(--i)) h();
- };
- for (var j = 0; j < len; j++) {
- if (c[j].state === 0) {
- throw Error('Can only use join with sticky channels.');
- }
- c[j].subscribe(f);
- }
- if (!len) h();
- },
-
- create: function (type) {
- return (channel[type] = new Channel(type, false));
- },
- createSticky: function (type) {
- return (channel[type] = new Channel(type, true));
- },
-
- /**
- * cordova Channels that must fire before "deviceready" is fired.
- */
- deviceReadyChannelsArray: [],
- deviceReadyChannelsMap: {},
-
- /**
- * Indicate that a feature needs to be initialized before it is ready to be used.
- * This holds up Cordova's "deviceready" event until the feature has been initialized
- * and Cordova.initComplete(feature) is called.
- *
- * @param feature {String} The unique feature name
- */
- waitForInitialization: function (feature) {
- if (feature) {
- var c = channel[feature] || this.createSticky(feature);
- this.deviceReadyChannelsMap[feature] = c;
- this.deviceReadyChannelsArray.push(c);
- }
- },
-
- /**
- * Indicate that initialization code has completed and the feature is ready to be used.
- *
- * @param feature {String} The unique feature name
- */
- initializationComplete: function (feature) {
- var c = this.deviceReadyChannelsMap[feature];
- if (c) {
- c.fire();
- }
- }
-};
-
-function checkSubscriptionArgument (argument) {
- if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') {
- throw new Error(
- 'Must provide a function or an EventListener object ' +
- 'implementing the handleEvent interface.'
- );
- }
-}
-
-/**
- * Subscribes the given function to the channel. Any time that
- * Channel.fire is called so too will the function.
- * Optionally specify an execution context for the function
- * and a guid that can be used to stop subscribing to the channel.
- * Returns the guid.
- */
-Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- eventListener = eventListenerOrFunction;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- if (this.state === 2) {
- handleEvent.apply(eventListener || this, this.fireArgs);
- return;
- }
-
- guid = eventListenerOrFunction.observer_guid;
- if (typeof eventListener === 'object') {
- handleEvent = utils.close(eventListener, handleEvent);
- }
-
- if (!guid) {
- // First time any channel has seen this subscriber
- guid = '' + nextGuid++;
- }
- handleEvent.observer_guid = guid;
- eventListenerOrFunction.observer_guid = guid;
-
- // Don't add the same handler more than once.
- if (!this.handlers[guid]) {
- this.handlers[guid] = handleEvent;
- this.numHandlers++;
- if (this.numHandlers === 1) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Unsubscribes the function with the given guid from the channel.
- */
-Channel.prototype.unsubscribe = function (eventListenerOrFunction) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid, handler;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- guid = handleEvent.observer_guid;
- handler = this.handlers[guid];
- if (handler) {
- delete this.handlers[guid];
- this.numHandlers--;
- if (this.numHandlers === 0) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Calls all functions subscribed to this channel.
- */
-Channel.prototype.fire = function (e) {
- var fireArgs = Array.prototype.slice.call(arguments);
- // Apply stickiness.
- if (this.state === 1) {
- this.state = 2;
- this.fireArgs = fireArgs;
- }
- if (this.numHandlers) {
- // Copy the values first so that it is safe to modify it from within
- // callbacks.
- var toCall = [];
- for (var item in this.handlers) {
- toCall.push(this.handlers[item]);
- }
- for (var i = 0; i < toCall.length; ++i) {
- toCall[i].apply(this, fireArgs);
- }
- if (this.state === 2 && this.numHandlers) {
- this.numHandlers = 0;
- this.handlers = {};
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-// defining them here so they are ready super fast!
-// DOM event that is received when the web page is loaded and parsed.
-channel.createSticky('onDOMContentLoaded');
-
-// Event to indicate the Cordova native side is ready.
-channel.createSticky('onNativeReady');
-
-// Event to indicate that all Cordova JavaScript objects have been created
-// and it's time to run plugin constructors.
-channel.createSticky('onCordovaReady');
-
-// Event to indicate that all automatically loaded JS plugins are loaded and ready.
-// FIXME remove this
-channel.createSticky('onPluginsReady');
-
-// Event to indicate that Cordova is ready
-channel.createSticky('onDeviceReady');
-
-// Event to indicate a resume lifecycle event
-channel.create('onResume');
-
-// Event to indicate a pause lifecycle event
-channel.create('onPause');
-
-// Channels that must fire before "deviceready" is fired.
-channel.waitForInitialization('onCordovaReady');
-channel.waitForInitialization('onDOMContentLoaded');
-
-module.exports = channel;
-
-});
-
-// file: ../cordova-android/cordova-js-src/exec.js
-define("cordova/exec", function(require, exports, module) {
-
-/**
- * Execute a cordova command. It is up to the native side whether this action
- * is synchronous or asynchronous. The native side can return:
- * Synchronous: PluginResult object as a JSON string
- * Asynchronous: Empty string ""
- * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
- * depending upon the result of the action.
- *
- * @param {Function} success The success callback
- * @param {Function} fail The fail callback
- * @param {String} service The name of the service to use
- * @param {String} action Action to be run in cordova
- * @param {String[]} [args] Zero or more arguments to pass to the method
- */
-var cordova = require('cordova');
-var nativeApiProvider = require('cordova/android/nativeapiprovider');
-var utils = require('cordova/utils');
-var base64 = require('cordova/base64');
-var channel = require('cordova/channel');
-var jsToNativeModes = {
- PROMPT: 0,
- JS_OBJECT: 1
-};
-var nativeToJsModes = {
- // Polls for messages using the JS->Native bridge.
- POLLING: 0,
- // For LOAD_URL to be viable, it would need to have a work-around for
- // the bug where the soft-keyboard gets dismissed when a message is sent.
- LOAD_URL: 1,
- // For the ONLINE_EVENT to be viable, it would need to intercept all event
- // listeners (both through addEventListener and window.ononline) as well
- // as set the navigator property itself.
- ONLINE_EVENT: 2,
- EVAL_BRIDGE: 3
-};
-var jsToNativeBridgeMode; // Set lazily.
-var nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE;
-var pollEnabled = false;
-var bridgeSecret = -1;
-
-var messagesFromNative = [];
-var isProcessing = false;
-var resolvedPromise = typeof Promise === 'undefined' ? null : Promise.resolve();
-var nextTick = resolvedPromise ? function (fn) { resolvedPromise.then(fn); } : function (fn) { setTimeout(fn); };
-
-function androidExec (success, fail, service, action, args) {
- if (bridgeSecret < 0) {
- // If we ever catch this firing, we'll need to queue up exec()s
- // and fire them once we get a secret. For now, I don't think
- // it's possible for exec() to be called since plugins are parsed but
- // not run until until after onNativeReady.
- throw new Error('exec() called without bridgeSecret');
- }
- // Set default bridge modes if they have not already been set.
- // By default, we use the failsafe, since addJavascriptInterface breaks too often
- if (jsToNativeBridgeMode === undefined) {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- }
-
- // If args is not provided, default to an empty array
- args = args || [];
-
- // Process any ArrayBuffers in the args into a string.
- for (var i = 0; i < args.length; i++) {
- if (utils.typeName(args[i]) === 'ArrayBuffer') {
- args[i] = base64.fromArrayBuffer(args[i]);
- }
- }
-
- var callbackId = service + cordova.callbackId++;
- var argsJson = JSON.stringify(args);
- if (success || fail) {
- cordova.callbacks[callbackId] = { success: success, fail: fail };
- }
-
- var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
- // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
- // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
- if (jsToNativeBridgeMode === jsToNativeModes.JS_OBJECT && msgs === '@Null arguments.') {
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
- androidExec(success, fail, service, action, args);
- androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- } else if (msgs) {
- messagesFromNative.push(msgs);
- // Always process async to avoid exceptions messing up stack.
- nextTick(processMessages);
- }
-}
-
-androidExec.init = function () {
- bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
- channel.onNativeReady.fire();
-};
-
-function pollOnceFromOnlineEvent () {
- pollOnce(true);
-}
-
-function pollOnce (opt_fromOnlineEvent) {
- if (bridgeSecret < 0) {
- // This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
- // We know there's nothing to retrieve, so no need to poll.
- return;
- }
- var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
- if (msgs) {
- messagesFromNative.push(msgs);
- // Process sync since we know we're already top-of-stack.
- processMessages();
- }
-}
-
-function pollingTimerFunc () {
- if (pollEnabled) {
- pollOnce();
- setTimeout(pollingTimerFunc, 50);
- }
-}
-
-function hookOnlineApis () {
- function proxyEvent (e) {
- cordova.fireWindowEvent(e.type);
- }
- // The network module takes care of firing online and offline events.
- // It currently fires them only on document though, so we bridge them
- // to window here (while first listening for exec()-releated online/offline
- // events).
- window.addEventListener('online', pollOnceFromOnlineEvent, false);
- window.addEventListener('offline', pollOnceFromOnlineEvent, false);
- cordova.addWindowEventHandler('online');
- cordova.addWindowEventHandler('offline');
- document.addEventListener('online', proxyEvent, false);
- document.addEventListener('offline', proxyEvent, false);
-}
-
-hookOnlineApis();
-
-androidExec.jsToNativeModes = jsToNativeModes;
-androidExec.nativeToJsModes = nativeToJsModes;
-
-androidExec.setJsToNativeBridgeMode = function (mode) {
- if (mode === jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
- mode = jsToNativeModes.PROMPT;
- }
- nativeApiProvider.setPreferPrompt(mode === jsToNativeModes.PROMPT);
- jsToNativeBridgeMode = mode;
-};
-
-androidExec.setNativeToJsBridgeMode = function (mode) {
- if (mode === nativeToJsBridgeMode) {
- return;
- }
- if (nativeToJsBridgeMode === nativeToJsModes.POLLING) {
- pollEnabled = false;
- }
-
- nativeToJsBridgeMode = mode;
- // Tell the native side to switch modes.
- // Otherwise, it will be set by androidExec.init()
- if (bridgeSecret >= 0) {
- nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
- }
-
- if (mode === nativeToJsModes.POLLING) {
- pollEnabled = true;
- setTimeout(pollingTimerFunc, 1);
- }
-};
-
-function buildPayload (payload, message) {
- var payloadKind = message.charAt(0);
- if (payloadKind === 's') {
- payload.push(message.slice(1));
- } else if (payloadKind === 't') {
- payload.push(true);
- } else if (payloadKind === 'f') {
- payload.push(false);
- } else if (payloadKind === 'N') {
- payload.push(null);
- } else if (payloadKind === 'n') {
- payload.push(+message.slice(1));
- } else if (payloadKind === 'A') {
- var data = message.slice(1);
- payload.push(base64.toArrayBuffer(data));
- } else if (payloadKind === 'S') {
- payload.push(window.atob(message.slice(1)));
- } else if (payloadKind === 'M') {
- var multipartMessages = message.slice(1);
- while (multipartMessages !== '') {
- var spaceIdx = multipartMessages.indexOf(' ');
- var msgLen = +multipartMessages.slice(0, spaceIdx);
- var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
- multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
- buildPayload(payload, multipartMessage);
- }
- } else {
- payload.push(JSON.parse(message));
- }
-}
-
-// Processes a single message, as encoded by NativeToJsMessageQueue.java.
-function processMessage (message) {
- var firstChar = message.charAt(0);
- if (firstChar === 'J') {
- // This is deprecated on the .java side. It doesn't work with CSP enabled.
- // eslint-disable-next-line no-eval
- eval(message.slice(1));
- } else if (firstChar === 'S' || firstChar === 'F') {
- var success = firstChar === 'S';
- var keepCallback = message.charAt(1) === '1';
- var spaceIdx = message.indexOf(' ', 2);
- var status = +message.slice(2, spaceIdx);
- var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
- var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
- var payloadMessage = message.slice(nextSpaceIdx + 1);
- var payload = [];
- buildPayload(payload, payloadMessage);
- cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
- } else {
- console.log('processMessage failed: invalid message: ' + JSON.stringify(message));
- }
-}
-
-function processMessages () {
- // Check for the reentrant case.
- if (isProcessing) {
- return;
- }
- if (messagesFromNative.length === 0) {
- return;
- }
- isProcessing = true;
- try {
- var msg = popMessageFromQueue();
- // The Java side can send a * message to indicate that it
- // still has messages waiting to be retrieved.
- if (msg === '*' && messagesFromNative.length === 0) {
- nextTick(pollOnce);
- return;
- }
- processMessage(msg);
- } finally {
- isProcessing = false;
- if (messagesFromNative.length > 0) {
- nextTick(processMessages);
- }
- }
-}
-
-function popMessageFromQueue () {
- var messageBatch = messagesFromNative.shift();
- if (messageBatch === '*') {
- return '*';
- }
-
- var spaceIdx = messageBatch.indexOf(' ');
- var msgLen = +messageBatch.slice(0, spaceIdx);
- var message = messageBatch.substr(spaceIdx + 1, msgLen);
- messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
- if (messageBatch) {
- messagesFromNative.unshift(messageBatch);
- }
- return message;
-}
-
-module.exports = androidExec;
-
-});
-
-// file: src/common/exec/proxy.js
-define("cordova/exec/proxy", function(require, exports, module) {
-
-// internal map of proxy function
-var CommandProxyMap = {};
-
-module.exports = {
-
- // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
- add: function (id, proxyObj) {
- console.log('adding proxy for ' + id);
- CommandProxyMap[id] = proxyObj;
- return proxyObj;
- },
-
- // cordova.commandProxy.remove("Accelerometer");
- remove: function (id) {
- var proxy = CommandProxyMap[id];
- delete CommandProxyMap[id];
- CommandProxyMap[id] = null;
- return proxy;
- },
-
- get: function (service, action) {
- return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null);
- }
-};
-
-});
-
-// file: src/common/init.js
-define("cordova/init", function(require, exports, module) {
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-
-var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
-
-function logUnfiredChannels (arr) {
- for (var i = 0; i < arr.length; ++i) {
- if (arr[i].state !== 2) {
- console.log('Channel not fired: ' + arr[i].type);
- }
- }
-}
-
-window.setTimeout(function () {
- if (channel.onDeviceReady.state !== 2) {
- console.log('deviceready has not fired after 5 seconds.');
- logUnfiredChannels(platformInitChannelsArray);
- logUnfiredChannels(channel.deviceReadyChannelsArray);
- }
-}, 5000);
-
-if (!window.console) {
- window.console = {
- log: function () {}
- };
-}
-if (!window.console.warn) {
- window.console.warn = function (msg) {
- this.log('warn: ' + msg);
- };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onActivated = cordova.addDocumentEventHandler('activated');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState === 'complete' || document.readyState === 'interactive') {
- channel.onDOMContentLoaded.fire();
-} else {
- document.addEventListener('DOMContentLoaded', function () {
- channel.onDOMContentLoaded.fire();
- }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
- channel.onNativeReady.fire();
-}
-
-modulemapper.clobbers('cordova', 'cordova');
-modulemapper.clobbers('cordova/exec', 'cordova.exec');
-modulemapper.clobbers('cordova/exec', 'Cordova.exec');
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
-// The delay allows the attached modules to be defined before the plugin loader looks for them.
-setTimeout(function () {
- pluginloader.load(function () {
- channel.onPluginsReady.fire();
- });
-}, 0);
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function () {
- modulemapper.mapModules(window);
-
- platform.initialize && platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once page has fully loaded, all
- // constructors have run and cordova info has been received from native
- // side.
- channel.join(function () {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-}, platformInitChannelsArray);
-
-});
-
-// file: src/common/modulemapper.js
-define("cordova/modulemapper", function(require, exports, module) {
-
-var builder = require('cordova/builder');
-var moduleMap = define.moduleMap;
-var symbolList;
-var deprecationMap;
-
-exports.reset = function () {
- symbolList = [];
- deprecationMap = {};
-};
-
-function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) {
- if (!(moduleName in moduleMap)) {
- throw new Error('Module ' + moduleName + ' does not exist.');
- }
- symbolList.push(strategy, moduleName, symbolPath);
- if (opt_deprecationMessage) {
- deprecationMap[symbolPath] = opt_deprecationMessage;
- }
-}
-
-// Note: Android 2.3 does have Function.bind().
-exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.runs = function (moduleName) {
- addEntry('r', moduleName, null);
-};
-
-function prepareNamespace (symbolPath, context) {
- if (!symbolPath) {
- return context;
- }
- return symbolPath.split('.').reduce(function (cur, part) {
- return (cur[part] = cur[part] || {});
- }, context);
-}
-
-exports.mapModules = function (context) {
- var origSymbols = {};
- context.CDV_origSymbols = origSymbols;
- for (var i = 0, len = symbolList.length; i < len; i += 3) {
- var strategy = symbolList[i];
- var moduleName = symbolList[i + 1];
- var module = require(moduleName);
- // <runs/>
- if (strategy === 'r') {
- continue;
- }
- var symbolPath = symbolList[i + 2];
- var lastDot = symbolPath.lastIndexOf('.');
- var namespace = symbolPath.substr(0, lastDot);
- var lastName = symbolPath.substr(lastDot + 1);
-
- var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
- var parentObj = prepareNamespace(namespace, context);
- var target = parentObj[lastName];
-
- if (strategy === 'm' && target) {
- builder.recursiveMerge(target, module);
- } else if ((strategy === 'd' && !target) || (strategy !== 'd')) {
- if (!(symbolPath in origSymbols)) {
- origSymbols[symbolPath] = target;
- }
- builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
- }
- }
-};
-
-exports.getOriginalSymbol = function (context, symbolPath) {
- var origSymbols = context.CDV_origSymbols;
- if (origSymbols && (symbolPath in origSymbols)) {
- return origSymbols[symbolPath];
- }
- var parts = symbolPath.split('.');
- var obj = context;
- for (var i = 0; i < parts.length; ++i) {
- obj = obj && obj[parts[i]];
- }
- return obj;
-};
-
-exports.reset();
-
-});
-
-// file: ../cordova-android/cordova-js-src/platform.js
-define("cordova/platform", function(require, exports, module) {
-
-// The last resume event that was received that had the result of a plugin call.
-var lastResumeEvent = null;
-
-module.exports = {
- id: 'android',
- bootstrap: function () {
- var channel = require('cordova/channel');
- var cordova = require('cordova');
- var exec = require('cordova/exec');
- var modulemapper = require('cordova/modulemapper');
-
- // Get the shared secret needed to use the bridge.
- exec.init();
-
- // TODO: Extract this as a proper plugin.
- modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
-
- var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
- // Inject a listener for the backbutton on the document.
- var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
- backButtonChannel.onHasSubscribersChange = function () {
- // If we just attached the first handler or detached the last handler,
- // let native know we need to override the back button.
- exec(null, null, APP_PLUGIN_NAME, 'overrideBackbutton', [this.numHandlers === 1]);
- };
-
- // Add hardware MENU and SEARCH button handlers
- cordova.addDocumentEventHandler('menubutton');
- cordova.addDocumentEventHandler('searchbutton');
-
- function bindButtonChannel (buttonName) {
- // generic button bind used for volumeup/volumedown buttons
- var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
- volumeButtonChannel.onHasSubscribersChange = function () {
- exec(null, null, APP_PLUGIN_NAME, 'overrideButton', [buttonName, this.numHandlers === 1]);
- };
- }
- // Inject a listener for the volume buttons on the document.
- bindButtonChannel('volumeup');
- bindButtonChannel('volumedown');
-
- // The resume event is not "sticky", but it is possible that the event
- // will contain the result of a plugin call. We need to ensure that the
- // plugin result is delivered even after the event is fired (CB-10498)
- var cordovaAddEventListener = document.addEventListener;
-
- document.addEventListener = function (evt, handler, capture) {
- cordovaAddEventListener(evt, handler, capture);
-
- if (evt === 'resume' && lastResumeEvent) {
- handler(lastResumeEvent);
- }
- };
-
- // Let native code know we are all done on the JS side.
- // Native code will then un-hide the WebView.
- channel.onCordovaReady.subscribe(function () {
- exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
- exec(null, null, APP_PLUGIN_NAME, 'show', []);
- });
- }
-};
-
-function onMessageFromNative (msg) {
- var cordova = require('cordova');
- var action = msg.action;
-
- switch (action) {
- // pause and resume are Android app life cycle events
- case 'backbutton':
- case 'menubutton':
- case 'searchbutton':
- case 'pause':
- case 'volumedownbutton':
- case 'volumeupbutton':
- cordova.fireDocumentEvent(action);
- break;
- case 'resume':
- if (arguments.length > 1 && msg.pendingResult) {
- if (arguments.length === 2) {
- msg.pendingResult.result = arguments[1];
- } else {
- // The plugin returned a multipart message
- var res = [];
- for (var i = 1; i < arguments.length; i++) {
- res.push(arguments[i]);
- }
- msg.pendingResult.result = res;
- }
-
- // Save the plugin result so that it can be delivered to the js
- // even if they miss the initial firing of the event
- lastResumeEvent = msg;
- }
- cordova.fireDocumentEvent(action, msg);
- break;
- default:
- throw new Error('Unknown event action ' + action);
- }
-}
-
-});
-
-// file: ../cordova-android/cordova-js-src/plugin/android/app.js
-define("cordova/plugin/android/app", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
-module.exports = {
- /**
- * Clear the resource cache.
- */
- clearCache: function () {
- exec(null, null, APP_PLUGIN_NAME, 'clearCache', []);
- },
-
- /**
- * Load the url into the webview or into new browser instance.
- *
- * @param url The URL to load
- * @param props Properties that can be passed in to the activity:
- * wait: int => wait msec before loading URL
- * loadingDialog: "Title,Message" => display a native loading dialog
- * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
- * clearHistory: boolean => clear webview history (default=false)
- * openExternal: boolean => open in a new browser (default=false)
- *
- * Example:
- * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
- */
- loadUrl: function (url, props) {
- exec(null, null, APP_PLUGIN_NAME, 'loadUrl', [url, props]);
- },
-
- /**
- * Cancel loadUrl that is waiting to be loaded.
- */
- cancelLoadUrl: function () {
- exec(null, null, APP_PLUGIN_NAME, 'cancelLoadUrl', []);
- },
-
- /**
- * Clear web history in this web view.
- * Instead of BACK button loading the previous web page, it will exit the app.
- */
- clearHistory: function () {
- exec(null, null, APP_PLUGIN_NAME, 'clearHistory', []);
- },
-
- /**
- * Go to previous page displayed.
- * This is the same as pressing the backbutton on Android device.
- */
- backHistory: function () {
- exec(null, null, APP_PLUGIN_NAME, 'backHistory', []);
- },
-
- /**
- * Override the default behavior of the Android back button.
- * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "backbutton" event, this is automatically done.
- *
- * @param override T=override, F=cancel override
- */
- overrideBackbutton: function (override) {
- exec(null, null, APP_PLUGIN_NAME, 'overrideBackbutton', [override]);
- },
-
- /**
- * Override the default behavior of the Android volume button.
- * If overridden, when the volume button is pressed, the "volume[up|down]button"
- * JavaScript event will be fired.
- *
- * Note: The user should not have to call this method. Instead, when the user
- * registers for the "volume[up|down]button" event, this is automatically done.
- *
- * @param button volumeup, volumedown
- * @param override T=override, F=cancel override
- */
- overrideButton: function (button, override) {
- exec(null, null, APP_PLUGIN_NAME, 'overrideButton', [button, override]);
- },
-
- /**
- * Exit and terminate the application.
- */
- exitApp: function () {
- return exec(null, null, APP_PLUGIN_NAME, 'exitApp', []);
- }
-};
-
-});
-
-// file: src/common/pluginloader.js
-define("cordova/pluginloader", function(require, exports, module) {
-
-var modulemapper = require('cordova/modulemapper');
-
-// Helper function to inject a <script> tag.
-// Exported for testing.
-exports.injectScript = function (url, onload, onerror) {
- var script = document.createElement('script');
- // onload fires even when script fails loads with an error.
- script.onload = onload;
- // onerror fires for malformed URLs.
- script.onerror = onerror;
- script.src = url;
- document.head.appendChild(script);
-};
-
-function injectIfNecessary (id, url, onload, onerror) {
- onerror = onerror || onload;
- if (id in define.moduleMap) {
- onload();
- } else {
- exports.injectScript(url, function () {
- if (id in define.moduleMap) {
- onload();
- } else {
- onerror();
- }
- }, onerror);
- }
-}
-
-function onScriptLoadingComplete (moduleList, finishPluginLoading) {
- // Loop through all the plugins and then through their clobbers and merges.
- for (var i = 0, module; (module = moduleList[i]); i++) {
- if (module.clobbers && module.clobbers.length) {
- for (var j = 0; j < module.clobbers.length; j++) {
- modulemapper.clobbers(module.id, module.clobbers[j]);
- }
- }
-
- if (module.merges && module.merges.length) {
- for (var k = 0; k < module.merges.length; k++) {
- modulemapper.merges(module.id, module.merges[k]);
- }
- }
-
- // Finally, if runs is truthy we want to simply require() the module.
- if (module.runs) {
- modulemapper.runs(module.id);
- }
- }
-
- finishPluginLoading();
-}
-
-// Handler for the cordova_plugins.js content.
-// See plugman's plugin_loader.js for the details of this object.
-// This function is only called if the really is a plugins array that isn't empty.
-// Otherwise the onerror response handler will just call finishPluginLoading().
-function handlePluginsObject (path, moduleList, finishPluginLoading) {
- // Now inject the scripts.
- var scriptCounter = moduleList.length;
-
- if (!scriptCounter) {
- finishPluginLoading();
- return;
- }
- function scriptLoadedCallback () {
- if (!--scriptCounter) {
- onScriptLoadingComplete(moduleList, finishPluginLoading);
- }
- }
-
- for (var i = 0; i < moduleList.length; i++) {
- injectIfNecessary(moduleList[i].id, path + moduleList[i].file, scriptLoadedCallback);
- }
-}
-
-function findCordovaPath () {
- var path = null;
- var scripts = document.getElementsByTagName('script');
- var term = '/cordova.js';
- for (var n = scripts.length - 1; n > -1; n--) {
- var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
- if (src.indexOf(term) === (src.length - term.length)) {
- path = src.substring(0, src.length - term.length) + '/';
- break;
- }
- }
- return path;
-}
-
-// Tries to load all plugins' js-modules.
-// This is an async process, but onDeviceReady is blocked on onPluginsReady.
-// onPluginsReady is fired when there are no plugins to load, or they are all done.
-exports.load = function (callback) {
- var pathPrefix = findCordovaPath();
- if (pathPrefix === null) {
- console.log('Could not find cordova.js script tag. Plugin loading may fail.');
- pathPrefix = '';
- }
- injectIfNecessary('cordova/plugin_list', pathPrefix + 'cordova_plugins.js', function () {
- var moduleList = require('cordova/plugin_list');
- handlePluginsObject(pathPrefix, moduleList, callback);
- }, callback);
-};
-
-});
-
-// file: src/common/urlutil.js
-define("cordova/urlutil", function(require, exports, module) {
-
-/**
- * For already absolute URLs, returns what is passed in.
- * For relative URLs, converts them to absolute ones.
- */
-exports.makeAbsolute = function makeAbsolute (url) {
- var anchorEl = document.createElement('a');
- anchorEl.href = url;
- return anchorEl.href;
-};
-
-});
-
-// file: src/common/utils.js
-define("cordova/utils", function(require, exports, module) {
-
-var utils = exports;
-
-/**
- * Defines a property getter / setter for obj[key].
- */
-utils.defineGetterSetter = function (obj, key, getFunc, opt_setFunc) {
- if (Object.defineProperty) {
- var desc = {
- get: getFunc,
- configurable: true
- };
- if (opt_setFunc) {
- desc.set = opt_setFunc;
- }
- Object.defineProperty(obj, key, desc);
- } else {
- obj.__defineGetter__(key, getFunc);
- if (opt_setFunc) {
- obj.__defineSetter__(key, opt_setFunc);
- }
- }
-};
-
-/**
- * Defines a property getter for obj[key].
- */
-utils.defineGetter = utils.defineGetterSetter;
-
-utils.arrayIndexOf = function (a, item) {
- if (a.indexOf) {
- return a.indexOf(item);
- }
- var len = a.length;
- for (var i = 0; i < len; ++i) {
- if (a[i] === item) {
- return i;
- }
- }
- return -1;
-};
-
-/**
- * Returns whether the item was found in the array.
- */
-utils.arrayRemove = function (a, item) {
- var index = utils.arrayIndexOf(a, item);
- if (index !== -1) {
- a.splice(index, 1);
- }
- return index !== -1;
-};
-
-utils.typeName = function (val) {
- return Object.prototype.toString.call(val).slice(8, -1);
-};
-
-/**
- * Returns an indication of whether the argument is an array or not
- */
-utils.isArray = Array.isArray ||
- function (a) { return utils.typeName(a) === 'Array'; };
-
-/**
- * Returns an indication of whether the argument is a Date or not
- */
-utils.isDate = function (d) {
- return (d instanceof Date);
-};
-
-/**
- * Does a deep clone of the object.
- */
-utils.clone = function (obj) {
- if (!obj || typeof obj === 'function' || utils.isDate(obj) || typeof obj !== 'object') {
- return obj;
- }
-
- var retVal, i;
-
- if (utils.isArray(obj)) {
- retVal = [];
- for (i = 0; i < obj.length; ++i) {
- retVal.push(utils.clone(obj[i]));
- }
- return retVal;
- }
-
- retVal = {};
- for (i in obj) {
- // 'unknown' type may be returned in custom protocol activation case on
- // Windows Phone 8.1 causing "No such interface supported" exception on
- // cloning (https://issues.apache.org/jira/browse/CB-11522)
- // eslint-disable-next-line valid-typeof
- if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') {
- retVal[i] = utils.clone(obj[i]);
- }
- }
- return retVal;
-};
-
-/**
- * Returns a wrapped version of the function
- */
-utils.close = function (context, func, params) {
- return function () {
- var args = params || arguments;
- return func.apply(context, args);
- };
-};
-
-// ------------------------------------------------------------------------------
-function UUIDcreatePart (length) {
- var uuidpart = '';
- for (var i = 0; i < length; i++) {
- var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
- if (uuidchar.length === 1) {
- uuidchar = '0' + uuidchar;
- }
- uuidpart += uuidchar;
- }
- return uuidpart;
-}
-
-/**
- * Create a UUID
- */
-utils.createUUID = function () {
- return UUIDcreatePart(4) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(6);
-};
-
-/**
- * Extends a child object from a parent object using classical inheritance
- * pattern.
- */
-utils.extend = (function () {
- // proxy used to establish prototype chain
- var F = function () {};
- // extend Child from Parent
- return function (Child, Parent) {
- F.prototype = Parent.prototype;
- Child.prototype = new F();
- Child.__super__ = Parent.prototype;
- Child.prototype.constructor = Child;
- };
-}());
-
-/**
- * Alerts a message in any available way: alert or console.log.
- */
-utils.alert = function (msg) {
- if (window.alert) {
- window.alert(msg);
- } else if (console && console.log) {
- console.log(msg);
- }
-};
-
-});
-
-window.cordova = require('cordova');
-// file: src/scripts/bootstrap.js
-require('cordova/init');
-
-})();
diff --git a/cordova/platforms/android/platform_www/cordova_plugins.js b/cordova/platforms/android/platform_www/cordova_plugins.js
deleted file mode 100644
index 58781f3aa..000000000
--- a/cordova/platforms/android/platform_www/cordova_plugins.js
+++ /dev/null
@@ -1,286 +0,0 @@
-cordova.define('cordova/plugin_list', function(require, exports, module) {
- module.exports = [
- {
- "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
- "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
- "pluginId": "com-darryncampbell-cordova-plugin-intent",
- "clobbers": [
- "intentShim"
- ]
- },
- {
- "id": "com.ourcodeworld.plugins.Filebrowser.Filebrowser",
- "file": "plugins/com.ourcodeworld.plugins.Filebrowser/www/filebrowser.js",
- "pluginId": "com.ourcodeworld.plugins.Filebrowser",
- "clobbers": [
- "window.OurCodeWorld.Filebrowser"
- ]
- },
- {
- "id": "com.whebcraft.cordova.plugin.downloader.Downloader",
- "file": "plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js",
- "pluginId": "com.whebcraft.cordova.plugin.downloader",
- "clobbers": [
- "plugins.Downloader"
- ]
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
- },
- {
- "id": "cordova-plugin-background-mode.BackgroundMode",
- "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
- "pluginId": "cordova-plugin-background-mode",
- "clobbers": [
- "cordova.plugins.backgroundMode",
- "plugin.backgroundMode"
- ]
- },
- {
- "id": "cordova-plugin-camera.Camera",
- "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "Camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverOptions",
- "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverOptions"
- ]
- },
- {
- "id": "cordova-plugin-camera.camera",
- "file": "plugins/cordova-plugin-camera/www/Camera.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "navigator.camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverHandle",
- "file": "plugins/cordova-plugin-camera/www/CameraPopoverHandle.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverHandle"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryEntry",
- "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryReader",
- "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryReader"
- ]
- },
- {
- "id": "cordova-plugin-file.Entry",
- "file": "plugins/cordova-plugin-file/www/Entry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Entry"
- ]
- },
- {
- "id": "cordova-plugin-file.File",
- "file": "plugins/cordova-plugin-file/www/File.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.File"
- ]
- },
- {
- "id": "cordova-plugin-file.FileEntry",
- "file": "plugins/cordova-plugin-file/www/FileEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.FileError",
- "file": "plugins/cordova-plugin-file/www/FileError.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileError"
- ]
- },
- {
- "id": "cordova-plugin-file.FileReader",
- "file": "plugins/cordova-plugin-file/www/FileReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileReader"
- ]
- },
- {
- "id": "cordova-plugin-file.FileSystem",
- "file": "plugins/cordova-plugin-file/www/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadOptions",
- "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadOptions"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadResult",
- "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadResult"
- ]
- },
- {
- "id": "cordova-plugin-file.FileWriter",
- "file": "plugins/cordova-plugin-file/www/FileWriter.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileWriter"
- ]
- },
- {
- "id": "cordova-plugin-file.Flags",
- "file": "plugins/cordova-plugin-file/www/Flags.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Flags"
- ]
- },
- {
- "id": "cordova-plugin-file.LocalFileSystem",
- "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.LocalFileSystem"
- ],
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.Metadata",
- "file": "plugins/cordova-plugin-file/www/Metadata.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Metadata"
- ]
- },
- {
- "id": "cordova-plugin-file.ProgressEvent",
- "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.ProgressEvent"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems",
- "file": "plugins/cordova-plugin-file/www/fileSystems.js",
- "pluginId": "cordova-plugin-file"
- },
- {
- "id": "cordova-plugin-file.requestFileSystem",
- "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.requestFileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.resolveLocalFileSystemURI",
- "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.isChrome",
- "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.androidFileSystem",
- "file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems-roots",
- "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.fileSystemPaths",
- "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "cordova"
- ],
- "runs": true
- },
- {
- "id": "cordova-plugin-file-opener2.FileOpener2",
- "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
- "pluginId": "cordova-plugin-file-opener2",
- "clobbers": [
- "cordova.plugins.fileOpener2"
- ]
- },
- {
- "id": "es6-promise-plugin.Promise",
- "file": "plugins/es6-promise-plugin/www/promise.js",
- "pluginId": "es6-promise-plugin",
- "runs": true
- },
- {
- "id": "cordova-plugin-x-socialsharing.SocialSharing",
- "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
- "pluginId": "cordova-plugin-x-socialsharing",
- "clobbers": [
- "window.plugins.socialsharing"
- ]
- }
- ];
- module.exports.metadata = {
- "com-darryncampbell-cordova-plugin-intent": "2.0.0",
- "com.ourcodeworld.plugins.Filebrowser": "1.0.0",
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "cordova-plugin-device": "2.0.3",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-camera": "5.0.1",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.5",
- "cordova-plugin-whitelist": "1.3.4",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-x-socialsharing": "6.0.3"
- };
-});
\ No newline at end of file
diff --git a/cordova/platforms/android/platform_www/js/filebrowser.js b/cordova/platforms/android/platform_www/js/filebrowser.js
deleted file mode 100644
index e809a8f84..000000000
--- a/cordova/platforms/android/platform_www/js/filebrowser.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*global cordova, module*/
-
-module.exports = {
- filePicker: {
- single: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showPicker", [{
- "start_directory": startupPath
- }]);
- },
- multi: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showMultiFilepicker", [{
- "start_directory": startupPath
- }]);
- }
- },
- folderPicker: {
- single: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showFolderpicker", [{
- "start_directory": startupPath
- }]);
- },
- multi: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showMultiFolderpicker", [{
- "start_directory": startupPath
- }]);
- }
- },
- mixedPicker: function(config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showMixedPicker", [{
- "start_directory": startupPath
- }]);
- },
- createFileDialog: function(config){
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showCreatefile", [{
- "start_directory": startupPath
- }]);
- }
-};
diff --git a/cordova/platforms/android/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js b/cordova/platforms/android/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
deleted file mode 100644
index 67be5340c..000000000
--- a/cordova/platforms/android/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
+++ /dev/null
@@ -1,91 +0,0 @@
-cordova.define("com-darryncampbell-cordova-plugin-intent.IntentShim", function(require, exports, module) {
-var argscheck = require('cordova/argscheck'),
- channel = require('cordova/channel'),
- utils = require('cordova/utils'),
- exec = require('cordova/exec'),
- cordova = require('cordova');
-
-
-/**
- * This represents a thin shim layer over the Android Intent implementation
- * @constructor
- */
-function IntentShim() {
- var me = this;
-}
-
-IntentShim.prototype.ACTION_SEND = "android.intent.action.SEND";
-IntentShim.prototype.ACTION_VIEW= "android.intent.action.VIEW";
-IntentShim.prototype.ACTION_INSTALL_PACKAGE="android.intent.action.INSTALL_PACKAGE";
-IntentShim.prototype.ACTION_UNINSTALL_PACKAGE= "android.intent.action.UNINSTALL_PACKAGE";
-IntentShim.prototype.EXTRA_TEXT = "android.intent.extra.TEXT";
-IntentShim.prototype.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
-IntentShim.prototype.EXTRA_STREAM = "android.intent.extra.STREAM";
-IntentShim.prototype.EXTRA_EMAIL = "android.intent.extra.EMAIL";
-IntentShim.prototype.ACTION_CALL = "android.intent.action.CALL";
-IntentShim.prototype.ACTION_SENDTO = "android.intent.action.SENDTO";
-// StartActivityForResult
-IntentShim.prototype.ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
-IntentShim.prototype.ACTION_PICK = "android.intent.action.PICK";
-IntentShim.prototype.RESULT_CANCELED = 0; // Activity.RESULT_CANCELED
-IntentShim.prototype.RESULT_OK = -1; // Activity.RESULT_OK
-
-IntentShim.prototype.startActivity = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startActivity', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startActivity", [params]);
-};
-
-IntentShim.prototype.startActivityForResult = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startActivityForResult', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startActivityForResult", [params]);
-};
-
-IntentShim.prototype.sendBroadcast = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.sendBroadcast', arguments);
- exec(successCallback, errorCallback, "IntentShim", "sendBroadcast", [params]);
-};
-
-IntentShim.prototype.startService = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startService', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startService", [params]);
-};
-
-IntentShim.prototype.registerBroadcastReceiver = function(params, callback) {
- argscheck.checkArgs('of', 'IntentShim.registerBroadcastReceiver', arguments);
- exec(callback, null, "IntentShim", "registerBroadcastReceiver", [params]);
-};
-
-IntentShim.prototype.unregisterBroadcastReceiver = function() {
- argscheck.checkArgs('', 'IntentShim.unregisterBroadcastReceiver', arguments);
- exec(null, null, "IntentShim", "unregisterBroadcastReceiver", []);
-};
-
-IntentShim.prototype.onIntent = function(callback) {
- argscheck.checkArgs('f', 'IntentShim.onIntent', arguments);
- exec(callback, null, "IntentShim", "onIntent", [callback]);
-};
-
-IntentShim.prototype.onActivityResult = function(callback) {
- argscheck.checkArgs('f', 'IntentShim.onActivityResult', arguments);
- exec(callback, null, "IntentShim", "onActivityResult", [callback]);
-};
-
-IntentShim.prototype.getIntent = function(successCallback, failureCallback) {
- argscheck.checkArgs('ff', 'IntentShim.getIntent', arguments);
- exec(successCallback, failureCallback, "IntentShim", "getIntent", []);
-};
-
-IntentShim.prototype.sendResult = function(params, callback) {
- argscheck.checkArgs('of', 'IntentShim.sendResult', arguments);
- exec(callback, null, "IntentShim", "sendResult", [params]);
-}
-
-IntentShim.prototype.realPathFromUri = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.realPathFromUri', arguments);
- exec(successCallback, errorCallback, "IntentShim", "realPathFromUri", [params]);
-};
-
-window.intentShim = new IntentShim();
-window.plugins = window.plugins || {};
-window.plugins.intentShim = window.intentShim;
-});
diff --git a/cordova/platforms/android/platform_www/plugins/com.ourcodeworld.plugins.Filebrowser/www/filebrowser.js b/cordova/platforms/android/platform_www/plugins/com.ourcodeworld.plugins.Filebrowser/www/filebrowser.js
deleted file mode 100644
index 2224917a4..000000000
--- a/cordova/platforms/android/platform_www/plugins/com.ourcodeworld.plugins.Filebrowser/www/filebrowser.js
+++ /dev/null
@@ -1,89 +0,0 @@
-cordova.define("com.ourcodeworld.plugins.Filebrowser.Filebrowser", function(require, exports, module) {
-/*global cordova, module*/
-
-module.exports = {
- filePicker: {
- single: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showPicker", [{
- "start_directory": startupPath
- }]);
- },
- multi: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showMultiFilepicker", [{
- "start_directory": startupPath
- }]);
- }
- },
- folderPicker: {
- single: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showFolderpicker", [{
- "start_directory": startupPath
- }]);
- },
- multi: function (config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showMultiFolderpicker", [{
- "start_directory": startupPath
- }]);
- }
- },
- mixedPicker: function(config) {
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showMixedPicker", [{
- "start_directory": startupPath
- }]);
- },
- createFileDialog: function(config){
- var successCallback = config.success || function(){};
- var errorCallback = config.error || function(){};
- var startupPath = config.startupPath || "default";
-
- cordova.exec(function(files){
- if(typeof(successCallback) == "function"){
- successCallback(JSON.parse(files));
- }
- }, errorCallback, "Filebrowser", "showCreatefile", [{
- "start_directory": startupPath
- }]);
- }
-};
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js b/cordova/platforms/android/platform_www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js
deleted file mode 100644
index b8dad0882..000000000
--- a/cordova/platforms/android/platform_www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js
+++ /dev/null
@@ -1,25 +0,0 @@
-cordova.define("com.whebcraft.cordova.plugin.downloader.Downloader", function(require, exports, module) {
-var Downloader = {
- download: function (arguments, successCallback, errorCallback) {
- cordova.exec(
- successCallback,
- errorCallback,
- 'Downloader',
- 'download',
- [arguments]
- );
- }
-};
-
-function install() {
- if (!window.plugins) {
- window.plugins = {};
- }
-
- window.plugins.Downloader = Downloader;
- return window.plugins.Downloader;
-};
-
-cordova.addConstructor(install);
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js
deleted file mode 100644
index 7895b27ad..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js
+++ /dev/null
@@ -1,513 +0,0 @@
-cordova.define("cordova-plugin-background-mode.BackgroundMode", function(require, exports, module) {
-/*
- Copyright 2013-2017 appPlant GmbH
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var exec = require('cordova/exec'),
- channel = require('cordova/channel');
-
-/**
- * Activates the background mode. When activated the application
- * will be prevented from going to sleep while in background
- * for the next time.
- *
- * @return [ Void ]
- */
-exports.enable = function()
-{
- if (this.isEnabled())
- return;
-
- var fn = function() {
- exports._isEnabled = true;
- exports.fireEvent('enable');
- };
-
- cordova.exec(fn, null, 'BackgroundMode', 'enable', []);
-};
-
-/**
- * Deactivates the background mode. When deactivated the application
- * will not stay awake while in background.
- *
- * @return [ Void ]
- */
-exports.disable = function()
-{
- if (!this.isEnabled())
- return;
-
- var fn = function() {
- exports._isEnabled = false;
- exports.fireEvent('disable');
- };
-
- cordova.exec(fn, null, 'BackgroundMode', 'disable', []);
-};
-
-/**
- * Enable or disable the background mode.
- *
- * @param [ Bool ] enable The status to set for.
- *
- * @return [ Void ]
- */
-exports.setEnabled = function (enable)
-{
- if (enable) {
- this.enable();
- } else {
- this.disable();
- }
-};
-
-/**
- * List of all available options with their default value.
- *
- * @return [ Object ]
- */
-exports.getDefaults = function()
-{
- return this._defaults;
-};
-
-/**
- * The actual applied settings.
- *
- * @return [ Object ]
- */
-exports.getSettings = function()
-{
- return this._settings || {};
-};
-
-/**
- * Overwrite the default settings.
- *
- * @param [ Object ] overrides Dict of options to be overridden.
- *
- * @return [ Void ]
- */
-exports.setDefaults = function (overrides)
-{
- var defaults = this.getDefaults();
-
- for (var key in defaults)
- {
- if (overrides.hasOwnProperty(key))
- {
- defaults[key] = overrides[key];
- }
- }
-
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundMode', 'configure', [defaults, false]);
- }
-};
-
-/**
- * Configures the notification settings for Android.
- * Will be merged with the defaults.
- *
- * @param [ Object ] options Dict of options to be overridden.
- *
- * @return [ Void ]
- */
-exports.configure = function (options)
-{
- var settings = this.getSettings(),
- defaults = this.getDefaults();
-
- if (!this._isAndroid)
- return;
-
- if (!this._isActive)
- {
- console.log('BackgroundMode is not active, skipped...');
- return;
- }
-
- this._mergeObjects(options, settings);
- this._mergeObjects(options, defaults);
- this._settings = options;
-
- cordova.exec(null, null, 'BackgroundMode', 'configure', [options, true]);
-};
-
-/**
- * Enable GPS-tracking in background (Android).
- *
- * @return [ Void ]
- */
-exports.disableWebViewOptimizations = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'webview', []);
- }
-};
-
-/**
- * Disables battery optimazation mode for the app.
- *
- * @return [ Void ]
- */
-exports.disableBatteryOptimizations = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'battery', []);
- }
-};
-
-/**
- * Opens the system settings dialog where the user can tweak or turn off any
- * custom app start settings added by the manufacturer if available.
- *
- * @param [ Object|Bool ] options Set to false if you dont want to display an
- * alert dialog first.
- *
- * @return [ Void ]
- */
-exports.openAppStartSettings = function (options)
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'appstart', [options]);
- }
-};
-
-/**
- * Move app to background (Android only).
- *
- * @return [ Void ]
- */
-exports.moveToBackground = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'background', []);
- }
-};
-
-/**
- * Move app to foreground when in background (Android only).
- *
- * @return [ Void ]
- */
-exports.moveToForeground = function()
-{
- if (this.isActive() && this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'foreground', []);
- }
-};
-
-/**
- * Exclude the app from the recent tasks list (Android only).
- *
- * @return [ Void ]
- */
-exports.excludeFromTaskList = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'tasklist', []);
- }
-};
-
-/**
- * Override the back button on Android to go to background
- * instead of closing the app.
- *
- * @return [ Void ]
- */
-exports.overrideBackButton = function()
-{
- document.addEventListener('backbutton', function() {
- exports.moveToBackground();
- }, false);
-};
-
-/**
- * If the screen is off.
- *
- * @param [ Function ] fn Callback function to invoke with boolean arg.
- *
- * @return [ Void ]
- */
-exports.isScreenOff = function (fn)
-{
- if (this._isAndroid)
- {
- cordova.exec(fn, null, 'BackgroundModeExt', 'dimmed', []);
- }
- else
- {
- fn(undefined);
- }
-};
-
-/**
- * Wake up the device.
- *
- * @return [ Void ]
- */
-exports.wakeUp = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'wakeup', []);
- }
-};
-
-/**
- * Wake up and unlock the device.
- *
- * @return [ Void ]
- */
-exports.unlock = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'unlock', []);
- }
-};
-
-/**
- * If the mode is enabled or disabled.
- *
- * @return [ Boolean ]
- */
-exports.isEnabled = function()
-{
- return this._isEnabled !== false;
-};
-
-/**
- * If the mode is active.
- *
- * @return [ Boolean ]
- */
-exports.isActive = function()
-{
- return this._isActive !== false;
-};
-
-exports._listener = {};
-
-/**
- * Fire event with given arguments.
- *
- * @param [ String ] event The event's name.
- * @param [ Array<Object> ] The callback's arguments.
- *
- * @return [ Void ]
- */
-exports.fireEvent = function (event)
-{
- var args = Array.apply(null, arguments).slice(1),
- listener = this._listener[event];
-
- if (!listener)
- return;
-
- for (var i = 0; i < listener.length; i++)
- {
- var fn = listener[i][0],
- scope = listener[i][1];
-
- fn.apply(scope, args);
- }
-};
-
-/**
- * Register callback for given event.
- *
- * @param [ String ] event The event's name.
- * @param [ Function ] callback The function to be exec as callback.
- * @param [ Object ] scope The callback function's scope.
- *
- * @return [ Void ]
- */
-exports.on = function (event, callback, scope)
-{
- if (typeof callback !== "function")
- return;
-
- if (!this._listener[event])
- {
- this._listener[event] = [];
- }
-
- var item = [callback, scope || window];
-
- this._listener[event].push(item);
-};
-
-/**
- * Unregister callback for given event.
- *
- * @param [ String ] event The event's name.
- * @param [ Function ] callback The function to be exec as callback.
- *
- * @return [ Void ]
- */
-exports.un = function (event, callback)
-{
- var listener = this._listener[event];
-
- if (!listener)
- return;
-
- for (var i = 0; i < listener.length; i++)
- {
- var fn = listener[i][0];
-
- if (fn == callback)
- {
- listener.splice(i, 1);
- break;
- }
- }
-};
-
-/**
- * @private
- *
- * Flag indicates if the mode is enabled.
- */
-exports._isEnabled = false;
-
-/**
- * @private
- *
- * Flag indicates if the mode is active.
- */
-exports._isActive = false;
-
-/**
- * @private
- *
- * Default values of all available options.
- */
-exports._defaults =
-{
- title: 'App is running in background',
- text: 'Doing heavy tasks.',
- bigText: false,
- resume: true,
- silent: false,
- hidden: true,
- color: undefined,
- icon: 'icon'
-};
-
-/**
- * @private
- *
- * Merge settings with default values.
- *
- * @param [ Object ] options The custom options.
- * @param [ Object ] toMergeIn The options to merge in.
- *
- * @return [ Object ] Default values merged with custom values.
- */
-exports._mergeObjects = function (options, toMergeIn)
-{
- for (var key in toMergeIn)
- {
- if (!options.hasOwnProperty(key))
- {
- options[key] = toMergeIn[key];
- continue;
- }
- }
-
- return options;
-};
-
-/**
- * @private
- *
- * Setter for the isActive flag. Resets the
- * settings if the mode isnt active anymore.
- *
- * @param [ Boolean] value The new value for the flag.
- *
- * @return [ Void ]
- */
-exports._setActive = function(value)
-{
- if (this._isActive == value)
- return;
-
- this._isActive = value;
- this._settings = value ? this._mergeObjects({}, this._defaults) : {};
-};
-
-/**
- * @private
- *
- * Initialize the plugin.
- *
- * Method should be called after the 'deviceready' event
- * but before the event listeners will be called.
- *
- * @return [ Void ]
- */
-exports._pluginInitialize = function()
-{
- this._isAndroid = device.platform.match(/^android|amazon/i) !== null;
- this.setDefaults({});
-
- if (device.platform == 'browser')
- {
- this.enable();
- this._isEnabled = true;
- }
-
- this._isActive = this._isActive || device.platform == 'browser';
-};
-
-// Called before 'deviceready' listener will be called
-channel.onCordovaReady.subscribe(function()
-{
- channel.onCordovaInfoReady.subscribe(function() {
- exports._pluginInitialize();
- });
-});
-
-// Called after 'deviceready' event
-channel.deviceready.subscribe(function()
-{
- if (exports.isEnabled())
- {
- exports.fireEvent('enable');
- }
-
- if (exports.isActive())
- {
- exports.fireEvent('activate');
- }
-});
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js
deleted file mode 100644
index 3f614ec80..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js
+++ /dev/null
@@ -1,188 +0,0 @@
-cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var exec = require('cordova/exec');
-var Camera = require('./Camera');
-// XXX: commented out
-// CameraPopoverHandle = require('./CameraPopoverHandle');
-
-/**
- * @namespace navigator
- */
-
-/**
- * @exports camera
- */
-var cameraExport = {};
-
-// Tack on the Camera Constants to the base camera plugin.
-for (var key in Camera) {
- cameraExport[key] = Camera[key];
-}
-
-/**
- * Callback function that provides an error message.
- * @callback module:camera.onError
- * @param {string} message - The message is provided by the device's native code.
- */
-
-/**
- * Callback function that provides the image data.
- * @callback module:camera.onSuccess
- * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
- * @example
- * // Show image
- * //
- * function cameraCallback(imageData) {
- * var image = document.getElementById('myImage');
- * image.src = "data:image/jpeg;base64," + imageData;
- * }
- */
-
-/**
- * Optional parameters to customize the camera settings.
- * * [Quirks](#CameraOptions-quirks)
- * @typedef module:camera.CameraOptions
- * @type {Object}
- * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
- * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
- * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
- * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
- * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
- * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
- * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
- * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
- * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
- * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
- * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
- * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
- */
-
-/**
- * @description Takes a photo using the camera, or retrieves a photo from the device's
- * image gallery. The image is passed to the success callback as a
- * Base64-encoded `String`, or as the URI for the image file.
- *
- * The `camera.getPicture` function opens the device's default camera
- * application that allows users to snap pictures by default - this behavior occurs,
- * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
- * Once the user snaps the photo, the camera application closes and the application is restored.
- *
- * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
- * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
- * that allows users to select an existing image.
- *
- * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
- * one of the following formats, depending on the specified
- * `cameraOptions`:
- *
- * - A `String` containing the Base64-encoded photo image.
- * - A `String` representing the image file location on local storage (default).
- *
- * You can do whatever you want with the encoded image or URI, for
- * example:
- *
- * - Render the image in an `<img>` tag, as in the example below
- * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
- * - Post the data to a remote server
- *
- * __NOTE__: Photo resolution on newer devices is quite good. Photos
- * selected from the device's gallery are not downscaled to a lower
- * quality, even if a `quality` parameter is specified. To avoid common
- * memory problems, set `Camera.destinationType` to `FILE_URI` rather
- * than `DATA_URL`.
- *
- * __Supported Platforms__
- *
- * - Android
- * - BlackBerry
- * - Browser
- * - Firefox
- * - FireOS
- * - iOS
- * - Windows
- * - WP8
- * - Ubuntu
- *
- * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
- *
- * @example
- * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
- * @param {module:camera.onSuccess} successCallback
- * @param {module:camera.onError} errorCallback
- * @param {module:camera.CameraOptions} options CameraOptions
- */
-cameraExport.getPicture = function (successCallback, errorCallback, options) {
- argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
- options = options || {};
- var getValue = argscheck.getValue;
-
- var quality = getValue(options.quality, 50);
- var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
- var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
- var targetWidth = getValue(options.targetWidth, -1);
- var targetHeight = getValue(options.targetHeight, -1);
- var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
- var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
- var allowEdit = !!options.allowEdit;
- var correctOrientation = !!options.correctOrientation;
- var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
- var popoverOptions = getValue(options.popoverOptions, null);
- var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
-
- var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
- mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
-
- exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
- // XXX: commented out
- // return new CameraPopoverHandle();
-};
-
-/**
- * Removes intermediate image files that are kept in temporary storage
- * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
- * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
- * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
- *
- * __Supported Platforms__
- *
- * - iOS
- *
- * @example
- * navigator.camera.cleanup(onSuccess, onFail);
- *
- * function onSuccess() {
- * console.log("Camera cleanup success.")
- * }
- *
- * function onFail(message) {
- * alert('Failed because: ' + message);
- * }
- */
-cameraExport.cleanup = function (successCallback, errorCallback) {
- exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
-};
-
-module.exports = cameraExport;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
deleted file mode 100644
index 0fe4c6d03..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
+++ /dev/null
@@ -1,95 +0,0 @@
-cordova.define("cordova-plugin-camera.Camera", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * @module Camera
- */
-module.exports = {
- /**
- * @description
- * Defines the output format of `Camera.getPicture` call.
- *
- * @enum {number}
- */
- DestinationType: {
- /** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI if possible */
- DATA_URL: 0,
- /** Return file uri (content://media/external/images/media/2 for Android) */
- FILE_URI: 1
- },
- /**
- * @enum {number}
- */
- EncodingType: {
- /** Return JPEG encoded image */
- JPEG: 0,
- /** Return PNG encoded image */
- PNG: 1
- },
- /**
- * @enum {number}
- */
- MediaType: {
- /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
- PICTURE: 0,
- /** Allow selection of video only, ONLY RETURNS URL */
- VIDEO: 1,
- /** Allow selection from all media types */
- ALLMEDIA: 2
- },
- /**
- * @description
- * Defines the output format of `Camera.getPicture` call.
- *
- * @enum {number}
- */
- PictureSourceType: {
- /** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
- PHOTOLIBRARY: 0,
- /** Take picture from camera */
- CAMERA: 1,
- /** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
- SAVEDPHOTOALBUM: 2
- },
- /**
- * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
- * @enum {number}
- */
- PopoverArrowDirection: {
- ARROW_UP: 1,
- ARROW_DOWN: 2,
- ARROW_LEFT: 4,
- ARROW_RIGHT: 8,
- ARROW_ANY: 15
- },
- /**
- * @enum {number}
- */
- Direction: {
- /** Use the back-facing camera */
- BACK: 0,
- /** Use the front-facing camera */
- FRONT: 1
- }
-};
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
deleted file mode 100644
index c970f55a3..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
+++ /dev/null
@@ -1,35 +0,0 @@
-cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * @ignore in favour of iOS' one
- * A handle to an image picker popover.
- */
-var CameraPopoverHandle = function () {
- this.setPosition = function (popoverOptions) {
- console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
- };
-};
-
-module.exports = CameraPopoverHandle;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
deleted file mode 100644
index 6e03c52ee..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
+++ /dev/null
@@ -1,59 +0,0 @@
-cordova.define("cordova-plugin-camera.CameraPopoverOptions", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Camera = require('./Camera');
-
-/**
- * @namespace navigator
- */
-
-/**
- * iOS-only parameters that specify the anchor element location and arrow
- * direction of the popover when selecting images from an iPad's library
- * or album.
- * Note that the size of the popover may change to adjust to the
- * direction of the arrow and orientation of the screen. Make sure to
- * account for orientation changes when specifying the anchor element
- * location.
- * @module CameraPopoverOptions
- * @param {Number} [x=0] - x pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [y=32] - y pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [width=320] - width, in pixels, of the screen element onto which to anchor the popover.
- * @param {Number} [height=480] - height, in pixels, of the screen element onto which to anchor the popover.
- * @param {module:Camera.PopoverArrowDirection} [arrowDir=ARROW_ANY] - Direction the arrow on the popover should point.
- * @param {Number} [popoverWidth=0] - width of the popover (0 or not specified will use apple's default width).
- * @param {Number} [popoverHeight=0] - height of the popover (0 or not specified will use apple's default height).
- */
-var CameraPopoverOptions = function (x, y, width, height, arrowDir, popoverWidth, popoverHeight) {
- // information of rectangle that popover should be anchored to
- this.x = x || 0;
- this.y = y || 32;
- this.width = width || 320;
- this.height = height || 480;
- this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
- this.popoverWidth = popoverWidth || 0;
- this.popoverHeight = popoverHeight || 0;
-};
-
-module.exports = CameraPopoverOptions;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js
deleted file mode 100644
index ae48e3546..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js
+++ /dev/null
@@ -1,86 +0,0 @@
-cordova.define("cordova-plugin-device.device", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var channel = require('cordova/channel');
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var cordova = require('cordova');
-
-channel.createSticky('onCordovaInfoReady');
-// Tell cordova channel to wait on the CordovaInfoReady event
-channel.waitForInitialization('onCordovaInfoReady');
-
-/**
- * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
- * phone, etc.
- * @constructor
- */
-function Device () {
- this.available = false;
- this.platform = null;
- this.version = null;
- this.uuid = null;
- this.cordova = null;
- this.model = null;
- this.manufacturer = null;
- this.isVirtual = null;
- this.serial = null;
-
- var me = this;
-
- channel.onCordovaReady.subscribe(function () {
- me.getInfo(function (info) {
- // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
- // TODO: CB-5105 native implementations should not return info.cordova
- var buildLabel = cordova.version;
- me.available = true;
- me.platform = info.platform;
- me.version = info.version;
- me.uuid = info.uuid;
- me.cordova = buildLabel;
- me.model = info.model;
- me.isVirtual = info.isVirtual;
- me.manufacturer = info.manufacturer || 'unknown';
- me.serial = info.serial || 'unknown';
- channel.onCordovaInfoReady.fire();
- }, function (e) {
- me.available = false;
- utils.alert('[ERROR] Error initializing Cordova: ' + e);
- });
- });
-}
-
-/**
- * Get device info
- *
- * @param {Function} successCallback The function to call when the heading data is available
- * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
- */
-Device.prototype.getInfo = function (successCallback, errorCallback) {
- argscheck.checkArgs('fF', 'Device.getInfo', arguments);
- exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
-};
-
-module.exports = new Device();
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
deleted file mode 100644
index 395c4d973..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
+++ /dev/null
@@ -1,54 +0,0 @@
-cordova.define("cordova-plugin-file-opener2.FileOpener2", function(require, exports, module) {
-/*jslint browser: true, devel: true, node: true, sloppy: true, plusplus: true*/
-/*global require, cordova */
-/*
-The MIT License (MIT)
-
-Copyright (c) 2013 pwlin - [email protected]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-var exec = require('cordova/exec');
-
-function FileOpener2() {}
-
-FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
- contentType = contentType || '';
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
-};
-
-FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
- contentType = contentType || '';
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position || [0, 0]]);
-};
-
-FileOpener2.prototype.uninstall = function (packageId, callbackContext) {
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'uninstall', [packageId]);
-};
-
-FileOpener2.prototype.appIsInstalled = function (packageId, callbackContext) {
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'appIsInstalled', [packageId]);
-};
-
-module.exports = new FileOpener2();
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js
deleted file mode 100644
index bb676eb6c..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js
+++ /dev/null
@@ -1,120 +0,0 @@
-cordova.define("cordova-plugin-file.DirectoryEntry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var Entry = require('./Entry');
-var FileError = require('./FileError');
-var DirectoryReader = require('./DirectoryReader');
-
-/**
- * An interface representing a directory on the file system.
- *
- * {boolean} isFile always false (readonly)
- * {boolean} isDirectory always true (readonly)
- * {DOMString} name of the directory, excluding the path leading to it (readonly)
- * {DOMString} fullPath the absolute full path to the directory (readonly)
- * {FileSystem} filesystem on which the directory resides (readonly)
- */
-var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
-
- // add trailing slash if it is missing
- if ((fullPath) && !/\/$/.test(fullPath)) {
- fullPath += '/';
- }
- // add trailing slash if it is missing
- if (nativeURL && !/\/$/.test(nativeURL)) {
- nativeURL += '/';
- }
- DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
-};
-
-utils.extend(DirectoryEntry, Entry);
-
-/**
- * Creates a new DirectoryReader to read entries from this directory
- */
-DirectoryEntry.prototype.createReader = function () {
- return new DirectoryReader(this.toInternalURL());
-};
-
-/**
- * Creates or looks up a directory
- *
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory
- * @param {Flags} options to create or exclusively create the directory
- * @param {Function} successCallback is called with the new entry
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
- argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getDirectory', [this.toInternalURL(), path, options]);
-};
-
-/**
- * Deletes a directory and all of it's contents
- *
- * @param {Function} successCallback is called with no parameters
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(successCallback, fail, 'File', 'removeRecursively', [this.toInternalURL()]);
-};
-
-/**
- * Creates or looks up a file
- *
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file
- * @param {Flags} options to create or exclusively create the file
- * @param {Function} successCallback is called with the new entry
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
- argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var FileEntry = require('./FileEntry');
- var entry = new FileEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getFile', [this.toInternalURL(), path, options]);
-};
-
-module.exports = DirectoryEntry;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js
deleted file mode 100644
index 417c85f10..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js
+++ /dev/null
@@ -1,75 +0,0 @@
-cordova.define("cordova-plugin-file.DirectoryReader", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-
-/**
- * An interface that lists the files and directories in a directory.
- */
-function DirectoryReader (localURL) {
- this.localURL = localURL || null;
- this.hasReadEntries = false;
-}
-
-/**
- * Returns a list of entries from a directory.
- *
- * @param {Function} successCallback is called with a list of entries
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryReader.prototype.readEntries = function (successCallback, errorCallback) {
- // If we've already read and passed on this directory's entries, return an empty list.
- if (this.hasReadEntries) {
- successCallback([]);
- return;
- }
- var reader = this;
- var win = typeof successCallback !== 'function' ? null : function (result) {
- var retVal = [];
- for (var i = 0; i < result.length; i++) {
- var entry = null;
- if (result[i].isDirectory) {
- entry = new (require('./DirectoryEntry'))();
- } else if (result[i].isFile) {
- entry = new (require('./FileEntry'))();
- }
- entry.isDirectory = result[i].isDirectory;
- entry.isFile = result[i].isFile;
- entry.name = result[i].name;
- entry.fullPath = result[i].fullPath;
- entry.filesystem = new (require('./FileSystem'))(result[i].filesystemName);
- entry.nativeURL = result[i].nativeURL;
- retVal.push(entry);
- }
- reader.hasReadEntries = true;
- successCallback(retVal);
- };
- var fail = typeof errorCallback !== 'function' ? null : function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'readEntries', [this.localURL]);
-};
-
-module.exports = DirectoryReader;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Entry.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Entry.js
deleted file mode 100644
index b296d999e..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Entry.js
+++ /dev/null
@@ -1,263 +0,0 @@
-cordova.define("cordova-plugin-file.Entry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-var Metadata = require('./Metadata');
-
-/**
- * Represents a file or directory on the local file system.
- *
- * @param isFile
- * {boolean} true if Entry is a file (readonly)
- * @param isDirectory
- * {boolean} true if Entry is a directory (readonly)
- * @param name
- * {DOMString} name of the file or directory, excluding the path
- * leading to it (readonly)
- * @param fullPath
- * {DOMString} the absolute full path to the file or directory
- * (readonly)
- * @param fileSystem
- * {FileSystem} the filesystem on which this entry resides
- * (readonly)
- * @param nativeURL
- * {DOMString} an alternate URL which can be used by native
- * webview controls, for example media players.
- * (optional, readonly)
- */
-function Entry (isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
- this.isFile = !!isFile;
- this.isDirectory = !!isDirectory;
- this.name = name || '';
- this.fullPath = fullPath || '';
- this.filesystem = fileSystem || null;
- this.nativeURL = nativeURL || null;
-}
-
-/**
- * Look up the metadata of the entry.
- *
- * @param successCallback
- * {Function} is called with a Metadata object
- * @param errorCallback
- * {Function} is called with a FileError
- */
-Entry.prototype.getMetadata = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
- var success = successCallback && function (entryMetadata) {
- var metadata = new Metadata({
- size: entryMetadata.size,
- modificationTime: entryMetadata.lastModifiedDate
- });
- successCallback(metadata);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(success, fail, 'File', 'getFileMetadata', [this.toInternalURL()]);
-};
-
-/**
- * Set the metadata of the entry.
- *
- * @param successCallback
- * {Function} is called with a Metadata object
- * @param errorCallback
- * {Function} is called with a FileError
- * @param metadataObject
- * {Object} keys and values to set
- */
-Entry.prototype.setMetadata = function (successCallback, errorCallback, metadataObject) {
- argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
- exec(successCallback, errorCallback, 'File', 'setMetadata', [this.toInternalURL(), metadataObject]);
-};
-
-/**
- * Move a file or directory to a new location.
- *
- * @param parent
- * {DirectoryEntry} the directory to which to move this entry
- * @param newName
- * {DOMString} new name of the entry, defaults to the current name
- * @param successCallback
- * {Function} called with the new DirectoryEntry object
- * @param errorCallback
- * {Function} called with a FileError
- */
-Entry.prototype.moveTo = function (parent, newName, successCallback, errorCallback) {
- argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- var srcURL = this.toInternalURL();
- // entry name
- var name = newName || this.name;
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
- var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
- var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- }
- } else {
- // no Entry object returned
- if (fail) {
- fail(FileError.NOT_FOUND_ERR);
- }
- }
- };
-
- // copy
- exec(success, fail, 'File', 'moveTo', [srcURL, parent.toInternalURL(), name]);
-};
-
-/**
- * Copy a directory to a different location.
- *
- * @param parent
- * {DirectoryEntry} the directory to which to copy the entry
- * @param newName
- * {DOMString} new name of the entry, defaults to the current name
- * @param successCallback
- * {Function} called with the new Entry object
- * @param errorCallback
- * {Function} called with a FileError
- */
-Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallback) {
- argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- var srcURL = this.toInternalURL();
- // entry name
- var name = newName || this.name;
- // success callback
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
- var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
- var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- }
- } else {
- // no Entry object returned
- if (fail) {
- fail(FileError.NOT_FOUND_ERR);
- }
- }
- };
-
- // copy
- exec(success, fail, 'File', 'copyTo', [srcURL, parent.toInternalURL(), name]);
-};
-
-/**
- * Return a URL that can be passed across the bridge to identify this entry.
- */
-Entry.prototype.toInternalURL = function () {
- if (this.filesystem && this.filesystem.__format__) {
- return this.filesystem.__format__(this.fullPath, this.nativeURL);
- }
-};
-
-/**
- * Return a URL that can be used to identify this entry.
- * Use a URL that can be used to as the src attribute of a <video> or
- * <audio> tag. If that is not possible, construct a cdvfile:// URL.
- */
-Entry.prototype.toURL = function () {
- if (this.nativeURL) {
- return this.nativeURL;
- }
- // fullPath attribute may contain the full URL in the case that
- // toInternalURL fails.
- return this.toInternalURL() || 'file://localhost' + this.fullPath;
-};
-
-/**
- * Backwards-compatibility: In v1.0.0 - 1.0.2, .toURL would only return a
- * cdvfile:// URL, and this method was necessary to obtain URLs usable by the
- * webview.
- * See CB-6051, CB-6106, CB-6117, CB-6152, CB-6199, CB-6201, CB-6243, CB-6249,
- * and CB-6300.
- */
-Entry.prototype.toNativeURL = function () {
- console.log("DEPRECATED: Update your code to use 'toURL'");
- return this.toURL();
-};
-
-/**
- * Returns a URI that can be used to identify this entry.
- *
- * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.
- * @return uri
- */
-Entry.prototype.toURI = function (mimeType) {
- console.log("DEPRECATED: Update your code to use 'toURL'");
- return this.toURL();
-};
-
-/**
- * Remove a file or directory. It is an error to attempt to delete a
- * directory that is not empty. It is an error to attempt to delete a
- * root directory of a file system.
- *
- * @param successCallback {Function} called with no parameters
- * @param errorCallback {Function} called with a FileError
- */
-Entry.prototype.remove = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.remove', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(successCallback, fail, 'File', 'remove', [this.toInternalURL()]);
-};
-
-/**
- * Look up the parent DirectoryEntry of this entry.
- *
- * @param successCallback {Function} called with the parent DirectoryEntry object
- * @param errorCallback {Function} called with a FileError
- */
-Entry.prototype.getParent = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.getParent', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var DirectoryEntry = require('./DirectoryEntry');
- var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getParent', [this.toInternalURL()]);
-};
-
-module.exports = Entry;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/File.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/File.js
deleted file mode 100644
index c77178653..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/File.js
+++ /dev/null
@@ -1,81 +0,0 @@
-cordova.define("cordova-plugin-file.File", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Constructor.
- * name {DOMString} name of the file, without path information
- * fullPath {DOMString} the full path of the file, including the name
- * type {DOMString} mime type
- * lastModifiedDate {Date} last modified date
- * size {Number} size of the file in bytes
- */
-
-var File = function (name, localURL, type, lastModifiedDate, size) {
- this.name = name || '';
- this.localURL = localURL || null;
- this.type = type || null;
- this.lastModified = lastModifiedDate || null;
- // For backwards compatibility, store the timestamp in lastModifiedDate as well
- this.lastModifiedDate = lastModifiedDate || null;
- this.size = size || 0;
-
- // These store the absolute start and end for slicing the file.
- this.start = 0;
- this.end = this.size;
-};
-
-/**
- * Returns a "slice" of the file. Since Cordova Files don't contain the actual
- * content, this really returns a File with adjusted start and end.
- * Slices of slices are supported.
- * start {Number} The index at which to start the slice (inclusive).
- * end {Number} The index at which to end the slice (exclusive).
- */
-File.prototype.slice = function (start, end) {
- var size = this.end - this.start;
- var newStart = 0;
- var newEnd = size;
- if (arguments.length) {
- if (start < 0) {
- newStart = Math.max(size + start, 0);
- } else {
- newStart = Math.min(size, start);
- }
- }
-
- if (arguments.length >= 2) {
- if (end < 0) {
- newEnd = Math.max(size + end, 0);
- } else {
- newEnd = Math.min(end, size);
- }
- }
-
- var newFile = new File(this.name, this.localURL, this.type, this.lastModified, this.size);
- newFile.start = this.start + newStart;
- newFile.end = this.start + newEnd;
- return newFile;
-};
-
-module.exports = File;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileEntry.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileEntry.js
deleted file mode 100644
index 6651b5542..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileEntry.js
+++ /dev/null
@@ -1,95 +0,0 @@
-cordova.define("cordova-plugin-file.FileEntry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var Entry = require('./Entry');
-var FileWriter = require('./FileWriter');
-var File = require('./File');
-var FileError = require('./FileError');
-
-/**
- * An interface representing a file on the file system.
- *
- * {boolean} isFile always true (readonly)
- * {boolean} isDirectory always false (readonly)
- * {DOMString} name of the file, excluding the path leading to it (readonly)
- * {DOMString} fullPath the absolute full path to the file (readonly)
- * {FileSystem} filesystem on which the file resides (readonly)
- */
-var FileEntry = function (name, fullPath, fileSystem, nativeURL) {
- // remove trailing slash if it is present
- if (fullPath && /\/$/.test(fullPath)) {
- fullPath = fullPath.substring(0, fullPath.length - 1);
- }
- if (nativeURL && /\/$/.test(nativeURL)) {
- nativeURL = nativeURL.substring(0, nativeURL.length - 1);
- }
-
- FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem, nativeURL]);
-};
-
-utils.extend(FileEntry, Entry);
-
-/**
- * Creates a new FileWriter associated with the file that this FileEntry represents.
- *
- * @param {Function} successCallback is called with the new FileWriter
- * @param {Function} errorCallback is called with a FileError
- */
-FileEntry.prototype.createWriter = function (successCallback, errorCallback) {
- this.file(function (filePointer) {
- var writer = new FileWriter(filePointer);
-
- if (writer.localURL === null || writer.localURL === '') {
- if (errorCallback) {
- errorCallback(new FileError(FileError.INVALID_STATE_ERR));
- }
- } else {
- if (successCallback) {
- successCallback(writer);
- }
- }
- }, errorCallback);
-};
-
-/**
- * Returns a File that represents the current state of the file that this FileEntry represents.
- *
- * @param {Function} successCallback is called with the new File object
- * @param {Function} errorCallback is called with a FileError
- */
-FileEntry.prototype.file = function (successCallback, errorCallback) {
- var localURL = this.toInternalURL();
- var win = successCallback && function (f) {
- var file = new File(f.name, localURL, f.type, f.lastModifiedDate, f.size);
- successCallback(file);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getFileMetadata', [localURL]);
-};
-
-module.exports = FileEntry;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileError.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileError.js
deleted file mode 100644
index f378c3874..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileError.js
+++ /dev/null
@@ -1,49 +0,0 @@
-cordova.define("cordova-plugin-file.FileError", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * FileError
- */
-function FileError (error) {
- this.code = error || null;
-}
-
-// File error codes
-// Found in DOMException
-FileError.NOT_FOUND_ERR = 1;
-FileError.SECURITY_ERR = 2;
-FileError.ABORT_ERR = 3;
-
-// Added by File API specification
-FileError.NOT_READABLE_ERR = 4;
-FileError.ENCODING_ERR = 5;
-FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
-FileError.INVALID_STATE_ERR = 7;
-FileError.SYNTAX_ERR = 8;
-FileError.INVALID_MODIFICATION_ERR = 9;
-FileError.QUOTA_EXCEEDED_ERR = 10;
-FileError.TYPE_MISMATCH_ERR = 11;
-FileError.PATH_EXISTS_ERR = 12;
-
-module.exports = FileError;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileReader.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileReader.js
deleted file mode 100644
index 5c030913b..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileReader.js
+++ /dev/null
@@ -1,301 +0,0 @@
-cordova.define("cordova-plugin-file.FileReader", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var modulemapper = require('cordova/modulemapper');
-var utils = require('cordova/utils');
-var FileError = require('./FileError');
-var ProgressEvent = require('./ProgressEvent');
-var origFileReader = modulemapper.getOriginalSymbol(window, 'FileReader');
-
-/**
- * This class reads the mobile device file system.
- *
- * For Android:
- * The root directory is the root of the file system.
- * To read from the SD card, the file name is "sdcard/my_file.txt"
- * @constructor
- */
-var FileReader = function () {
- this._readyState = 0;
- this._error = null;
- this._result = null;
- this._progress = null;
- this._localURL = '';
- this._realReader = origFileReader ? new origFileReader() : {}; // eslint-disable-line new-cap
-};
-
-/**
- * Defines the maximum size to read at a time via the native API. The default value is a compromise between
- * minimizing the overhead of many exec() calls while still reporting progress frequently enough for large files.
- * (Note attempts to allocate more than a few MB of contiguous memory on the native side are likely to cause
- * OOM exceptions, while the JS engine seems to have fewer problems managing large strings or ArrayBuffers.)
- */
-FileReader.READ_CHUNK_SIZE = 256 * 1024;
-
-// States
-FileReader.EMPTY = 0;
-FileReader.LOADING = 1;
-FileReader.DONE = 2;
-
-utils.defineGetter(FileReader.prototype, 'readyState', function () {
- return this._localURL ? this._readyState : this._realReader.readyState;
-});
-
-utils.defineGetter(FileReader.prototype, 'error', function () {
- return this._localURL ? this._error : this._realReader.error;
-});
-
-utils.defineGetter(FileReader.prototype, 'result', function () {
- return this._localURL ? this._result : this._realReader.result;
-});
-
-function defineEvent (eventName) {
- utils.defineGetterSetter(FileReader.prototype, eventName, function () {
- return this._realReader[eventName] || null;
- }, function (value) {
- this._realReader[eventName] = value;
- });
-}
-defineEvent('onloadstart'); // When the read starts.
-defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
-defineEvent('onload'); // When the read has successfully completed.
-defineEvent('onerror'); // When the read has failed (see errors).
-defineEvent('onloadend'); // When the request has completed (either in success or failure).
-defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method.
-
-function initRead (reader, file) {
- // Already loading something
- if (reader.readyState === FileReader.LOADING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- reader._result = null;
- reader._error = null;
- reader._progress = 0;
- reader._readyState = FileReader.LOADING;
-
- if (typeof file.localURL === 'string') {
- reader._localURL = file.localURL;
- } else {
- reader._localURL = '';
- return true;
- }
-
- if (reader.onloadstart) {
- reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
- }
-}
-
-/**
- * Callback used by the following read* functions to handle incremental or final success.
- * Must be bound to the FileReader's this along with all but the last parameter,
- * e.g. readSuccessCallback.bind(this, "readAsText", "UTF-8", offset, totalSize, accumulate)
- * @param readType The name of the read function to call.
- * @param encoding Text encoding, or null if this is not a text type read.
- * @param offset Starting offset of the read.
- * @param totalSize Total number of bytes or chars to read.
- * @param accumulate A function that takes the callback result and accumulates it in this._result.
- * @param r Callback result returned by the last read exec() call, or null to begin reading.
- */
-function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, r) {
- if (this._readyState === FileReader.DONE) {
- return;
- }
-
- var CHUNK_SIZE = FileReader.READ_CHUNK_SIZE;
- if (readType === 'readAsDataURL') {
- // Windows proxy does not support reading file slices as Data URLs
- // so read the whole file at once.
- CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
- // Calculate new chunk size for data URLs to be multiply of 3
- // Otherwise concatenated base64 chunks won't be valid base64 data
- FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
- }
-
- if (typeof r !== 'undefined') {
- accumulate(r);
- this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
-
- if (typeof this.onprogress === 'function') {
- this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
- }
- }
-
- if (typeof r === 'undefined' || this._progress < totalSize) {
- var execArgs = [
- this._localURL,
- offset + this._progress,
- offset + this._progress + Math.min(totalSize - this._progress, CHUNK_SIZE)];
- if (encoding) {
- execArgs.splice(1, 0, encoding);
- }
- exec(
- readSuccessCallback.bind(this, readType, encoding, offset, totalSize, accumulate),
- readFailureCallback.bind(this),
- 'File', readType, execArgs);
- } else {
- this._readyState = FileReader.DONE;
-
- if (typeof this.onload === 'function') {
- this.onload(new ProgressEvent('load', {target: this}));
- }
-
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
- }
-}
-
-/**
- * Callback used by the following read* functions to handle errors.
- * Must be bound to the FileReader's this, e.g. readFailureCallback.bind(this)
- */
-function readFailureCallback (e) {
- if (this._readyState === FileReader.DONE) {
- return;
- }
-
- this._readyState = FileReader.DONE;
- this._result = null;
- this._error = new FileError(e);
-
- if (typeof this.onerror === 'function') {
- this.onerror(new ProgressEvent('error', {target: this}));
- }
-
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
-}
-
-/**
- * Abort reading file.
- */
-FileReader.prototype.abort = function () {
- if (origFileReader && !this._localURL) {
- return this._realReader.abort();
- }
- this._result = null;
-
- if (this._readyState === FileReader.DONE || this._readyState === FileReader.EMPTY) {
- return;
- }
-
- this._readyState = FileReader.DONE;
-
- // If abort callback
- if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', {target: this}));
- }
- // If load end callback
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
-};
-
-/**
- * Read text file.
- *
- * @param file {File} File object containing file properties
- * @param encoding [Optional] (see http://www.iana.org/assignments/character-sets)
- */
-FileReader.prototype.readAsText = function (file, encoding) {
- if (initRead(this, file)) {
- return this._realReader.readAsText(file, encoding);
- }
-
- // Default encoding is UTF-8
- var enc = encoding || 'UTF-8';
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsText', enc, file.start, totalSize, function (r) {
- if (this._progress === 0) {
- this._result = '';
- }
- this._result += r;
- }.bind(this));
-};
-
-/**
- * Read file and return data as a base64 encoded data url.
- * A data url is of the form:
- * data:[<mediatype>][;base64],<data>
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsDataURL = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsDataURL(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsDataURL', null, file.start, totalSize, function (r) {
- var commaIndex = r.indexOf(',');
- if (this._progress === 0) {
- this._result = r;
- } else {
- this._result += r.substring(commaIndex + 1);
- }
- }.bind(this));
-};
-
-/**
- * Read file and return data as a binary data.
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsBinaryString = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsBinaryString(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsBinaryString', null, file.start, totalSize, function (r) {
- if (this._progress === 0) {
- this._result = '';
- }
- this._result += r;
- }.bind(this));
-};
-
-/**
- * Read file and return data as a binary data.
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsArrayBuffer = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsArrayBuffer(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsArrayBuffer', null, file.start, totalSize, function (r) {
- var resultArray = (this._progress === 0 ? new Uint8Array(totalSize) : new Uint8Array(this._result));
- resultArray.set(new Uint8Array(r), this._progress);
- this._result = resultArray.buffer;
- }.bind(this));
-};
-
-module.exports = FileReader;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileSystem.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileSystem.js
deleted file mode 100644
index ad9ea7859..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileSystem.js
+++ /dev/null
@@ -1,58 +0,0 @@
-cordova.define("cordova-plugin-file.FileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var DirectoryEntry = require('./DirectoryEntry');
-
-/**
- * An interface representing a file system
- *
- * @constructor
- * {DOMString} name the unique name of the file system (readonly)
- * {DirectoryEntry} root directory of the file system (readonly)
- */
-var FileSystem = function (name, root) {
- this.name = name;
- if (root) {
- this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
- } else {
- this.root = new DirectoryEntry(this.name, '/', this);
- }
-};
-
-FileSystem.prototype.__format__ = function (fullPath, nativeUrl) {
- return fullPath;
-};
-
-FileSystem.prototype.toJSON = function () {
- return '<FileSystem: ' + this.name + '>';
-};
-
-// Use instead of encodeURI() when encoding just the path part of a URI rather than an entire URI.
-FileSystem.encodeURIPath = function (path) {
- // Because # is a valid filename character, it must be encoded to prevent part of the
- // path from being parsed as a URI fragment.
- return encodeURI(path).replace(/#/g, '%23');
-};
-
-module.exports = FileSystem;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js
deleted file mode 100644
index 6acd09334..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js
+++ /dev/null
@@ -1,44 +0,0 @@
-cordova.define("cordova-plugin-file.FileUploadOptions", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Options to customize the HTTP request used to upload files.
- * @constructor
- * @param fileKey {String} Name of file request parameter.
- * @param fileName {String} Filename to be used by the server. Defaults to image.jpg.
- * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg.
- * @param params {Object} Object with key: value params to send to the server.
- * @param headers {Object} Keys are header names, values are header values. Multiple
- * headers of the same name are not supported.
- */
-var FileUploadOptions = function (fileKey, fileName, mimeType, params, headers, httpMethod) {
- this.fileKey = fileKey || null;
- this.fileName = fileName || null;
- this.mimeType = mimeType || null;
- this.params = params || null;
- this.headers = headers || null;
- this.httpMethod = httpMethod || null;
-};
-
-module.exports = FileUploadOptions;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js
deleted file mode 100644
index e3c3a7431..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js
+++ /dev/null
@@ -1,33 +0,0 @@
-cordova.define("cordova-plugin-file.FileUploadResult", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * FileUploadResult
- * @constructor
- */
-module.exports = function FileUploadResult (size, code, content) {
- this.bytesSent = size;
- this.responseCode = code;
- this.response = content;
-};
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileWriter.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileWriter.js
deleted file mode 100644
index c3e856219..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/FileWriter.js
+++ /dev/null
@@ -1,328 +0,0 @@
-cordova.define("cordova-plugin-file.FileWriter", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-var FileReader = require('./FileReader');
-var ProgressEvent = require('./ProgressEvent');
-
-/**
- * This class writes to the mobile device file system.
- *
- * For Android:
- * The root directory is the root of the file system.
- * To write to the SD card, the file name is "sdcard/my_file.txt"
- *
- * @constructor
- * @param file {File} File object containing file properties
- * @param append if true write to the end of the file, otherwise overwrite the file
- */
-var FileWriter = function (file) {
- this.fileName = '';
- this.length = 0;
- if (file) {
- this.localURL = file.localURL || file;
- this.length = file.size || 0;
- }
- // default is to write at the beginning of the file
- this.position = 0;
-
- this.readyState = 0; // EMPTY
-
- this.result = null;
-
- // Error
- this.error = null;
-
- // Event handlers
- this.onwritestart = null; // When writing starts
- this.onprogress = null; // While writing the file, and reporting partial file data
- this.onwrite = null; // When the write has successfully completed.
- this.onwriteend = null; // When the request has completed (either in success or failure).
- this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method.
- this.onerror = null; // When the write has failed (see errors).
-};
-
-// States
-FileWriter.INIT = 0;
-FileWriter.WRITING = 1;
-FileWriter.DONE = 2;
-
-/**
- * Abort writing file.
- */
-FileWriter.prototype.abort = function () {
- // check for invalid state
- if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // set error
- this.error = new FileError(FileError.ABORT_ERR);
-
- this.readyState = FileWriter.DONE;
-
- // If abort callback
- if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', {'target': this}));
- }
-
- // If write end callback
- if (typeof this.onwriteend === 'function') {
- this.onwriteend(new ProgressEvent('writeend', {'target': this}));
- }
-};
-
-/**
- * Writes data to the file
- *
- * @param data text or blob to be written
- * @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
- */
-FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
-
- var that = this;
- var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
- /* eslint-disable no-undef */
- var isProxySupportBlobNatively = (cordova.platformId === 'windows8' || cordova.platformId === 'windows');
- var isBinary;
-
- // Check to see if the incoming data is a blob
- if (data instanceof File || (!isProxySupportBlobNatively && supportsBinary && data instanceof Blob)) {
- var fileReader = new FileReader();
- /* eslint-enable no-undef */
- fileReader.onload = function () {
- // Call this method again, with the arraybuffer as argument
- FileWriter.prototype.write.call(that, this.result, true /* isPendingBlobReadResult */);
- };
- fileReader.onerror = function () {
- // DONE state
- that.readyState = FileWriter.DONE;
-
- // Save error
- that.error = this.error;
-
- // If onerror callback
- if (typeof that.onerror === 'function') {
- that.onerror(new ProgressEvent('error', {'target': that}));
- }
-
- // If onwriteend callback
- if (typeof that.onwriteend === 'function') {
- that.onwriteend(new ProgressEvent('writeend', {'target': that}));
- }
- };
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- if (supportsBinary) {
- fileReader.readAsArrayBuffer(data);
- } else {
- fileReader.readAsText(data);
- }
- return;
- }
-
- // Mark data type for safer transport over the binary bridge
- isBinary = supportsBinary && (data instanceof ArrayBuffer);
- if (isBinary && cordova.platformId === 'windowsphone') { // eslint-disable-line no-undef
- // create a plain array, using the keys from the Uint8Array view so that we can serialize it
- data = Array.apply(null, new Uint8Array(data));
- }
-
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING && !isPendingBlobReadResult) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- var me = this;
-
- // If onwritestart callback
- if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', {'target': me}));
- }
-
- // Write file
- exec(
- // Success callback
- function (r) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // position always increases by bytes written because file would be extended
- me.position += r;
- // The length of the file is now where we are done writing.
-
- me.length = me.position;
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // If onwrite callback
- if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- },
- // Error callback
- function (e) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Save error
- me.error = new FileError(e);
-
- // If onerror callback
- if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- }, 'File', 'write', [this.localURL, data, this.position, isBinary]);
-};
-
-/**
- * Moves the file pointer to the location specified.
- *
- * If the offset is a negative number the position of the file
- * pointer is rewound. If the offset is greater than the file
- * size the position is set to the end of the file.
- *
- * @param offset is the location to move the file pointer to.
- */
-FileWriter.prototype.seek = function (offset) {
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- if (!offset && offset !== 0) {
- return;
- }
-
- // See back from end of file.
- if (offset < 0) {
- this.position = Math.max(offset + this.length, 0);
- // Offset is bigger than file size so set position
- // to the end of the file.
- } else if (offset > this.length) {
- this.position = this.length;
- // Offset is between 0 and file size so set the position
- // to start writing.
- } else {
- this.position = offset;
- }
-};
-
-/**
- * Truncates the file to the size specified.
- *
- * @param size to chop the file at.
- */
-FileWriter.prototype.truncate = function (size) {
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- var me = this;
-
- // If onwritestart callback
- if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', {'target': this}));
- }
-
- // Write file
- exec(
- // Success callback
- function (r) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Update the length of the file
- me.length = r;
- me.position = Math.min(me.position, r);
-
- // If onwrite callback
- if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- },
- // Error callback
- function (e) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Save error
- me.error = new FileError(e);
-
- // If onerror callback
- if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- }, 'File', 'truncate', [this.localURL, size]);
-};
-
-module.exports = FileWriter;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Flags.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Flags.js
deleted file mode 100644
index cdb12bb73..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Flags.js
+++ /dev/null
@@ -1,39 +0,0 @@
-cordova.define("cordova-plugin-file.Flags", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Supplies arguments to methods that lookup or create files and directories.
- *
- * @param create
- * {boolean} file or directory if it doesn't exist
- * @param exclusive
- * {boolean} used with create; if true the command will fail if
- * target path exists
- */
-function Flags (create, exclusive) {
- this.create = create || false;
- this.exclusive = exclusive || false;
-}
-
-module.exports = Flags;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js
deleted file mode 100644
index 4ce684812..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js
+++ /dev/null
@@ -1,26 +0,0 @@
-cordova.define("cordova-plugin-file.LocalFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-exports.TEMPORARY = 0;
-exports.PERSISTENT = 1;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Metadata.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Metadata.js
deleted file mode 100644
index 22366e167..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/Metadata.js
+++ /dev/null
@@ -1,43 +0,0 @@
-cordova.define("cordova-plugin-file.Metadata", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Information about the state of the file or directory
- *
- * {Date} modificationTime (readonly)
- */
-var Metadata = function (metadata) {
- if (typeof metadata === 'object') {
- this.modificationTime = new Date(metadata.modificationTime);
- this.size = metadata.size || 0;
- } else if (typeof metadata === 'undefined') {
- this.modificationTime = null;
- this.size = 0;
- } else {
- /* Backwards compatiblity with platforms that only return a timestamp */
- this.modificationTime = new Date(metadata);
- }
-};
-
-module.exports = Metadata;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js
deleted file mode 100644
index cbecdb12b..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js
+++ /dev/null
@@ -1,70 +0,0 @@
-cordova.define("cordova-plugin-file.ProgressEvent", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
-// Feature test: See if we can instantiate a native ProgressEvent;
-// if so, use that approach,
-// otherwise fill-in with our own implementation.
-//
-// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview.
-var ProgressEvent = (function () {
- /*
- var createEvent = function(data) {
- var event = document.createEvent('Events');
- event.initEvent('ProgressEvent', false, false);
- if (data) {
- for (var i in data) {
- if (data.hasOwnProperty(i)) {
- event[i] = data[i];
- }
- }
- if (data.target) {
- // TODO: cannot call <some_custom_object>.dispatchEvent
- // need to first figure out how to implement EventTarget
- }
- }
- return event;
- };
- try {
- var ev = createEvent({type:"abort",target:document});
- return function ProgressEvent(type, data) {
- data.type = type;
- return createEvent(data);
- };
- } catch(e){
- */
- return function ProgressEvent (type, dict) {
- this.type = type;
- this.bubbles = false;
- this.cancelBubble = false;
- this.cancelable = false;
- this.lengthComputable = false;
- this.loaded = dict && dict.loaded ? dict.loaded : 0;
- this.total = dict && dict.total ? dict.total : 0;
- this.target = dict && dict.target ? dict.target : null;
- };
- // }
-})();
-
-module.exports = ProgressEvent;
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/android/FileSystem.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/android/FileSystem.js
deleted file mode 100644
index 0124fa673..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/android/FileSystem.js
+++ /dev/null
@@ -1,51 +0,0 @@
-cordova.define("cordova-plugin-file.androidFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-FILESYSTEM_PROTOCOL = 'cdvfile'; // eslint-disable-line no-undef
-
-module.exports = {
- __format__: function (fullPath, nativeUrl) {
- var path;
- var contentUrlMatch = /^content:\/\//.exec(nativeUrl);
- if (contentUrlMatch) {
- // When available, use the path from a native content URL, which was already encoded by Android.
- // This is necessary because JavaScript's encodeURI() does not encode as many characters as
- // Android, which can result in permission exceptions when the encoding of a content URI
- // doesn't match the string for which permission was originally granted.
- path = nativeUrl.substring(contentUrlMatch[0].length - 1);
- } else {
- path = FileSystem.encodeURIPath(fullPath); // eslint-disable-line no-undef
- if (!/^\//.test(path)) {
- path = '/' + path;
- }
-
- var m = /\?.*/.exec(nativeUrl);
- if (m) {
- path += m[0];
- }
- }
-
- return FILESYSTEM_PROTOCOL + '://localhost/' + this.name + path; // eslint-disable-line no-undef
- }
-};
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js
deleted file mode 100644
index 90450d862..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js
+++ /dev/null
@@ -1,29 +0,0 @@
-cordova.define("cordova-plugin-file.isChrome", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-module.exports = function () {
- // window.webkitRequestFileSystem and window.webkitResolveLocalFileSystemURL are available only in Chrome and
- // possibly a good flag to indicate that we're running in Chrome
- return window.webkitRequestFileSystem && window.webkitResolveLocalFileSystemURL;
-};
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js
deleted file mode 100644
index 4bfc0f629..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js
+++ /dev/null
@@ -1,65 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystemPaths", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var channel = require('cordova/channel');
-
-exports.file = {
- // Read-only directory where the application is installed.
- applicationDirectory: null,
- // Root of app's private writable storage
- applicationStorageDirectory: null,
- // Where to put app-specific data files.
- dataDirectory: null,
- // Cached files that should survive app restarts.
- // Apps should not rely on the OS to delete files in here.
- cacheDirectory: null,
- // Android: the application space on external storage.
- externalApplicationStorageDirectory: null,
- // Android: Where to put app-specific data files on external storage.
- externalDataDirectory: null,
- // Android: the application cache on external storage.
- externalCacheDirectory: null,
- // Android: the external storage (SD card) root.
- externalRootDirectory: null,
- // iOS: Temp directory that the OS can clear at will.
- tempDirectory: null,
- // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
- syncedDataDirectory: null,
- // iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
- documentsDirectory: null,
- // BlackBerry10: Files globally available to all apps
- sharedDirectory: null
-};
-
-channel.waitForInitialization('onFileSystemPathsReady');
-channel.onCordovaReady.subscribe(function () {
- function after (paths) {
- for (var k in paths) {
- exports.file[k] = paths[k];
- }
- channel.initializationComplete('onFileSystemPathsReady');
- }
- exec(after, null, 'File', 'requestAllPaths', []);
-});
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js
deleted file mode 100644
index 6e02953e8..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js
+++ /dev/null
@@ -1,49 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystems-roots", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Map of fsName -> FileSystem.
-var fsMap = null;
-var FileSystem = require('./FileSystem');
-var exec = require('cordova/exec');
-
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-require('./fileSystems').getFs = function (name, callback) {
- function success (response) {
- fsMap = {};
- for (var i = 0; i < response.length; ++i) {
- var fsRoot = response[i];
- if (fsRoot) {
- var fs = new FileSystem(fsRoot.filesystemName, fsRoot);
- fsMap[fs.name] = fs;
- }
- }
- callback(fsMap[name]);
- }
-
- if (fsMap) {
- callback(fsMap[name]);
- } else {
- exec(success, null, 'File', 'requestAllFileSystems', []);
- }
-};
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems.js
deleted file mode 100644
index e61ceafc8..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems.js
+++ /dev/null
@@ -1,28 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystems", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-module.exports.getFs = function (name, callback) {
- callback(null);
-};
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js
deleted file mode 100644
index 7f652193c..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js
+++ /dev/null
@@ -1,84 +0,0 @@
-cordova.define("cordova-plugin-file.requestFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-(function () {
- // For browser platform: not all browsers use this file.
- function checkBrowser () {
- if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
- module.exports = window.requestFileSystem || window.webkitRequestFileSystem;
- return true;
- }
- return false;
- }
- if (checkBrowser()) {
- return;
- }
-
- var argscheck = require('cordova/argscheck');
- var FileError = require('./FileError');
- var FileSystem = require('./FileSystem');
- var exec = require('cordova/exec');
- var fileSystems = require('./fileSystems');
-
- /**
- * Request a file system in which to store application data.
- * @param type local file system type
- * @param size indicates how much storage space, in bytes, the application expects to need
- * @param successCallback invoked with a FileSystem object
- * @param errorCallback invoked if error occurs retrieving file system
- */
- var requestFileSystem = function (type, size, successCallback, errorCallback) {
- argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
- var fail = function (code) {
- if (errorCallback) {
- errorCallback(new FileError(code));
- }
- };
-
- if (type < 0) {
- fail(FileError.SYNTAX_ERR);
- } else {
- // if successful, return a FileSystem object
- var success = function (file_system) {
- if (file_system) {
- if (successCallback) {
- fileSystems.getFs(file_system.name, function (fs) {
- // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
- if (!fs) {
- fs = new FileSystem(file_system.name, file_system.root);
- }
- successCallback(fs);
- });
- }
- } else {
- // no FileSystem object returned
- fail(FileError.NOT_FOUND_ERR);
- }
- };
- exec(success, fail, 'File', 'requestFileSystem', [type, size]);
- }
- };
-
- module.exports = requestFileSystem;
-})();
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
deleted file mode 100644
index 73715bc0e..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
+++ /dev/null
@@ -1,94 +0,0 @@
-cordova.define("cordova-plugin-file.resolveLocalFileSystemURI", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-(function () {
- // For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`.
- function checkBrowser () {
- if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
- module.exports.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
- return true;
- }
- return false;
- }
- if (checkBrowser()) {
- return;
- }
-
- var argscheck = require('cordova/argscheck');
- var DirectoryEntry = require('./DirectoryEntry');
- var FileEntry = require('./FileEntry');
- var FileError = require('./FileError');
- var exec = require('cordova/exec');
- var fileSystems = require('./fileSystems');
-
- /**
- * Look up file system Entry referred to by local URI.
- * @param {DOMString} uri URI referring to a local file or directory
- * @param successCallback invoked with Entry object corresponding to URI
- * @param errorCallback invoked if error occurs retrieving file system entry
- */
- module.exports.resolveLocalFileSystemURL = module.exports.resolveLocalFileSystemURL || function (uri, successCallback, errorCallback) {
- argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments);
- // error callback
- var fail = function (error) {
- if (errorCallback) {
- errorCallback(new FileError(error));
- }
- };
- // sanity check for 'not:valid:filename' or '/not:valid:filename'
- // file.spec.12 window.resolveLocalFileSystemURI should error (ENCODING_ERR) when resolving invalid URI with leading /.
- if (!uri || uri.split(':').length > 2) {
- setTimeout(function () {
- fail(FileError.ENCODING_ERR);
- }, 0);
- return;
- }
- // if successful, return either a file or directory entry
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var fsName = entry.filesystemName || (entry.filesystem && entry.filesystem.name) || (entry.filesystem === window.PERSISTENT ? 'persistent' : 'temporary'); // eslint-disable-line no-undef
- fileSystems.getFs(fsName, function (fs) {
- // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
- if (!fs) {
- fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
- }
- var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- });
- }
- } else {
- // no Entry object returned
- fail(FileError.NOT_FOUND_ERR);
- }
- };
-
- exec(success, fail, 'File', 'resolveLocalFileSystemURI', [uri]);
- };
-
- module.exports.resolveLocalFileSystemURI = function () {
- console.log('resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.');
- module.exports.resolveLocalFileSystemURL.apply(this, arguments);
- };
-})();
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
deleted file mode 100644
index d16bfdc1c..000000000
--- a/cordova/platforms/android/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
+++ /dev/null
@@ -1,160 +0,0 @@
-cordova.define("cordova-plugin-x-socialsharing.SocialSharing", function(require, exports, module) {
-function SocialSharing() {
-}
-
-// Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear.
-// If not overridden with different values, the popup is not used. Example:
-//
-// window.plugins.socialsharing.iPadPopupCoordinates = function() {
-// return "100,100,200,300";
-// };
-SocialSharing.prototype.iPadPopupCoordinates = function () {
- // left,top,width,height
- return "-1,-1,-1,-1";
-};
-
-SocialSharing.prototype.setIPadPopupCoordinates = function (coords) {
- console.log("Deprecated - setIPadPopupCoordinates no longer works since plugin version 5.5.0. See https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/1052");
- // left,top,width,height
- cordova.exec(function() {}, this._getErrorCallback(function() {}, "setIPadPopupCoordinates"), "SocialSharing", "setIPadPopupCoordinates", [coords]);
-};
-
-SocialSharing.prototype.available = function (callback) {
- cordova.exec(function (avail) {
- callback(avail ? true : false);
- }, null, "SocialSharing", "available", []);
-};
-
-// this is the recommended way to share as it is the most feature-rich with respect to what you pass in and get back
-SocialSharing.prototype.shareWithOptions = function (options, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareWithOptions"), "SocialSharing", "shareWithOptions", [options]);
-};
-
-SocialSharing.prototype.shareW3C = function (sharedata) {
- return new Promise(function(resolve, reject) {
- var options = {
- subject: sharedata.title,
- message: sharedata.text,
- url: sharedata.url,
- iPadCoordinates: sharedata.iPadCoordinates || undefined
- };
- if(sharedata.hasOwnProperty('title') ||
- sharedata.hasOwnProperty('text') ||
- sharedata.hasOwnProperty('url')) {
- cordova.exec(resolve, reject, "SocialSharing", "shareWithOptions", [options]);
- } else {
- reject();
- }
- });
-};
-
-SocialSharing.prototype.share = function (message, subject, fileOrFileArray, url, iPadCoordinates, successCallback, errorCallback) {
- if (typeof iPadCoordinates === 'function') {
- errorCallback = successCallback;
- successCallback = iPadCoordinates;
- iPadCoordinates = "";
- }
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "share"), "SocialSharing", "share", [message, subject, this._asArray(fileOrFileArray), url, iPadCoordinates]);
-};
-
-SocialSharing.prototype.shareViaTwitter = function (message, file /* multiple not allowed by twitter */, url, successCallback, errorCallback) {
- var fileArray = this._asArray(file);
- var ecb = this._getErrorCallback(errorCallback, "shareViaTwitter");
- if (fileArray.length > 1) {
- ecb("shareViaTwitter supports max one file");
- } else {
- cordova.exec(successCallback, ecb, "SocialSharing", "shareViaTwitter", [message, null, fileArray, url]);
- }
-};
-
-SocialSharing.prototype.shareViaFacebook = function (message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebook"), "SocialSharing", "shareViaFacebook", [message, null, this._asArray(fileOrFileArray), url]);
-};
-
-SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message, fileOrFileArray, url, pasteMessageHint, successCallback, errorCallback) {
- pasteMessageHint = pasteMessageHint || "If you like you can paste a message from your clipboard";
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebookWithPasteMessageHint"), "SocialSharing", "shareViaFacebookWithPasteMessageHint", [message, null, this._asArray(fileOrFileArray), url, pasteMessageHint]);
-};
-
-SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, null]);
-};
-
-SocialSharing.prototype.shareViaWhatsAppToReceiver = function (receiver, message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToReceiver"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, receiver, null]);
-};
-
-SocialSharing.prototype.shareViaWhatsAppToPhone = function (phone, message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToPhone"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, phone]);
-};
-
-SocialSharing.prototype.shareViaSMS = function (options, phonenumbers, successCallback, errorCallback) {
- var opts = options;
- if (typeof options === "string") {
- opts = {"message":options}; // for backward compatibility as the options param used to be the message
- }
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaSMS"), "SocialSharing", "shareViaSMS", [opts, phonenumbers]);
-};
-
-SocialSharing.prototype.shareViaEmail = function (message, subject, toArray, ccArray, bccArray, fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaEmail"), "SocialSharing", "shareViaEmail", [message, subject, this._asArray(toArray), this._asArray(ccArray), this._asArray(bccArray), this._asArray(fileOrFileArray)]);
-};
-
-SocialSharing.prototype.canShareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareVia"), "SocialSharing", "canShareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
-};
-
-SocialSharing.prototype.canShareViaEmail = function (successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareViaEmail"), "SocialSharing", "canShareViaEmail", []);
-};
-
-SocialSharing.prototype.shareViaInstagram = function (message, fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaInstagram"), "SocialSharing", "shareViaInstagram", [message, null, this._asArray(fileOrFileArray), null]);
-};
-
-SocialSharing.prototype.shareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareVia"), "SocialSharing", "shareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
-};
-
-SocialSharing.prototype.saveToPhotoAlbum = function (fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "saveToPhotoAlbum"), "SocialSharing", "saveToPhotoAlbum", [this._asArray(fileOrFileArray)]);
-};
-
-SocialSharing.prototype._asArray = function (param) {
- if (param == null) {
- param = [];
- } else if (typeof param === 'string') {
- param = new Array(param);
- }
- return param;
-};
-
-SocialSharing.prototype._getErrorCallback = function (ecb, functionName) {
- if (typeof ecb === 'function') {
- return ecb;
- } else {
- return function (result) {
- console.log("The injected error callback of '" + functionName + "' received: " + JSON.stringify(result));
- }
- }
-};
-
-SocialSharing.install = function () {
- if (!window.plugins) {
- window.plugins = {};
- }
-
- window.plugins.socialsharing = new SocialSharing();
-
- // Note only polyfill navigator.share if it is not defined, since shareW3C implements L1 of the spec,
- // and an existing navigator.share method could implement L2.
- if (!navigator.share) {
- navigator.share = window.plugins.socialsharing.shareW3C;
- }
-
- return window.plugins.socialsharing;
-};
-
-cordova.addConstructor(SocialSharing.install);
-
-});
diff --git a/cordova/platforms/android/platform_www/plugins/es6-promise-plugin/www/promise.js b/cordova/platforms/android/platform_www/plugins/es6-promise-plugin/www/promise.js
deleted file mode 100644
index 6cce47ae8..000000000
--- a/cordova/platforms/android/platform_www/plugins/es6-promise-plugin/www/promise.js
+++ /dev/null
@@ -1,13 +0,0 @@
-cordova.define("es6-promise-plugin.Promise", function(require, exports, module) {
-/*!
- * @overview es6-promise - a tiny implementation of Promises/A+.
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
- * @license Licensed under MIT license
- * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
- * @version v4.2.2+97478eb6
- */
-
-!function t(e,n,r){function o(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(t){var n=e[u][1][t];return o(n?n:t)},a,a.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t){void 0===window.Promise&&t("es6-promise").polyfill()},{"es6-promise":2}],2:[function(t,e,n){(function(r,o){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.ES6Promise=r()}(this,function(){"use strict";function e(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function n(t){return"function"==typeof t}function i(t){J=t}function u(t){Q=t}function s(){return function(){return r.nextTick(h)}}function c(){return"undefined"!=typeof I?function(){I(h)}:l()}function f(){var t=0,e=new X(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function a(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function l(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;H>t;t+=2){var e=te[t],n=te[t+1];e(n),te[t]=void 0,te[t+1]=void 0}H=0}function p(){try{var e=t,n=e("vertx");return I=n.runOnLoop||n.runOnContext,c()}catch(r){return l()}}function d(t,e){var n=this,r=new this.constructor(y);void 0===r[ne]&&D(r);var o=n._state;if(o){var i=arguments[o-1];Q(function(){return L(o,r,i,n._result)})}else O(n,r,t,e);return r}function v(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(y);return E(n,t),n}function y(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ue.error=e,ue}}function g(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function b(t,e,n){Q(function(t){var r=!1,o=g(n,e,function(n){r||(r=!0,e!==n?E(t,n):j(t,n))},function(e){r||(r=!0,x(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,x(t,o))},t)}function T(t,e){e._state===oe?j(t,e._result):e._state===ie?x(t,e._result):O(e,void 0,function(e){return E(t,e)},function(e){return x(t,e)})}function A(t,e,r){e.constructor===t.constructor&&r===d&&e.constructor.resolve===v?T(t,e):r===ue?(x(t,ue.error),ue.error=null):void 0===r?j(t,e):n(r)?b(t,e,r):j(t,e)}function E(t,n){t===n?x(t,m()):e(n)?A(t,n,w(n)):j(t,n)}function S(t){t._onerror&&t._onerror(t._result),M(t)}function j(t,e){t._state===re&&(t._result=e,t._state=oe,0!==t._subscribers.length&&Q(M,t))}function x(t,e){t._state===re&&(t._state=ie,t._result=e,Q(S,t))}function O(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+oe]=n,o[i+ie]=r,0===i&&t._state&&Q(M,t)}function M(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)r=e[u],o=e[u+n],r?L(n,r,o,i):o(i);t._subscribers.length=0}}function P(){this.error=null}function C(t,e){try{return t(e)}catch(n){return se.error=n,se}}function L(t,e,r,o){var i=n(r),u=void 0,s=void 0,c=void 0,f=void 0;if(i){if(u=C(r,o),u===se?(f=!0,s=u.error,u.error=null):c=!0,e===u)return x(e,_()),void 0}else u=o,c=!0;e._state!==re||(i&&c?E(e,u):f?x(e,s):t===oe?j(e,u):t===ie&&x(e,u))}function k(t,e){try{e(function(e){E(t,e)},function(e){x(t,e)})}catch(n){x(t,n)}}function q(){return ce++}function D(t){t[ne]=ce++,t._state=void 0,t._result=void 0,t._subscribers=[]}function F(){return new Error("Array Methods must be provided an Array")}function F(){return new Error("Array Methods must be provided an Array")}function N(t){return new fe(this,t).promise}function U(t){var e=this;return G(t)?new e(function(n,r){for(var o=t.length,i=0;o>i;i++)e.resolve(t[i]).then(n,r)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})}function Y(t){var e=this,n=new e(y);return x(n,t),n}function K(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function z(){var t=void 0;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=ae}var B=void 0;B=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=B,H=0,I=void 0,J=void 0,Q=function(t,e){te[H]=t,te[H+1]=e,H+=2,2===H&&(J?J(h):ee())},R="undefined"!=typeof window?window:void 0,V=R||{},X=V.MutationObserver||V.WebKitMutationObserver,Z="undefined"==typeof self&&"undefined"!=typeof r&&"[object process]"==={}.toString.call(r),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3),ee=void 0;ee=Z?s():X?f():$?a():void 0===R&&"function"==typeof t?p():l();var ne=Math.random().toString(36).substring(16),re=void 0,oe=1,ie=2,ue=new P,se=new P,ce=0,fe=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(y),this.promise[ne]||D(this.promise),G(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&j(this.promise,this._result))):x(this.promise,F())}return t.prototype._enumerate=function(t){for(var e=0;this._state===re&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===v){var o=w(t);if(o===d&&t._state!==re)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===ae){var i=new n(y);A(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===re&&(this._remaining--,t===ie?x(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){return n._settledAt(oe,e,t)},function(t){return n._settledAt(ie,e,t)})},t}(),ae=function(){function t(e){this[ne]=q(),this._result=this._state=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&K(),this instanceof t?k(this,e):W())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this,n=e.constructor;return e.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})},t}();return ae.prototype.then=d,ae.all=N,ae.race=U,ae.resolve=v,ae.reject=Y,ae._setScheduler=i,ae._setAsap=u,ae._asap=Q,ae.polyfill=z,ae.Promise=ae,ae})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],3:[function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(a===setTimeout)return setTimeout(t,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(t,0);try{return a(t,0)}catch(e){try{return a.call(null,t,0)}catch(e){return a.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!v){var t=o(u);v=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var a,l,h=e.exports={};!function(){try{a="function"==typeof setTimeout?setTimeout:n}catch(t){a=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,d=[],v=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(){return[]},h.binding=function(){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}]},{},[1]);
-
-
-});
diff --git a/cordova/platforms/android/project.properties b/cordova/platforms/android/project.properties
deleted file mode 100644
index 6c069afe2..000000000
--- a/cordova/platforms/android/project.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file was originally created by the Android Tools, but is now
-# used by cordova-android to manage the state of the various third party
-# libraries used in your application
-
-# This is the Library Module that contains the Cordova Library, this is not
-# required when using an AAR
-
-# This is the application project. This is only required for Android Studio Gradle projects
-
-# Project target.
-target=android-29
-android.library.reference.1=CordovaLib
-android.library.reference.2=app
-cordova.system.library.1=androidx.core:core:1.1.0
-cordova.gradle.include.1=com.ourcodeworld.plugins.Filebrowser/mobileapp-plugin.gradle
-cordova.system.library.2=androidx.legacy:legacy-support-v4:1.0.0
-cordova.system.library.3=androidx.legacy:legacy-support-v4:1.0.0
-cordova.system.library.4=androidx.legacy:legacy-support-v4:1.0.0
diff --git a/cordova/platforms/android/repositories.gradle b/cordova/platforms/android/repositories.gradle
deleted file mode 100644
index 1384d1457..000000000
--- a/cordova/platforms/android/repositories.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-ext.repos = {
- google()
- jcenter()
-}
diff --git a/cordova/platforms/android/settings.gradle b/cordova/platforms/android/settings.gradle
deleted file mode 100644
index dfb85579d..000000000
--- a/cordova/platforms/android/settings.gradle
+++ /dev/null
@@ -1,4 +0,0 @@
-// GENERATED FILE - DO NOT EDIT
-include ":"
-include ":CordovaLib"
-include ":app"
diff --git a/cordova/platforms/android/wrapper.gradle b/cordova/platforms/android/wrapper.gradle
deleted file mode 100644
index d7ebabd72..000000000
--- a/cordova/platforms/android/wrapper.gradle
+++ /dev/null
@@ -1 +0,0 @@
-//This file is intentionally just a comment
diff --git a/cordova/platforms/ios/.gitignore b/cordova/platforms/ios/.gitignore
deleted file mode 100644
index cc76483f6..000000000
--- a/cordova/platforms/ios/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.mode1v3
-*.perspectivev3
-*.pbxuser
-.DS_Store
-build/
diff --git a/cordova/platforms/ios/App.xcodeproj/project.pbxproj b/cordova/platforms/ios/App.xcodeproj/project.pbxproj
deleted file mode 100755
index 39acab319..000000000
--- a/cordova/platforms/ios/App.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,636 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 60;
- objects = {
-
-/* Begin PBXBuildFile section */
- 907F98562C06B87200D2D242 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 907F98552C06B87200D2D242 /* PrivacyInfo.xcprivacy */; };
- 907F98662C06BC1B00D2D242 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 907F98652C06BC1B00D2D242 /* config.xml */; };
- 907F986A2C06BCD300D2D242 /* www in Resources */ = {isa = PBXBuildFile; fileRef = 907F98692C06BCD300D2D242 /* www */; };
- 90A914592CA3D370003DB979 /* Cordova in Frameworks */ = {isa = PBXBuildFile; productRef = 90A914582CA3D370003DB979 /* Cordova */; };
- 90BD9B7A2C06907D000DEBAB /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 90BD9B792C06907D000DEBAB /* Base */; };
- 90BD9B7C2C06907E000DEBAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90BD9B7B2C06907E000DEBAB /* Assets.xcassets */; };
- 90BD9B7F2C06907E000DEBAB /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 90BD9B7E2C06907E000DEBAB /* Base */; };
- 90CBB5282C06968500B805A2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB5272C06968500B805A2 /* AppDelegate.swift */; };
- 90CBB52A2C06968500B805A2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB5292C06968500B805A2 /* SceneDelegate.swift */; };
- 90CBB52C2C06968500B805A2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB52B2C06968500B805A2 /* ViewController.swift */; };
- 90D82ABD2CF19AEA001383CF /* CordovaPlugins in Frameworks */ = {isa = PBXBuildFile; productRef = 90D82ABC2CF19AEA001383CF /* CordovaPlugins */; };
- 8B6D746AB6784BBDBD1FDB5C /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08A211998CB4C9CAA7B0B1E /* Downloader.swift */; };
- 5EE7AF17F1814EAA9DB9B632 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = F6D2E458CF444CDCACBB29A7 /* CDVDevice.m */; };
- 7AC77B4ED7024E9399B4AEBB /* APPBackgroundMode.m in Sources */ = {isa = PBXBuildFile; fileRef = B5AD53E5FD924993A288DAF8 /* APPBackgroundMode.m */; };
- 3921269DA02C4B359E4C3021 /* APPMethodMagic.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CA5E14DF9884624B3817506 /* APPMethodMagic.m */; };
- 97C4D801879447A9A49795F4 /* appbeep.wav in Resources */ = {isa = PBXBuildFile; fileRef = EADE3DA7D3A847D1A388413D /* appbeep.wav */; };
- 4550856B9FB84DAAAC08AB97 /* CDVFile.m in Sources */ = {isa = PBXBuildFile; fileRef = D93579623C1A4451B27262FF /* CDVFile.m */; };
- 7C421B76F2FF46C195223500 /* CDVLocalFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = AC07D5F062E24FAAA7469A58 /* CDVLocalFilesystem.m */; };
- 1ED5D70524C94EE1958772C8 /* CDVAssetLibraryFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 056915956BD4456FB9EADED5 /* CDVAssetLibraryFilesystem.m */; };
- 7BBD621DCB904C6EB1D4C3BC /* FileOpener2.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B9A8D5D4BEF4488B802F06B /* FileOpener2.m */; };
- 32E8E41ED89B40D2BE58D24D /* NSString+SSURLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 6623E5A56C4749DEB5D2AB2C /* NSString+SSURLEncoding.m */; };
- 0645FB225CEA45DBA045E1B0 /* SocialSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D2AE4D4F0934D68904B9100 /* SocialSharing.m */; };
- CE71D7FE969C408EAC23A1FD /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E181E201B5D34148971AB055 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 191ACBE97BD049598C9FD160 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5DF15065E8A4AD99BF7885C /* MessageUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- AA70162D431645389AC4E8C8 /* UIImage+CropScaleOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 79408A8909D447A3B71E3A37 /* UIImage+CropScaleOrientation.m */; };
- 1BE83F16BCB64DF1B6F55046 /* CDVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = BEBBDA6A98E04CD0A7B766E9 /* CDVCamera.m */; };
- E0B1AB6529D842688A1974D6 /* CDVJpegHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 5072190018BB418ABC2FE2CE /* CDVJpegHeaderWriter.m */; };
- E09C94120362409D8F27D833 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19FA584C297642399D8E9705 /* ImageIO.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 3589191384F64C638E24E2CB /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C38C8E066424CE5BF6960C9 /* CoreLocation.framework */; };
- 25F57262FB204B99B55314FB /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 770671E12B2C44D59330AA70 /* AVFoundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 902AE2152C6C059A0041150F /* Embed Frameworks */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 10;
- files = (
- );
- name = "Embed Frameworks";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 9040B1872C6DD3EB00662C5D /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
- 9040B1882C6DD41B00662C5D /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
- 907F98552C06B87200D2D242 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
- 907F98622C06B97000D2D242 /* Entitlements-Debug.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Entitlements-Debug.plist"; sourceTree = "<group>"; };
- 907F98632C06B9C800D2D242 /* Entitlements-Release.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Entitlements-Release.plist"; sourceTree = "<group>"; };
- 907F98652C06BC1B00D2D242 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
- 907F98692C06BCD300D2D242 /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
- 9080B40F2C6DD7EC00078F33 /* config.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
- 90BD9B6C2C06907D000DEBAB /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 90BD9B792C06907D000DEBAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
- 90BD9B7B2C06907E000DEBAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
- 90BD9B7E2C06907E000DEBAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/CDVLaunchScreen.storyboard; sourceTree = "<group>"; };
- 90BD9B802C06907E000DEBAB /* App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "App-Info.plist"; sourceTree = "<group>"; };
- 90CBB5272C06968500B805A2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
- 90CBB5292C06968500B805A2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
- 90CBB52B2C06968500B805A2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
- 90EB303B2C6DD83300CEEB2F /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; };
- 90EB303C2C6DD83300CEEB2F /* build-extras.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-extras.xcconfig"; path = "cordova/build-extras.xcconfig"; sourceTree = SOURCE_ROOT; };
- 90EB303F2C6DD87600CEEB2F /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
- 90EB30402C6DD87600CEEB2F /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; };
- 90F7E7002C6EB78900AD84C2 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
- 90F7E7012C6EB78900AD84C2 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
- F08A211998CB4C9CAA7B0B1E /* Downloader.swift */ = {isa = PBXFileReference; name = "Downloader.swift"; path = "com.whebcraft.cordova.plugin.downloader/Downloader.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; includeInIndex = 0; };
- F6D2E458CF444CDCACBB29A7 /* CDVDevice.m */ = {isa = PBXFileReference; name = "CDVDevice.m"; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 1579879C3824404F819A9E8F /* CDVDevice.h */ = {isa = PBXFileReference; name = "CDVDevice.h"; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- B5AD53E5FD924993A288DAF8 /* APPBackgroundMode.m */ = {isa = PBXFileReference; name = "APPBackgroundMode.m"; path = "cordova-plugin-background-mode/APPBackgroundMode.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 3CA5E14DF9884624B3817506 /* APPMethodMagic.m */ = {isa = PBXFileReference; name = "APPMethodMagic.m"; path = "cordova-plugin-background-mode/APPMethodMagic.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 910909FE259C453B9667FAC3 /* APPBackgroundMode.h */ = {isa = PBXFileReference; name = "APPBackgroundMode.h"; path = "cordova-plugin-background-mode/APPBackgroundMode.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 53A55FEDB6A74B99A86BBDD8 /* APPMethodMagic.h */ = {isa = PBXFileReference; name = "APPMethodMagic.h"; path = "cordova-plugin-background-mode/APPMethodMagic.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- EADE3DA7D3A847D1A388413D /* appbeep.wav */ = {isa = PBXFileReference; name = "appbeep.wav"; path = "appbeep.wav"; sourceTree = "<group>"; lastKnownFileType = unknown; includeInIndex = 0; };
- D93579623C1A4451B27262FF /* CDVFile.m */ = {isa = PBXFileReference; name = "CDVFile.m"; path = "cordova-plugin-file/CDVFile.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- AC07D5F062E24FAAA7469A58 /* CDVLocalFilesystem.m */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.m"; path = "cordova-plugin-file/CDVLocalFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 056915956BD4456FB9EADED5 /* CDVAssetLibraryFilesystem.m */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.m"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 74623D9AD29148A1B2E8EF5C /* CDVFile.h */ = {isa = PBXFileReference; name = "CDVFile.h"; path = "cordova-plugin-file/CDVFile.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 37576CA46A7047ED9265AF58 /* CDVLocalFilesystem.h */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.h"; path = "cordova-plugin-file/CDVLocalFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- F762E469D4AE4C96B1093AF8 /* CDVAssetLibraryFilesystem.h */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.h"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 2B9A8D5D4BEF4488B802F06B /* FileOpener2.m */ = {isa = PBXFileReference; name = "FileOpener2.m"; path = "cordova-plugin-file-opener2/FileOpener2.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 30C096BE39254EA387829D33 /* FileOpener2.h */ = {isa = PBXFileReference; name = "FileOpener2.h"; path = "cordova-plugin-file-opener2/FileOpener2.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 6623E5A56C4749DEB5D2AB2C /* NSString+SSURLEncoding.m */ = {isa = PBXFileReference; name = "NSString+SSURLEncoding.m"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 3D2AE4D4F0934D68904B9100 /* SocialSharing.m */ = {isa = PBXFileReference; name = "SocialSharing.m"; path = "cordova-plugin-x-socialsharing/SocialSharing.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 4A11CC71BD4C4F878AE3232C /* NSString+SSURLEncoding.h */ = {isa = PBXFileReference; name = "NSString+SSURLEncoding.h"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 544B3072C77B4C1B8D7DF4D5 /* SocialSharing.h */ = {isa = PBXFileReference; name = "SocialSharing.h"; path = "cordova-plugin-x-socialsharing/SocialSharing.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- E181E201B5D34148971AB055 /* Social.framework */ = {isa = PBXFileReference; name = "Social.framework"; path = "System/Library/Frameworks/Social.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
- E5DF15065E8A4AD99BF7885C /* MessageUI.framework */ = {isa = PBXFileReference; name = "MessageUI.framework"; path = "System/Library/Frameworks/MessageUI.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
- 79408A8909D447A3B71E3A37 /* UIImage+CropScaleOrientation.m */ = {isa = PBXFileReference; name = "UIImage+CropScaleOrientation.m"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- BEBBDA6A98E04CD0A7B766E9 /* CDVCamera.m */ = {isa = PBXFileReference; name = "CDVCamera.m"; path = "cordova-plugin-camera/CDVCamera.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- 5072190018BB418ABC2FE2CE /* CDVJpegHeaderWriter.m */ = {isa = PBXFileReference; name = "CDVJpegHeaderWriter.m"; path = "cordova-plugin-camera/CDVJpegHeaderWriter.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
- D8C16A6E22A04975950CED74 /* UIImage+CropScaleOrientation.h */ = {isa = PBXFileReference; name = "UIImage+CropScaleOrientation.h"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 4B41B040A42E4840A98FC527 /* CDVCamera.h */ = {isa = PBXFileReference; name = "CDVCamera.h"; path = "cordova-plugin-camera/CDVCamera.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- ACAE658C7FE64932ACC0101B /* CDVJpegHeaderWriter.h */ = {isa = PBXFileReference; name = "CDVJpegHeaderWriter.h"; path = "cordova-plugin-camera/CDVJpegHeaderWriter.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 76F264E800DC4D41A6F1F655 /* CDVExif.h */ = {isa = PBXFileReference; name = "CDVExif.h"; path = "cordova-plugin-camera/CDVExif.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
- 19FA584C297642399D8E9705 /* ImageIO.framework */ = {isa = PBXFileReference; name = "ImageIO.framework"; path = "System/Library/Frameworks/ImageIO.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
- 9C38C8E066424CE5BF6960C9 /* CoreLocation.framework */ = {isa = PBXFileReference; name = "CoreLocation.framework"; path = "System/Library/Frameworks/CoreLocation.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
- 770671E12B2C44D59330AA70 /* AVFoundation.framework */ = {isa = PBXFileReference; name = "AVFoundation.framework"; path = "System/Library/Frameworks/AVFoundation.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 90BD9B692C06907D000DEBAB /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 90A914592CA3D370003DB979 /* Cordova in Frameworks */,
- 90D82ABD2CF19AEA001383CF /* CordovaPlugins in Frameworks */,
- CE71D7FE969C408EAC23A1FD /* Social.framework in Frameworks */,
- 191ACBE97BD049598C9FD160 /* MessageUI.framework in Frameworks */,
- E09C94120362409D8F27D833 /* ImageIO.framework in Frameworks */,
- 3589191384F64C638E24E2CB /* CoreLocation.framework in Frameworks */,
- 25F57262FB204B99B55314FB /* AVFoundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 905D2F6D2C6DDEE100117937 /* Resources */ = {
- isa = PBXGroup;
- children = (
- EADE3DA7D3A847D1A388413D /* appbeep.wav */,
- );
- path = Resources;
- sourceTree = "<group>";
- };
- 907F98542C06B85800D2D242 /* Plugins */ = {
- isa = PBXGroup;
- children = (
- F08A211998CB4C9CAA7B0B1E /* Downloader.swift */,
- F6D2E458CF444CDCACBB29A7 /* CDVDevice.m */,
- 1579879C3824404F819A9E8F /* CDVDevice.h */,
- B5AD53E5FD924993A288DAF8 /* APPBackgroundMode.m */,
- 3CA5E14DF9884624B3817506 /* APPMethodMagic.m */,
- 910909FE259C453B9667FAC3 /* APPBackgroundMode.h */,
- 53A55FEDB6A74B99A86BBDD8 /* APPMethodMagic.h */,
- D93579623C1A4451B27262FF /* CDVFile.m */,
- AC07D5F062E24FAAA7469A58 /* CDVLocalFilesystem.m */,
- 056915956BD4456FB9EADED5 /* CDVAssetLibraryFilesystem.m */,
- 74623D9AD29148A1B2E8EF5C /* CDVFile.h */,
- 37576CA46A7047ED9265AF58 /* CDVLocalFilesystem.h */,
- F762E469D4AE4C96B1093AF8 /* CDVAssetLibraryFilesystem.h */,
- 2B9A8D5D4BEF4488B802F06B /* FileOpener2.m */,
- 30C096BE39254EA387829D33 /* FileOpener2.h */,
- 6623E5A56C4749DEB5D2AB2C /* NSString+SSURLEncoding.m */,
- 3D2AE4D4F0934D68904B9100 /* SocialSharing.m */,
- 4A11CC71BD4C4F878AE3232C /* NSString+SSURLEncoding.h */,
- 544B3072C77B4C1B8D7DF4D5 /* SocialSharing.h */,
- 79408A8909D447A3B71E3A37 /* UIImage+CropScaleOrientation.m */,
- BEBBDA6A98E04CD0A7B766E9 /* CDVCamera.m */,
- 5072190018BB418ABC2FE2CE /* CDVJpegHeaderWriter.m */,
- D8C16A6E22A04975950CED74 /* UIImage+CropScaleOrientation.h */,
- 4B41B040A42E4840A98FC527 /* CDVCamera.h */,
- ACAE658C7FE64932ACC0101B /* CDVJpegHeaderWriter.h */,
- 76F264E800DC4D41A6F1F655 /* CDVExif.h */,
- );
- path = Plugins;
- sourceTree = "<group>";
- };
- 907F98602C06B8F000D2D242 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- E181E201B5D34148971AB055 /* Social.framework */,
- E5DF15065E8A4AD99BF7885C /* MessageUI.framework */,
- 19FA584C297642399D8E9705 /* ImageIO.framework */,
- 9C38C8E066424CE5BF6960C9 /* CoreLocation.framework */,
- 770671E12B2C44D59330AA70 /* AVFoundation.framework */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- 9080B40D2C6DD79000078F33 /* config */ = {
- isa = PBXGroup;
- children = (
- 90EB303F2C6DD87600CEEB2F /* build-debug.xcconfig */,
- 90EB30402C6DD87600CEEB2F /* build-release.xcconfig */,
- 90EB303C2C6DD83300CEEB2F /* build-extras.xcconfig */,
- 90EB303B2C6DD83300CEEB2F /* build.xcconfig */,
- );
- name = config;
- sourceTree = "<group>";
- };
- 9080B40E2C6DD7A100078F33 /* staging */ = {
- isa = PBXGroup;
- children = (
- 907F98652C06BC1B00D2D242 /* config.xml */,
- 907F98692C06BCD300D2D242 /* www */,
- );
- name = staging;
- sourceTree = "<group>";
- };
- 90BD9B632C06907D000DEBAB /* CustomTemplate */ = {
- isa = PBXGroup;
- children = (
- 9080B40F2C6DD7EC00078F33 /* config.xml */,
- 9040B1882C6DD41B00662C5D /* www */,
- 90BD9B6E2C06907D000DEBAB /* App */,
- 90BD9B6D2C06907D000DEBAB /* Products */,
- 907F98602C06B8F000D2D242 /* Frameworks */,
- );
- name = CustomTemplate;
- sourceTree = "<group>";
- };
- 90BD9B6D2C06907D000DEBAB /* Products */ = {
- isa = PBXGroup;
- children = (
- 90BD9B6C2C06907D000DEBAB /* App.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 90BD9B6E2C06907D000DEBAB /* App */ = {
- isa = PBXGroup;
- children = (
- 90CBB5272C06968500B805A2 /* AppDelegate.swift */,
- 90CBB5292C06968500B805A2 /* SceneDelegate.swift */,
- 90CBB52B2C06968500B805A2 /* ViewController.swift */,
- 90BD9B7D2C06907E000DEBAB /* CDVLaunchScreen.storyboard */,
- 90BD9B782C06907D000DEBAB /* Main.storyboard */,
- 90BD9B7B2C06907E000DEBAB /* Assets.xcassets */,
- 90BD9B802C06907E000DEBAB /* Info.plist */,
- 907F98552C06B87200D2D242 /* PrivacyInfo.xcprivacy */,
- 907F98622C06B97000D2D242 /* Entitlements-Debug.plist */,
- 907F98632C06B9C800D2D242 /* Entitlements-Release.plist */,
- 90F7E7002C6EB78900AD84C2 /* AppDelegate.h */,
- 9040B1872C6DD3EB00662C5D /* Bridging-Header.h */,
- 90F7E7012C6EB78900AD84C2 /* MainViewController.h */,
- 907F98542C06B85800D2D242 /* Plugins */,
- 905D2F6D2C6DDEE100117937 /* Resources */,
- 9080B40D2C6DD79000078F33 /* config */,
- 9080B40E2C6DD7A100078F33 /* staging */,
- );
- path = App;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 90BD9B6B2C06907D000DEBAB /* App */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 90BD9B852C06907E000DEBAB /* Build configuration list for PBXNativeTarget "App" */;
- buildPhases = (
- 90BD9B682C06907D000DEBAB /* Sources */,
- 90BD9B692C06907D000DEBAB /* Frameworks */,
- 90BD9B6A2C06907D000DEBAB /* Resources */,
- 902AE2152C6C059A0041150F /* Embed Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = App;
- packageProductDependencies = (
- 90A914582CA3D370003DB979 /* Cordova */,
- 90D82ABC2CF19AEA001383CF /* CordovaPlugins */,
- );
- productName = App;
- productReference = 90BD9B6C2C06907D000DEBAB /* App.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 90BD9B642C06907D000DEBAB /* Project object */ = {
- isa = PBXProject;
- attributes = {
- BuildIndependentTargetsInParallel = YES;
- LastSwiftUpdateCheck = 1540;
- LastUpgradeCheck = 2600;
- TargetAttributes = {
- 90BD9B6B2C06907D000DEBAB = {
- CreatedOnToolsVersion = 15.4;
- };
- };
- };
- buildConfigurationList = 90BD9B672C06907D000DEBAB /* Build configuration list for PBXProject "App" */;
- compatibilityVersion = "Xcode 15.0";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 90BD9B632C06907D000DEBAB /* CustomTemplate */;
- packageReferences = (
- 90A914572CA3D370003DB979 /* XCLocalSwiftPackageReference "../../../cordova-ios" */,
- 90D82ABB2CF19AEA001383CF /* XCLocalSwiftPackageReference "CordovaPlugins" */,
- );
- productRefGroup = 90BD9B6D2C06907D000DEBAB /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 90BD9B6B2C06907D000DEBAB /* App */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 90BD9B6A2C06907D000DEBAB /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 907F986A2C06BCD300D2D242 /* www in Resources */,
- 90BD9B7C2C06907E000DEBAB /* Assets.xcassets in Resources */,
- 90BD9B7F2C06907E000DEBAB /* Base in Resources */,
- 907F98562C06B87200D2D242 /* PrivacyInfo.xcprivacy in Resources */,
- 90BD9B7A2C06907D000DEBAB /* Base in Resources */,
- 907F98662C06BC1B00D2D242 /* config.xml in Resources */,
- 97C4D801879447A9A49795F4 /* appbeep.wav in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 90BD9B682C06907D000DEBAB /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 90CBB52C2C06968500B805A2 /* ViewController.swift in Sources */,
- 90CBB5282C06968500B805A2 /* AppDelegate.swift in Sources */,
- 90CBB52A2C06968500B805A2 /* SceneDelegate.swift in Sources */,
- 8B6D746AB6784BBDBD1FDB5C /* Downloader.swift in Sources */,
- 5EE7AF17F1814EAA9DB9B632 /* CDVDevice.m in Sources */,
- 7AC77B4ED7024E9399B4AEBB /* APPBackgroundMode.m in Sources */,
- 3921269DA02C4B359E4C3021 /* APPMethodMagic.m in Sources */,
- 4550856B9FB84DAAAC08AB97 /* CDVFile.m in Sources */,
- 7C421B76F2FF46C195223500 /* CDVLocalFilesystem.m in Sources */,
- 1ED5D70524C94EE1958772C8 /* CDVAssetLibraryFilesystem.m in Sources */,
- 7BBD621DCB904C6EB1D4C3BC /* FileOpener2.m in Sources */,
- 32E8E41ED89B40D2BE58D24D /* NSString+SSURLEncoding.m in Sources */,
- 0645FB225CEA45DBA045E1B0 /* SocialSharing.m in Sources */,
- AA70162D431645389AC4E8C8 /* UIImage+CropScaleOrientation.m in Sources */,
- 1BE83F16BCB64DF1B6F55046 /* CDVCamera.m in Sources */,
- E0B1AB6529D842688A1974D6 /* CDVJpegHeaderWriter.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
- 90BD9B782C06907D000DEBAB /* Main.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 90BD9B792C06907D000DEBAB /* Base */,
- );
- name = Main.storyboard;
- sourceTree = "<group>";
- };
- 90BD9B7D2C06907E000DEBAB /* CDVLaunchScreen.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 90BD9B7E2C06907E000DEBAB /* Base */,
- );
- name = CDVLaunchScreen.storyboard;
- sourceTree = "<group>";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 90BD9B832C06907E000DEBAB /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- "DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
- "DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
- "DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
- DSTROOT = "$(SRCROOT)/build";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu17;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- "INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- "INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- "INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- IPHONEOS_DEPLOYMENT_TARGET = 13.0;
- LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
- MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
- MTL_FAST_MATH = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- STRING_CATALOG_GENERATE_SYMBOLS = YES;
- SUPPORTS_MACCATALYST = YES;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_WORKSPACE = NO;
- };
- name = Debug;
- };
- 90BD9B842C06907E000DEBAB /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- "DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
- "DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
- "DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
- DSTROOT = "$(SRCROOT)/build";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu17;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- "INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- "INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- "INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
- IPHONEOS_DEPLOYMENT_TARGET = 13.0;
- LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
- MTL_ENABLE_DEBUG_INFO = NO;
- MTL_FAST_MATH = YES;
- SDKROOT = iphoneos;
- STRING_CATALOG_GENERATE_SYMBOLS = YES;
- SUPPORTS_MACCATALYST = YES;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
- SWIFT_COMPILATION_MODE = wholemodule;
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 90BD9B862C06907E000DEBAB /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 90EB303F2C6DD87600CEEB2F /* build-debug.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CODE_SIGN_ENTITLEMENTS = "$(TARGET_NAME)/Entitlements-$(CONFIGURATION).plist";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1.0.0;
- GENERATE_INFOPLIST_FILE = YES;
- INFOPLIST_FILE = "$(TARGET_NAME)/$(TARGET_NAME)-Info.plist";
- INFOPLIST_KEY_CFBundleDisplayName = "$(PRODUCT_NAME)";
- INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
- INFOPLIST_KEY_UILaunchStoryboardName = CDVLaunchScreen;
- INFOPLIST_KEY_UIMainStoryboardFile = Main;
- INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
- INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- MARKETING_VERSION = 1.0.0;
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-ObjC",
- );
- PRODUCT_BUNDLE_IDENTIFIER = "org.tagspaces.mobileapp";
- PRODUCT_NAME = "TagSpaces";
- SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
- SUPPORTS_MACCATALYST = YES;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
- SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
- SWIFT_EMIT_LOC_STRINGS = YES;
- SWIFT_OBJC_BRIDGING_HEADER = "$(TARGET_NAME)/Bridging-Header.h";
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = "1,2,6,7";
- };
- name = Debug;
- };
- 90BD9B872C06907E000DEBAB /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 90EB30402C6DD87600CEEB2F /* build-release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CODE_SIGN_ENTITLEMENTS = "$(TARGET_NAME)/Entitlements-$(CONFIGURATION).plist";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1.0.0;
- GENERATE_INFOPLIST_FILE = YES;
- INFOPLIST_FILE = "$(TARGET_NAME)/$(TARGET_NAME)-Info.plist";
- INFOPLIST_KEY_CFBundleDisplayName = "$(PRODUCT_NAME)";
- INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
- INFOPLIST_KEY_UILaunchStoryboardName = CDVLaunchScreen;
- INFOPLIST_KEY_UIMainStoryboardFile = Main;
- INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
- INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- MARKETING_VERSION = 1.0.0;
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-ObjC",
- );
- PRODUCT_BUNDLE_IDENTIFIER = "org.tagspaces.mobileapp";
- PRODUCT_NAME = "TagSpaces";
- SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
- SUPPORTS_MACCATALYST = YES;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
- SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
- SWIFT_EMIT_LOC_STRINGS = YES;
- SWIFT_OBJC_BRIDGING_HEADER = "$(TARGET_NAME)/Bridging-Header.h";
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = "1,2,6,7";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 90BD9B672C06907D000DEBAB /* Build configuration list for PBXProject "App" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 90BD9B832C06907E000DEBAB /* Debug */,
- 90BD9B842C06907E000DEBAB /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 90BD9B852C06907E000DEBAB /* Build configuration list for PBXNativeTarget "App" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 90BD9B862C06907E000DEBAB /* Debug */,
- 90BD9B872C06907E000DEBAB /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
-
-/* Begin XCLocalSwiftPackageReference section */
- 90A914572CA3D370003DB979 /* XCLocalSwiftPackageReference "../../../cordova-ios" */ = {
- isa = XCLocalSwiftPackageReference;
- relativePath = "packages/cordova-ios";
- };
- 90D82ABB2CF19AEA001383CF /* XCLocalSwiftPackageReference "packages/cordova-ios-plugins" */ = {
- isa = XCLocalSwiftPackageReference;
- relativePath = "packages/cordova-ios-plugins";
- };
-/* End XCLocalSwiftPackageReference section */
-
-/* Begin XCSwiftPackageProductDependency section */
- 90A914582CA3D370003DB979 /* Cordova */ = {
- isa = XCSwiftPackageProductDependency;
- productName = Cordova;
- };
- 90D82ABC2CF19AEA001383CF /* CordovaPlugins */ = {
- isa = XCSwiftPackageProductDependency;
- productName = CordovaPlugins;
- };
-/* End XCSwiftPackageProductDependency section */
- };
- rootObject = 90BD9B642C06907D000DEBAB /* Project object */;
-}
diff --git a/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 21fc716e2..000000000
--- a/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<Workspace
- version = "1.0">
- <FileRef
- location = "self:">
- </FileRef>
-</Workspace>
diff --git a/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003..000000000
--- a/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IDEDidComputeMac32BitWarning</key>
- <true/>
-</dict>
-</plist>
diff --git a/cordova/platforms/ios/App.xcworkspace/contents.xcworkspacedata b/cordova/platforms/ios/App.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 4bae5d8d7..000000000
--- a/cordova/platforms/ios/App.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<Workspace
- version = "1.0">
- <FileRef
- location = "group:App.xcodeproj">
- </FileRef>
-</Workspace>
diff --git a/cordova/platforms/ios/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cordova/platforms/ios/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003..000000000
--- a/cordova/platforms/ios/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IDEDidComputeMac32BitWarning</key>
- <true/>
-</dict>
-</plist>
diff --git a/cordova/platforms/ios/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme b/cordova/platforms/ios/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme
deleted file mode 100644
index 3f54405ff..000000000
--- a/cordova/platforms/ios/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<Scheme
- LastUpgradeVersion = "2600"
- version = "1.3">
- <BuildAction
- parallelizeBuildables = "YES"
- buildImplicitDependencies = "YES">
- <BuildActionEntries>
- <BuildActionEntry
- buildForTesting = "YES"
- buildForRunning = "YES"
- buildForProfiling = "YES"
- buildForArchiving = "YES"
- buildForAnalyzing = "YES">
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
- BuildableName = "App.app"
- BlueprintName = "App"
- ReferencedContainer = "container:App.xcodeproj">
- </BuildableReference>
- </BuildActionEntry>
- </BuildActionEntries>
- </BuildAction>
- <TestAction
- buildConfiguration = "Debug"
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES">
- <MacroExpansion>
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
- BuildableName = "App.app"
- BlueprintName = "App"
- ReferencedContainer = "container:App.xcodeproj">
- </BuildableReference>
- </MacroExpansion>
- <Testables>
- </Testables>
- </TestAction>
- <LaunchAction
- buildConfiguration = "Debug"
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- launchStyle = "0"
- useCustomWorkingDirectory = "NO"
- ignoresPersistentStateOnLaunch = "NO"
- debugDocumentVersioning = "YES"
- debugServiceExtension = "internal"
- allowLocationSimulation = "YES">
- <BuildableProductRunnable
- runnableDebuggingMode = "0">
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
- BuildableName = "App.app"
- BlueprintName = "App"
- ReferencedContainer = "container:App.xcodeproj">
- </BuildableReference>
- </BuildableProductRunnable>
- </LaunchAction>
- <ProfileAction
- buildConfiguration = "Release"
- shouldUseLaunchSchemeArgsEnv = "YES"
- savedToolIdentifier = ""
- useCustomWorkingDirectory = "NO"
- debugDocumentVersioning = "YES">
- <BuildableProductRunnable
- runnableDebuggingMode = "0">
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
- BuildableName = "App.app"
- BlueprintName = "App"
- ReferencedContainer = "container:App.xcodeproj">
- </BuildableReference>
- </BuildableProductRunnable>
- </ProfileAction>
- <AnalyzeAction
- buildConfiguration = "Debug">
- </AnalyzeAction>
- <ArchiveAction
- buildConfiguration = "Release"
- revealArchiveInOrganizer = "YES">
- </ArchiveAction>
-</Scheme>
diff --git a/cordova/platforms/ios/App/.gitignore b/cordova/platforms/ios/App/.gitignore
deleted file mode 100644
index cc76483f6..000000000
--- a/cordova/platforms/ios/App/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.mode1v3
-*.perspectivev3
-*.pbxuser
-.DS_Store
-build/
diff --git a/cordova/platforms/ios/App/App-Info.plist b/cordova/platforms/ios/App/App-Info.plist
deleted file mode 100644
index c482dfb63..000000000
--- a/cordova/platforms/ios/App/App-Info.plist
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>UTImportedTypeDeclarations</key>
- <array>
- <dict>
- <key>UTTypeConformsTo</key>
- <array>
- <string>public.data</string>
- </array>
- <key>UTTypeDescription</key>
- <string>WebAssembly</string>
- <key>UTTypeIdentifier</key>
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
- <key>UTTypeTagSpecification</key>
- <dict>
- <key>public.filename-extension</key>
- <string>wasm</string>
- <key>public.mime-type</key>
- <string>application/wasm</string>
- </dict>
- </dict>
- </array>
- <key>UIApplicationSceneManifest</key>
- <dict>
- <key>UIApplicationSupportsMultipleScenes</key>
- <false/>
- <key>UISceneConfigurations</key>
- <dict>
- <key>UIWindowSceneSessionRoleApplication</key>
- <array>
- <dict>
- <key>UISceneConfigurationName</key>
- <string>Default Configuration</string>
- <key>UISceneDelegateClassName</key>
- <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
- <key>UISceneStoryboardFile</key>
- <string>Main</string>
- </dict>
- </array>
- </dict>
- </dict>
- <key>NSAppTransportSecurity</key>
- <dict>
- <key>NSAllowsArbitraryLoads</key>
- <true/>
- </dict>
- <key>UIBackgroundModes</key>
- <array>
- <string>audio</string>
- </array>
- <key>NSPhotoLibraryAddUsageDescription</key>
- <string>This app requires photo library access to function properly.</string>
- <key>NSPhotoLibraryUsageDescription</key>
- <string>This app requires photo library access to function properly.</string>
-</dict>
-</plist>
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/AppDelegate.h b/cordova/platforms/ios/App/AppDelegate.h
deleted file mode 100644
index 62a77631f..000000000
--- a/cordova/platforms/ios/App/AppDelegate.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <Cordova/CDVAppDelegate.h>
-
-#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
- #warning It is unsafe to rely on the AppDelegate class as an extension point. \
- Update your code to extend CDVAppDelegate instead -- \
- This code will stop working in Cordova iOS 9!
-#endif
-
-@interface AppDelegate : CDVAppDelegate
-@end
diff --git a/cordova/platforms/ios/App/AppDelegate.swift b/cordova/platforms/ios/App/AppDelegate.swift
deleted file mode 100644
index d0ec40f45..000000000
--- a/cordova/platforms/ios/App/AppDelegate.swift
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-import UIKit
-
-@main
-#if compiler(>=6.1)
-@objc @implementation
-#else
-@_objcImplementation
-#endif
-extension AppDelegate {
- open override func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
- return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
- }
-}
-
diff --git a/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index 2c8c083ab..000000000
--- a/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "images" : [
- {
- "filename" : "icon.png",
- "idiom" : "universal",
- "platform": "ios",
- "size" : "1024x1024"
- },
- {
- "filename" : "icon.png",
- "idiom" : "universal",
- "platform": "watchos",
- "size" : "1024x1024"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/icon.png b/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/icon.png
deleted file mode 100644
index b9250b124..000000000
Binary files a/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/icon.png and /dev/null differ
diff --git a/cordova/platforms/ios/App/Assets.xcassets/BackgroundColor.colorset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/BackgroundColor.colorset/Contents.json
deleted file mode 100644
index 38ce5e7c7..000000000
--- a/cordova/platforms/ios/App/Assets.xcassets/BackgroundColor.colorset/Contents.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "colors": [
- {
- "idiom": "universal",
- "color": {
- "platform": "ios",
- "reference": "systemBackgroundColor"
- }
- }
- ],
- "info": {
- "author": "Xcode",
- "version": 1
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Assets.xcassets/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/Contents.json
deleted file mode 100644
index da4a164c9..000000000
--- a/cordova/platforms/ios/App/Assets.xcassets/Contents.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Assets.xcassets/LaunchStoryboard.imageset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/LaunchStoryboard.imageset/Contents.json
deleted file mode 100644
index c0ac4835b..000000000
--- a/cordova/platforms/ios/App/Assets.xcassets/LaunchStoryboard.imageset/Contents.json
+++ /dev/null
@@ -1,872 +0,0 @@
-{
- "images": [
- {
- "idiom": "universal",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "width-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "height-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "1x"
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "1x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "width-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "height-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x"
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "2x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "width-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "height-class": "compact"
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x"
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "universal",
- "scale": "3x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "width-class": "compact"
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "height-class": "compact"
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x"
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "1x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "width-class": "compact"
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "height-class": "compact"
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x"
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "ipad",
- "scale": "2x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "width-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "height-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x"
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "1x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "width-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "height-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x"
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "2x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "width-class": "compact",
- "height-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "width-class": "compact",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "width-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "width-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "height-class": "compact"
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "height-class": "compact",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x"
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "dark"
- }
- ]
- },
- {
- "idiom": "iphone",
- "scale": "3x",
- "appearances": [
- {
- "appearance": "luminosity",
- "value": "light"
- }
- ]
- }
- ],
- "info": {
- "author": "Xcode",
- "version": 1
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Assets.xcassets/SplashScreenBackgroundColor.colorset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/SplashScreenBackgroundColor.colorset/Contents.json
deleted file mode 100644
index 38ce5e7c7..000000000
--- a/cordova/platforms/ios/App/Assets.xcassets/SplashScreenBackgroundColor.colorset/Contents.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "colors": [
- {
- "idiom": "universal",
- "color": {
- "platform": "ios",
- "reference": "systemBackgroundColor"
- }
- }
- ],
- "info": {
- "author": "Xcode",
- "version": 1
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Assets.xcassets/StatusBarBackgroundColor.colorset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/StatusBarBackgroundColor.colorset/Contents.json
deleted file mode 100644
index 38ce5e7c7..000000000
--- a/cordova/platforms/ios/App/Assets.xcassets/StatusBarBackgroundColor.colorset/Contents.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "colors": [
- {
- "idiom": "universal",
- "color": {
- "platform": "ios",
- "reference": "systemBackgroundColor"
- }
- }
- ],
- "info": {
- "author": "Xcode",
- "version": 1
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Base.lproj/CDVLaunchScreen.storyboard b/cordova/platforms/ios/App/Base.lproj/CDVLaunchScreen.storyboard
deleted file mode 100644
index be89abe10..000000000
--- a/cordova/platforms/ios/App/Base.lproj/CDVLaunchScreen.storyboard
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
- <device id="retina6_1" orientation="portrait" appearance="light"/>
- <dependencies>
- <deployment identifier="iOS"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
- <capability name="Named colors" minToolsVersion="9.0"/>
- <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
- </dependencies>
- <scenes>
- <!--View Controller-->
- <scene sceneID="EHf-IW-A2E">
- <objects>
- <viewController id="01J-lp-oVM" sceneMemberID="viewController">
- <layoutGuides>
- <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
- <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
- </layoutGuides>
- <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
- <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchStoryboard" translatesAutoresizingMaskIntoConstraints="NO" id="2ns-9I-Qjs">
- <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
- </imageView>
- </subviews>
- <color key="backgroundColor" name="SplashScreenBackgroundColor"/>
- <constraints>
- <constraint firstAttribute="trailing" secondItem="2ns-9I-Qjs" secondAttribute="trailing" id="FZL-3Z-NFz"/>
- <constraint firstItem="2ns-9I-Qjs" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="L9l-pw-wXj"/>
- <constraint firstItem="2ns-9I-Qjs" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="oGN-hc-Uzj"/>
- <constraint firstItem="2ns-9I-Qjs" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="rS9-Wd-zY4"/>
- </constraints>
- </view>
- </viewController>
- <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
- </objects>
- <point key="canvasLocation" x="53" y="375"/>
- </scene>
- </scenes>
- <resources>
- <image name="LaunchStoryboard" width="1366" height="1366"/>
- <namedColor name="SplashScreenBackgroundColor">
- <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
- </namedColor>
- </resources>
-</document>
diff --git a/cordova/platforms/ios/App/Base.lproj/Main.storyboard b/cordova/platforms/ios/App/Base.lproj/Main.storyboard
deleted file mode 100644
index 3372d5d22..000000000
--- a/cordova/platforms/ios/App/Base.lproj/Main.storyboard
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
- <dependencies>
- <deployment identifier="iOS"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
- <capability name="Named colors" minToolsVersion="9.0"/>
- <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
- </dependencies>
- <scenes>
- <!--View Controller-->
- <scene sceneID="tne-QT-ifu">
- <objects>
- <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="$(PRODUCT_MODULE_NAME)" customModuleProvider="target" sceneMemberID="viewController">
- <view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="8bC-Xf-vdC">
- <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <color key="backgroundColor" name="BackgroundColor"/>
- </view>
- <userDefinedRuntimeAttributes>
- <userDefinedRuntimeAttribute type="color" keyPath="backgroundColor">
- <color key="value" name="BackgroundColor"/>
- </userDefinedRuntimeAttribute>
- <userDefinedRuntimeAttribute type="color" keyPath="splashBackgroundColor">
- <color key="value" name="SplashScreenBackgroundColor"/>
- </userDefinedRuntimeAttribute>
- <userDefinedRuntimeAttribute type="boolean" keyPath="showSplashScreen" value="YES"/>
- <userDefinedRuntimeAttribute type="color" keyPath="statusBarBackgroundColor">
- <color key="value" name="StatusBarBackgroundColor"/>
- </userDefinedRuntimeAttribute>
- </userDefinedRuntimeAttributes>
- </viewController>
- <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
- </objects>
- </scene>
- </scenes>
- <resources>
- <namedColor name="BackgroundColor">
- <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
- </namedColor>
- <namedColor name="SplashScreenBackgroundColor">
- <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
- </namedColor>
- <namedColor name="StatusBarBackgroundColor">
- <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
- </namedColor>
- </resources>
-</document>
-
diff --git a/cordova/platforms/ios/App/Bridging-Header.h b/cordova/platforms/ios/App/Bridging-Header.h
deleted file mode 100644
index 9dec52955..000000000
--- a/cordova/platforms/ios/App/Bridging-Header.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/Cordova.h>
-
-#define __CORDOVA_SILENCE_HEADER_DEPRECATIONS
-#import "AppDelegate.h"
-#import "MainViewController.h"
-#undef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
diff --git a/cordova/platforms/ios/App/Entitlements-Debug.plist b/cordova/platforms/ios/App/Entitlements-Debug.plist
deleted file mode 100644
index 1ed4ae5b9..000000000
--- a/cordova/platforms/ios/App/Entitlements-Debug.plist
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<plist version="1.0">
- <dict>
- </dict>
-</plist>
diff --git a/cordova/platforms/ios/App/Entitlements-Release.plist b/cordova/platforms/ios/App/Entitlements-Release.plist
deleted file mode 100644
index 1ed4ae5b9..000000000
--- a/cordova/platforms/ios/App/Entitlements-Release.plist
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<plist version="1.0">
- <dict>
- </dict>
-</plist>
diff --git a/cordova/platforms/ios/App/MainViewController.h b/cordova/platforms/ios/App/MainViewController.h
deleted file mode 100644
index ddb37c4a7..000000000
--- a/cordova/platforms/ios/App/MainViewController.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <Cordova/CDVViewController.h>
-
-#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
- #warning It is unsafe to rely on the MainViewController class as an extension point. \
- Update your code to extend CDVViewController instead -- \
- This code will stop working in Cordova iOS 9!
-#endif
-
-@interface MainViewController : CDVViewController
-@end
diff --git a/cordova/platforms/ios/App/Plugins/README b/cordova/platforms/ios/App/Plugins/README
deleted file mode 100644
index 87df09f2c..000000000
--- a/cordova/platforms/ios/App/Plugins/README
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-Put the .h and .m files of your plugin here. The .js files of your plugin belong in the www folder.
diff --git a/cordova/platforms/ios/App/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift b/cordova/platforms/ios/App/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift
deleted file mode 100644
index 2178afbbf..000000000
--- a/cordova/platforms/ios/App/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift
+++ /dev/null
@@ -1,64 +0,0 @@
-import Foundation
-
-@objc(Downloader) class Downloader : CDVPlugin {
- func download(_ command: CDVInvokedUrlCommand) {
- var pluginResult = CDVPluginResult(
- status: CDVCommandStatus_ERROR
- )
-
- var isError = false
-
- let args = command.arguments[0] as! NSDictionary
- let url = URL(string: args["url"] as! String)
- let targetFile = args["path"] as! String
-
- let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first as URL?
- let destinationUrl = documentsUrl?.appendingPathComponent(targetFile)
-
- if FileManager().fileExists(atPath: destinationUrl!.path) {
- print("file already exists [\(destinationUrl?.path)]")
- do {
- try FileManager().removeItem(atPath: destinationUrl!.path)
- }
- catch let error as NSError {
- pluginResult = CDVPluginResult(
- status: CDVCommandStatus_ERROR,
- messageAs: error.localizedDescription
- )
-
- self.commandDelegate!.send(
- pluginResult,
- callbackId: command.callbackId
- )
-
- isError = true
- }
- }
- if !(isError) {
- let sessionConfig = URLSessionConfiguration.default
- let session = URLSession(configuration: sessionConfig, delegate: nil, delegateQueue: nil)
- var request = URLRequest(url: url!)
- request.httpMethod = "GET"
- let task = session.dataTask(with: request, completionHandler: { (data: Data?, response: URLResponse?, error: Error?) -> Void in
- if (error == nil) {
- if let response = response as? HTTPURLResponse {
- if response.statusCode == 200 {
- if (try? data!.write(to: destinationUrl!, options: [.atomic])) != nil {
- pluginResult = CDVPluginResult(
- status: CDVCommandStatus_OK,
- messageAs: documentsUrl?.path ?? ""
- )
-
- self.commandDelegate!.send(
- pluginResult,
- callbackId: command.callbackId
- )
- }
- }
- }
- }
- })
- task.resume()
- }
- }
-}
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h
deleted file mode 100755
index e7ed1e5a3..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Copyright 2013-2017 appPlant GmbH
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <AVFoundation/AVFoundation.h>
-#import <Cordova/CDVPlugin.h>
-
-@interface APPBackgroundMode : CDVPlugin {
- AVAudioPlayer* audioPlayer;
- BOOL enabled;
-}
-
-// Activate the background mode
-- (void) enable:(CDVInvokedUrlCommand*)command;
-// Deactivate the background mode
-- (void) disable:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m
deleted file mode 100755
index e0792cccc..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- Copyright 2013-2017 appPlant GmbH
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import "APPMethodMagic.h"
-#import "APPBackgroundMode.h"
-#import <Cordova/CDVAvailability.h>
-
-@implementation APPBackgroundMode
-
-#pragma mark -
-#pragma mark Constants
-
-NSString* const kAPPBackgroundJsNamespace = @"cordova.plugins.backgroundMode";
-NSString* const kAPPBackgroundEventActivate = @"activate";
-NSString* const kAPPBackgroundEventDeactivate = @"deactivate";
-
-
-#pragma mark -
-#pragma mark Life Cycle
-
-/**
- * Called by runtime once the Class has been loaded.
- * Exchange method implementations to hook into their execution.
- */
-+ (void) load
-{
- [self swizzleWKWebViewEngine];
-}
-
-/**
- * Initialize the plugin.
- */
-- (void) pluginInitialize
-{
- enabled = NO;
- [self configureAudioPlayer];
- [self configureAudioSession];
- [self observeLifeCycle];
-}
-
-/**
- * Register the listener for pause and resume events.
- */
-- (void) observeLifeCycle
-{
- NSNotificationCenter* listener = [NSNotificationCenter
- defaultCenter];
-
- [listener addObserver:self
- selector:@selector(keepAwake)
- name:UIApplicationDidEnterBackgroundNotification
- object:nil];
-
- [listener addObserver:self
- selector:@selector(stopKeepingAwake)
- name:UIApplicationWillEnterForegroundNotification
- object:nil];
-
- [listener addObserver:self
- selector:@selector(handleAudioSessionInterruption:)
- name:AVAudioSessionInterruptionNotification
- object:nil];
-}
-
-#pragma mark -
-#pragma mark Interface
-
-/**
- * Enable the mode to stay awake
- * when switching to background for the next time.
- */
-- (void) enable:(CDVInvokedUrlCommand*)command
-{
- if (enabled)
- return;
-
- enabled = YES;
- [self execCallback:command];
-}
-
-/**
- * Disable the background mode
- * and stop being active in background.
- */
-- (void) disable:(CDVInvokedUrlCommand*)command
-{
- if (!enabled)
- return;
-
- enabled = NO;
- [self stopKeepingAwake];
- [self execCallback:command];
-}
-
-#pragma mark -
-#pragma mark Core
-
-/**
- * Keep the app awake.
- */
-- (void) keepAwake
-{
- if (!enabled)
- return;
-
- [audioPlayer play];
- [self fireEvent:kAPPBackgroundEventActivate];
-}
-
-/**
- * Let the app going to sleep.
- */
-- (void) stopKeepingAwake
-{
- if (TARGET_IPHONE_SIMULATOR) {
- NSLog(@"BackgroundMode: On simulator apps never pause in background!");
- }
-
- if (audioPlayer.isPlaying) {
- [self fireEvent:kAPPBackgroundEventDeactivate];
- }
-
- [audioPlayer pause];
-}
-
-/**
- * Configure the audio player.
- */
-- (void) configureAudioPlayer
-{
- NSString* path = [[NSBundle mainBundle]
- pathForResource:@"appbeep" ofType:@"wav"];
-
- NSURL* url = [NSURL fileURLWithPath:path];
-
-
- audioPlayer = [[AVAudioPlayer alloc]
- initWithContentsOfURL:url error:NULL];
-
- audioPlayer.volume = 0;
- audioPlayer.numberOfLoops = -1;
-};
-
-/**
- * Configure the audio session.
- */
-- (void) configureAudioSession
-{
- AVAudioSession* session = [AVAudioSession
- sharedInstance];
-
- // Don't activate the audio session yet
- [session setActive:NO error:NULL];
-
- // Play music even in background and dont stop playing music
- // even another app starts playing sound
- [session setCategory:AVAudioSessionCategoryPlayback
- error:NULL];
-
- // Active the audio session
- [session setActive:YES error:NULL];
-};
-
-#pragma mark -
-#pragma mark Helper
-
-/**
- * Simply invokes the callback without any parameter.
- */
-- (void) execCallback:(CDVInvokedUrlCommand*)command
-{
- CDVPluginResult *result = [CDVPluginResult
- resultWithStatus:CDVCommandStatus_OK];
-
- [self.commandDelegate sendPluginResult:result
- callbackId:command.callbackId];
-}
-
-/**
- * Restart playing sound when interrupted by phone calls.
- */
-- (void) handleAudioSessionInterruption:(NSNotification*)notification
-{
- [self fireEvent:kAPPBackgroundEventDeactivate];
- [self keepAwake];
-}
-
-/**
- * Find out if the app runs inside the webkit powered webview.
- */
-+ (BOOL) isRunningWebKit
-{
- return IsAtLeastiOSVersion(@"8.0") && NSClassFromString(@"CDVWKWebViewEngine");
-}
-
-/**
- * Method to fire an event with some parameters in the browser.
- */
-- (void) fireEvent:(NSString*)event
-{
- NSString* active =
- [event isEqualToString:kAPPBackgroundEventActivate] ? @"true" : @"false";
-
- NSString* flag = [NSString stringWithFormat:@"%@._isActive=%@;",
- kAPPBackgroundJsNamespace, active];
-
- NSString* depFn = [NSString stringWithFormat:@"%@.on('%@');",
- kAPPBackgroundJsNamespace, event];
-
- NSString* fn = [NSString stringWithFormat:@"%@.fireEvent('%@');",
- kAPPBackgroundJsNamespace, event];
-
- NSString* js = [NSString stringWithFormat:@"%@%@%@", flag, depFn, fn];
-
- [self.commandDelegate evalJs:js];
-}
-
-#pragma mark -
-#pragma mark Swizzling
-
-/**
- * Method to swizzle.
- */
-+ (NSString*) wkProperty
-{
- NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
- NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
-
- return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
-}
-
-/**
- * Swizzle some implementations of CDVWKWebViewEngine.
- */
-+ (void) swizzleWKWebViewEngine
-{
- if (![self isRunningWebKit])
- return;
-
- Class wkWebViewEngineCls = NSClassFromString(@"CDVWKWebViewEngine");
- SEL selector = NSSelectorFromString(@"createConfigurationFromSettings:");
-
- SwizzleSelectorWithBlock_Begin(wkWebViewEngineCls, selector)
- ^(CDVPlugin *self, NSDictionary *settings) {
- id obj = ((id (*)(id, SEL, NSDictionary*))_imp)(self, _cmd, settings);
-
- [obj setValue:[NSNumber numberWithBool:YES]
- forKey:[APPBackgroundMode wkProperty]];
-
- [obj setValue:[NSNumber numberWithBool:NO]
- forKey:@"requiresUserActionForMediaPlayback"];
-
- return obj;
- }
- SwizzleSelectorWithBlock_End;
-}
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.h
deleted file mode 100755
index 84de79111..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright 2013-2017 appPlant GmbH
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-/**
- * Code extracted from
- * - http://defagos.github.io/yet_another_article_about_method_swizzling/
- * - https://gist.github.com/defagos/1312fec96b48540efa5c
- */
-
-#import <objc/runtime.h>
-#import <objc/message.h>
-
-#define SwizzleSelector(clazz, selector, newImpl, oldImpl) \
-(*oldImpl) = (__typeof((*oldImpl)))class_swizzleSelector((clazz), (selector), (IMP)(newImpl))
-
-#define SwizzleClassSelector(clazz, selector, newImpl, oldImpl) \
-(*oldImpl) = (__typeof((*oldImpl)))class_swizzleClassSelector((clazz), (selector), (IMP)(newImpl))
-
-#define SwizzleSelectorWithBlock_Begin(clazz, selector) { \
-SEL _cmd = selector; \
-__block IMP _imp = class_swizzleSelectorWithBlock((clazz), (selector),
-#define SwizzleSelectorWithBlock_End );}
-
-#define SwizzleClassSelectorWithBlock_Begin(clazz, selector) { \
-SEL _cmd = selector; \
-__block IMP _imp = class_swizzleClassSelectorWithBlock((clazz), (selector),
-#define SwizzleClassSelectorWithBlock_End );}
-
-/**
- * Swizzle class method specified by class and selector
- * through the provided method implementation.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ IMP ] newImpl The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleClassSelector(Class clazz, SEL selector, IMP newImpl);
-
-/**
- * Swizzle class method specified by class and selector
- * through the provided code block.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ id ] newImplBlock The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleClassSelectorWithBlock(Class clazz, SEL selector, id newImplBlock);
-
-/**
- * Swizzle method specified by class and selector
- * through the provided code block.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ id ] newImplBlock The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleSelectorWithBlock(Class clazz, SEL selector, id newImplBlock);
-
-/**
- * Swizzle method specified by class and selector
- * through the provided method implementation.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ IMP ] newImpl The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleSelector(Class clazz, SEL selector, IMP newImpl);
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.m
deleted file mode 100755
index cb9cc35f5..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.m
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- Copyright 2013-2017 appPlant GmbH
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-/**
- * Code extracted from
- * - http://defagos.github.io/yet_another_article_about_method_swizzling/
- * - https://gist.github.com/defagos/1312fec96b48540efa5c
- */
-
-#import "APPMethodMagic.h"
-#import <objc/runtime.h>
-#import <objc/message.h>
-
-/**
- * Swizzle class method specified by class and selector
- * through the provided method implementation.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ IMP ] newImpl The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleClassSelector(Class clazz, SEL selector, IMP newImpl)
-{
- return class_swizzleSelector(object_getClass(clazz), selector, newImpl);
-}
-
-/**
- * Swizzle class method specified by class and selector
- * through the provided code block.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ id ] newImplBlock The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleClassSelectorWithBlock(Class clazz, SEL selector, id newImplBlock)
-{
- IMP newImpl = imp_implementationWithBlock(newImplBlock);
- return class_swizzleClassSelector(clazz, selector, newImpl);
-}
-
-/**
- * Swizzle method specified by class and selector
- * through the provided code block.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ id ] newImplBlock The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleSelectorWithBlock(Class clazz, SEL selector, id newImplBlock)
-{
- IMP newImpl = imp_implementationWithBlock(newImplBlock);
- return class_swizzleSelector(clazz, selector, newImpl);
-}
-
-/**
- * Swizzle method specified by class and selector
- * through the provided method implementation.
- *
- * @param [ Class ] clazz The class containing the method.
- * @param [ SEL ] selector The selector of the method.
- * @param [ IMP ] newImpl The new implementation of the method.
- *
- * @return [ IMP ] The previous implementation of the method.
- */
-IMP class_swizzleSelector(Class clazz, SEL selector, IMP newImpl)
-{
- Method method = class_getInstanceMethod(clazz, selector);
- const char *types = method_getTypeEncoding(method);
-
- class_addMethod(clazz, selector, imp_implementationWithBlock(^(__unsafe_unretained id self, va_list argp) {
- struct objc_super super = {
- .receiver = self,
- .super_class = class_getSuperclass(clazz)
- };
-
- id (*objc_msgSendSuper_typed)(struct objc_super*, SEL, va_list) = (void*)&objc_msgSendSuper;
- return objc_msgSendSuper_typed(&super, selector, argp);
- }), types);
-
- return class_replaceMethod(clazz, selector, newImpl, types);
-}
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.h
deleted file mode 100755
index f64f66c27..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <CoreLocation/CoreLocation.h>
-#import <CoreLocation/CLLocationManager.h>
-#import <Cordova/CDVPlugin.h>
-
-enum CDVDestinationType {
- DestinationTypeDataUrl = 0,
- DestinationTypeFileUri,
- DestinationTypeNativeUri
-};
-typedef NSUInteger CDVDestinationType;
-
-enum CDVEncodingType {
- EncodingTypeJPEG = 0,
- EncodingTypePNG
-};
-typedef NSUInteger CDVEncodingType;
-
-enum CDVMediaType {
- MediaTypePicture = 0,
- MediaTypeVideo,
- MediaTypeAll
-};
-typedef NSUInteger CDVMediaType;
-
-@interface CDVPictureOptions : NSObject
-
-@property (strong) NSNumber* quality;
-@property (assign) CDVDestinationType destinationType;
-@property (assign) UIImagePickerControllerSourceType sourceType;
-@property (assign) CGSize targetSize;
-@property (assign) CDVEncodingType encodingType;
-@property (assign) CDVMediaType mediaType;
-@property (assign) BOOL allowsEditing;
-@property (assign) BOOL correctOrientation;
-@property (assign) BOOL saveToPhotoAlbum;
-@property (strong) NSDictionary* popoverOptions;
-@property (assign) UIImagePickerControllerCameraDevice cameraDirection;
-
-@property (assign) BOOL popoverSupported;
-@property (assign) BOOL usesGeolocation;
-@property (assign) BOOL cropToSize;
-
-+ (instancetype) createFromTakePictureArguments:(CDVInvokedUrlCommand*)command;
-
-@end
-
-@interface CDVCameraPicker : UIImagePickerController
-
-@property (strong) CDVPictureOptions* pictureOptions;
-
-@property (copy) NSString* callbackId;
-@property (copy) NSString* postUrl;
-@property (strong) UIPopoverController* pickerPopoverController;
-@property (assign) BOOL cropToSize;
-@property (strong) UIView* webView;
-
-+ (instancetype) createFromPictureOptions:(CDVPictureOptions*)options;
-
-@end
-
-// ======================================================================= //
-
-@interface CDVCamera : CDVPlugin <UIImagePickerControllerDelegate,
- UINavigationControllerDelegate,
- UIPopoverControllerDelegate,
- CLLocationManagerDelegate>
-{}
-
-@property (strong) CDVCameraPicker* pickerController;
-@property (strong) NSMutableDictionary *metadata;
-@property (strong, nonatomic) CLLocationManager *locationManager;
-@property (strong) NSData* data;
-
-/*
- * getPicture
- *
- * arguments:
- * 1: this is the javascript function that will be called with the results, the first parameter passed to the
- * javascript function is the picture as a Base64 encoded string
- * 2: this is the javascript function to be called if there was an error
- * options:
- * quality: integer between 1 and 100
- */
-- (void)takePicture:(CDVInvokedUrlCommand*)command;
-- (void)cleanup:(CDVInvokedUrlCommand*)command;
-- (void)repositionPopover:(CDVInvokedUrlCommand*)command;
-
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info;
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo;
-- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker;
-- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
-
-- (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation;
-- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.m
deleted file mode 100755
index bf02ca2e6..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.m
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVCamera.h"
-#import "CDVJpegHeaderWriter.h"
-#import "UIImage+CropScaleOrientation.h"
-#import <ImageIO/CGImageProperties.h>
-#import <AssetsLibrary/ALAssetRepresentation.h>
-#import <AssetsLibrary/AssetsLibrary.h>
-#import <AVFoundation/AVFoundation.h>
-#import <ImageIO/CGImageSource.h>
-#import <ImageIO/CGImageProperties.h>
-#import <ImageIO/CGImageDestination.h>
-#import <MobileCoreServices/UTCoreTypes.h>
-#import <objc/message.h>
-
-#ifndef __CORDOVA_4_0_0
- #import <Cordova/NSData+Base64.h>
-#endif
-
-#define CDV_PHOTO_PREFIX @"cdv_photo_"
-
-static NSSet* org_apache_cordova_validArrowDirections;
-
-static NSString* toBase64(NSData* data) {
- SEL s1 = NSSelectorFromString(@"cdv_base64EncodedString");
- SEL s2 = NSSelectorFromString(@"base64EncodedString");
- SEL s3 = NSSelectorFromString(@"base64EncodedStringWithOptions:");
-
- if ([data respondsToSelector:s1]) {
- NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s1];
- return func(data, s1);
- } else if ([data respondsToSelector:s2]) {
- NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s2];
- return func(data, s2);
- } else if ([data respondsToSelector:s3]) {
- NSString* (*func)(id, SEL, NSUInteger) = (void *)[data methodForSelector:s3];
- return func(data, s3, 0);
- } else {
- return nil;
- }
-}
-
-@implementation CDVPictureOptions
-
-+ (instancetype) createFromTakePictureArguments:(CDVInvokedUrlCommand*)command
-{
- CDVPictureOptions* pictureOptions = [[CDVPictureOptions alloc] init];
-
- pictureOptions.quality = [command argumentAtIndex:0 withDefault:@(50)];
- pictureOptions.destinationType = [[command argumentAtIndex:1 withDefault:@(DestinationTypeFileUri)] unsignedIntegerValue];
- pictureOptions.sourceType = [[command argumentAtIndex:2 withDefault:@(UIImagePickerControllerSourceTypeCamera)] unsignedIntegerValue];
-
- NSNumber* targetWidth = [command argumentAtIndex:3 withDefault:nil];
- NSNumber* targetHeight = [command argumentAtIndex:4 withDefault:nil];
- pictureOptions.targetSize = CGSizeMake(0, 0);
- if ((targetWidth != nil) && (targetHeight != nil)) {
- pictureOptions.targetSize = CGSizeMake([targetWidth floatValue], [targetHeight floatValue]);
- }
-
- pictureOptions.encodingType = [[command argumentAtIndex:5 withDefault:@(EncodingTypeJPEG)] unsignedIntegerValue];
- pictureOptions.mediaType = [[command argumentAtIndex:6 withDefault:@(MediaTypePicture)] unsignedIntegerValue];
- pictureOptions.allowsEditing = [[command argumentAtIndex:7 withDefault:@(NO)] boolValue];
- pictureOptions.correctOrientation = [[command argumentAtIndex:8 withDefault:@(NO)] boolValue];
- pictureOptions.saveToPhotoAlbum = [[command argumentAtIndex:9 withDefault:@(NO)] boolValue];
- pictureOptions.popoverOptions = [command argumentAtIndex:10 withDefault:nil];
- pictureOptions.cameraDirection = [[command argumentAtIndex:11 withDefault:@(UIImagePickerControllerCameraDeviceRear)] unsignedIntegerValue];
-
- pictureOptions.popoverSupported = NO;
- pictureOptions.usesGeolocation = NO;
-
- return pictureOptions;
-}
-
-@end
-
-
-@interface CDVCamera ()
-
-@property (readwrite, assign) BOOL hasPendingOperation;
-
-@end
-
-@implementation CDVCamera
-
-+ (void)initialize
-{
- org_apache_cordova_validArrowDirections = [[NSSet alloc] initWithObjects:[NSNumber numberWithInt:UIPopoverArrowDirectionUp], [NSNumber numberWithInt:UIPopoverArrowDirectionDown], [NSNumber numberWithInt:UIPopoverArrowDirectionLeft], [NSNumber numberWithInt:UIPopoverArrowDirectionRight], [NSNumber numberWithInt:UIPopoverArrowDirectionAny], nil];
-}
-
-@synthesize hasPendingOperation, pickerController, locationManager;
-
-- (NSURL*) urlTransformer:(NSURL*)url
-{
- NSURL* urlToTransform = url;
-
- // for backwards compatibility - we check if this property is there
- SEL sel = NSSelectorFromString(@"urlTransformer");
- if ([self.commandDelegate respondsToSelector:sel]) {
- // grab the block from the commandDelegate
- NSURL* (^urlTransformer)(NSURL*) = ((id(*)(id, SEL))objc_msgSend)(self.commandDelegate, sel);
- // if block is not null, we call it
- if (urlTransformer) {
- urlToTransform = urlTransformer(url);
- }
- }
-
- return urlToTransform;
-}
-
-- (BOOL)usesGeolocation
-{
- id useGeo = [self.commandDelegate.settings objectForKey:[@"CameraUsesGeolocation" lowercaseString]];
- return [(NSNumber*)useGeo boolValue];
-}
-
-- (BOOL)popoverSupported
-{
- return (NSClassFromString(@"UIPopoverController") != nil) &&
- (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
-}
-
-- (void)takePicture:(CDVInvokedUrlCommand*)command
-{
- self.hasPendingOperation = YES;
- __weak CDVCamera* weakSelf = self;
-
- [self.commandDelegate runInBackground:^{
- CDVPictureOptions* pictureOptions = [CDVPictureOptions createFromTakePictureArguments:command];
- pictureOptions.popoverSupported = [weakSelf popoverSupported];
- pictureOptions.usesGeolocation = [weakSelf usesGeolocation];
- pictureOptions.cropToSize = NO;
-
- BOOL hasCamera = [UIImagePickerController isSourceTypeAvailable:pictureOptions.sourceType];
- if (!hasCamera) {
- NSLog(@"Camera.getPicture: source type %lu not available.", (unsigned long)pictureOptions.sourceType);
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No camera available"];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- // Validate the app has permission to access the camera
- if (pictureOptions.sourceType == UIImagePickerControllerSourceTypeCamera) {
- [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted)
- {
- if(!granted)
- {
- // Denied; show an alert
- dispatch_async(dispatch_get_main_queue(), ^{
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] message:NSLocalizedString(@"Access to the camera has been prohibited; please enable it in the Settings app to continue.", nil) preferredStyle:UIAlertControllerStyleAlert];
- [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- [weakSelf sendNoPermissionResult:command.callbackId];
- }]];
- [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Settings", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
- [weakSelf sendNoPermissionResult:command.callbackId];
- }]];
- [weakSelf.viewController presentViewController:alertController animated:YES completion:nil];
- });
- } else {
- [weakSelf showCameraPicker:command.callbackId withOptions:pictureOptions];
- }
- }];
- } else {
- [weakSelf showCameraPicker:command.callbackId withOptions:pictureOptions];
- }
- }];
-}
-
-- (void)showCameraPicker:(NSString*)callbackId withOptions:(CDVPictureOptions *) pictureOptions
-{
- CDVCameraPicker* cameraPicker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
- self.pickerController = cameraPicker;
-
- cameraPicker.delegate = self;
- cameraPicker.callbackId = callbackId;
- // we need to capture this state for memory warnings that dealloc this object
- cameraPicker.webView = self.webView;
-
- // Perform UI operations on the main thread
- dispatch_async(dispatch_get_main_queue(), ^{
- // If a popover is already open, close it; we only want one at a time.
- if (([[self pickerController] pickerPopoverController] != nil) && [[[self pickerController] pickerPopoverController] isPopoverVisible]) {
- [[[self pickerController] pickerPopoverController] dismissPopoverAnimated:YES];
- [[[self pickerController] pickerPopoverController] setDelegate:nil];
- [[self pickerController] setPickerPopoverController:nil];
- }
-
- if ([self popoverSupported] && (pictureOptions.sourceType != UIImagePickerControllerSourceTypeCamera)) {
- if (cameraPicker.pickerPopoverController == nil) {
- cameraPicker.pickerPopoverController = [[NSClassFromString(@"UIPopoverController") alloc] initWithContentViewController:cameraPicker];
- }
- [self displayPopover:pictureOptions.popoverOptions];
- self.hasPendingOperation = NO;
- } else {
- cameraPicker.modalPresentationStyle = UIModalPresentationCurrentContext;
- [self.viewController presentViewController:cameraPicker animated:YES completion:^{
- self.hasPendingOperation = NO;
- }];
- }
- });
-}
-
-- (void)sendNoPermissionResult:(NSString*)callbackId
-{
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"]; // error callback expects string ATM
-
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
-
- self.hasPendingOperation = NO;
- self.pickerController = nil;
-}
-
-- (void)repositionPopover:(CDVInvokedUrlCommand*)command
-{
- if (([[self pickerController] pickerPopoverController] != nil) && [[[self pickerController] pickerPopoverController] isPopoverVisible]) {
-
- [[[self pickerController] pickerPopoverController] dismissPopoverAnimated:NO];
-
- NSDictionary* options = [command argumentAtIndex:0 withDefault:nil];
- [self displayPopover:options];
- }
-}
-
-- (NSInteger)integerValueForKey:(NSDictionary*)dict key:(NSString*)key defaultValue:(NSInteger)defaultValue
-{
- NSInteger value = defaultValue;
-
- NSNumber* val = [dict valueForKey:key]; // value is an NSNumber
-
- if (val != nil) {
- value = [val integerValue];
- }
- return value;
-}
-
-- (void)displayPopover:(NSDictionary*)options
-{
- NSInteger x = 0;
- NSInteger y = 32;
- NSInteger width = 320;
- NSInteger height = 480;
- UIPopoverArrowDirection arrowDirection = UIPopoverArrowDirectionAny;
-
- if (options) {
- x = [self integerValueForKey:options key:@"x" defaultValue:0];
- y = [self integerValueForKey:options key:@"y" defaultValue:32];
- width = [self integerValueForKey:options key:@"width" defaultValue:320];
- height = [self integerValueForKey:options key:@"height" defaultValue:480];
- arrowDirection = [self integerValueForKey:options key:@"arrowDir" defaultValue:UIPopoverArrowDirectionAny];
- if (![org_apache_cordova_validArrowDirections containsObject:[NSNumber numberWithUnsignedInteger:arrowDirection]]) {
- arrowDirection = UIPopoverArrowDirectionAny;
- }
- }
-
- [[[self pickerController] pickerPopoverController] setDelegate:self];
- [[[self pickerController] pickerPopoverController] presentPopoverFromRect:CGRectMake(x, y, width, height)
- inView:[self.webView superview]
- permittedArrowDirections:arrowDirection
- animated:YES];
-}
-
-- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
-{
- if([navigationController isKindOfClass:[UIImagePickerController class]]){
-
- // If popoverWidth and popoverHeight are specified and are greater than 0, then set popover size, else use apple's default popoverSize
- NSDictionary* options = self.pickerController.pictureOptions.popoverOptions;
- if(options) {
- NSInteger popoverWidth = [self integerValueForKey:options key:@"popoverWidth" defaultValue:0];
- NSInteger popoverHeight = [self integerValueForKey:options key:@"popoverHeight" defaultValue:0];
- if(popoverWidth > 0 && popoverHeight > 0)
- {
- [viewController setPreferredContentSize:CGSizeMake(popoverWidth,popoverHeight)];
- }
- }
-
-
- UIImagePickerController* cameraPicker = (UIImagePickerController*)navigationController;
-
- if(![cameraPicker.mediaTypes containsObject:(NSString*)kUTTypeImage]){
- [viewController.navigationItem setTitle:NSLocalizedString(@"Videos", nil)];
- }
- }
-}
-
-- (void)cleanup:(CDVInvokedUrlCommand*)command
-{
- // empty the tmp directory
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- NSError* err = nil;
- BOOL hasErrors = NO;
-
- // clear contents of NSTemporaryDirectory
- NSString* tempDirectoryPath = NSTemporaryDirectory();
- NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];
- NSString* fileName = nil;
- BOOL result;
-
- while ((fileName = [directoryEnumerator nextObject])) {
- // only delete the files we created
- if (![fileName hasPrefix:CDV_PHOTO_PREFIX]) {
- continue;
- }
- NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
- result = [fileMgr removeItemAtPath:filePath error:&err];
- if (!result && err) {
- NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
- hasErrors = YES;
- }
- }
-
- CDVPluginResult* pluginResult;
- if (hasErrors) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:@"One or more files failed to be deleted."];
- } else {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- }
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
-- (void)popoverControllerDidDismissPopover:(id)popoverController
-{
- UIPopoverController* pc = (UIPopoverController*)popoverController;
-
- [pc dismissPopoverAnimated:YES];
- pc.delegate = nil;
- if (self.pickerController && self.pickerController.callbackId && self.pickerController.pickerPopoverController) {
- self.pickerController.pickerPopoverController = nil;
- NSString* callbackId = self.pickerController.callbackId;
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no image selected"]; // error callback expects string ATM
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
- self.hasPendingOperation = NO;
-}
-
-- (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPictureOptions*)options
-{
- NSData* data = nil;
-
- switch (options.encodingType) {
- case EncodingTypePNG:
- data = UIImagePNGRepresentation(image);
- break;
- case EncodingTypeJPEG:
- {
- if ((options.allowsEditing == NO) && (options.targetSize.width <= 0) && (options.targetSize.height <= 0) && (options.correctOrientation == NO) && (([options.quality integerValue] == 100) || (options.sourceType != UIImagePickerControllerSourceTypeCamera))){
- // use image unedited as requested , don't resize
- data = UIImageJPEGRepresentation(image, 1.0);
- } else {
- data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f);
- }
-
- if (options.usesGeolocation) {
- NSDictionary* controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
- if (controllerMetadata) {
- self.data = data;
- self.metadata = [[NSMutableDictionary alloc] init];
-
- NSMutableDictionary* EXIFDictionary = [[controllerMetadata objectForKey:(NSString*)kCGImagePropertyExifDictionary]mutableCopy];
- if (EXIFDictionary) {
- [self.metadata setObject:EXIFDictionary forKey:(NSString*)kCGImagePropertyExifDictionary];
- }
-
- if (IsAtLeastiOSVersion(@"8.0")) {
- [[self locationManager] performSelector:NSSelectorFromString(@"requestWhenInUseAuthorization") withObject:nil afterDelay:0];
- }
- [[self locationManager] startUpdatingLocation];
- }
- }
- }
- break;
- default:
- break;
- };
-
- return data;
-}
-
-- (NSString*)tempFilePath:(NSString*)extension
-{
- NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];
- NSFileManager* fileMgr = [[NSFileManager alloc] init]; // recommended by Apple (vs [NSFileManager defaultManager]) to be threadsafe
- NSString* filePath;
-
- // generate unique file name
- int i = 1;
- do {
- filePath = [NSString stringWithFormat:@"%@/%@%03d.%@", docsPath, CDV_PHOTO_PREFIX, i++, extension];
- } while ([fileMgr fileExistsAtPath:filePath]);
-
- return filePath;
-}
-
-- (UIImage*)retrieveImage:(NSDictionary*)info options:(CDVPictureOptions*)options
-{
- // get the image
- UIImage* image = nil;
- if (options.allowsEditing && [info objectForKey:UIImagePickerControllerEditedImage]) {
- image = [info objectForKey:UIImagePickerControllerEditedImage];
- } else {
- image = [info objectForKey:UIImagePickerControllerOriginalImage];
- }
-
- if (options.correctOrientation) {
- image = [image imageCorrectedForCaptureOrientation];
- }
-
- UIImage* scaledImage = nil;
-
- if ((options.targetSize.width > 0) && (options.targetSize.height > 0)) {
- // if cropToSize, resize image and crop to target size, otherwise resize to fit target without cropping
- if (options.cropToSize) {
- scaledImage = [image imageByScalingAndCroppingForSize:options.targetSize];
- } else {
- scaledImage = [image imageByScalingNotCroppingForSize:options.targetSize];
- }
- }
-
- return (scaledImage == nil ? image : scaledImage);
-}
-
-- (void)resultForImage:(CDVPictureOptions*)options info:(NSDictionary*)info completion:(void (^)(CDVPluginResult* res))completion
-{
- CDVPluginResult* result = nil;
- BOOL saveToPhotoAlbum = options.saveToPhotoAlbum;
- UIImage* image = nil;
-
- switch (options.destinationType) {
- case DestinationTypeNativeUri:
- {
- NSURL* url = [info objectForKey:UIImagePickerControllerReferenceURL];
- saveToPhotoAlbum = NO;
- // If, for example, we use sourceType = Camera, URL might be nil because image is stored in memory.
- // In this case we must save image to device before obtaining an URI.
- if (url == nil) {
- image = [self retrieveImage:info options:options];
- ALAssetsLibrary* library = [ALAssetsLibrary new];
- [library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)(image.imageOrientation) completionBlock:^(NSURL *assetURL, NSError *error) {
- CDVPluginResult* resultToReturn = nil;
- if (error) {
- resultToReturn = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]];
- } else {
- NSString* nativeUri = [[self urlTransformer:assetURL] absoluteString];
- resultToReturn = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nativeUri];
- }
- completion(resultToReturn);
- }];
- return;
- } else {
- NSString* nativeUri = [[self urlTransformer:url] absoluteString];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nativeUri];
- }
- }
- break;
- case DestinationTypeFileUri:
- {
- image = [self retrieveImage:info options:options];
- NSData* data = [self processImage:image info:info options:options];
- if (data) {
-
- NSString* extension = options.encodingType == EncodingTypePNG? @"png" : @"jpg";
- NSString* filePath = [self tempFilePath:extension];
- NSError* err = nil;
-
- // save file
- if (![data writeToFile:filePath options:NSAtomicWrite error:&err]) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[err localizedDescription]];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[[self urlTransformer:[NSURL fileURLWithPath:filePath]] absoluteString]];
- }
- }
- }
- break;
- case DestinationTypeDataUrl:
- {
- image = [self retrieveImage:info options:options];
- NSData* data = [self processImage:image info:info options:options];
- if (data) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:toBase64(data)];
- }
- }
- break;
- default:
- break;
- };
-
- if (saveToPhotoAlbum && image) {
- ALAssetsLibrary* library = [ALAssetsLibrary new];
- [library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)(image.imageOrientation) completionBlock:nil];
- }
-
- completion(result);
-}
-
-- (CDVPluginResult*)resultForVideo:(NSDictionary*)info
-{
- NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath];
-}
-
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
-{
- __weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
- __weak CDVCamera* weakSelf = self;
-
- dispatch_block_t invoke = ^(void) {
- __block CDVPluginResult* result = nil;
-
- NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];
- if ([mediaType isEqualToString:(NSString*)kUTTypeImage]) {
- [weakSelf resultForImage:cameraPicker.pictureOptions info:info completion:^(CDVPluginResult* res) {
- if (![self usesGeolocation] || picker.sourceType != UIImagePickerControllerSourceTypeCamera) {
- [weakSelf.commandDelegate sendPluginResult:res callbackId:cameraPicker.callbackId];
- weakSelf.hasPendingOperation = NO;
- weakSelf.pickerController = nil;
- }
- }];
- }
- else {
- result = [weakSelf resultForVideo:info];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId];
- weakSelf.hasPendingOperation = NO;
- weakSelf.pickerController = nil;
- }
- };
-
- if (cameraPicker.pictureOptions.popoverSupported && (cameraPicker.pickerPopoverController != nil)) {
- [cameraPicker.pickerPopoverController dismissPopoverAnimated:YES];
- cameraPicker.pickerPopoverController.delegate = nil;
- cameraPicker.pickerPopoverController = nil;
- invoke();
- } else {
- [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:invoke];
- }
-}
-
-// older api calls newer didFinishPickingMediaWithInfo
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo
-{
- NSDictionary* imageInfo = [NSDictionary dictionaryWithObject:image forKey:UIImagePickerControllerOriginalImage];
-
- [self imagePickerController:picker didFinishPickingMediaWithInfo:imageInfo];
-}
-
-- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker
-{
- __weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
- __weak CDVCamera* weakSelf = self;
-
- dispatch_block_t invoke = ^ (void) {
- CDVPluginResult* result;
- if (picker.sourceType == UIImagePickerControllerSourceTypeCamera && [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] != ALAuthorizationStatusAuthorized) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"];
- } else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && ! IsAtLeastiOSVersion(@"11.0") && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to assets"];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No Image Selected"];
- }
-
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId];
-
- weakSelf.hasPendingOperation = NO;
- weakSelf.pickerController = nil;
- };
-
- [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:invoke];
-}
-
-- (CLLocationManager*)locationManager
-{
- if (locationManager != nil) {
- return locationManager;
- }
-
- locationManager = [[CLLocationManager alloc] init];
- [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
- [locationManager setDelegate:self];
-
- return locationManager;
-}
-
-- (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation
-{
- if (locationManager == nil) {
- return;
- }
-
- [self.locationManager stopUpdatingLocation];
- self.locationManager = nil;
-
- NSMutableDictionary *GPSDictionary = [[NSMutableDictionary dictionary] init];
-
- CLLocationDegrees latitude = newLocation.coordinate.latitude;
- CLLocationDegrees longitude = newLocation.coordinate.longitude;
-
- // latitude
- if (latitude < 0.0) {
- latitude = latitude * -1.0f;
- [GPSDictionary setObject:@"S" forKey:(NSString*)kCGImagePropertyGPSLatitudeRef];
- } else {
- [GPSDictionary setObject:@"N" forKey:(NSString*)kCGImagePropertyGPSLatitudeRef];
- }
- [GPSDictionary setObject:[NSNumber numberWithFloat:latitude] forKey:(NSString*)kCGImagePropertyGPSLatitude];
-
- // longitude
- if (longitude < 0.0) {
- longitude = longitude * -1.0f;
- [GPSDictionary setObject:@"W" forKey:(NSString*)kCGImagePropertyGPSLongitudeRef];
- }
- else {
- [GPSDictionary setObject:@"E" forKey:(NSString*)kCGImagePropertyGPSLongitudeRef];
- }
- [GPSDictionary setObject:[NSNumber numberWithFloat:longitude] forKey:(NSString*)kCGImagePropertyGPSLongitude];
-
- // altitude
- CGFloat altitude = newLocation.altitude;
- if (!isnan(altitude)){
- if (altitude < 0) {
- altitude = -altitude;
- [GPSDictionary setObject:@"1" forKey:(NSString *)kCGImagePropertyGPSAltitudeRef];
- } else {
- [GPSDictionary setObject:@"0" forKey:(NSString *)kCGImagePropertyGPSAltitudeRef];
- }
- [GPSDictionary setObject:[NSNumber numberWithFloat:altitude] forKey:(NSString *)kCGImagePropertyGPSAltitude];
- }
-
- // Time and date
- NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
- [formatter setDateFormat:@"HH:mm:ss.SSSSSS"];
- [formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
- [GPSDictionary setObject:[formatter stringFromDate:newLocation.timestamp] forKey:(NSString *)kCGImagePropertyGPSTimeStamp];
- [formatter setDateFormat:@"yyyy:MM:dd"];
- [GPSDictionary setObject:[formatter stringFromDate:newLocation.timestamp] forKey:(NSString *)kCGImagePropertyGPSDateStamp];
-
- [self.metadata setObject:GPSDictionary forKey:(NSString *)kCGImagePropertyGPSDictionary];
- [self imagePickerControllerReturnImageResult];
-}
-
-- (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error
-{
- if (locationManager == nil) {
- return;
- }
-
- [self.locationManager stopUpdatingLocation];
- self.locationManager = nil;
-
- [self imagePickerControllerReturnImageResult];
-}
-
-- (void)imagePickerControllerReturnImageResult
-{
- CDVPictureOptions* options = self.pickerController.pictureOptions;
- CDVPluginResult* result = nil;
-
- if (self.metadata) {
- CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge CFDataRef)self.data, NULL);
- CFStringRef sourceType = CGImageSourceGetType(sourceImage);
-
- CGImageDestinationRef destinationImage = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, sourceType, 1, NULL);
- CGImageDestinationAddImageFromSource(destinationImage, sourceImage, 0, (__bridge CFDictionaryRef)self.metadata);
- CGImageDestinationFinalize(destinationImage);
-
- CFRelease(sourceImage);
- CFRelease(destinationImage);
- }
-
- switch (options.destinationType) {
- case DestinationTypeFileUri:
- {
- NSError* err = nil;
- NSString* extension = self.pickerController.pictureOptions.encodingType == EncodingTypePNG ? @"png":@"jpg";
- NSString* filePath = [self tempFilePath:extension];
-
- // save file
- if (![self.data writeToFile:filePath options:NSAtomicWrite error:&err]) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[err localizedDescription]];
- }
- else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[[self urlTransformer:[NSURL fileURLWithPath:filePath]] absoluteString]];
- }
- }
- break;
- case DestinationTypeDataUrl:
- {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:toBase64(self.data)];
- }
- break;
- case DestinationTypeNativeUri:
- default:
- break;
- };
-
- if (result) {
- [self.commandDelegate sendPluginResult:result callbackId:self.pickerController.callbackId];
- }
-
- self.hasPendingOperation = NO;
- self.pickerController = nil;
- self.data = nil;
- self.metadata = nil;
-
- if (options.saveToPhotoAlbum) {
- ALAssetsLibrary *library = [ALAssetsLibrary new];
- [library writeImageDataToSavedPhotosAlbum:self.data metadata:self.metadata completionBlock:nil];
- }
-}
-
-@end
-
-@implementation CDVCameraPicker
-
-- (BOOL)prefersStatusBarHidden
-{
- return YES;
-}
-
-- (UIViewController*)childViewControllerForStatusBarHidden
-{
- return nil;
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
- SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
- if ([self respondsToSelector:sel]) {
- [self performSelector:sel withObject:nil afterDelay:0];
- }
-
- [super viewWillAppear:animated];
-}
-
-+ (instancetype) createFromPictureOptions:(CDVPictureOptions*)pictureOptions;
-{
- CDVCameraPicker* cameraPicker = [[CDVCameraPicker alloc] init];
- cameraPicker.pictureOptions = pictureOptions;
- cameraPicker.sourceType = pictureOptions.sourceType;
- cameraPicker.allowsEditing = pictureOptions.allowsEditing;
-
- if (cameraPicker.sourceType == UIImagePickerControllerSourceTypeCamera) {
- // We only allow taking pictures (no video) in this API.
- cameraPicker.mediaTypes = @[(NSString*)kUTTypeImage];
- // We can only set the camera device if we're actually using the camera.
- cameraPicker.cameraDevice = pictureOptions.cameraDirection;
- } else if (pictureOptions.mediaType == MediaTypeAll) {
- cameraPicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:cameraPicker.sourceType];
- } else {
- NSArray* mediaArray = @[(NSString*)(pictureOptions.mediaType == MediaTypeVideo ? kUTTypeMovie : kUTTypeImage)];
- cameraPicker.mediaTypes = mediaArray;
- }
-
- return cameraPicker;
-}
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVExif.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVExif.h
deleted file mode 100755
index 3e8adbd02..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVExif.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#ifndef CordovaLib_ExifData_h
-#define CordovaLib_ExifData_h
-
-// exif data types
-typedef enum exifDataTypes {
- EDT_UBYTE = 1, // 8 bit unsigned integer
- EDT_ASCII_STRING, // 8 bits containing 7 bit ASCII code, null terminated
- EDT_USHORT, // 16 bit unsigned integer
- EDT_ULONG, // 32 bit unsigned integer
- EDT_URATIONAL, // 2 longs, first is numerator and second is denominator
- EDT_SBYTE,
- EDT_UNDEFINED, // 8 bits
- EDT_SSHORT,
- EDT_SLONG, // 32bit signed integer (2's complement)
- EDT_SRATIONAL, // 2 SLONGS, first long is numerator, second is denominator
- EDT_SINGLEFLOAT,
- EDT_DOUBLEFLOAT
-} ExifDataTypes;
-
-// maps integer code for exif data types to width in bytes
-static const int DataTypeToWidth[] = {1,1,2,4,8,1,1,2,4,8,4,8};
-
-static const int RECURSE_HORIZON = 8;
-#endif
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h
deleted file mode 100755
index 3b43ef0b7..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface CDVJpegHeaderWriter : NSObject {
- NSDictionary * SubIFDTagFormatDict;
- NSDictionary * IFD0TagFormatDict;
-}
-
-- (NSData*) spliceExifBlockIntoJpeg: (NSData*) jpegdata
- withExifBlock: (NSString*) exifstr;
-- (NSString*) createExifAPP1 : (NSDictionary*) datadict;
-- (NSString*) formattedHexStringFromDecimalNumber: (NSNumber*) numb
- withPlaces: (NSNumber*) width;
-- (NSString*) formatNumberWithLeadingZeroes: (NSNumber*) numb
- withPlaces: (NSNumber*) places;
-- (NSString*) decimalToUnsignedRational: (NSNumber*) numb
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator;
-- (void) continuedFraction: (double) val
- withFractionList: (NSMutableArray*) fractionlist
- withHorizon: (int) horizon;
-//- (void) expandContinuedFraction: (NSArray*) fractionlist;
-- (void) splitDouble: (double) val
- withIntComponent: (int*) rightside
- withFloatRemainder: (double*) leftside;
-- (NSString*) formatRationalWithNumerator: (NSNumber*) numerator
- withDenominator: (NSNumber*) denominator
- asSigned: (Boolean) signedFlag;
-- (NSString*) hexStringFromData : (NSData*) data;
-- (NSNumber*) numericFromHexString : (NSString *) hexstring;
-
-/*
-- (void) readExifMetaData : (NSData*) imgdata;
-- (void) spliceImageData : (NSData*) imgdata withExifData: (NSDictionary*) exifdata;
-- (void) locateExifMetaData : (NSData*) imgdata;
-- (NSString*) createExifAPP1 : (NSDictionary*) datadict;
-- (void) createExifDataString : (NSDictionary*) datadict;
-- (NSString*) createDataElement : (NSString*) element
- withElementData: (NSString*) data
- withExternalDataBlock: (NSDictionary*) memblock;
-- (NSString*) hexStringFromData : (NSData*) data;
-- (NSNumber*) numericFromHexString : (NSString *) hexstring;
-*/
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m
deleted file mode 100755
index 4d3ea2443..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVJpegHeaderWriter.h"
-#include "CDVExif.h"
-
-/* macros for tag info shorthand:
- tagno : tag number
- typecode : data type
- components : number of components
- appendString (TAGINF_W_APPEND only) : string to append to data
- Exif date data format include an extra 0x00 to the end of the data
- */
-#define TAGINF(tagno, typecode, components) [NSArray arrayWithObjects: tagno, typecode, components, nil]
-#define TAGINF_W_APPEND(tagno, typecode, components, appendString) [NSArray arrayWithObjects: tagno, typecode, components, appendString, nil]
-
-const uint mJpegId = 0xffd8; // JPEG format marker
-const uint mExifMarker = 0xffe1; // APP1 jpeg header marker
-const uint mExif = 0x45786966; // ASCII 'Exif', first characters of valid exif header after size
-const uint mMotorallaByteAlign = 0x4d4d; // 'MM', motorola byte align, msb first or 'sane'
-const uint mIntelByteAlgin = 0x4949; // 'II', Intel byte align, lsb first or 'batshit crazy reverso world'
-const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a(MM) or 0x2a00(II), tiff version number
-
-
-@implementation CDVJpegHeaderWriter
-
-- (id) init {
- self = [super init];
- // supported tags for exif IFD
- IFD0TagFormatDict = [[NSDictionary alloc] initWithObjectsAndKeys:
- // TAGINF(@"010e", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"ImageDescription",
- TAGINF_W_APPEND(@"0132", [NSNumber numberWithInt:EDT_ASCII_STRING], @20, @"00"), @"DateTime",
- TAGINF(@"010f", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Make",
- TAGINF(@"0110", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Model",
- TAGINF(@"0131", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Software",
- TAGINF(@"011a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"XResolution",
- TAGINF(@"011b", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"YResolution",
- // currently supplied outside of Exif data block by UIImagePickerControllerMediaMetadata, this is set manually in CDVCamera.m
- /* TAGINF(@"0112", [NSNumber numberWithInt:EDT_USHORT], @1), @"Orientation",
-
- // rest of the tags are supported by exif spec, but are not specified by UIImagePickerControllerMediaMedadata
- // should camera hardware supply these values in future versions, or if they can be derived, ImageHeaderWriter will include them gracefully
- TAGINF(@"0128", [NSNumber numberWithInt:EDT_USHORT], @1), @"ResolutionUnit",
- TAGINF(@"013e", [NSNumber numberWithInt:EDT_URATIONAL], @2), @"WhitePoint",
- TAGINF(@"013f", [NSNumber numberWithInt:EDT_URATIONAL], @6), @"PrimaryChromaticities",
- TAGINF(@"0211", [NSNumber numberWithInt:EDT_URATIONAL], @3), @"YCbCrCoefficients",
- TAGINF(@"0213", [NSNumber numberWithInt:EDT_USHORT], @1), @"YCbCrPositioning",
- TAGINF(@"0214", [NSNumber numberWithInt:EDT_URATIONAL], @6), @"ReferenceBlackWhite",
- TAGINF(@"8298", [NSNumber numberWithInt:EDT_URATIONAL], @0), @"Copyright",
-
- // offset to exif subifd, we determine this dynamically based on the size of the main exif IFD
- TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1), @"ExifOffset",*/
- nil];
-
-
- // supported tages for exif subIFD
- SubIFDTagFormatDict = [[NSDictionary alloc] initWithObjectsAndKeys:
- //TAGINF(@"9000", [NSNumber numberWithInt:], @), @"ExifVersion",
- //TAGINF(@"9202",[NSNumber numberWithInt:EDT_URATIONAL],@1), @"ApertureValue",
- //TAGINF(@"9203",[NSNumber numberWithInt:EDT_SRATIONAL],@1), @"BrightnessValue",
- TAGINF(@"a001",[NSNumber numberWithInt:EDT_USHORT],@1), @"ColorSpace",
- TAGINF_W_APPEND(@"9004",[NSNumber numberWithInt:EDT_ASCII_STRING],@20,@"00"), @"DateTimeDigitized",
- TAGINF_W_APPEND(@"9003",[NSNumber numberWithInt:EDT_ASCII_STRING],@20,@"00"), @"DateTimeOriginal",
- TAGINF(@"a402", [NSNumber numberWithInt:EDT_USHORT], @1), @"ExposureMode",
- TAGINF(@"8822", [NSNumber numberWithInt:EDT_USHORT], @1), @"ExposureProgram",
- //TAGINF(@"829a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"ExposureTime",
- //TAGINF(@"829d", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"FNumber",
- TAGINF(@"9209", [NSNumber numberWithInt:EDT_USHORT], @1), @"Flash",
- // FocalLengthIn35mmFilm
- TAGINF(@"a405", [NSNumber numberWithInt:EDT_USHORT], @1), @"FocalLenIn35mmFilm",
- //TAGINF(@"920a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"FocalLength",
- //TAGINF(@"8827", [NSNumber numberWithInt:EDT_USHORT], @2), @"ISOSpeedRatings",
- TAGINF(@"9207", [NSNumber numberWithInt:EDT_USHORT],@1), @"MeteringMode",
- // specific to compressed data
- TAGINF(@"a002", [NSNumber numberWithInt:EDT_ULONG],@1), @"PixelXDimension",
- TAGINF(@"a003", [NSNumber numberWithInt:EDT_ULONG],@1), @"PixelYDimension",
- // data type undefined, but this is a DSC camera, so value is always 1, treat as ushort
- TAGINF(@"a301", [NSNumber numberWithInt:EDT_USHORT],@1), @"SceneType",
- TAGINF(@"a217",[NSNumber numberWithInt:EDT_USHORT],@1), @"SensingMethod",
- //TAGINF(@"9201", [NSNumber numberWithInt:EDT_SRATIONAL], @1), @"ShutterSpeedValue",
- // specifies location of main subject in scene (x,y,wdith,height) expressed before rotation processing
- //TAGINF(@"9214", [NSNumber numberWithInt:EDT_USHORT], @4), @"SubjectArea",
- TAGINF(@"a403", [NSNumber numberWithInt:EDT_USHORT], @1), @"WhiteBalance",
- nil];
- return self;
-}
-
-- (NSData*) spliceExifBlockIntoJpeg: (NSData*) jpegdata withExifBlock: (NSString*) exifstr {
-
- CDVJpegHeaderWriter * exifWriter = [[CDVJpegHeaderWriter alloc] init];
-
- NSMutableData * exifdata = [NSMutableData dataWithCapacity: [exifstr length]/2];
- int idx;
- for (idx = 0; idx+1 < [exifstr length]; idx+=2) {
- NSRange range = NSMakeRange(idx, 2);
- NSString* hexStr = [exifstr substringWithRange:range];
- NSScanner* scanner = [NSScanner scannerWithString:hexStr];
- unsigned int intValue;
- [scanner scanHexInt:&intValue];
- [exifdata appendBytes:&intValue length:1];
- }
-
- NSMutableData * ddata = [NSMutableData dataWithCapacity: [jpegdata length]];
- NSMakeRange(0,4);
- int loc = 0;
- bool done = false;
- // read the jpeg data until we encounter the app1==0xFFE1 marker
- while (loc+1 < [jpegdata length]) {
- NSData * blag = [jpegdata subdataWithRange: NSMakeRange(loc,2)];
- if( [[blag description] isEqualToString : @"<ffe1>"]) {
- // read the APP1 block size bits
- NSString * the = [exifWriter hexStringFromData:[jpegdata subdataWithRange: NSMakeRange(loc+2,2)]];
- NSNumber * app1width = [exifWriter numericFromHexString:the];
- //consume the original app1 block
- [ddata appendData:exifdata];
- // advance our loc marker past app1
- loc += [app1width intValue] + 2;
- done = true;
- } else {
- if(!done) {
- [ddata appendData:blag];
- loc += 2;
- } else {
- break;
- }
- }
- }
- // copy the remaining data
- [ddata appendData:[jpegdata subdataWithRange: NSMakeRange(loc,[jpegdata length]-loc)]];
- return ddata;
-}
-
-
-
-/**
- * Create the Exif data block as a hex string
- * jpeg uses Application Markers (APP's) as markers for application data
- * APP1 is the application marker reserved for exif data
- *
- * (NSDictionary*) datadict - with subdictionaries marked '{TIFF}' and '{EXIF}' as returned by imagePickerController with a valid
- * didFinishPickingMediaWithInfo data dict, under key @"UIImagePickerControllerMediaMetadata"
- *
- * the following constructs a hex string to Exif specifications, and is therefore brittle
- * altering the order of arguments to the string constructors, modifying field sizes or formats,
- * and any other minor change will likely prevent the exif data from being read
- */
-- (NSString*) createExifAPP1 : (NSDictionary*) datadict {
- NSMutableString * app1; // holds finalized product
- NSString * exifIFD; // exif information file directory
- NSString * subExifIFD; // subexif information file directory
-
- // FFE1 is the hex APP1 marker code, and will allow client apps to read the data
- NSString * app1marker = @"ffe1";
- // SSSS size, to be determined
- // EXIF ascii characters followed by 2bytes of zeros
- NSString * exifmarker = @"457869660000";
- // Tiff header: 4d4d is motorolla byte align (big endian), 002a is hex for 42
- NSString * tiffheader = @"4d4d002a";
- //first IFD offset from the Tiff header to IFD0. Since we are writing it, we know it's address 0x08
- NSString * ifd0offset = @"00000008";
- // current offset to next data area
- int currentDataOffset = 0;
-
- //data labeled as TIFF in UIImagePickerControllerMediaMetaData is part of the EXIF IFD0 portion of APP1
- exifIFD = [self createExifIFDFromDict: [datadict objectForKey:@"{TIFF}"] withFormatDict: IFD0TagFormatDict isIFD0:YES currentDataOffset:&currentDataOffset];
-
- //data labeled as EXIF in UIImagePickerControllerMediaMetaData is part of the EXIF Sub IFD portion of APP1
- subExifIFD = [self createExifIFDFromDict: [datadict objectForKey:@"{Exif}"] withFormatDict: SubIFDTagFormatDict isIFD0:NO currentDataOffset:&currentDataOffset];
- /*
- NSLog(@"SUB EXIF IFD %@ WITH SIZE: %d",exifIFD,[exifIFD length]);
-
- NSLog(@"SUB EXIF IFD %@ WITH SIZE: %d",subExifIFD,[subExifIFD length]);
- */
- // construct the complete app1 data block
- app1 = [[NSMutableString alloc] initWithFormat: @"%@%04x%@%@%@%@%@",
- app1marker,
- (unsigned int)(16 + ([exifIFD length]/2) + ([subExifIFD length]/2)) /*16+[exifIFD length]/2*/,
- exifmarker,
- tiffheader,
- ifd0offset,
- exifIFD,
- subExifIFD];
-
- return app1;
-}
-
-// returns hex string representing a valid exif information file directory constructed from the datadict and formatdict
-- (NSString*) createExifIFDFromDict : (NSDictionary*) datadict
- withFormatDict : (NSDictionary*) formatdict
- isIFD0 : (BOOL) ifd0flag
- currentDataOffset : (int*) dataoffset {
- NSArray * datakeys = [datadict allKeys]; // all known data keys
- NSArray * knownkeys = [formatdict allKeys]; // only keys in knowkeys are considered for entry in this IFD
- NSMutableArray * ifdblock = [[NSMutableArray alloc] initWithCapacity: [datadict count]]; // all ifd entries
- NSMutableArray * ifddatablock = [[NSMutableArray alloc] initWithCapacity: [datadict count]]; // data block entries
- // ifd0flag = NO; // ifd0 requires a special flag and has offset to next ifd appended to end
-
- // iterate through known provided data keys
- for (int i = 0; i < [datakeys count]; i++) {
- NSString * key = [datakeys objectAtIndex:i];
- // don't muck about with unknown keys
- if ([knownkeys indexOfObject: key] != NSNotFound) {
- // create new IFD entry
- NSString * entry = [self createIFDElement: key
- withFormat: [formatdict objectForKey:key]
- withElementData: [datadict objectForKey:key]];
- // create the IFD entry's data block
- NSString * data = [self createIFDElementDataWithFormat: [formatdict objectForKey:key]
- withData: [datadict objectForKey:key]];
- if (entry) {
- [ifdblock addObject:entry];
- if(!data) {
- [ifdblock addObject:@""];
- } else {
- [ifddatablock addObject:data];
- }
- }
- }
- }
-
- NSMutableString * exifstr = [[NSMutableString alloc] initWithCapacity: [ifdblock count] * 24];
- NSMutableString * dbstr = [[NSMutableString alloc] initWithCapacity: 100];
-
- int addr=*dataoffset; // current offset/address in datablock
- if (ifd0flag) {
- // calculate offset to datablock based on ifd file entry count
- addr += 14+(12*([ifddatablock count]+1)); // +1 for tag 0x8769, exifsubifd offset
- } else {
- // current offset + numSubIFDs (2-bytes) + 12*numSubIFDs + endMarker (4-bytes)
- addr += 2+(12*[ifddatablock count])+4;
- }
-
- for (int i = 0; i < [ifdblock count]; i++) {
- NSString * entry = [ifdblock objectAtIndex:i];
- NSString * data = [ifddatablock objectAtIndex:i];
-
- // check if the data fits into 4 bytes
- if( [data length] <= 8) {
- // concatenate the entry and the (4byte) data entry into the final IFD entry and append to exif ifd string
- [exifstr appendFormat : @"%@%@", entry, data];
- } else {
- [exifstr appendFormat : @"%@%08x", entry, addr];
- [dbstr appendFormat: @"%@", data];
- addr+= [data length] / 2;
- /*
- NSLog(@"=====data-length[%i]=======",[data length]);
- NSLog(@"addr-offset[%i]",addr);
- NSLog(@"entry[%@]",entry);
- NSLog(@"data[%@]",data);
- */
- }
- }
-
- // calculate IFD0 terminal offset tags, currently ExifSubIFD
- unsigned int entrycount = (unsigned int)[ifdblock count];
- if (ifd0flag) {
- // 18 accounts for 8769's width + offset to next ifd, 8 accounts for start of header
- NSNumber * offset = [NSNumber numberWithUnsignedInteger:[exifstr length] / 2 + [dbstr length] / 2 + 18+8];
-
- [self appendExifOffsetTagTo: exifstr
- withOffset : offset];
- entrycount++;
- }
- *dataoffset = addr;
- return [[NSString alloc] initWithFormat: @"%04x%@%@%@",
- entrycount,
- exifstr,
- @"00000000", // offset to next IFD, 0 since there is none
- dbstr]; // lastly, the datablock
-}
-
-// Creates an exif formatted exif information file directory entry
-- (NSString*) createIFDElement: (NSString*) elementName withFormat: (NSArray*) formtemplate withElementData: (NSString*) data {
- //NSArray * fielddata = [formatdict objectForKey: elementName];// format data of desired field
- if (formtemplate) {
- // format string @"%@%@%@%@", tag number, data format, components, value
- NSNumber * dataformat = [formtemplate objectAtIndex:1];
- NSNumber * components = [formtemplate objectAtIndex:2];
- if([components intValue] == 0) {
- components = [NSNumber numberWithUnsignedInteger:[data length] * DataTypeToWidth[[dataformat intValue]-1]];
- }
-
- return [[NSString alloc] initWithFormat: @"%@%@%08x",
- [formtemplate objectAtIndex:0], // the field code
- [self formatNumberWithLeadingZeroes: dataformat withPlaces: @4], // the data type code
- [components intValue]]; // number of components
- }
- return NULL;
-}
-
-/**
- * appends exif IFD0 tag 8769 "ExifOffset" to the string provided
- * (NSMutableString*) str - string you wish to append the 8769 tag to: APP1 or IFD0 hex data string
- * // TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1), @"ExifOffset",
- */
-- (void) appendExifOffsetTagTo: (NSMutableString*) str withOffset : (NSNumber*) offset {
- NSArray * format = TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1);
-
- NSString * entry = [self createIFDElement: @"ExifOffset"
- withFormat: format
- withElementData: [offset stringValue]];
-
- NSString * data = [self createIFDElementDataWithFormat: format
- withData: [offset stringValue]];
- [str appendFormat:@"%@%@", entry, data];
-}
-
-// formats the Information File Directory Data to exif format
-- (NSString*) createIFDElementDataWithFormat: (NSArray*) dataformat withData: (NSString*) data {
- NSMutableString * datastr = nil;
- NSNumber * tmp = nil;
- NSNumber * formatcode = [dataformat objectAtIndex:1];
- NSUInteger formatItemsCount = [dataformat count];
- NSNumber * num = @0;
- NSNumber * denom = @0;
-
- switch ([formatcode intValue]) {
- case EDT_UBYTE:
- break;
- case EDT_ASCII_STRING:
- datastr = [[NSMutableString alloc] init];
- for (int i = 0; i < [data length]; i++) {
- [datastr appendFormat:@"%02x",[data characterAtIndex:i]];
- }
- if (formatItemsCount > 3) {
- // We have additional data to append.
- // currently used by Date format to append final 0x00 but can be used by other data types as well in the future
- [datastr appendString:[dataformat objectAtIndex:3]];
- }
- if ([datastr length] < 8) {
- NSString * format = [NSString stringWithFormat:@"%%0%dd", (int)(8 - [datastr length])];
- [datastr appendFormat:format,0];
- }
- return datastr;
- case EDT_USHORT:
- return [[NSString alloc] initWithFormat : @"%@%@",
- [self formattedHexStringFromDecimalNumber: [NSNumber numberWithInt: [data intValue]] withPlaces: @4],
- @"0000"];
- case EDT_ULONG:
- tmp = [NSNumber numberWithUnsignedLong:[data intValue]];
- return [NSString stringWithFormat : @"%@",
- [self formattedHexStringFromDecimalNumber: tmp withPlaces: @8]];
- case EDT_URATIONAL:
- return [self decimalToUnsignedRational: [NSNumber numberWithDouble:[data doubleValue]]
- withResultNumerator: &num
- withResultDenominator: &denom];
- case EDT_SBYTE:
-
- break;
- case EDT_UNDEFINED:
- break; // 8 bits
- case EDT_SSHORT:
- break;
- case EDT_SLONG:
- break; // 32bit signed integer (2's complement)
- case EDT_SRATIONAL:
- break; // 2 SLONGS, first long is numerator, second is denominator
- case EDT_SINGLEFLOAT:
- break;
- case EDT_DOUBLEFLOAT:
- break;
- }
- return datastr;
-}
-
-//======================================================================================================================
-// Utility Methods
-//======================================================================================================================
-
-// creates a formatted little endian hex string from a number and width specifier
-- (NSString*) formattedHexStringFromDecimalNumber: (NSNumber*) numb withPlaces: (NSNumber*) width {
- NSMutableString * str = [[NSMutableString alloc] initWithCapacity:[width intValue]];
- NSString * formatstr = [[NSString alloc] initWithFormat: @"%%%@%dx", @"0", [width intValue]];
- [str appendFormat:formatstr, [numb intValue]];
- return str;
-}
-
-// format number as string with leading 0's
-- (NSString*) formatNumberWithLeadingZeroes: (NSNumber *) numb withPlaces: (NSNumber *) places {
- NSNumberFormatter * formatter = [[NSNumberFormatter alloc] init];
- NSString *formatstr = [@"" stringByPaddingToLength:[places unsignedIntegerValue] withString:@"0" startingAtIndex:0];
- [formatter setPositiveFormat:formatstr];
- return [formatter stringFromNumber:numb];
-}
-
-// approximate a decimal with a rational by method of continued fraction
-// can be collasped into decimalToUnsignedRational after testing
-- (void) decimalToRational: (NSNumber *) numb
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator {
- NSMutableArray * fractionlist = [[NSMutableArray alloc] initWithCapacity:8];
-
- [self continuedFraction: [numb doubleValue]
- withFractionList: fractionlist
- withHorizon: 8];
-
- // simplify complex fraction represented by partial fraction list
- [self expandContinuedFraction: fractionlist
- withResultNumerator: numerator
- withResultDenominator: denominator];
-
-}
-
-// approximate a decimal with an unsigned rational by method of continued fraction
-- (NSString*) decimalToUnsignedRational: (NSNumber *) numb
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator {
- NSMutableArray * fractionlist = [[NSMutableArray alloc] initWithCapacity:8];
-
- // generate partial fraction list
- [self continuedFraction: [numb doubleValue]
- withFractionList: fractionlist
- withHorizon: 8];
-
- // simplify complex fraction represented by partial fraction list
- [self expandContinuedFraction: fractionlist
- withResultNumerator: numerator
- withResultDenominator: denominator];
-
- return [self formatFractionList: fractionlist];
-}
-
-// recursive implementation of decimal approximation by continued fraction
-- (void) continuedFraction: (double) val
- withFractionList: (NSMutableArray*) fractionlist
- withHorizon: (int) horizon {
- int whole;
- double remainder;
- // 1. split term
- [self splitDouble: val withIntComponent: &whole withFloatRemainder: &remainder];
- [fractionlist addObject: [NSNumber numberWithInt:whole]];
-
- // 2. calculate reciprocal of remainder
- if (!remainder) return; // early exit, exact fraction found, avoids recip/0
- double recip = 1 / remainder;
-
- // 3. exit condition
- if ([fractionlist count] > horizon) {
- return;
- }
-
- // 4. recurse
- [self continuedFraction:recip withFractionList: fractionlist withHorizon: horizon];
-
-}
-
-// expand continued fraction list, creating a single level rational approximation
--(void) expandContinuedFraction: (NSArray*) fractionlist
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator {
- NSUInteger i = 0;
- int den = 0;
- int num = 0;
- if ([fractionlist count] == 1) {
- *numerator = [NSNumber numberWithInt:[[fractionlist objectAtIndex:0] intValue]];
- *denominator = @1;
- return;
- }
-
- //begin at the end of the list
- i = [fractionlist count] - 1;
- num = 1;
- den = [[fractionlist objectAtIndex:i] intValue];
-
- while (i > 0) {
- int t = [[fractionlist objectAtIndex: i-1] intValue];
- num = t * den + num;
- if (i==1) {
- break;
- } else {
- t = num;
- num = den;
- den = t;
- }
- i--;
- }
- // set result parameters values
- *numerator = [NSNumber numberWithInt: num];
- *denominator = [NSNumber numberWithInt: den];
-}
-
-// formats expanded fraction list to string matching exif specification
-- (NSString*) formatFractionList: (NSArray *) fractionlist {
- NSMutableString * str = [[NSMutableString alloc] initWithCapacity:16];
-
- if ([fractionlist count] == 1){
- [str appendFormat: @"%08x00000001", [[fractionlist objectAtIndex:0] intValue]];
- }
- return str;
-}
-
-// format rational as
-- (NSString*) formatRationalWithNumerator: (NSNumber*) numerator withDenominator: (NSNumber*) denominator asSigned: (Boolean) signedFlag {
- NSMutableString * str = [[NSMutableString alloc] initWithCapacity:16];
- if (signedFlag) {
- long num = [numerator longValue];
- long den = [denominator longValue];
- [str appendFormat: @"%08lx%08lx", num >= 0 ? num : ~ABS(num) + 1, num >= 0 ? den : ~ABS(den) + 1];
- } else {
- [str appendFormat: @"%08lx%08lx", [numerator unsignedLongValue], [denominator unsignedLongValue]];
- }
- return str;
-}
-
-// split a floating point number into two integer values representing the left and right side of the decimal
-- (void) splitDouble: (double) val withIntComponent: (int*) rightside withFloatRemainder: (double*) leftside {
- *rightside = val; // convert numb to int representation, which truncates the decimal portion
- *leftside = val - *rightside;
-}
-
-
-//
-- (NSString*) hexStringFromData : (NSData*) data {
- //overflow detection
- const unsigned char *dataBuffer = [data bytes];
- return [[NSString alloc] initWithFormat: @"%02x%02x",
- (unsigned char)dataBuffer[0],
- (unsigned char)dataBuffer[1]];
-}
-
-// convert a hex string to a number
-- (NSNumber*) numericFromHexString : (NSString *) hexstring {
- NSScanner * scan = NULL;
- unsigned int numbuf= 0;
-
- scan = [NSScanner scannerWithString:hexstring];
- [scan scanHexInt:&numbuf];
- return [NSNumber numberWithInt:numbuf];
-}
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h
deleted file mode 100755
index 31bc42ff0..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-
-@interface UIImage (CropScaleOrientation)
-
-- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize;
-- (UIImage*)imageCorrectedForCaptureOrientation;
-- (UIImage*)imageCorrectedForCaptureOrientation:(UIImageOrientation)imageOrientation;
-- (UIImage*)imageByScalingNotCroppingForSize:(CGSize)targetSize;
-
-@end
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m
deleted file mode 100755
index a66a5d88d..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "UIImage+CropScaleOrientation.h"
-
-@implementation UIImage (CropScaleOrientation)
-
-- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize
-{
- UIImage* sourceImage = self;
- UIImage* newImage = nil;
- CGSize imageSize = sourceImage.size;
- CGFloat width = imageSize.width;
- CGFloat height = imageSize.height;
- CGFloat targetWidth = targetSize.width;
- CGFloat targetHeight = targetSize.height;
- CGFloat scaleFactor = 0.0;
- CGFloat scaledWidth = targetWidth;
- CGFloat scaledHeight = targetHeight;
- CGPoint thumbnailPoint = CGPointMake(0.0, 0.0);
-
- if (CGSizeEqualToSize(imageSize, targetSize) == NO) {
- CGFloat widthFactor = targetWidth / width;
- CGFloat heightFactor = targetHeight / height;
-
- if (widthFactor > heightFactor) {
- scaleFactor = widthFactor; // scale to fit height
- } else {
- scaleFactor = heightFactor; // scale to fit width
- }
- scaledWidth = width * scaleFactor;
- scaledHeight = height * scaleFactor;
-
- // center the image
- if (widthFactor > heightFactor) {
- thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5;
- } else if (widthFactor < heightFactor) {
- thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5;
- }
- }
-
- UIGraphicsBeginImageContext(targetSize); // this will crop
-
- CGRect thumbnailRect = CGRectZero;
- thumbnailRect.origin = thumbnailPoint;
- thumbnailRect.size.width = scaledWidth;
- thumbnailRect.size.height = scaledHeight;
-
- [sourceImage drawInRect:thumbnailRect];
-
- newImage = UIGraphicsGetImageFromCurrentImageContext();
- if (newImage == nil) {
- NSLog(@"could not scale image");
- }
-
- // pop the context to get back to the default
- UIGraphicsEndImageContext();
- return newImage;
-}
-
-- (UIImage*)imageCorrectedForCaptureOrientation:(UIImageOrientation)imageOrientation
-{
- float rotation_radians = 0;
- bool perpendicular = false;
-
- switch (imageOrientation) {
- case UIImageOrientationUp :
- rotation_radians = 0.0;
- break;
-
- case UIImageOrientationDown:
- rotation_radians = M_PI; // don't be scared of radians, if you're reading this, you're good at math
- break;
-
- case UIImageOrientationRight:
- rotation_radians = M_PI_2;
- perpendicular = true;
- break;
-
- case UIImageOrientationLeft:
- rotation_radians = -M_PI_2;
- perpendicular = true;
- break;
-
- default:
- break;
- }
-
- UIGraphicsBeginImageContext(CGSizeMake(self.size.width, self.size.height));
- CGContextRef context = UIGraphicsGetCurrentContext();
-
- // Rotate around the center point
- CGContextTranslateCTM(context, self.size.width / 2, self.size.height / 2);
- CGContextRotateCTM(context, rotation_radians);
-
- CGContextScaleCTM(context, 1.0, -1.0);
- float width = perpendicular ? self.size.height : self.size.width;
- float height = perpendicular ? self.size.width : self.size.height;
- CGContextDrawImage(context, CGRectMake(-width / 2, -height / 2, width, height), [self CGImage]);
-
- // Move the origin back since the rotation might've change it (if its 90 degrees)
- if (perpendicular) {
- CGContextTranslateCTM(context, -self.size.height / 2, -self.size.width / 2);
- }
-
- UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return newImage;
-}
-
-- (UIImage*)imageCorrectedForCaptureOrientation
-{
- return [self imageCorrectedForCaptureOrientation:[self imageOrientation]];
-}
-
-- (UIImage*)imageByScalingNotCroppingForSize:(CGSize)targetSize
-{
- UIImage* sourceImage = self;
- UIImage* newImage = nil;
- CGSize imageSize = sourceImage.size;
- CGFloat width = imageSize.width;
- CGFloat height = imageSize.height;
- CGFloat targetWidth = targetSize.width;
- CGFloat targetHeight = targetSize.height;
- CGFloat scaleFactor = 0.0;
- CGSize scaledSize = targetSize;
-
- if (CGSizeEqualToSize(imageSize, targetSize) == NO) {
- CGFloat widthFactor = targetWidth / width;
- CGFloat heightFactor = targetHeight / height;
-
- // opposite comparison to imageByScalingAndCroppingForSize in order to contain the image within the given bounds
- if (widthFactor > heightFactor) {
- scaleFactor = heightFactor; // scale to fit height
- } else {
- scaleFactor = widthFactor; // scale to fit width
- }
- scaledSize = CGSizeMake(MIN(width * scaleFactor, targetWidth), MIN(height * scaleFactor, targetHeight));
- }
-
- // If the pixels are floats, it causes a white line in iOS8 and probably other versions too
- scaledSize.width = (int)scaledSize.width;
- scaledSize.height = (int)scaledSize.height;
-
- UIGraphicsBeginImageContext(scaledSize); // this will resize
-
- [sourceImage drawInRect:CGRectMake(0, 0, scaledSize.width, scaledSize.height)];
-
- newImage = UIGraphicsGetImageFromCurrentImageContext();
- if (newImage == nil) {
- NSLog(@"could not scale image");
- }
-
- // pop the context to get back to the default
- UIGraphicsEndImageContext();
- return newImage;
-}
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.h
deleted file mode 100755
index a146d8829..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVDevice : CDVPlugin
-{}
-
-+ (NSString*)cordovaVersion;
-
-- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.m
deleted file mode 100755
index 4d75a5748..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.m
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#include "TargetConditionals.h"
-
-#import <Cordova/CDV.h>
-#import "CDVDevice.h"
-
-@implementation UIDevice (ModelVersion)
-
-- (NSString*)modelVersion
-{
- size_t size;
-
- sysctlbyname("hw.machine", NULL, &size, NULL, 0);
- char* machine = malloc(size);
- sysctlbyname("hw.machine", machine, &size, NULL, 0);
- NSString* platform = [NSString stringWithUTF8String:machine];
- free(machine);
-
- return platform;
-}
-
-@end
-
-@interface CDVDevice () {}
-@end
-
-@implementation CDVDevice
-
-- (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device
-{
- NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
- static NSString* UUID_KEY = @"CDVUUID";
-
- // Check user defaults first to maintain backwards compaitibility with previous versions
- // which didn't user identifierForVendor
- NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
- if (app_uuid == nil) {
- if ([device respondsToSelector:@selector(identifierForVendor)]) {
- app_uuid = [[device identifierForVendor] UUIDString];
- } else {
- CFUUIDRef uuid = CFUUIDCreate(NULL);
- app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
- CFRelease(uuid);
- }
-
- [userDefaults setObject:app_uuid forKey:UUID_KEY];
- [userDefaults synchronize];
- }
-
- return app_uuid;
-}
-
-- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
-{
- NSDictionary* deviceProperties = [self deviceProperties];
- CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
-
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
-- (NSDictionary*)deviceProperties
-{
- UIDevice* device = [UIDevice currentDevice];
-
- return @{
- @"manufacturer": @"Apple",
- @"model": [device modelVersion],
- @"platform": @"iOS",
- @"version": [device systemVersion],
- @"uuid": [self uniqueAppInstanceIdentifier:device],
- @"cordova": [[self class] cordovaVersion],
- @"isVirtual": @([self isVirtual])
- };
-}
-
-+ (NSString*)cordovaVersion
-{
- return CDV_VERSION;
-}
-
-- (BOOL)isVirtual
-{
- #if TARGET_OS_SIMULATOR
- return true;
- #elif TARGET_IPHONE_SIMULATOR
- return true;
- #else
- return false;
- #endif
-}
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.h
deleted file mode 100644
index f3014d07c..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2013 pwlin - [email protected]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#import <Cordova/CDV.h>
-
-@interface FileOpener2 : CDVPlugin <UIDocumentInteractionControllerDelegate> {
- NSString *localFile;
-}
-
-@property(nonatomic, strong) UIDocumentInteractionController *controller;
-@property(nonatomic, strong) CDVViewController *cdvViewController;
-
-- (void) open: (CDVInvokedUrlCommand*)command;
-
-@end
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.m
deleted file mode 100644
index 716170543..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.m
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2013 pwlin - [email protected]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-#import "FileOpener2.h"
-#import <Cordova/CDV.h>
-
-#import <QuartzCore/QuartzCore.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-
-@implementation FileOpener2
-@synthesize controller = docController;
-
-- (void) open: (CDVInvokedUrlCommand*)command {
-
- NSString *path = [command.arguments objectAtIndex:0];
- NSString *contentType = [command.arguments objectAtIndex:1];
- BOOL showPreview = YES;
-
- if ([command.arguments count] >= 3) {
- showPreview = [[command.arguments objectAtIndex:2] boolValue];
- }
-
- CDVViewController* cont = (CDVViewController*)[super viewController];
- self.cdvViewController = cont;
- NSString *uti = nil;
-
- if([contentType length] == 0){
- NSArray *dotParts = [path componentsSeparatedByString:@"."];
- NSString *fileExt = [dotParts lastObject];
-
- uti = (__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExt, NULL);
- } else {
- uti = (__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge CFStringRef)contentType, NULL);
- }
-
- dispatch_async(dispatch_get_main_queue(), ^{
- NSURL *fileURL = NULL;
- NSString *decodedPath = [path stringByRemovingPercentEncoding];
- if ([path isEqualToString:decodedPath]) {
- NSLog(@"Path parameter not encoded. Building file URL encoding it...");
- fileURL = [NSURL fileURLWithPath:[path stringByReplacingOccurrencesOfString:@"file://" withString:@""]];;
- } else {
- NSLog(@"Path parameter already encoded. Building file URL without encoding it...");
- fileURL = [NSURL URLWithString:path];
- }
-
- localFile = fileURL.path;
-
- NSLog(@"looking for file at %@", fileURL);
- NSFileManager *fm = [NSFileManager defaultManager];
- if(![fm fileExistsAtPath:localFile]) {
- NSDictionary *jsonObj = @{@"status" : @"9",
- @"message" : @"File does not exist"};
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:jsonObj];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- return;
- }
-
- docController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
- docController.delegate = self;
- docController.UTI = uti;
-
- CDVPluginResult* pluginResult = nil;
-
- //Opens the file preview
- CGRect rect;
- if ([command.arguments count] >= 4) {
- NSArray *positionValues = [command.arguments objectAtIndex:3];
-
- if (![positionValues isEqual:[NSNull null]] && [positionValues count] >= 2) {
- rect = CGRectMake(0, 0, [[positionValues objectAtIndex:0] floatValue], [[positionValues objectAtIndex:1] floatValue]);
- } else {
- rect = CGRectMake(0, 0, 0, 0);
- }
- } else {
- rect = CGRectMake(0, 0, cont.view.bounds.size.width, cont.view.bounds.size.height);
- }
-
- BOOL wasOpened = NO;
-
- if (showPreview) {
- wasOpened = [docController presentPreviewAnimated: NO];
- } else {
- CDVViewController* cont = self.cdvViewController;
- wasOpened = [docController presentOpenInMenuFromRect:rect inView:cont.view animated:YES];
- }
-
- if(wasOpened) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: @""];
- //NSLog(@"Success");
- } else {
- NSDictionary *jsonObj = [ [NSDictionary alloc]
- initWithObjectsAndKeys :
- @"9", @"status",
- @"Could not handle UTI", @"message",
- nil
- ];
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:jsonObj];
- }
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- });
-}
-
-@end
-
-@implementation FileOpener2 (UIDocumentInteractionControllerDelegate)
- - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller {
- UIViewController *presentingViewController = self.viewController;
- if (presentingViewController.view.window != [UIApplication sharedApplication].keyWindow){
- presentingViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
- }
-
- while (presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController isBeingDismissed]){
- presentingViewController = presentingViewController.presentedViewController;
- }
- return presentingViewController;
- }
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h
deleted file mode 100755
index e09e2250e..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVFile.h"
-
-extern NSString* const kCDVAssetsLibraryPrefix;
-extern NSString* const kCDVAssetsLibraryScheme;
-
-@interface CDVAssetLibraryFilesystem : NSObject<CDVFileSystem> {
-}
-
-- (id) initWithName:(NSString *)name;
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m
deleted file mode 100755
index 8486b7be1..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVFile.h"
-#import "CDVAssetLibraryFilesystem.h"
-#import <Cordova/CDV.h>
-#import <AssetsLibrary/ALAsset.h>
-#import <AssetsLibrary/ALAssetRepresentation.h>
-#import <AssetsLibrary/ALAssetsLibrary.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-
-NSString* const kCDVAssetsLibraryPrefix = @"assets-library://";
-NSString* const kCDVAssetsLibraryScheme = @"assets-library";
-
-@implementation CDVAssetLibraryFilesystem
-@synthesize name=_name, urlTransformer;
-
-
-/*
- The CDVAssetLibraryFilesystem works with resources which are identified
- by iOS as
- asset-library://<path>
- and represents them internally as URLs of the form
- cdvfile://localhost/assets-library/<path>
- */
-
-- (NSURL *)assetLibraryURLForLocalURL:(CDVFilesystemURL *)url
-{
- if ([url.url.scheme isEqualToString:kCDVFilesystemURLPrefix]) {
- NSString *path = [[url.url absoluteString] substringFromIndex:[@"cdvfile://localhost/assets-library" length]];
- return [NSURL URLWithString:[NSString stringWithFormat:@"assets-library:/%@", path]];
- }
- return url.url;
-}
-
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url
-{
- NSDictionary* entry = [self makeEntryForLocalURL:url];
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:entry];
-}
-
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url {
- return [self makeEntryForPath:url.fullPath isDirectory:NO];
-}
-
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir
-{
- NSMutableDictionary* dirEntry = [NSMutableDictionary dictionaryWithCapacity:5];
- NSString* lastPart = [fullPath lastPathComponent];
- if (isDir && ![fullPath hasSuffix:@"/"]) {
- fullPath = [fullPath stringByAppendingString:@"/"];
- }
- [dirEntry setObject:[NSNumber numberWithBool:!isDir] forKey:@"isFile"];
- [dirEntry setObject:[NSNumber numberWithBool:isDir] forKey:@"isDirectory"];
- [dirEntry setObject:fullPath forKey:@"fullPath"];
- [dirEntry setObject:lastPart forKey:@"name"];
- [dirEntry setObject:self.name forKey: @"filesystemName"];
-
- NSURL* nativeURL = [NSURL URLWithString:[NSString stringWithFormat:@"assets-library:/%@",fullPath]];
- if (self.urlTransformer) {
- nativeURL = self.urlTransformer(nativeURL);
- }
- dirEntry[@"nativeURL"] = [nativeURL absoluteString];
-
- return dirEntry;
-}
-
-/* helper function to get the mimeType from the file extension
- * IN:
- * NSString* fullPath - filename (may include path)
- * OUT:
- * NSString* the mime type as type/subtype. nil if not able to determine
- */
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath
-{
- NSString* mimeType = nil;
-
- if (fullPath) {
- CFStringRef typeId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[fullPath pathExtension], NULL);
- if (typeId) {
- mimeType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass(typeId, kUTTagClassMIMEType);
- if (!mimeType) {
- // special case for m4a
- if ([(__bridge NSString*)typeId rangeOfString : @"m4a-audio"].location != NSNotFound) {
- mimeType = @"audio/mp4";
- } else if ([[fullPath pathExtension] rangeOfString:@"wav"].location != NSNotFound) {
- mimeType = @"audio/wav";
- } else if ([[fullPath pathExtension] rangeOfString:@"css"].location != NSNotFound) {
- mimeType = @"text/css";
- }
- }
- CFRelease(typeId);
- }
- }
- return mimeType;
-}
-
-- (id)initWithName:(NSString *)name
-{
- if (self) {
- self.name = name;
- }
- return self;
-}
-
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options
-{
- // return unsupported result for assets-library URLs
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"getFile not supported for assets-library URLs."];
-}
-
-- (CDVPluginResult*)getParentForURL:(CDVFilesystemURL *)localURI
-{
- // we don't (yet?) support getting the parent of an asset
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_READABLE_ERR];
-}
-
-- (CDVPluginResult*)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options
-{
- // setMetadata doesn't make sense for asset library files
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
-}
-
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI
-{
- // return error for assets-library URLs
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:INVALID_MODIFICATION_ERR];
-}
-
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI
-{
- // return error for assets-library URLs
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"removeRecursively not supported for assets-library URLs."];
-}
-
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI
-{
- // return unsupported result for assets-library URLs
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"readEntries not supported for assets-library URLs."];
-}
-
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos
-{
- // assets-library files can't be truncated
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
-}
-
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend
-{
- // text can't be written into assets-library files
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
-}
-
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback
-{
- // Copying to an assets library file is not doable, since we can't write it.
- CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:INVALID_MODIFICATION_ERR];
- callback(result);
-}
-
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)url
-{
- NSString *path = nil;
- if ([[url.url scheme] isEqualToString:kCDVAssetsLibraryScheme]) {
- path = [url.url path];
- } else {
- path = url.fullPath;
- }
- if ([path hasSuffix:@"/"]) {
- path = [path substringToIndex:([path length]-1)];
- }
- return path;
-}
-
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback
-{
- ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) {
- if (asset) {
- // We have the asset! Get the data and send it off.
- ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation];
- NSUInteger size = (end > start) ? (end - start) : [assetRepresentation size];
- Byte* buffer = (Byte*)malloc(size);
- NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:start length:size error:nil];
- NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES];
- NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType);
-
- callback(data, MIMEType, NO_ERROR);
- } else {
- callback(nil, nil, NOT_FOUND_ERR);
- }
- };
-
- ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) {
- // Retrieving the asset failed for some reason. Send the appropriate error.
- NSLog(@"Error: %@", error);
- callback(nil, nil, SECURITY_ERR);
- };
-
- ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init];
- [assetsLibrary assetForURL:[self assetLibraryURLForLocalURL:localURL] resultBlock:resultBlock failureBlock:failureBlock];
-}
-
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback
-{
- // In this case, we need to use an asynchronous method to retrieve the file.
- // Because of this, we can't just assign to `result` and send it at the end of the method.
- // Instead, we return after calling the asynchronous method and send `result` in each of the blocks.
- ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) {
- if (asset) {
- // We have the asset! Populate the dictionary and send it off.
- NSMutableDictionary* fileInfo = [NSMutableDictionary dictionaryWithCapacity:5];
- ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation];
- [fileInfo setObject:[NSNumber numberWithUnsignedLongLong:[assetRepresentation size]] forKey:@"size"];
- [fileInfo setObject:localURL.fullPath forKey:@"fullPath"];
- NSString* filename = [assetRepresentation filename];
- [fileInfo setObject:filename forKey:@"name"];
- [fileInfo setObject:[CDVAssetLibraryFilesystem getMimeTypeFromPath:filename] forKey:@"type"];
- NSDate* creationDate = [asset valueForProperty:ALAssetPropertyDate];
- NSNumber* msDate = [NSNumber numberWithDouble:[creationDate timeIntervalSince1970] * 1000];
- [fileInfo setObject:msDate forKey:@"lastModifiedDate"];
-
- callback([CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileInfo]);
- } else {
- // We couldn't find the asset. Send the appropriate error.
- callback([CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]);
- }
- };
- ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) {
- // Retrieving the asset failed for some reason. Send the appropriate error.
- callback([CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]]);
- };
-
- ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init];
- [assetsLibrary assetForURL:[self assetLibraryURLForLocalURL:localURL] resultBlock:resultBlock failureBlock:failureBlock];
- return;
-}
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.h
deleted file mode 100755
index 987c66b5c..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVPlugin.h>
-
-extern NSString* const kCDVAssetsLibraryPrefix;
-extern NSString* const kCDVFilesystemURLPrefix;
-
-enum CDVFileError {
- NO_ERROR = 0,
- NOT_FOUND_ERR = 1,
- SECURITY_ERR = 2,
- ABORT_ERR = 3,
- NOT_READABLE_ERR = 4,
- ENCODING_ERR = 5,
- NO_MODIFICATION_ALLOWED_ERR = 6,
- INVALID_STATE_ERR = 7,
- SYNTAX_ERR = 8,
- INVALID_MODIFICATION_ERR = 9,
- QUOTA_EXCEEDED_ERR = 10,
- TYPE_MISMATCH_ERR = 11,
- PATH_EXISTS_ERR = 12
-};
-typedef int CDVFileError;
-
-@interface CDVFilesystemURL : NSObject {
- NSURL *_url;
- NSString *_fileSystemName;
- NSString *_fullPath;
-}
-
-- (id) initWithString:(NSString*)strURL;
-- (id) initWithURL:(NSURL*)URL;
-+ (CDVFilesystemURL *)fileSystemURLWithString:(NSString *)strURL;
-+ (CDVFilesystemURL *)fileSystemURLWithURL:(NSURL *)URL;
-
-- (NSString *)absoluteURL;
-
-@property (atomic) NSURL *url;
-@property (atomic) NSString *fileSystemName;
-@property (atomic) NSString *fullPath;
-
-@end
-
-@interface CDVFilesystemURLProtocol : NSURLProtocol
-@end
-
-@protocol CDVFileSystem
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url;
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options;
-- (CDVPluginResult *)getParentForURL:(CDVFilesystemURL *)localURI;
-- (CDVPluginResult *)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options;
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI;
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI;
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI;
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos;
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend;
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback;
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback;
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback;
-
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url;
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir;
-
-@property (nonatomic,strong) NSString *name;
-@property (nonatomic, copy) NSURL*(^urlTransformer)(NSURL*);
-
-@optional
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)localURI;
-- (CDVFilesystemURL *)URLforFilesystemPath:(NSString *)path;
-
-@end
-
-@interface CDVFile : CDVPlugin {
- NSString* rootDocsPath;
- NSString* appDocsPath;
- NSString* appLibraryPath;
- NSString* appTempPath;
-
- NSMutableArray* fileSystems_;
- BOOL userHasAllowed;
-}
-
-- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath;
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath fileSystemName:(NSString *)fsName isDirectory:(BOOL)isDir;
-- (NSDictionary *)makeEntryForURL:(NSURL *)URL;
-- (CDVFilesystemURL *)fileSystemURLforLocalPath:(NSString *)localPath;
-
-- (NSObject<CDVFileSystem> *)filesystemForURL:(CDVFilesystemURL *)localURL;
-
-/* Native Registration API */
-- (void)registerFilesystem:(NSObject<CDVFileSystem> *)fs;
-- (NSObject<CDVFileSystem> *)fileSystemByName:(NSString *)fsName;
-
-/* Exec API */
-- (void)requestFileSystem:(CDVInvokedUrlCommand*)command;
-- (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command;
-- (void)getDirectory:(CDVInvokedUrlCommand*)command;
-- (void)getFile:(CDVInvokedUrlCommand*)command;
-- (void)getParent:(CDVInvokedUrlCommand*)command;
-- (void)removeRecursively:(CDVInvokedUrlCommand*)command;
-- (void)remove:(CDVInvokedUrlCommand*)command;
-- (void)copyTo:(CDVInvokedUrlCommand*)command;
-- (void)moveTo:(CDVInvokedUrlCommand*)command;
-- (void)getFileMetadata:(CDVInvokedUrlCommand*)command;
-- (void)readEntries:(CDVInvokedUrlCommand*)command;
-- (void)readAsText:(CDVInvokedUrlCommand*)command;
-- (void)readAsDataURL:(CDVInvokedUrlCommand*)command;
-- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command;
-- (void)write:(CDVInvokedUrlCommand*)command;
-- (void)testFileExists:(CDVInvokedUrlCommand*)command;
-- (void)testDirectoryExists:(CDVInvokedUrlCommand*)command;
-- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command;
-- (void)truncate:(CDVInvokedUrlCommand*)command;
-- (void)doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy;
-
-/* Compatibilty with older File API */
-- (NSString*)getMimeTypeFromPath:(NSString*)fullPath;
-- (NSDictionary *)getDirectoryEntry:(NSString *)target isDirectory:(BOOL)bDirRequest;
-
-/* Conversion between filesystem paths and URLs */
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)URL;
-
-/* Internal methods for testing */
-- (void)_getLocalFilesystemPath:(CDVInvokedUrlCommand*)command;
-
-@property (nonatomic, strong) NSString* rootDocsPath;
-@property (nonatomic, strong) NSString* appDocsPath;
-@property (nonatomic, strong) NSString* appLibraryPath;
-@property (nonatomic, strong) NSString* appTempPath;
-@property (nonatomic, strong) NSString* persistentPath;
-@property (nonatomic, strong) NSString* temporaryPath;
-@property (nonatomic, strong) NSMutableArray* fileSystems;
-
-@property BOOL userHasAllowed;
-
-@end
-
-#define kW3FileTemporary @"temporary"
-#define kW3FilePersistent @"persistent"
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.m
deleted file mode 100755
index 59e7d6407..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.m
+++ /dev/null
@@ -1,1119 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDV.h>
-#import "CDVFile.h"
-#import "CDVLocalFilesystem.h"
-#import "CDVAssetLibraryFilesystem.h"
-#import <objc/message.h>
-
-static NSString* toBase64(NSData* data) {
- SEL s1 = NSSelectorFromString(@"cdv_base64EncodedString");
- SEL s2 = NSSelectorFromString(@"base64EncodedString");
- SEL s3 = NSSelectorFromString(@"base64EncodedStringWithOptions:");
-
- if ([data respondsToSelector:s1]) {
- NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s1];
- return func(data, s1);
- } else if ([data respondsToSelector:s2]) {
- NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s2];
- return func(data, s2);
- } else if ([data respondsToSelector:s3]) {
- NSString* (*func)(id, SEL, NSUInteger) = (void *)[data methodForSelector:s3];
- return func(data, s3, 0);
- } else {
- return nil;
- }
-}
-
-CDVFile *filePlugin = nil;
-
-extern NSString * const NSURLIsExcludedFromBackupKey __attribute__((weak_import));
-
-#ifndef __IPHONE_5_1
- NSString* const NSURLIsExcludedFromBackupKey = @"NSURLIsExcludedFromBackupKey";
-#endif
-
-NSString* const kCDVFilesystemURLPrefix = @"cdvfile";
-
-@implementation CDVFilesystemURL
-@synthesize url=_url;
-@synthesize fileSystemName=_fileSystemName;
-@synthesize fullPath=_fullPath;
-
-- (id) initWithString:(NSString *)strURL
-{
- if ( self = [super init] ) {
- NSURL *decodedURL = [NSURL URLWithString:strURL];
- return [self initWithURL:decodedURL];
- }
- return nil;
-}
-
--(id) initWithURL:(NSURL *)URL
-{
- if ( self = [super init] ) {
- self.url = URL;
- self.fileSystemName = [self filesystemNameForLocalURI:URL];
- self.fullPath = [self fullPathForLocalURI:URL];
- }
- return self;
-}
-
-/*
- * IN
- * NSString localURI
- * OUT
- * NSString FileSystem Name for this URI, or nil if it is not recognized.
- */
-- (NSString *)filesystemNameForLocalURI:(NSURL *)uri
-{
- if ([[uri scheme] isEqualToString:kCDVFilesystemURLPrefix] && [[uri host] isEqualToString:@"localhost"]) {
- NSArray *pathComponents = [uri pathComponents];
- if (pathComponents != nil && pathComponents.count > 1) {
- return [pathComponents objectAtIndex:1];
- }
- } else if ([[uri scheme] isEqualToString:kCDVAssetsLibraryScheme]) {
- return @"assets-library";
- }
- return nil;
-}
-
-/*
- * IN
- * NSString localURI
- * OUT
- * NSString fullPath component suitable for an Entry object.
- * The incoming URI should be properly escaped. The returned fullPath is unescaped.
- */
-- (NSString *)fullPathForLocalURI:(NSURL *)uri
-{
- if ([[uri scheme] isEqualToString:kCDVFilesystemURLPrefix] && [[uri host] isEqualToString:@"localhost"]) {
- NSString *path = [uri path];
- if ([uri query]) {
- path = [NSString stringWithFormat:@"%@?%@", path, [uri query]];
- }
- NSRange slashRange = [path rangeOfString:@"/" options:0 range:NSMakeRange(1, path.length-1)];
- if (slashRange.location == NSNotFound) {
- return @"";
- }
- return [path substringFromIndex:slashRange.location];
- } else if ([[uri scheme] isEqualToString:kCDVAssetsLibraryScheme]) {
- return [[uri absoluteString] substringFromIndex:[kCDVAssetsLibraryScheme length]+2];
- }
- return nil;
-}
-
-+ (CDVFilesystemURL *)fileSystemURLWithString:(NSString *)strURL
-{
- return [[CDVFilesystemURL alloc] initWithString:strURL];
-}
-
-+ (CDVFilesystemURL *)fileSystemURLWithURL:(NSURL *)URL
-{
- return [[CDVFilesystemURL alloc] initWithURL:URL];
-}
-
-- (NSString *)absoluteURL
-{
- return [NSString stringWithFormat:@"cdvfile://localhost/%@%@", self.fileSystemName, self.fullPath];
-}
-
-@end
-
-@implementation CDVFilesystemURLProtocol
-
-+ (BOOL)canInitWithRequest:(NSURLRequest*)request
-{
- NSURL* url = [request URL];
- return [[url scheme] isEqualToString:kCDVFilesystemURLPrefix];
-}
-
-+ (NSURLRequest*)canonicalRequestForRequest:(NSURLRequest*)request
-{
- return request;
-}
-
-+ (BOOL)requestIsCacheEquivalent:(NSURLRequest*)requestA toRequest:(NSURLRequest*)requestB
-{
- return [[[requestA URL] resourceSpecifier] isEqualToString:[[requestB URL] resourceSpecifier]];
-}
-
-- (void)startLoading
-{
- CDVFilesystemURL* url = [CDVFilesystemURL fileSystemURLWithURL:[[self request] URL]];
- NSObject<CDVFileSystem> *fs = [filePlugin filesystemForURL:url];
- __weak CDVFilesystemURLProtocol* weakSelf = self;
-
- [fs readFileAtURL:url start:0 end:-1 callback:^void(NSData *data, NSString *mimetype, CDVFileError error) {
- NSMutableDictionary* responseHeaders = [[NSMutableDictionary alloc] init];
- responseHeaders[@"Cache-Control"] = @"no-cache";
-
- if (!error) {
- responseHeaders[@"Content-Type"] = mimetype;
- NSURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:url.url statusCode:200 HTTPVersion:@"HTTP/1.1"headerFields:responseHeaders];
- [[weakSelf client] URLProtocol:weakSelf didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
- [[weakSelf client] URLProtocol:weakSelf didLoadData:data];
- [[weakSelf client] URLProtocolDidFinishLoading:weakSelf];
- } else {
- NSURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:url.url statusCode:404 HTTPVersion:@"HTTP/1.1"headerFields:responseHeaders];
- [[weakSelf client] URLProtocol:weakSelf didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
- [[weakSelf client] URLProtocolDidFinishLoading:weakSelf];
- }
- }];
-}
-
-- (void)stopLoading
-{}
-
-- (NSCachedURLResponse *)connection:(NSURLConnection *)connection
- willCacheResponse:(NSCachedURLResponse*)cachedResponse {
- return nil;
-}
-
-@end
-
-
-@implementation CDVFile
-
-@synthesize rootDocsPath, appDocsPath, appLibraryPath, appTempPath, userHasAllowed, fileSystems=fileSystems_;
-
-- (void)registerFilesystem:(NSObject<CDVFileSystem> *)fs {
- __weak CDVFile* weakSelf = self;
- SEL sel = NSSelectorFromString(@"urlTransformer");
- // for backwards compatibility - we check if this property is there
- // we create a wrapper block because the urlTransformer property
- // on the commandDelegate might be set dynamically at a future time
- // (and not dependent on plugin loading order)
- if ([self.commandDelegate respondsToSelector:sel]) {
- fs.urlTransformer = ^NSURL*(NSURL* urlToTransform) {
- // grab the block from the commandDelegate
- NSURL* (^urlTransformer)(NSURL*) = ((id(*)(id, SEL))objc_msgSend)(weakSelf.commandDelegate, sel);
- // if block is not null, we call it
- if (urlTransformer) {
- return urlTransformer(urlToTransform);
- } else { // else we return the same url
- return urlToTransform;
- }
- };
- }
- [fileSystems_ addObject:fs];
-}
-
-- (NSObject<CDVFileSystem> *)fileSystemByName:(NSString *)fsName
-{
- if (self.fileSystems != nil) {
- for (NSObject<CDVFileSystem> *fs in self.fileSystems) {
- if ([fs.name isEqualToString:fsName]) {
- return fs;
- }
- }
- }
- return nil;
-}
-
-- (NSObject<CDVFileSystem> *)filesystemForURL:(CDVFilesystemURL *)localURL {
- if (localURL.fileSystemName == nil) return nil;
- @try {
- return [self fileSystemByName:localURL.fileSystemName];
- }
- @catch (NSException *e) {
- return nil;
- }
-}
-
-- (NSArray *)getExtraFileSystemsPreference:(UIViewController *)vc
-{
- NSString *filesystemsStr = nil;
- if([self.viewController isKindOfClass:[CDVViewController class]]) {
- CDVViewController *vc = (CDVViewController *)self.viewController;
- NSDictionary *settings = [vc settings];
- filesystemsStr = [settings[@"iosextrafilesystems"] lowercaseString];
- }
- if (!filesystemsStr) {
- filesystemsStr = @"library,library-nosync,documents,documents-nosync,cache,bundle,root";
- }
- return [filesystemsStr componentsSeparatedByString:@","];
-}
-
-- (void)makeNonSyncable:(NSString*)path {
- [[NSFileManager defaultManager] createDirectoryAtPath:path
- withIntermediateDirectories:YES
- attributes:nil
- error:nil];
- NSURL* url = [NSURL fileURLWithPath:path];
- [url setResourceValue: [NSNumber numberWithBool: YES]
- forKey: NSURLIsExcludedFromBackupKey error:nil];
-
-}
-
-- (void)registerExtraFileSystems:(NSArray *)filesystems fromAvailableSet:(NSDictionary *)availableFileSystems
-{
- NSMutableSet *installedFilesystems = [[NSMutableSet alloc] initWithCapacity:7];
-
- /* Build non-syncable directories as necessary */
- for (NSString *nonSyncFS in @[@"library-nosync", @"documents-nosync"]) {
- if ([filesystems containsObject:nonSyncFS]) {
- [self makeNonSyncable:availableFileSystems[nonSyncFS]];
- }
- }
-
- /* Register filesystems in order */
- for (NSString *fsName in filesystems) {
- if (![installedFilesystems containsObject:fsName]) {
- NSString *fsRoot = availableFileSystems[fsName];
- if (fsRoot) {
- [filePlugin registerFilesystem:[[CDVLocalFilesystem alloc] initWithName:fsName root:fsRoot]];
- [installedFilesystems addObject:fsName];
- } else {
- NSLog(@"Unrecognized extra filesystem identifier: %@", fsName);
- }
- }
- }
-}
-
-- (NSDictionary *)getAvailableFileSystems
-{
- NSString *libPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
- NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
- return @{
- @"library": libPath,
- @"library-nosync": [libPath stringByAppendingPathComponent:@"NoCloud"],
- @"documents": docPath,
- @"documents-nosync": [docPath stringByAppendingPathComponent:@"NoCloud"],
- @"cache": [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0],
- @"bundle": [[NSBundle mainBundle] bundlePath],
- @"root": @"/"
- };
-}
-
-- (void)pluginInitialize
-{
- filePlugin = self;
- [NSURLProtocol registerClass:[CDVFilesystemURLProtocol class]];
-
- fileSystems_ = [[NSMutableArray alloc] initWithCapacity:3];
-
- // Get the Library directory path
- NSArray* paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
- self.appLibraryPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"files"];
-
- // Get the Temporary directory path
- self.appTempPath = [NSTemporaryDirectory()stringByStandardizingPath]; // remove trailing slash from NSTemporaryDirectory()
-
- // Get the Documents directory path
- paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- self.rootDocsPath = [paths objectAtIndex:0];
- self.appDocsPath = [self.rootDocsPath stringByAppendingPathComponent:@"files"];
-
-
- NSString *location = nil;
- if([self.viewController isKindOfClass:[CDVViewController class]]) {
- CDVViewController *vc = (CDVViewController *)self.viewController;
- NSMutableDictionary *settings = vc.settings;
- location = [[settings objectForKey:@"iospersistentfilelocation"] lowercaseString];
- }
- if (location == nil) {
- // Compatibilty by default (if the config preference is not set, or
- // if we're not embedded in a CDVViewController somehow.)
- location = @"compatibility";
- }
-
- NSError *error;
- if ([[NSFileManager defaultManager] createDirectoryAtPath:self.appTempPath
- withIntermediateDirectories:YES
- attributes:nil
- error:&error]) {
- [self registerFilesystem:[[CDVLocalFilesystem alloc] initWithName:@"temporary" root:self.appTempPath]];
- } else {
- NSLog(@"Unable to create temporary directory: %@", error);
- }
- if ([location isEqualToString:@"library"]) {
- if ([[NSFileManager defaultManager] createDirectoryAtPath:self.appLibraryPath
- withIntermediateDirectories:YES
- attributes:nil
- error:&error]) {
- [self registerFilesystem:[[CDVLocalFilesystem alloc] initWithName:@"persistent" root:self.appLibraryPath]];
- } else {
- NSLog(@"Unable to create library directory: %@", error);
- }
- } else if ([location isEqualToString:@"compatibility"]) {
- /*
- * Fall-back to compatibility mode -- this is the logic implemented in
- * earlier versions of this plugin, and should be maintained here so
- * that apps which were originally deployed with older versions of the
- * plugin can continue to provide access to files stored under those
- * versions.
- */
- [self registerFilesystem:[[CDVLocalFilesystem alloc] initWithName:@"persistent" root:self.rootDocsPath]];
- } else {
- NSAssert(false,
- @"File plugin configuration error: Please set iosPersistentFileLocation in config.xml to one of \"library\" (for new applications) or \"compatibility\" (for compatibility with previous versions)");
- }
- [self registerFilesystem:[[CDVAssetLibraryFilesystem alloc] initWithName:@"assets-library"]];
-
- [self registerExtraFileSystems:[self getExtraFileSystemsPreference:self.viewController]
- fromAvailableSet:[self getAvailableFileSystems]];
-
-}
-
-- (CDVFilesystemURL *)fileSystemURLforArg:(NSString *)urlArg
-{
- CDVFilesystemURL* ret = nil;
- if ([urlArg hasPrefix:@"file://"]) {
- /* This looks like a file url. Get the path, and see if any handlers recognize it. */
- NSURL *fileURL = [NSURL URLWithString:urlArg];
- NSURL *resolvedFileURL = [fileURL URLByResolvingSymlinksInPath];
- NSString *path = [resolvedFileURL path];
- ret = [self fileSystemURLforLocalPath:path];
- } else {
- ret = [CDVFilesystemURL fileSystemURLWithString:urlArg];
- }
- return ret;
-}
-
-- (CDVFilesystemURL *)fileSystemURLforLocalPath:(NSString *)localPath
-{
- CDVFilesystemURL *localURL = nil;
- NSUInteger shortestFullPath = 0;
-
- // Try all installed filesystems, in order. Return the most match url.
- for (id object in self.fileSystems) {
- if ([object respondsToSelector:@selector(URLforFilesystemPath:)]) {
- CDVFilesystemURL *url = [object URLforFilesystemPath:localPath];
- if (url){
- // A shorter fullPath would imply that the filesystem is a better match for the local path
- if (!localURL || ([[url fullPath] length] < shortestFullPath)) {
- localURL = url;
- shortestFullPath = [[url fullPath] length];
- }
- }
- }
- }
- return localURL;
-}
-
-- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath
-{
- NSFileManager* fMgr = [[NSFileManager alloc] init];
-
- NSError* __autoreleasing pError = nil;
-
- NSDictionary* pDict = [fMgr attributesOfFileSystemForPath:appPath error:&pError];
- NSNumber* pNumAvail = (NSNumber*)[pDict objectForKey:NSFileSystemFreeSize];
-
- return pNumAvail;
-}
-
-/* Request the File System info
- *
- * IN:
- * arguments[0] - type (number as string)
- * TEMPORARY = 0, PERSISTENT = 1;
- * arguments[1] - size
- *
- * OUT:
- * Dictionary representing FileSystem object
- * name - the human readable directory name
- * root = DirectoryEntry object
- * bool isDirectory
- * bool isFile
- * string name
- * string fullPath
- * fileSystem = FileSystem object - !! ignored because creates circular reference !!
- */
-
-- (void)requestFileSystem:(CDVInvokedUrlCommand*)command
-{
- // arguments
- NSString* strType = [command argumentAtIndex:0];
- unsigned long long size = [[command argumentAtIndex:1] longLongValue];
-
- int type = [strType intValue];
- CDVPluginResult* result = nil;
-
- if (type >= self.fileSystems.count) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:NOT_FOUND_ERR];
- NSLog(@"No filesystem of type requested");
- } else {
- NSString* fullPath = @"/";
- // check for avail space for size request
- NSNumber* pNumAvail = [self checkFreeDiskSpace:self.rootDocsPath];
- // NSLog(@"Free space: %@", [NSString stringWithFormat:@"%qu", [ pNumAvail unsignedLongLongValue ]]);
- if (pNumAvail && ([pNumAvail unsignedLongLongValue] < size)) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:QUOTA_EXCEEDED_ERR];
- } else {
- NSObject<CDVFileSystem> *rootFs = [self.fileSystems objectAtIndex:type];
- if (rootFs == nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:NOT_FOUND_ERR];
- NSLog(@"No filesystem of type requested");
- } else {
- NSMutableDictionary* fileSystem = [NSMutableDictionary dictionaryWithCapacity:2];
- [fileSystem setObject:rootFs.name forKey:@"name"];
- NSDictionary* dirEntry = [self makeEntryForPath:fullPath fileSystemName:rootFs.name isDirectory:YES];
- [fileSystem setObject:dirEntry forKey:@"root"];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileSystem];
- }
- }
- }
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-
-- (void)requestAllFileSystems:(CDVInvokedUrlCommand*)command
-{
- NSMutableArray* ret = [[NSMutableArray alloc] init];
- for (NSObject<CDVFileSystem>* root in fileSystems_) {
- [ret addObject:[self makeEntryForPath:@"/" fileSystemName:root.name isDirectory:YES]];
- }
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:ret];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-- (void)requestAllPaths:(CDVInvokedUrlCommand*)command
-{
- NSString* libPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)[0];
- NSString* libPathSync = [libPath stringByAppendingPathComponent:@"Cloud"];
- NSString* libPathNoSync = [libPath stringByAppendingPathComponent:@"NoCloud"];
- NSString* docPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
- NSString* storagePath = [libPath stringByDeletingLastPathComponent];
- NSString* cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0];
-
- // Create the directories if necessary.
- [[NSFileManager defaultManager] createDirectoryAtPath:libPathSync withIntermediateDirectories:YES attributes:nil error:nil];
- [[NSFileManager defaultManager] createDirectoryAtPath:libPathNoSync withIntermediateDirectories:YES attributes:nil error:nil];
- // Mark NoSync as non-iCloud.
- [[NSURL fileURLWithPath:libPathNoSync] setResourceValue: [NSNumber numberWithBool: YES]
- forKey: NSURLIsExcludedFromBackupKey error:nil];
-
- NSDictionary* ret = @{
- @"applicationDirectory": [[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]] absoluteString],
- @"applicationStorageDirectory": [[NSURL fileURLWithPath:storagePath] absoluteString],
- @"dataDirectory": [[NSURL fileURLWithPath:libPathNoSync] absoluteString],
- @"syncedDataDirectory": [[NSURL fileURLWithPath:libPathSync] absoluteString],
- @"documentsDirectory": [[NSURL fileURLWithPath:docPath] absoluteString],
- @"cacheDirectory": [[NSURL fileURLWithPath:cachePath] absoluteString],
- @"tempDirectory": [[NSURL fileURLWithPath:NSTemporaryDirectory()] absoluteString]
- };
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:ret];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-/* Creates and returns a dictionary representing an Entry Object
- *
- * IN:
- * NSString* fullPath of the entry
- * int fsType - FileSystem type
- * BOOL isDirectory - YES if this is a directory, NO if is a file
- * OUT:
- * NSDictionary* Entry object
- * bool as NSNumber isDirectory
- * bool as NSNumber isFile
- * NSString* name - last part of path
- * NSString* fullPath
- * NSString* filesystemName - FileSystem name -- actual filesystem will be created on the JS side if necessary, to avoid
- * creating circular reference (FileSystem contains DirectoryEntry which contains FileSystem.....!!)
- */
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath fileSystemName:(NSString *)fsName isDirectory:(BOOL)isDir
-{
- NSObject<CDVFileSystem> *fs = [self fileSystemByName:fsName];
- return [fs makeEntryForPath:fullPath isDirectory:isDir];
-}
-
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)localURL
-{
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURL];
- return [fs makeEntryForLocalURL:localURL];
-}
-
-- (NSDictionary *)makeEntryForURL:(NSURL *)URL
-{
- CDVFilesystemURL* fsURL = [self fileSystemURLforArg:[URL absoluteString]];
- return [self makeEntryForLocalURL:fsURL];
-}
-
-/*
- * Given a URI determine the File System information associated with it and return an appropriate W3C entry object
- * IN
- * NSString* localURI: Should be an escaped local filesystem URI
- * OUT
- * Entry object
- * bool isDirectory
- * bool isFile
- * string name
- * string fullPath
- * fileSystem = FileSystem object - !! ignored because creates circular reference FileSystem contains DirectoryEntry which contains FileSystem.....!!
- */
-- (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command
-{
- // arguments
- NSString* localURIstr = [command argumentAtIndex:0];
- CDVPluginResult* result;
-
- localURIstr = [self encodePath:localURIstr]; //encode path before resolving
- CDVFilesystemURL* inputURI = [self fileSystemURLforArg:localURIstr];
-
- if (inputURI == nil || inputURI.fileSystemName == nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:ENCODING_ERR];
- } else {
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:inputURI];
- if (fs == nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:ENCODING_ERR];
- } else {
- result = [fs entryForLocalURI:inputURI];
- }
- }
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-//encode path with percent escapes
--(NSString *)encodePath:(NSString *)path
-{
- NSString *decodedPath = [path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //decode incase it's already encoded to avoid encoding twice
- return [decodedPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-}
-
-
-/* Part of DirectoryEntry interface, creates or returns the specified directory
- * IN:
- * NSString* localURI - local filesystem URI for this directory
- * NSString* path - directory to be created/returned; may be full path or relative path
- * NSDictionary* - Flags object
- * boolean as NSNumber create -
- * if create is true and directory does not exist, create dir and return directory entry
- * if create is true and exclusive is true and directory does exist, return error
- * if create is false and directory does not exist, return error
- * if create is false and the path represents a file, return error
- * boolean as NSNumber exclusive - used in conjunction with create
- * if exclusive is true and create is true - specifies failure if directory already exists
- *
- *
- */
-- (void)getDirectory:(CDVInvokedUrlCommand*)command
-{
- NSMutableArray* arguments = [NSMutableArray arrayWithArray:command.arguments];
- NSMutableDictionary* options = nil;
-
- if ([arguments count] >= 3) {
- options = [command argumentAtIndex:2 withDefault:nil];
- }
- // add getDir to options and call getFile()
- if (options != nil) {
- options = [NSMutableDictionary dictionaryWithDictionary:options];
- } else {
- options = [NSMutableDictionary dictionaryWithCapacity:1];
- }
- [options setObject:[NSNumber numberWithInt:1] forKey:@"getDir"];
- if ([arguments count] >= 3) {
- [arguments replaceObjectAtIndex:2 withObject:options];
- } else {
- [arguments addObject:options];
- }
- CDVInvokedUrlCommand* subCommand =
- [[CDVInvokedUrlCommand alloc] initWithArguments:arguments
- callbackId:command.callbackId
- className:command.className
- methodName:command.methodName];
-
- [self getFile:subCommand];
-}
-
-/* Part of DirectoryEntry interface, creates or returns the specified file
- * IN:
- * NSString* baseURI - local filesytem URI for the base directory to search
- * NSString* requestedPath - file to be created/returned; may be absolute path or relative path
- * NSDictionary* options - Flags object
- * boolean as NSNumber create -
- * if create is true and file does not exist, create file and return File entry
- * if create is true and exclusive is true and file does exist, return error
- * if create is false and file does not exist, return error
- * if create is false and the path represents a directory, return error
- * boolean as NSNumber exclusive - used in conjunction with create
- * if exclusive is true and create is true - specifies failure if file already exists
- */
-- (void)getFile:(CDVInvokedUrlCommand*)command
-{
- NSString* baseURIstr = [command argumentAtIndex:0];
- CDVFilesystemURL* baseURI = [self fileSystemURLforArg:baseURIstr];
- NSString* requestedPath = [command argumentAtIndex:1];
- NSDictionary* options = [command argumentAtIndex:2 withDefault:nil];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:baseURI];
- CDVPluginResult* result = [fs getFileForURL:baseURI requestedPath:requestedPath options:options];
-
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-/*
- * Look up the parent Entry containing this Entry.
- * If this Entry is the root of its filesystem, its parent is itself.
- * IN:
- * NSArray* arguments
- * 0 - NSString* localURI
- * NSMutableDictionary* options
- * empty
- */
-- (void)getParent:(CDVInvokedUrlCommand*)command
-{
- // arguments are URL encoded
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
- CDVPluginResult* result = [fs getParentForURL:localURI];
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-/*
- * set MetaData of entry
- * Currently we only support "com.apple.MobileBackup" (boolean)
- */
-- (void)setMetadata:(CDVInvokedUrlCommand*)command
-{
- // arguments
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- NSDictionary* options = [command argumentAtIndex:1 withDefault:nil];
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
- CDVPluginResult* result = [fs setMetadataForURL:localURI withObject:options];
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-/* removes the directory or file entry
- * IN:
- * NSArray* arguments
- * 0 - NSString* localURI
- *
- * returns NO_MODIFICATION_ALLOWED_ERR if is top level directory or no permission to delete dir
- * returns INVALID_MODIFICATION_ERR if is non-empty dir or asset library file
- * returns NOT_FOUND_ERR if file or dir is not found
-*/
-- (void)remove:(CDVInvokedUrlCommand*)command
-{
- // arguments
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- CDVPluginResult* result = nil;
-
- if ([localURI.fullPath isEqualToString:@""]) {
- // error if try to remove top level (documents or tmp) dir
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
- } else {
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
- result = [fs removeFileAtURL:localURI];
- }
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-/* recursively removes the directory
- * IN:
- * NSArray* arguments
- * 0 - NSString* localURI
- *
- * returns NO_MODIFICATION_ALLOWED_ERR if is top level directory or no permission to delete dir
- * returns NOT_FOUND_ERR if file or dir is not found
- */
-- (void)removeRecursively:(CDVInvokedUrlCommand*)command
-{
- // arguments
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- CDVPluginResult* result = nil;
-
- if ([localURI.fullPath isEqualToString:@""]) {
- // error if try to remove top level (documents or tmp) dir
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
- } else {
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
- result = [fs recursiveRemoveFileAtURL:localURI];
- }
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-- (void)copyTo:(CDVInvokedUrlCommand*)command
-{
- [self doCopyMove:command isCopy:YES];
-}
-
-- (void)moveTo:(CDVInvokedUrlCommand*)command
-{
- [self doCopyMove:command isCopy:NO];
-}
-
-/* Copy/move a file or directory to a new location
- * IN:
- * NSArray* arguments
- * 0 - NSString* URL of entry to copy
- * 1 - NSString* URL of the directory into which to copy/move the entry
- * 2 - Optionally, the new name of the entry, defaults to the current name
- * BOOL - bCopy YES if copy, NO if move
- */
-- (void)doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy
-{
- NSArray* arguments = command.arguments;
-
- // arguments
- NSString* srcURLstr = [command argumentAtIndex:0];
- NSString* destURLstr = [command argumentAtIndex:1];
-
- CDVPluginResult *result;
-
- if (!srcURLstr || !destURLstr) {
- // either no source or no destination provided
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- CDVFilesystemURL* srcURL = [self fileSystemURLforArg:srcURLstr];
- CDVFilesystemURL* destURL = [self fileSystemURLforArg:destURLstr];
-
- NSObject<CDVFileSystem> *srcFs = [self filesystemForURL:srcURL];
- NSObject<CDVFileSystem> *destFs = [self filesystemForURL:destURL];
-
- // optional argument; use last component from srcFullPath if new name not provided
- NSString* newName = ([arguments count] > 2) ? [command argumentAtIndex:2] : [srcURL.url lastPathComponent];
- if ([newName rangeOfString:@":"].location != NSNotFound) {
- // invalid chars in new name
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:ENCODING_ERR];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- __weak CDVFile* weakSelf = self;
- [self.commandDelegate runInBackground:^ {
- [destFs copyFileToURL:destURL withName:newName fromFileSystem:srcFs atURL:srcURL copy:bCopy callback:^(CDVPluginResult* result) {
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
- }];
-
-}
-
-- (void)getFileMetadata:(CDVInvokedUrlCommand*)command
-{
- // arguments
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
- __weak CDVFile* weakSelf = self;
- [fs getFileMetadataForURL:localURI callback:^(CDVPluginResult* result) {
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
-}
-
-- (void)readEntries:(CDVInvokedUrlCommand*)command
-{
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
- CDVPluginResult *result = [fs readEntriesAtURL:localURI];
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-/* read and return file data
- * IN:
- * NSArray* arguments
- * 0 - NSString* fullPath
- * 1 - NSString* encoding
- * 2 - NSString* start
- * 3 - NSString* end
- */
-- (void)readAsText:(CDVInvokedUrlCommand*)command
-{
- // arguments
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- NSString* encoding = [command argumentAtIndex:1];
- NSInteger start = [[command argumentAtIndex:2] integerValue];
- NSInteger end = [[command argumentAtIndex:3] integerValue];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
-
- if (fs == nil) {
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- // TODO: implement
- if ([@"UTF-8" caseInsensitiveCompare : encoding] != NSOrderedSame) {
- NSLog(@"Only UTF-8 encodings are currently supported by readAsText");
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:ENCODING_ERR];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- __weak CDVFile* weakSelf = self;
-
- [self.commandDelegate runInBackground:^ {
- [fs readFileAtURL:localURI start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) {
- CDVPluginResult* result = nil;
- if (data != nil) {
- NSString* str = [[NSString alloc] initWithBytesNoCopy:(void*)[data bytes] length:[data length] encoding:NSUTF8StringEncoding freeWhenDone:NO];
- // Check that UTF8 conversion did not fail.
- if (str != nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:str];
- result.associatedObject = data;
- } else {
- errorCode = ENCODING_ERR;
- }
- }
- if (result == nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
- }
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
- }];
-}
-
-/* Read content of text file and return as base64 encoded data url.
- * IN:
- * NSArray* arguments
- * 0 - NSString* fullPath
- * 1 - NSString* start
- * 2 - NSString* end
- *
- * Determines the mime type from the file extension, returns ENCODING_ERR if mimetype can not be determined.
- */
-
-- (void)readAsDataURL:(CDVInvokedUrlCommand*)command
-{
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- NSInteger start = [[command argumentAtIndex:1] integerValue];
- NSInteger end = [[command argumentAtIndex:2] integerValue];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
-
- __weak CDVFile* weakSelf = self;
- [self.commandDelegate runInBackground:^ {
- [fs readFileAtURL:localURI start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) {
- CDVPluginResult* result = nil;
- if (data != nil) {
- NSString* b64Str = toBase64(data);
- NSString* output = [NSString stringWithFormat:@"data:%@;base64,%@", mimeType, b64Str];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:output];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
- }
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
- }];
-}
-
-/* Read content of text file and return as an arraybuffer
- * IN:
- * NSArray* arguments
- * 0 - NSString* fullPath
- * 1 - NSString* start
- * 2 - NSString* end
- */
-
-- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command
-{
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- NSInteger start = [[command argumentAtIndex:1] integerValue];
- NSInteger end = [[command argumentAtIndex:2] integerValue];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
-
- __weak CDVFile* weakSelf = self;
-
- [self.commandDelegate runInBackground:^ {
- [fs readFileAtURL:localURI start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) {
- CDVPluginResult* result = nil;
- if (data != nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArrayBuffer:data];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
- }
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
- }];
-}
-
-- (void)readAsBinaryString:(CDVInvokedUrlCommand*)command
-{
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- NSInteger start = [[command argumentAtIndex:1] integerValue];
- NSInteger end = [[command argumentAtIndex:2] integerValue];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
-
- __weak CDVFile* weakSelf = self;
-
- [self.commandDelegate runInBackground:^ {
- [fs readFileAtURL:localURI start:start end:end callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) {
- CDVPluginResult* result = nil;
- if (data != nil) {
- NSString* payload = [[NSString alloc] initWithBytesNoCopy:(void*)[data bytes] length:[data length] encoding:NSASCIIStringEncoding freeWhenDone:NO];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:payload];
- result.associatedObject = data;
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
- }
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
- }];
-}
-
-
-- (void)truncate:(CDVInvokedUrlCommand*)command
-{
- // arguments
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- unsigned long long pos = (unsigned long long)[[command argumentAtIndex:1] longLongValue];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
- CDVPluginResult *result = [fs truncateFileAtURL:localURI atPosition:pos];
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-/* write
- * IN:
- * NSArray* arguments
- * 0 - NSString* localURI of file to write to
- * 1 - NSString* or NSData* data to write
- * 2 - NSNumber* position to begin writing
- */
-- (void)write:(CDVInvokedUrlCommand*)command
-{
- __weak CDVFile* weakSelf = self;
-
- [self.commandDelegate runInBackground:^ {
- NSString* callbackId = command.callbackId;
-
- // arguments
- CDVFilesystemURL* localURI = [self fileSystemURLforArg:command.arguments[0]];
- id argData = [command argumentAtIndex:1];
- unsigned long long pos = (unsigned long long)[[command argumentAtIndex:2] longLongValue];
-
- NSObject<CDVFileSystem> *fs = [self filesystemForURL:localURI];
-
-
- [fs truncateFileAtURL:localURI atPosition:pos];
- CDVPluginResult *result;
- if ([argData isKindOfClass:[NSString class]]) {
- NSData *encData = [argData dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
- result = [fs writeToFileAtURL:localURI withData:encData append:YES];
- } else if ([argData isKindOfClass:[NSData class]]) {
- result = [fs writeToFileAtURL:localURI withData:argData append:YES];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid parameter type"];
- }
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- }];
-}
-
-#pragma mark Methods for converting between URLs and paths
-
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)localURL
-{
- for (NSObject<CDVFileSystem> *fs in self.fileSystems) {
- if ([fs.name isEqualToString:localURL.fileSystemName]) {
- if ([fs respondsToSelector:@selector(filesystemPathForURL:)]) {
- return [fs filesystemPathForURL:localURL];
- }
- }
- }
- return nil;
-}
-
-#pragma mark Undocumented Filesystem API
-
-- (void)testFileExists:(CDVInvokedUrlCommand*)command
-{
- // arguments
- NSString* argPath = [command argumentAtIndex:0];
-
- // Get the file manager
- NSFileManager* fMgr = [NSFileManager defaultManager];
- NSString* appFile = argPath; // [ self getFullPath: argPath];
-
- BOOL bExists = [fMgr fileExistsAtPath:appFile];
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(bExists ? 1 : 0)];
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-- (void)testDirectoryExists:(CDVInvokedUrlCommand*)command
-{
- // arguments
- NSString* argPath = [command argumentAtIndex:0];
-
- // Get the file manager
- NSFileManager* fMgr = [[NSFileManager alloc] init];
- NSString* appFile = argPath; // [self getFullPath: argPath];
- BOOL bIsDir = NO;
- BOOL bExists = [fMgr fileExistsAtPath:appFile isDirectory:&bIsDir];
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:((bExists && bIsDir) ? 1 : 0)];
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-// Returns number of bytes available via callback
-- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command
-{
- // no arguments
-
- NSNumber* pNumAvail = [self checkFreeDiskSpace:self.rootDocsPath];
-
- NSString* strFreeSpace = [NSString stringWithFormat:@"%qu", [pNumAvail unsignedLongLongValue]];
- // NSLog(@"Free space is %@", strFreeSpace );
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:strFreeSpace];
-
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-#pragma mark Compatibility with older File API
-
-- (NSString*)getMimeTypeFromPath:(NSString*)fullPath
-{
- return [CDVLocalFilesystem getMimeTypeFromPath:fullPath];
-}
-
-- (NSDictionary *)getDirectoryEntry:(NSString *)localPath isDirectory:(BOOL)bDirRequest
-{
- CDVFilesystemURL *localURL = [self fileSystemURLforLocalPath:localPath];
- return [self makeEntryForPath:localURL.fullPath fileSystemName:localURL.fileSystemName isDirectory:bDirRequest];
-}
-
-#pragma mark Internal methods for testing
-// Internal methods for testing: Get the on-disk location of a local filesystem url.
-// [Currently used for testing file-transfer]
-
-- (void)_getLocalFilesystemPath:(CDVInvokedUrlCommand*)command
-{
- CDVFilesystemURL* localURL = [self fileSystemURLforArg:command.arguments[0]];
-
- NSString* fsPath = [self filesystemPathForURL:localURL];
- CDVPluginResult* result;
- if (fsPath) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:fsPath];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Cannot resolve URL to a file"];
- }
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.h
deleted file mode 100755
index a0186c853..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVFile.h"
-
-@interface CDVLocalFilesystem : NSObject<CDVFileSystem> {
- NSString *_name;
- NSString *_fsRoot;
-}
-
-- (id) initWithName:(NSString *)name root:(NSString *)fsRoot;
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath;
-
-@property (nonatomic,strong) NSString *fsRoot;
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
deleted file mode 100755
index c340ce0cc..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
+++ /dev/null
@@ -1,750 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVFile.h"
-#import "CDVLocalFilesystem.h"
-#import <Cordova/CDV.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-#import <sys/xattr.h>
-
-@implementation CDVLocalFilesystem
-@synthesize name=_name, fsRoot=_fsRoot, urlTransformer;
-
-- (id) initWithName:(NSString *)name root:(NSString *)fsRoot
-{
- if (self) {
- self.name = name;
- self.fsRoot = fsRoot;
- }
- return self;
-}
-
-/*
- * IN
- * NSString localURI
- * OUT
- * CDVPluginResult result containing a file or directoryEntry for the localURI, or an error if the
- * URI represents a non-existent path, or is unrecognized or otherwise malformed.
- */
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url
-{
- CDVPluginResult* result = nil;
- NSDictionary* entry = [self makeEntryForLocalURL:url];
- if (entry) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:entry];
- } else {
- // return NOT_FOUND_ERR
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
- }
- return result;
-}
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url {
- NSString *path = [self filesystemPathForURL:url];
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- BOOL isDir = NO;
- // see if exists and is file or dir
- BOOL bExists = [fileMgr fileExistsAtPath:path isDirectory:&isDir];
- if (bExists) {
- return [self makeEntryForPath:url.fullPath isDirectory:isDir];
- } else {
- return nil;
- }
-}
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir
-{
- NSMutableDictionary* dirEntry = [NSMutableDictionary dictionaryWithCapacity:5];
- NSString* lastPart = [[self stripQueryParametersFromPath:fullPath] lastPathComponent];
- if (isDir && ![fullPath hasSuffix:@"/"]) {
- fullPath = [fullPath stringByAppendingString:@"/"];
- }
- [dirEntry setObject:[NSNumber numberWithBool:!isDir] forKey:@"isFile"];
- [dirEntry setObject:[NSNumber numberWithBool:isDir] forKey:@"isDirectory"];
- [dirEntry setObject:fullPath forKey:@"fullPath"];
- [dirEntry setObject:lastPart forKey:@"name"];
- [dirEntry setObject:self.name forKey: @"filesystemName"];
-
- NSURL* nativeURL = [NSURL fileURLWithPath:[self filesystemPathForFullPath:fullPath]];
- if (self.urlTransformer) {
- nativeURL = self.urlTransformer(nativeURL);
- }
-
- dirEntry[@"nativeURL"] = [nativeURL absoluteString];
-
- return dirEntry;
-}
-
-- (NSString *)stripQueryParametersFromPath:(NSString *)fullPath
-{
- NSRange questionMark = [fullPath rangeOfString:@"?"];
- if (questionMark.location != NSNotFound) {
- return [fullPath substringWithRange:NSMakeRange(0,questionMark.location)];
- }
- return fullPath;
-}
-
-- (NSString *)filesystemPathForFullPath:(NSString *)fullPath
-{
- NSString *path = nil;
- NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
- path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
- if ([path length] > 1 && [path hasSuffix:@"/"]) {
- path = [path substringToIndex:([path length]-1)];
- }
- return path;
-}
-/*
- * IN
- * NSString localURI
- * OUT
- * NSString full local filesystem path for the represented file or directory, or nil if no such path is possible
- * The file or directory does not necessarily have to exist. nil is returned if the filesystem type is not recognized,
- * or if the URL is malformed.
- * The incoming URI should be properly escaped (no raw spaces, etc. URI percent-encoding is expected).
- */
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)url
-{
- return [self filesystemPathForFullPath:url.fullPath];
-}
-
-- (CDVFilesystemURL *)URLforFullPath:(NSString *)fullPath
-{
- if (fullPath) {
- NSString* escapedPath = [fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- if ([fullPath hasPrefix:@"/"]) {
- return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
- }
- return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@/%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
- }
- return nil;
-}
-
-- (CDVFilesystemURL *)URLforFilesystemPath:(NSString *)path
-{
- return [self URLforFullPath:[self fullPathForFileSystemPath:path]];
-
-}
-
-- (NSString *)normalizePath:(NSString *)rawPath
-{
- // If this is an absolute path, the first path component will be '/'. Skip it if that's the case
- BOOL isAbsolutePath = [rawPath hasPrefix:@"/"];
- if (isAbsolutePath) {
- rawPath = [rawPath substringFromIndex:1];
- }
- NSMutableArray *components = [NSMutableArray arrayWithArray:[rawPath pathComponents]];
- for (int index = 0; index < [components count]; ++index) {
- if ([[components objectAtIndex:index] isEqualToString:@".."]) {
- [components removeObjectAtIndex:index];
- if (index > 0) {
- [components removeObjectAtIndex:index-1];
- --index;
- }
- }
- }
-
- if (isAbsolutePath) {
- return [NSString stringWithFormat:@"/%@", [components componentsJoinedByString:@"/"]];
- } else {
- return [components componentsJoinedByString:@"/"];
- }
-
-
-}
-
-- (BOOL)valueForKeyIsNumber:(NSDictionary*)dict key:(NSString*)key
-{
- BOOL bNumber = NO;
- NSObject* value = dict[key];
- if (value) {
- bNumber = [value isKindOfClass:[NSNumber class]];
- }
- return bNumber;
-}
-
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options
-{
- CDVPluginResult* result = nil;
- BOOL bDirRequest = NO;
- BOOL create = NO;
- BOOL exclusive = NO;
- int errorCode = 0; // !!! risky - no error code currently defined for 0
-
- if ([self valueForKeyIsNumber:options key:@"create"]) {
- create = [(NSNumber*)[options valueForKey:@"create"] boolValue];
- }
- if ([self valueForKeyIsNumber:options key:@"exclusive"]) {
- exclusive = [(NSNumber*)[options valueForKey:@"exclusive"] boolValue];
- }
- if ([self valueForKeyIsNumber:options key:@"getDir"]) {
- // this will not exist for calls directly to getFile but will have been set by getDirectory before calling this method
- bDirRequest = [(NSNumber*)[options valueForKey:@"getDir"] boolValue];
- }
- // see if the requested path has invalid characters - should we be checking for more than just ":"?
- if ([requestedPath rangeOfString:@":"].location != NSNotFound) {
- errorCode = ENCODING_ERR;
- } else {
- // Build new fullPath for the requested resource.
- // We concatenate the two paths together, and then scan the resulting string to remove
- // parent ("..") references. Any parent references at the beginning of the string are
- // silently removed.
- NSString *combinedPath = [baseURI.fullPath stringByAppendingPathComponent:requestedPath];
- combinedPath = [self normalizePath:combinedPath];
- CDVFilesystemURL* requestedURL = [self URLforFullPath:combinedPath];
-
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- BOOL bIsDir;
- BOOL bExists = [fileMgr fileExistsAtPath:[self filesystemPathForURL:requestedURL] isDirectory:&bIsDir];
- if (bExists && (create == NO) && (bIsDir == !bDirRequest)) {
- // path exists and is not of requested type - return TYPE_MISMATCH_ERR
- errorCode = TYPE_MISMATCH_ERR;
- } else if (!bExists && (create == NO)) {
- // path does not exist and create is false - return NOT_FOUND_ERR
- errorCode = NOT_FOUND_ERR;
- } else if (bExists && (create == YES) && (exclusive == YES)) {
- // file/dir already exists and exclusive and create are both true - return PATH_EXISTS_ERR
- errorCode = PATH_EXISTS_ERR;
- } else {
- // if bExists and create == YES - just return data
- // if bExists and create == NO - just return data
- // if !bExists and create == YES - create and return data
- BOOL bSuccess = YES;
- NSError __autoreleasing* pError = nil;
- if (!bExists && (create == YES)) {
- if (bDirRequest) {
- // create the dir
- bSuccess = [fileMgr createDirectoryAtPath:[self filesystemPathForURL:requestedURL] withIntermediateDirectories:NO attributes:nil error:&pError];
- } else {
- // create the empty file
- bSuccess = [fileMgr createFileAtPath:[self filesystemPathForURL:requestedURL] contents:nil attributes:nil];
- }
- }
- if (!bSuccess) {
- errorCode = ABORT_ERR;
- if (pError) {
- NSLog(@"error creating directory: %@", [pError localizedDescription]);
- }
- } else {
- // NSLog(@"newly created file/dir (%@) exists: %d", reqFullPath, [fileMgr fileExistsAtPath:reqFullPath]);
- // file existed or was created
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self makeEntryForPath:requestedURL.fullPath isDirectory:bDirRequest]];
- }
- } // are all possible conditions met?
- }
-
- if (errorCode > 0) {
- // create error callback
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
- }
- return result;
-
-}
-
-- (CDVPluginResult*)getParentForURL:(CDVFilesystemURL *)localURI
-{
- CDVPluginResult* result = nil;
- CDVFilesystemURL *newURI = nil;
- if ([localURI.fullPath isEqualToString:@""]) {
- // return self
- newURI = localURI;
- } else {
- newURI = [CDVFilesystemURL fileSystemURLWithURL:[localURI.url URLByDeletingLastPathComponent]]; /* TODO: UGLY - FIX */
- }
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- BOOL bIsDir;
- BOOL bExists = [fileMgr fileExistsAtPath:[self filesystemPathForURL:newURI] isDirectory:&bIsDir];
- if (bExists) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self makeEntryForPath:newURI.fullPath isDirectory:bIsDir]];
- } else {
- // invalid path or file does not exist
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
- }
- return result;
-}
-
-- (CDVPluginResult*)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options
-{
- BOOL ok = NO;
-
- NSString* filePath = [self filesystemPathForURL:localURI];
- // we only care about this iCloud key for now.
- // set to 1/true to skip backup, set to 0/false to back it up (effectively removing the attribute)
- NSString* iCloudBackupExtendedAttributeKey = @"com.apple.MobileBackup";
- id iCloudBackupExtendedAttributeValue = [options objectForKey:iCloudBackupExtendedAttributeKey];
-
- if ((iCloudBackupExtendedAttributeValue != nil) && [iCloudBackupExtendedAttributeValue isKindOfClass:[NSNumber class]]) {
- if (IsAtLeastiOSVersion(@"5.1")) {
- NSURL* url = [NSURL fileURLWithPath:filePath];
- NSError* __autoreleasing error = nil;
-
- ok = [url setResourceValue:[NSNumber numberWithBool:[iCloudBackupExtendedAttributeValue boolValue]] forKey:NSURLIsExcludedFromBackupKey error:&error];
- } else { // below 5.1 (deprecated - only really supported in 5.01)
- u_int8_t value = [iCloudBackupExtendedAttributeValue intValue];
- if (value == 0) { // remove the attribute (allow backup, the default)
- ok = (removexattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], 0) == 0);
- } else { // set the attribute (skip backup)
- ok = (setxattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], &value, sizeof(value), 0, 0) == 0);
- }
- }
- }
-
- if (ok) {
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else {
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
- }
-}
-
-/* remove the file or directory (recursively)
- * IN:
- * NSString* fullPath - the full path to the file or directory to be removed
- * NSString* callbackId
- * called from remove and removeRecursively - check all pubic api specific error conditions (dir not empty, etc) before calling
- */
-
-- (CDVPluginResult*)doRemove:(NSString*)fullPath
-{
- CDVPluginResult* result = nil;
- BOOL bSuccess = NO;
- NSError* __autoreleasing pError = nil;
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
-
- @try {
- bSuccess = [fileMgr removeItemAtPath:fullPath error:&pError];
- if (bSuccess) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else {
- // see if we can give a useful error
- CDVFileError errorCode = ABORT_ERR;
- NSLog(@"error removing filesystem entry at %@: %@", fullPath, [pError localizedDescription]);
- if ([pError code] == NSFileNoSuchFileError) {
- errorCode = NOT_FOUND_ERR;
- } else if ([pError code] == NSFileWriteNoPermissionError) {
- errorCode = NO_MODIFICATION_ALLOWED_ERR;
- }
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
- }
- } @catch(NSException* e) { // NSInvalidArgumentException if path is . or ..
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:SYNTAX_ERR];
- }
-
- return result;
-}
-
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI
-{
- NSString *fileSystemPath = [self filesystemPathForURL:localURI];
-
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- BOOL bIsDir = NO;
- BOOL bExists = [fileMgr fileExistsAtPath:fileSystemPath isDirectory:&bIsDir];
- if (!bExists) {
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
- }
- if (bIsDir && ([[fileMgr contentsOfDirectoryAtPath:fileSystemPath error:nil] count] != 0)) {
- // dir is not empty
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:INVALID_MODIFICATION_ERR];
- }
- return [self doRemove:fileSystemPath];
-}
-
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI
-{
- NSString *fileSystemPath = [self filesystemPathForURL:localURI];
- return [self doRemove:fileSystemPath];
-}
-
-/*
- * IN
- * NSString localURI
- * OUT
- * NSString full local filesystem path for the represented file or directory, or nil if no such path is possible
- * The file or directory does not necessarily have to exist. nil is returned if the filesystem type is not recognized,
- * or if the URL is malformed.
- * The incoming URI should be properly escaped (no raw spaces, etc. URI percent-encoding is expected).
- */
-- (NSString *)fullPathForFileSystemPath:(NSString *)fsPath
-{
- if ([fsPath hasPrefix:self.fsRoot]) {
- return [fsPath substringFromIndex:[self.fsRoot length]];
- }
- return nil;
-}
-
-
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI
-{
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- NSError* __autoreleasing error = nil;
- NSString *fileSystemPath = [self filesystemPathForURL:localURI];
-
- NSArray* contents = [fileMgr contentsOfDirectoryAtPath:fileSystemPath error:&error];
-
- if (contents) {
- NSMutableArray* entries = [NSMutableArray arrayWithCapacity:1];
- if ([contents count] > 0) {
- // create an Entry (as JSON) for each file/dir
- for (NSString* name in contents) {
- // see if is dir or file
- NSString* entryPath = [fileSystemPath stringByAppendingPathComponent:name];
- BOOL bIsDir = NO;
- [fileMgr fileExistsAtPath:entryPath isDirectory:&bIsDir];
- NSDictionary* entryDict = [self makeEntryForPath:[self fullPathForFileSystemPath:entryPath] isDirectory:bIsDir];
- [entries addObject:entryDict];
- }
- }
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:entries];
- } else {
- // assume not found but could check error for more specific error conditions
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
- }
-}
-
-- (unsigned long long)truncateFile:(NSString*)filePath atPosition:(unsigned long long)pos
-{
- unsigned long long newPos = 0UL;
-
- NSFileHandle* file = [NSFileHandle fileHandleForWritingAtPath:filePath];
-
- if (file) {
- [file truncateFileAtOffset:(unsigned long long)pos];
- newPos = [file offsetInFile];
- [file synchronizeFile];
- [file closeFile];
- }
- return newPos;
-}
-
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos
-{
- unsigned long long newPos = [self truncateFile:[self filesystemPathForURL:localURI] atPosition:pos];
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)newPos];
-}
-
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend
-{
- NSString *filePath = [self filesystemPathForURL:localURL];
-
- CDVPluginResult* result = nil;
- CDVFileError errCode = INVALID_MODIFICATION_ERR;
- int bytesWritten = 0;
-
- if (filePath) {
- NSOutputStream* fileStream = [NSOutputStream outputStreamToFileAtPath:filePath append:shouldAppend];
- if (fileStream) {
- NSUInteger len = [encData length];
- if (len == 0) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:(double)len];
- } else {
- [fileStream open];
-
- bytesWritten = (int)[fileStream write:[encData bytes] maxLength:len];
-
- [fileStream close];
- if (bytesWritten > 0) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:bytesWritten];
- // } else {
- // can probably get more detailed error info via [fileStream streamError]
- // errCode already set to INVALID_MODIFICATION_ERR;
- // bytesWritten = 0; // may be set to -1 on error
- }
- }
- } // else fileStream not created return INVALID_MODIFICATION_ERR
- } else {
- // invalid filePath
- errCode = NOT_FOUND_ERR;
- }
- if (!result) {
- // was an error
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errCode];
- }
- return result;
-}
-
-/**
- * Helper function to check to see if the user attempted to copy an entry into its parent without changing its name,
- * or attempted to copy a directory into a directory that it contains directly or indirectly.
- *
- * IN:
- * NSString* srcDir
- * NSString* destinationDir
- * OUT:
- * YES copy/ move is allows
- * NO move is onto itself
- */
-- (BOOL)canCopyMoveSrc:(NSString*)src ToDestination:(NSString*)dest
-{
- // This weird test is to determine if we are copying or moving a directory into itself.
- // Copy /Documents/myDir to /Documents/myDir-backup is okay but
- // Copy /Documents/myDir to /Documents/myDir/backup not okay
- BOOL copyOK = YES;
- NSRange range = [dest rangeOfString:src];
-
- if (range.location != NSNotFound) {
- NSRange testRange = {range.length - 1, ([dest length] - range.length)};
- NSRange resultRange = [dest rangeOfString:@"/" options:0 range:testRange];
- if (resultRange.location != NSNotFound) {
- copyOK = NO;
- }
- }
- return copyOK;
-}
-
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback
-{
- NSFileManager *fileMgr = [[NSFileManager alloc] init];
- NSString *destRootPath = [self filesystemPathForURL:destURL];
- BOOL bDestIsDir = NO;
- BOOL bDestExists = [fileMgr fileExistsAtPath:destRootPath isDirectory:&bDestIsDir];
-
- NSString *newFileSystemPath = [destRootPath stringByAppendingPathComponent:newName];
- NSString *newFullPath = [self fullPathForFileSystemPath:newFileSystemPath];
-
- BOOL bNewIsDir = NO;
- BOOL bNewExists = [fileMgr fileExistsAtPath:newFileSystemPath isDirectory:&bNewIsDir];
-
- CDVPluginResult *result = nil;
- int errCode = 0;
-
- if (!bDestExists) {
- // the destination root does not exist
- errCode = NOT_FOUND_ERR;
- }
-
- else if ([srcFs isKindOfClass:[CDVLocalFilesystem class]]) {
- /* Same FS, we can shortcut with NSFileManager operations */
- NSString *srcFullPath = [srcFs filesystemPathForURL:srcURL];
-
- BOOL bSrcIsDir = NO;
- BOOL bSrcExists = [fileMgr fileExistsAtPath:srcFullPath isDirectory:&bSrcIsDir];
-
- if (!bSrcExists) {
- // the source does not exist
- errCode = NOT_FOUND_ERR;
- } else if ([newFileSystemPath isEqualToString:srcFullPath]) {
- // source and destination can not be the same
- errCode = INVALID_MODIFICATION_ERR;
- } else if (bSrcIsDir && (bNewExists && !bNewIsDir)) {
- // can't copy/move dir to file
- errCode = INVALID_MODIFICATION_ERR;
- } else { // no errors yet
- NSError* __autoreleasing error = nil;
- BOOL bSuccess = NO;
- if (bCopy) {
- if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFileSystemPath]) {
- // can't copy dir into self
- errCode = INVALID_MODIFICATION_ERR;
- } else if (bNewExists) {
- // the full destination should NOT already exist if a copy
- errCode = PATH_EXISTS_ERR;
- } else {
- bSuccess = [fileMgr copyItemAtPath:srcFullPath toPath:newFileSystemPath error:&error];
- }
- } else { // move
- // iOS requires that destination must not exist before calling moveTo
- // is W3C INVALID_MODIFICATION_ERR error if destination dir exists and has contents
- //
- if (!bSrcIsDir && (bNewExists && bNewIsDir)) {
- // can't move a file to directory
- errCode = INVALID_MODIFICATION_ERR;
- } else if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFileSystemPath]) {
- // can't move a dir into itself
- errCode = INVALID_MODIFICATION_ERR;
- } else if (bNewExists) {
- if (bNewIsDir && ([[fileMgr contentsOfDirectoryAtPath:newFileSystemPath error:NULL] count] != 0)) {
- // can't move dir to a dir that is not empty
- errCode = INVALID_MODIFICATION_ERR;
- newFileSystemPath = nil; // so we won't try to move
- } else {
- // remove destination so can perform the moveItemAtPath
- bSuccess = [fileMgr removeItemAtPath:newFileSystemPath error:NULL];
- if (!bSuccess) {
- errCode = INVALID_MODIFICATION_ERR; // is this the correct error?
- newFileSystemPath = nil;
- }
- }
- } else if (bNewIsDir && [newFileSystemPath hasPrefix:srcFullPath]) {
- // can't move a directory inside itself or to any child at any depth;
- errCode = INVALID_MODIFICATION_ERR;
- newFileSystemPath = nil;
- }
-
- if (newFileSystemPath != nil) {
- bSuccess = [fileMgr moveItemAtPath:srcFullPath toPath:newFileSystemPath error:&error];
- }
- }
- if (bSuccess) {
- // should verify it is there and of the correct type???
- NSDictionary* newEntry = [self makeEntryForPath:newFullPath isDirectory:bSrcIsDir];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newEntry];
- } else {
- if (error) {
- if (([error code] == NSFileReadUnknownError) || ([error code] == NSFileReadTooLargeError)) {
- errCode = NOT_READABLE_ERR;
- } else if ([error code] == NSFileWriteOutOfSpaceError) {
- errCode = QUOTA_EXCEEDED_ERR;
- } else if ([error code] == NSFileWriteNoPermissionError) {
- errCode = NO_MODIFICATION_ALLOWED_ERR;
- }
- }
- }
- }
- } else {
- // Need to copy the hard way
- [srcFs readFileAtURL:srcURL start:0 end:-1 callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) {
- CDVPluginResult* result = nil;
- if (data != nil) {
- BOOL bSuccess = [data writeToFile:newFileSystemPath atomically:YES];
- if (bSuccess) {
- // should verify it is there and of the correct type???
- NSDictionary* newEntry = [self makeEntryForPath:newFullPath isDirectory:NO];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newEntry];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:ABORT_ERR];
- }
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
- }
- callback(result);
- }];
- return; // Async IO; return without callback.
- }
- if (result == nil) {
- if (!errCode) {
- errCode = INVALID_MODIFICATION_ERR; // Catch-all default
- }
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errCode];
- }
- callback(result);
-}
-
-/* helper function to get the mimeType from the file extension
- * IN:
- * NSString* fullPath - filename (may include path)
- * OUT:
- * NSString* the mime type as type/subtype. nil if not able to determine
- */
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath
-{
- NSString* mimeType = nil;
-
- if (fullPath) {
- CFStringRef typeId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[fullPath pathExtension], NULL);
- if (typeId) {
- mimeType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass(typeId, kUTTagClassMIMEType);
- if (!mimeType) {
- // special case for m4a
- if ([(__bridge NSString*)typeId rangeOfString : @"m4a-audio"].location != NSNotFound) {
- mimeType = @"audio/mp4";
- } else if ([[fullPath pathExtension] rangeOfString:@"wav"].location != NSNotFound) {
- mimeType = @"audio/wav";
- } else if ([[fullPath pathExtension] rangeOfString:@"css"].location != NSNotFound) {
- mimeType = @"text/css";
- }
- }
- CFRelease(typeId);
- }
- }
- return mimeType;
-}
-
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback
-{
- NSString *path = [self filesystemPathForURL:localURL];
-
- NSString* mimeType = [CDVLocalFilesystem getMimeTypeFromPath:path];
- if (mimeType == nil) {
- mimeType = @"*/*";
- }
- NSFileHandle* file = [NSFileHandle fileHandleForReadingAtPath:path];
- if (start > 0) {
- [file seekToFileOffset:start];
- }
-
- NSData* readData;
- if (end < 0) {
- readData = [file readDataToEndOfFile];
- } else {
- readData = [file readDataOfLength:(end - start)];
- }
- [file closeFile];
-
- callback(readData, mimeType, readData != nil ? NO_ERROR : NOT_FOUND_ERR);
-}
-
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback
-{
- NSString *path = [self filesystemPathForURL:localURL];
- CDVPluginResult *result;
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
-
- NSError* __autoreleasing error = nil;
- NSDictionary* fileAttrs = [fileMgr attributesOfItemAtPath:path error:&error];
-
- if (fileAttrs) {
-
- // create dictionary of file info
- NSMutableDictionary* fileInfo = [NSMutableDictionary dictionaryWithCapacity:5];
-
- [fileInfo setObject:localURL.fullPath forKey:@"fullPath"];
- [fileInfo setObject:[self mimeTypeForFileAtPath: path] forKey:@"type"];
- [fileInfo setObject:[path lastPathComponent] forKey:@"name"];
-
- // Ensure that directories (and other non-regular files) report size of 0
- unsigned long long size = ([fileAttrs fileType] == NSFileTypeRegular ? [fileAttrs fileSize] : 0);
- [fileInfo setObject:[NSNumber numberWithUnsignedLongLong:size] forKey:@"size"];
-
- NSDate* modDate = [fileAttrs fileModificationDate];
- if (modDate) {
- [fileInfo setObject:[NSNumber numberWithDouble:[modDate timeIntervalSince1970] * 1000] forKey:@"lastModifiedDate"];
- }
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileInfo];
-
- } else {
- // didn't get fileAttribs
- CDVFileError errorCode = ABORT_ERR;
- NSLog(@"error getting metadata: %@", [error localizedDescription]);
- if ([error code] == NSFileNoSuchFileError || [error code] == NSFileReadNoSuchFileError) {
- errorCode = NOT_FOUND_ERR;
- }
- // log [NSNumber numberWithDouble: theMessage] objCtype to see what it returns
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode];
- }
-
- callback(result);
-}
-
-// fix errors that base on Alexsander Akers from http://stackoverflow.com/a/5998683/2613194
-- (NSString*) mimeTypeForFileAtPath: (NSString *) path {
- if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
- return nil;
- }
-
- CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[path pathExtension], NULL);
- CFStringRef mimeType = UTTypeCopyPreferredTagWithClass (UTI, kUTTagClassMIMEType);
- CFRelease(UTI);
-
- if (!mimeType) {
- return @"application/octet-stream";
- }
- return (__bridge NSString *)mimeType;
-}
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h
deleted file mode 100644
index 696bac338..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@interface NSString (SSURLEncoding)
-@property (readonly) NSString *SSURLEncodedString;
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m
deleted file mode 100644
index d72effa08..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m
+++ /dev/null
@@ -1,30 +0,0 @@
-#import "NSString+SSURLEncoding.h"
-
-@implementation NSString (SSURLEncoding)
-- (NSString*)SSURLEncodedString
-{
- NSString* result = (NSString *)CFBridgingRelease(
- CFURLCreateStringByAddingPercentEscapes(
- kCFAllocatorDefault,
- (CFStringRef)self,
- CFSTR("#%"), // don't escape these
- NULL, // allow escaping these
- kCFStringEncodingUTF8
- )
- );
-
- // we may have a URL with more than one '#' now - which iOS doesn't allow, so escape all but the first one
- NSArray *parts = [result componentsSeparatedByString:@"#"];
- NSString *finalResult = parts[0];
- for (int i=1; i<parts.count; i++) {
- NSString *part = [parts objectAtIndex:i];
- if (i==1) {
- finalResult = [finalResult stringByAppendingString:@"#"];
- } else {
- finalResult = [finalResult stringByAppendingString:@"%23"];
- }
- finalResult = [finalResult stringByAppendingString:part];
- }
- return finalResult;
-}
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h
deleted file mode 100644
index 0c7314505..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#import <Cordova/CDV.h>
-#import <MessageUI/MFMailComposeViewController.h>
-
-@interface SocialSharing : CDVPlugin <UIPopoverControllerDelegate, MFMailComposeViewControllerDelegate, UIDocumentInteractionControllerDelegate>
-
-@property (nonatomic, strong) MFMailComposeViewController *globalMailComposer;
-@property (nonatomic, strong) UIDocumentInteractionController * documentInteractionController;
-@property (retain) NSString * tempStoredFile;
-@property (retain) CDVInvokedUrlCommand * command;
-
-- (void)available:(CDVInvokedUrlCommand*)command;
-- (void)setIPadPopupCoordinates:(CDVInvokedUrlCommand*)command;
-- (void)share:(CDVInvokedUrlCommand*)command;
-- (void)shareWithOptions:(CDVInvokedUrlCommand*)command;
-- (void)canShareVia:(CDVInvokedUrlCommand*)command;
-- (void)canShareViaEmail:(CDVInvokedUrlCommand*)command;
-- (void)shareVia:(CDVInvokedUrlCommand*)command;
-- (void)shareViaTwitter:(CDVInvokedUrlCommand*)command;
-- (void)shareViaFacebook:(CDVInvokedUrlCommand*)command;
-- (void)shareViaFacebookWithPasteMessageHint:(CDVInvokedUrlCommand*)command;
-- (void)shareViaWhatsApp:(CDVInvokedUrlCommand*)command;
-- (void)shareViaSMS:(CDVInvokedUrlCommand*)command;
-- (void)shareViaEmail:(CDVInvokedUrlCommand*)command;
-- (void)shareViaInstagram:(CDVInvokedUrlCommand*)command;
-
-- (void)saveToPhotoAlbum:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m
deleted file mode 100644
index 75c8b41bb..000000000
--- a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m
+++ /dev/null
@@ -1,868 +0,0 @@
-#import "SocialSharing.h"
-#import "NSString+SSURLEncoding.h"
-#import <Cordova/CDV.h>
-#import <Social/Social.h>
-#import <Foundation/NSException.h>
-#import <MessageUI/MFMessageComposeViewController.h>
-#import <MessageUI/MFMailComposeViewController.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-
-static NSString *const kShareOptionMessage = @"message";
-static NSString *const kShareOptionSubject = @"subject";
-static NSString *const kShareOptionFiles = @"files";
-static NSString *const kShareOptionUrl = @"url";
-static NSString *const kShareOptionIPadCoordinates = @"iPadCoordinates";
-
-@implementation SocialSharing {
- UIPopoverController *_popover;
- NSString *_popupCoordinates;
-}
-
-- (void)pluginInitialize {
-}
-
-- (void)available:(CDVInvokedUrlCommand*)command {
- BOOL avail = NO;
- if (NSClassFromString(@"UIActivityViewController")) {
- avail = YES;
- }
- CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:avail];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
-- (NSString*)getIPadPopupCoordinates {
- // see https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/1052
- return nil;
- /*
- if (_popupCoordinates != nil) {
- return _popupCoordinates;
- }
- if ([self.webView respondsToSelector:@selector(stringByEvaluatingJavaScriptFromString:)]) {
- return [(UIWebView*)self.webView stringByEvaluatingJavaScriptFromString:@"window.plugins.socialsharing.iPadPopupCoordinates();"];
- } else {
- // prolly a wkwebview, ignoring for now
- return nil;
- }
- */
-}
-
-- (void)setIPadPopupCoordinates:(CDVInvokedUrlCommand*)command {
- _popupCoordinates = [command.arguments objectAtIndex:0];
-}
-
-- (CGRect)getPopupRectFromIPadPopupCoordinates:(NSArray*)comps {
- CGRect rect = CGRectZero;
- if ([comps count] == 4) {
- rect = CGRectMake([[comps objectAtIndex:0] integerValue], [[comps objectAtIndex:1] integerValue], [[comps objectAtIndex:2] integerValue], [[comps objectAtIndex:3] integerValue]);
- }
- return rect;
-}
-
-- (void)share:(CDVInvokedUrlCommand*)command {
- [self shareInternal:command
- withOptions:@{
- kShareOptionMessage: [command.arguments objectAtIndex:0],
- kShareOptionSubject: [command.arguments objectAtIndex:1],
- kShareOptionFiles: [command.arguments objectAtIndex:2],
- kShareOptionUrl: [command.arguments objectAtIndex:3],
- kShareOptionIPadCoordinates: [command.arguments objectAtIndex:4]
- }
- isBooleanResponse:YES
-];
-}
-
-- (void)shareWithOptions:(CDVInvokedUrlCommand*)command {
- NSDictionary* options = [command.arguments objectAtIndex:0];
- [self shareInternal:command
- withOptions:options
- isBooleanResponse:NO
- ];
-}
-
-- (void)shareInternal:(CDVInvokedUrlCommand*)command withOptions:(NSDictionary*)options isBooleanResponse:(BOOL)boolResponse {
- [self.commandDelegate runInBackground:^{ //avoid main thread block especially if sharing big files from url
- if (!NSClassFromString(@"UIActivityViewController")) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- return;
- }
-
- NSString *message = options[kShareOptionMessage];
- NSString *subject = options[kShareOptionSubject];
- NSArray *filenames = options[kShareOptionFiles];
- NSString *urlString = options[kShareOptionUrl];
- NSString *iPadCoordString = options[kShareOptionIPadCoordinates];
- NSArray *iPadCoordinates;
-
- if (iPadCoordString != nil && iPadCoordString != [NSNull null]) {
- iPadCoordinates = [iPadCoordString componentsSeparatedByString:@","];
- } else {
- iPadCoordinates = @[];
- }
-
-
- NSMutableArray *activityItems = [[NSMutableArray alloc] init];
-
- if (message != (id)[NSNull null] && message != nil) {
- [activityItems addObject:message];
- }
-
- if (filenames != (id)[NSNull null] && filenames != nil && filenames.count > 0) {
- NSMutableArray *files = [[NSMutableArray alloc] init];
- for (NSString* filename in filenames) {
- NSObject *file = [self getImage:filename];
- if (file == nil) {
- file = [self getFile:filename];
- }
- if (file != nil) {
- [files addObject:file];
- }
- }
- [activityItems addObjectsFromArray:files];
- }
-
- if (urlString != (id)[NSNull null] && urlString != nil) {
- [activityItems addObject:[NSURL URLWithString:[urlString SSURLEncodedString]]];
- }
-
- UIActivity *activity = [[UIActivity alloc] init];
- NSArray *applicationActivities = [[NSArray alloc] initWithObjects:activity, nil];
- UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
- if (subject != (id)[NSNull null] && subject != nil) {
- [activityVC setValue:subject forKey:@"subject"];
- }
-
- if ([activityVC respondsToSelector:(@selector(setCompletionWithItemsHandler:))]) {
- [activityVC setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray * returnedItems, NSError * activityError) {
- [self cleanupStoredFiles];
- if (boolResponse) {
- [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:completed]
- callbackId:command.callbackId];
- } else {
- NSDictionary * result = @{@"completed":@(completed), @"app":activityType == nil ? @"" : activityType};
- [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:result]
- callbackId:command.callbackId];
- }
- }];
- } else {
- // let's suppress this warning otherwise folks will start opening issues while it's not relevant
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- [activityVC setCompletionHandler:^(NSString *activityType, BOOL completed) {
- [self cleanupStoredFiles];
- NSDictionary * result = @{@"completed":@(completed), @"app":activityType == nil ? @"" : activityType};
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:result];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }];
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
- }
-
- NSArray * socialSharingExcludeActivities = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SocialSharingExcludeActivities"];
- if (socialSharingExcludeActivities!=nil && [socialSharingExcludeActivities count] > 0) {
- activityVC.excludedActivityTypes = socialSharingExcludeActivities;
- }
-
- dispatch_async(dispatch_get_main_queue(), ^(void){
- // iPad on iOS >= 8 needs a different approach
- if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
- NSString* iPadCoords = [self getIPadPopupCoordinates];
- if (iPadCoords != nil && ![iPadCoords isEqual:@"-1,-1,-1,-1"]) {
- CGRect rect;
- if ([iPadCoordinates count] == 4) {
-
- rect = CGRectMake((int) [[iPadCoordinates objectAtIndex:0] integerValue], (int) [[iPadCoordinates objectAtIndex:1] integerValue], (int) [[iPadCoordinates objectAtIndex:2] integerValue], (int) [[iPadCoordinates objectAtIndex:3] integerValue]);
- } else {
- NSArray *comps = [iPadCoords componentsSeparatedByString:@","];
- rect = [self getPopupRectFromIPadPopupCoordinates:comps];
- }
- if ([activityVC respondsToSelector:@selector(popoverPresentationController)]) {
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 // iOS 8.0 supported
- activityVC.popoverPresentationController.sourceView = self.webView;
- activityVC.popoverPresentationController.sourceRect = rect;
-#endif
- } else {
- _popover = [[UIPopoverController alloc] initWithContentViewController:activityVC];
- _popover.delegate = self;
- [_popover presentPopoverFromRect:rect inView:self.webView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
- }
- } else if ([activityVC respondsToSelector:@selector(popoverPresentationController)]) {
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 // iOS 8.0 supported
- activityVC.popoverPresentationController.sourceView = self.webView;
- // position the popup at the bottom, just like iOS < 8 did (and iPhone still does on iOS 8)
- CGRect rect;
- if ([iPadCoordinates count] == 4) {
- NSLog([[NSString alloc] initWithFormat:@"test %d", [[iPadCoordinates objectAtIndex:0] integerValue]]);
- rect = CGRectMake((int) [[iPadCoordinates objectAtIndex:0] integerValue], (int) [[iPadCoordinates objectAtIndex:1] integerValue], (int) [[iPadCoordinates objectAtIndex:2] integerValue], (int) [[iPadCoordinates objectAtIndex:3] integerValue]);
- } else {
- NSArray *comps = [NSArray arrayWithObjects:
- [NSNumber numberWithInt:(self.viewController.view.frame.size.width/2)-200],
- [NSNumber numberWithInt:self.viewController.view.frame.size.height],
- [NSNumber numberWithInt:400],
- [NSNumber numberWithInt:400],
- nil];
- rect = [self getPopupRectFromIPadPopupCoordinates:comps];
- }
- activityVC.popoverPresentationController.sourceRect = rect;
-#endif
- }
- }
- [[self getTopMostViewController] presentViewController:activityVC animated:YES completion:nil];
- });
- }];
-}
-
-- (void)shareViaTwitter:(CDVInvokedUrlCommand*)command {
- [self shareViaInternal:command type:SLServiceTypeTwitter];
-}
-
-- (void)shareViaFacebook:(CDVInvokedUrlCommand*)command {
- [self shareViaInternal:command type:SLServiceTypeFacebook];
-}
-
-- (void)shareViaFacebookWithPasteMessageHint:(CDVInvokedUrlCommand*)command {
- // If Fb app is installed a message is not prefilled.
- // When shared through the default iOS widget (iOS Settings > Facebook) the message is prefilled already.
- NSString *message = [command.arguments objectAtIndex:0];
- if (message != (id)[NSNull null]) {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1000 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
- BOOL fbAppInstalled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]; // requires whitelisting on iOS9
- if (fbAppInstalled) {
- UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
- [pasteboard setValue:message forPasteboardType:@"public.utf8-plain-text"];
- NSString *hint = [command.arguments objectAtIndex:4];
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:hint delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
- [alert show];
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2800 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
- [alert dismissWithClickedButtonIndex:-1 animated:YES];
- });
- }
- });
- }
- [self shareViaInternal:command type:SLServiceTypeFacebook];
-}
-
-- (void)shareVia:(CDVInvokedUrlCommand*)command {
- [self shareViaInternal:command type:[command.arguments objectAtIndex:4]];
-}
-
-- (void)canShareVia:(CDVInvokedUrlCommand*)command {
- NSString *via = [command.arguments objectAtIndex:4];
- CDVPluginResult * pluginResult;
- if ([@"sms" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaSMS]) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else if ([@"email" caseInsensitiveCompare:via] == NSOrderedSame && [self isEmailAvailable]) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else if ([@"whatsapp" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaWhatsApp]) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else if ([@"instagram" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaInstagram]) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else if ([@"com.apple.social.facebook" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaFacebook]) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else if ([@"com.apple.social.twitter" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaTwitter]) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else if ([self isAvailableForSharing:command type:via]) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- } else {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- }
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
-- (void)canShareViaEmail:(CDVInvokedUrlCommand*)command {
- if ([self isEmailAvailable]) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- } else {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }
-}
-
-- (bool)isEmailAvailable {
- Class messageClass = (NSClassFromString(@"MFMailComposeViewController"));
- return messageClass != nil && [messageClass canSendMail];
-}
-
-- (bool)isAvailableForSharing:(CDVInvokedUrlCommand*)command
- type:(NSString *) type {
-
- // isAvailableForServiceType returns true if you pass it a type that is not
- // in the defined constants, this is probably a bug on apples part
- if(!([type isEqualToString:SLServiceTypeFacebook]
- || [type isEqualToString:SLServiceTypeTwitter]
- || [type isEqualToString:SLServiceTypeTencentWeibo]
- || [type isEqualToString:SLServiceTypeSinaWeibo])) {
- return false;
- }
- // wrapped in try-catch, because isAvailableForServiceType may crash if an invalid type is passed
- @try {
- return [SLComposeViewController isAvailableForServiceType:type];
- }
- @catch (NSException* exception) {
- return false;
- }
-}
-
-- (void)shareViaInternal:(CDVInvokedUrlCommand*)command
- type:(NSString *) type {
-
- NSString *message = [command.arguments objectAtIndex:0];
- // subject is not supported by the SLComposeViewController
- NSArray *filenames = [command.arguments objectAtIndex:2];
- NSString *urlString = [command.arguments objectAtIndex:3];
-
- // boldly invoke the target app, because the phone will display a nice message asking to configure the app
- SLComposeViewController *composeViewController = [SLComposeViewController composeViewControllerForServiceType:type];
- if (message != (id)[NSNull null]) {
- [composeViewController setInitialText:message];
- }
-
- for (NSString* filename in filenames) {
- UIImage* image = [self getImage:filename];
- if (image != nil) {
- [composeViewController addImage:image];
- }
- }
-
- if (urlString != (id)[NSNull null]) {
- [composeViewController addURL:[NSURL URLWithString:[urlString SSURLEncodedString]]];
- }
-
- [composeViewController setCompletionHandler:^(SLComposeViewControllerResult result) {
- if (SLComposeViewControllerResultCancelled == result) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"cancelled"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- } else if (SLComposeViewControllerResultDone == result || [self isAvailableForSharing:command type:type]) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:true];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- } else {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }
- // required for iOS6 (issues #162 and #167)
- [self.viewController dismissViewControllerAnimated:YES completion:nil];
- }];
- [[self getTopMostViewController] presentViewController:composeViewController animated:YES completion:nil];
-}
-
-- (void)shareViaEmail:(CDVInvokedUrlCommand*)command {
- if ([self isEmailAvailable]) {
-
- if (TARGET_IPHONE_SIMULATOR && IsAtLeastiOSVersion(@"8.0")) {
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"SocialSharing plugin"
- message:@"Sharing via email is not supported on the iOS 8 simulator."
- delegate:nil
- cancelButtonTitle:@"OK"
- otherButtonTitles:nil];
- [alert show];
- return;
- }
-
- [self cycleTheGlobalMailComposer];
-
- self.globalMailComposer.mailComposeDelegate = self;
-
- if ([command.arguments objectAtIndex:0] != (id)[NSNull null]) {
- NSString *message = [command.arguments objectAtIndex:0];
- BOOL isHTML = [message rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch].location != NSNotFound;
- [self.globalMailComposer setMessageBody:message isHTML:isHTML];
- }
-
- if ([command.arguments objectAtIndex:1] != (id)[NSNull null]) {
- [self.globalMailComposer setSubject: [command.arguments objectAtIndex:1]];
- }
-
- if ([command.arguments objectAtIndex:2] != (id)[NSNull null]) {
- [self.globalMailComposer setToRecipients:[command.arguments objectAtIndex:2]];
- }
-
- if ([command.arguments objectAtIndex:3] != (id)[NSNull null]) {
- [self.globalMailComposer setCcRecipients:[command.arguments objectAtIndex:3]];
- }
-
- if ([command.arguments objectAtIndex:4] != (id)[NSNull null]) {
- [self.globalMailComposer setBccRecipients:[command.arguments objectAtIndex:4]];
- }
-
- if ([command.arguments objectAtIndex:5] != (id)[NSNull null]) {
- NSArray* attachments = [command.arguments objectAtIndex:5];
- NSFileManager* fileManager = [NSFileManager defaultManager];
- for (NSString* path in attachments) {
- NSURL *file = [self getFile:path];
- NSData* data = [fileManager contentsAtPath:file.path];
-
- if (!data) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"invalid attachment"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- return;
- }
-
- NSString* fileName;
- NSString* mimeType;
- NSString* basename = [self getBasenameFromAttachmentPath:path];
-
- //Find data anywhere in string
- NSRange rangeData = [basename rangeOfString:@"data:"];
- if (rangeData.location == NSNotFound)
- {
- fileName = [basename pathComponents].lastObject;
- mimeType = [self getMimeTypeFromFileExtension:[basename pathExtension]];
- }
- else
- {
- mimeType = (NSString*)[[[basename substringFromIndex:rangeData.location+rangeData.length] componentsSeparatedByString: @";"] objectAtIndex:0];
-
- //Find df anywhere in string
- NSRange rangeDF = [basename rangeOfString:@"df:"];
- //If not found fallback to default name
- if (rangeDF.location == NSNotFound) {
- fileName = @"attachment.";
- fileName = [fileName stringByAppendingString:(NSString*)[[mimeType componentsSeparatedByString: @"/"] lastObject]];
- } else {
- //Found, apply name
- fileName = (NSString*)[[[basename substringFromIndex:rangeDF.location+rangeDF.length] componentsSeparatedByString: @";"] objectAtIndex:0];
- }
-
-
- NSString *base64content = (NSString*)[[basename componentsSeparatedByString: @","] lastObject];
- data = [SocialSharing dataFromBase64String:base64content];
- }
- [self.globalMailComposer addAttachmentData:data mimeType:mimeType fileName:fileName];
- }
- }
-
- // remember the command, because we need it in the didFinishWithResult method
- _command = command;
-
- dispatch_async(dispatch_get_main_queue(), ^{
- [[self getTopMostViewController] presentViewController:self.globalMailComposer animated:YES completion:nil];
- });
- } else {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }
-}
-
-- (UIViewController*) getTopMostViewController {
- UIViewController *presentingViewController = [[UIApplication sharedApplication] keyWindow].rootViewController;
- while (presentingViewController.presentedViewController != nil) {
- presentingViewController = presentingViewController.presentedViewController;
- }
- return presentingViewController;
-}
-
-- (NSString*) getBasenameFromAttachmentPath:(NSString*)path {
- if ([path hasPrefix:@"base64:"]) {
- NSString* pathWithoutPrefix = [path stringByReplacingOccurrencesOfString:@"base64:" withString:@""];
- return [pathWithoutPrefix substringToIndex:[pathWithoutPrefix rangeOfString:@"//"].location];
- }
- return [path componentsSeparatedByString: @"?"][0];
-}
-
-- (NSString*) getMimeTypeFromFileExtension:(NSString*)extension {
- if (!extension) {
- return nil;
- }
- // Get the UTI from the file's extension
- CFStringRef ext = (CFStringRef)CFBridgingRetain(extension);
- CFStringRef type = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, ext, NULL);
- // Converting UTI to a mime type
- NSString *result = (NSString*)CFBridgingRelease(UTTypeCopyPreferredTagWithClass(type, kUTTagClassMIMEType));
- CFRelease(ext);
- CFRelease(type);
- if (result == nil) {
- result = @"application/octet-stream";
- }
-
- return result;
-}
-
-/**
- * Delegate will be called after the mail composer did finish an action
- * to dismiss the view.
- */
-- (void) mailComposeController:(MFMailComposeViewController*)controller
- didFinishWithResult:(MFMailComposeResult)result
- error:(NSError*)error {
- bool ok = result == MFMailComposeResultSent;
- [self.globalMailComposer dismissViewControllerAnimated:YES completion:nil];
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:ok];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:_command.callbackId];
-}
-
--(void)cycleTheGlobalMailComposer {
- // we are cycling the damned GlobalMailComposer: http://stackoverflow.com/questions/25604552/i-have-real-misunderstanding-with-mfmailcomposeviewcontroller-in-swift-ios8-in/25604976#25604976
- self.globalMailComposer = nil;
- self.globalMailComposer = [[MFMailComposeViewController alloc] init];
-}
-
-- (bool)canShareViaSMS {
- Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
- return messageClass != nil && [messageClass canSendText];
-}
-
-- (void)shareViaSMS:(CDVInvokedUrlCommand*)command {
- if ([self canShareViaSMS]) {
- NSDictionary* options = [command.arguments objectAtIndex:0];
- NSString *phonenumbers = [command.arguments objectAtIndex:1];
- NSString *message = [options objectForKey:@"message"];
- NSString *subject = [options objectForKey:@"subject"];
- NSString *image = [options objectForKey:@"image"];
-
- MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
- picker.messageComposeDelegate = (id) self;
- if (message != (id)[NSNull null]) {
- picker.body = message;
- }
- if (subject != (id)[NSNull null]) {
- [picker setSubject:subject];
- }
- if (image != nil && image != (id)[NSNull null]) {
- BOOL canSendAttachments = [[MFMessageComposeViewController class] respondsToSelector:@selector(canSendAttachments)];
- if (canSendAttachments) {
- NSURL *file = [self getFile:image];
- if (file != nil) {
- [picker addAttachmentURL:file withAlternateFilename:nil];
- }
- }
- }
-
- if (phonenumbers != (id)[NSNull null]) {
- [picker setRecipients:[phonenumbers componentsSeparatedByString:@","]];
- }
- // remember the command, because we need it in the didFinishWithResult method
- _command = command;
- dispatch_async(dispatch_get_main_queue(), ^{
- picker.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
- [[self getTopMostViewController] presentViewController:picker animated:NO completion:nil];
- });
- } else {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }
-}
-
-// Dismisses the SMS composition interface when users taps Cancel or Send
-- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
- bool ok = result == MessageComposeResultSent;
- [[self getTopMostViewController] dismissViewControllerAnimated:YES completion:nil];
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:ok];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:_command.callbackId];
-}
-
-- (bool)canShareViaInstagram {
- return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"instagram://app"]]; // requires whitelisting on iOS9
-}
-
-- (bool)canShareViaWhatsApp {
- return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"whatsapp://app"]]; // requires whitelisting on iOS9
-}
-
-- (bool)canShareViaFacebook {
- return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"fb://"]]; // requires whitelisting on iOS9
-}
-
-- (bool)canShareViaTwitter {
- return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"twitter://"]]; // requires whitelisting on iOS9
-}
-
-// this is only an internal test method for now, can be used to open a share sheet with 'Open in xx' links for tumblr, drive, dropbox, ..
-- (void)openImage:(NSString *)imageName {
- UIImage* image =[self getImage:imageName];
- if (image != nil) {
- NSString * savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/myTempImage.jpg"];
- [UIImageJPEGRepresentation(image, 1.0) writeToFile:savePath atomically:YES];
- _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
- _documentInteractionController.UTI = @""; // TODO find the scheme for google drive and create a shareViaGoogleDrive function
- [_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.viewController.view animated: YES];
- }
-}
-
-- (void)shareViaInstagram:(CDVInvokedUrlCommand*)command {
-
- // on iOS9 canShareVia('instagram'..) will only work if instagram:// is whitelisted.
- // If it's not, this method will ask permission to the user on iOS9 for opening the app,
- // which is of course better than Instagram sharing not working at all because you forgot to whitelist it.
- // Tradeoff: on iOS9 this method will always return true, so make sure to whitelist it and call canShareVia('instagram'..)
- if (!IsAtLeastiOSVersion(@"9.0")) {
- if (![self canShareViaInstagram]) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- return;
- }
- }
-
- NSString *message = [command.arguments objectAtIndex:0];
- // subject is not supported by the SLComposeViewController
- NSArray *filenames = [command.arguments objectAtIndex:2];
-
- // only use the first image (for now.. maybe we can share in a loop?)
- UIImage* image = nil;
- for (NSString* filename in filenames) {
- image = [self getImage:filename];
- break;
- }
-
-// NSData *imageObj = [NSData dataFromBase64String:objectAtIndex0];
- NSString *tmpDir = NSTemporaryDirectory();
- NSString *path = [tmpDir stringByAppendingPathComponent:@"instagram.igo"];
- [UIImageJPEGRepresentation(image, 1.0) writeToFile:path atomically:YES];
-
- _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];
- _documentInteractionController.delegate = self;
- _documentInteractionController.UTI = @"com.instagram.exclusivegram";
-
- if (message != (id)[NSNull null]) {
- // no longer working, so ..
- _documentInteractionController.annotation = @{@"InstagramCaption" : message};
-
- // .. we put the message on the clipboard (you app can prompt the user to paste it)
- UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
- [pasteboard setValue:message forPasteboardType:@"public.utf8-plain-text"];
- }
-
- // remember the command for the delegate method
- _command = command;
-
- // test for #513
- dispatch_async(dispatch_get_main_queue(), ^(void){
- [_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.webView animated:YES];
- });
-}
-
-- (void)shareViaWhatsApp:(CDVInvokedUrlCommand*)command {
-
- // on iOS9 canShareVia('whatsapp'..) will only work if whatsapp:// is whitelisted.
- // If it's not, this method will ask permission to the user on iOS9 for opening the app,
- // which is of course better than WhatsApp sharing not working at all because you forgot to whitelist it.
- // Tradeoff: on iOS9 this method will always return true, so make sure to whitelist it and call canShareVia('whatsapp'..)
- if (!IsAtLeastiOSVersion(@"9.0")) {
- if (![self canShareViaWhatsApp]) {
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- return;
- }
- }
-
- NSString *message = [command.arguments objectAtIndex:0];
- // subject is not supported by the SLComposeViewController
- NSArray *filenames = [command.arguments objectAtIndex:2];
- NSString *urlString = [command.arguments objectAtIndex:3];
- NSString *abid = [command.arguments objectAtIndex:4];
- NSString *phone = [command.arguments objectAtIndex:5];
-
- // only use the first image (for now.. maybe we can share in a loop?)
- UIImage *image = nil;
- for (NSString *filename in filenames) {
- image = [self getImage:filename];
- break;
- }
-
- // with WhatsApp, we can share an image OR text+url.. image wins if set
- if (image != nil) {
- NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/whatsAppTmp.jpg"];
- [UIImageJPEGRepresentation(image, 1.0) writeToFile:savePath atomically:YES];
- _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
- _documentInteractionController.UTI = @"net.whatsapp.image";
- _documentInteractionController.delegate = self;
- _command = command;
- [_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.viewController.view animated: YES];
- } else {
- // append an url to a message, if both are passed
- NSString *shareString = @"";
- if (message != (id)[NSNull null]) {
- shareString = message;
- }
- if (urlString != (id)[NSNull null]) {
- if ([shareString isEqual: @""]) {
- shareString = urlString;
- } else {
- shareString = [NSString stringWithFormat:@"%@ %@", shareString, [urlString SSURLEncodedString]];
- }
- }
- NSString *encodedShareString = [shareString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- // also encode the '=' character
- encodedShareString = [encodedShareString stringByReplacingOccurrencesOfString:@"=" withString:@"%3D"];
- encodedShareString = [encodedShareString stringByReplacingOccurrencesOfString:@"&" withString:@"%26"];
- NSString *abidString = @"";
- if (abid != (id)[NSNull null]) {
- abidString = [NSString stringWithFormat:@"abid=%@&", abid];
- }
- NSString *phoneString = @"";
- if (phone != (id)[NSNull null]) {
- phoneString = [NSString stringWithFormat:@"phone=%@&", phone];
- }
- NSString *encodedShareStringForWhatsApp = [NSString stringWithFormat:@"whatsapp://send?%@%@text=%@", abidString, phoneString, encodedShareString];
-
- NSURL *whatsappURL = [NSURL URLWithString:encodedShareStringForWhatsApp];
- [[UIApplication sharedApplication] openURL: whatsappURL];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }
-}
-
-- (void)saveToPhotoAlbum:(CDVInvokedUrlCommand*)command {
- self.command = command;
- NSArray *filenames = [command.arguments objectAtIndex:0];
- [self.commandDelegate runInBackground:^{
- bool shared = false;
- for (NSString* filename in filenames) {
- UIImage* image = [self getImage:filename];
- if (image != nil) {
- shared = true;
- UIImageWriteToSavedPhotosAlbum(image, self, @selector(thisImage:wasSavedToPhotoAlbumWithError:contextInfo:), nil);
- }
- }
- if (!shared) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no valid image was passed"];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:self.command.callbackId];
- }
- }];
-}
-
-// called from saveToPhotoAlbum, note that we only send feedback for the first image that's being saved (not keeping the callback)
-// but since the UIImageWriteToSavedPhotosAlbum function is only called with valid images that should not be a problem
-- (void)thisImage:(UIImage *)image wasSavedToPhotoAlbumWithError:(NSError *)error contextInfo:(void*)ctxInfo {
- if (error) {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:error.localizedDescription];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:self.command.callbackId];
- } else {
- CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:self.command.callbackId];
- }
-}
-
--(UIImage*)getImage: (NSString *)imageName {
- UIImage *image = nil;
- if (imageName != (id)[NSNull null]) {
- if ([imageName hasPrefix:@"http"]) {
- image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageName]]];
- } else if ([imageName hasPrefix:@"www/"]) {
- image = [UIImage imageNamed:imageName];
- } else if ([imageName hasPrefix:@"file://"]) {
- image = [UIImage imageWithData:[NSData dataWithContentsOfFile:[[NSURL URLWithString:imageName] path]]];
- } else if ([imageName hasPrefix:@"data:"]) {
- // using a base64 encoded string
- NSURL *imageURL = [NSURL URLWithString:imageName];
- NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
- image = [UIImage imageWithData:imageData];
- } else if ([imageName hasPrefix:@"assets-library://"]) {
- // use assets-library
- NSURL *imageURL = [NSURL URLWithString:imageName];
- NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
- image = [UIImage imageWithData:imageData];
- } else {
- // assume anywhere else, on the local filesystem
- image = [UIImage imageWithData:[NSData dataWithContentsOfFile:imageName]];
- }
- }
- return image;
-}
-
--(NSURL*)getFile: (NSString *)fileName {
- NSURL *file = nil;
- if (fileName != (id)[NSNull null]) {
- NSRange rangeData = [fileName rangeOfString:@"data:"];
- if ([fileName hasPrefix:@"http"]) {
- NSURL *url = [NSURL URLWithString:fileName];
- NSData *fileData = [NSData dataWithContentsOfURL:url];
- NSURLRequest *request = [NSURLRequest requestWithURL: url];
- NSHTTPURLResponse *response;
- [NSURLConnection sendSynchronousRequest: request returningResponse: &response error: nil];
- if ([response respondsToSelector:@selector(allHeaderFields)]) {
- NSDictionary *dictionary = [response allHeaderFields];
- NSLog([dictionary description]);
- NSString *name = dictionary[@"Content-Disposition"];
- if (name == nil){
- NSString *name = (NSString*)[[fileName componentsSeparatedByString: @"/"] lastObject];
- file = [NSURL fileURLWithPath:[self storeInFile:[name componentsSeparatedByString: @"?"][0] fileData:fileData]];
- } else {
- file = [NSURL fileURLWithPath:[self storeInFile:[[name componentsSeparatedByString:@"="] lastObject] fileData:fileData]];
- }
- } else {
- NSString *name = (NSString*)[[fileName componentsSeparatedByString: @"/"] lastObject];
- file = [NSURL fileURLWithPath:[self storeInFile:[name componentsSeparatedByString: @"?"][0] fileData:fileData]];
- }
- } else if ([fileName hasPrefix:@"www/"]) {
- NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
- NSString *fullPath = [NSString stringWithFormat:@"%@/%@", bundlePath, fileName];
- file = [NSURL fileURLWithPath:fullPath];
- } else if ([fileName hasPrefix:@"file://"]) {
- // stripping the first 6 chars, because the path should start with / instead of file://
- file = [NSURL fileURLWithPath:[fileName substringFromIndex:6]];
- } else if (rangeData.location != NSNotFound ){
- //If found "data:"
- NSString *fileType = (NSString*)[[[fileName substringFromIndex:rangeData.location+rangeData.length] componentsSeparatedByString: @";"] objectAtIndex:0];
-
- NSString* attachmentName;
- //Find df anywhere in string
- NSRange rangeDF = [fileName rangeOfString:@"df:"];
- //If not found fallback to default name
- if (rangeDF.location == NSNotFound) {
- attachmentName = @"attachment.";
- attachmentName = [attachmentName stringByAppendingString:(NSString*)[[fileType componentsSeparatedByString: @"/"] lastObject]];
- } else {
- //Found, apply name
- attachmentName = (NSString*)[[[fileName substringFromIndex:rangeDF.location+rangeDF.length] componentsSeparatedByString: @";"] objectAtIndex:0];
- }
-
-
- NSString *base64content = (NSString*)[[fileName componentsSeparatedByString: @","] lastObject];
- NSData* data = [SocialSharing dataFromBase64String:base64content];
- file = [NSURL fileURLWithPath:[self storeInFile:attachmentName fileData:data]];
-
- } else {
- // assume anywhere else, on the local filesystem
- file = [NSURL fileURLWithPath:fileName];
- }
- }
- return file;
-}
-
--(NSString*) storeInFile: (NSString*) fileName
- fileData: (NSData*) fileData {
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentsDirectory = [paths objectAtIndex:0];
- NSString *filePath = [documentsDirectory stringByAppendingPathComponent:fileName];
- [fileData writeToFile:filePath atomically:YES];
- _tempStoredFile = filePath;
- return filePath;
-}
-
-- (void) cleanupStoredFiles {
- if (_tempStoredFile != nil) {
- NSError *error;
- [[NSFileManager defaultManager]removeItemAtPath:_tempStoredFile error:&error];
- }
-}
-
-+ (NSData*) dataFromBase64String:(NSString*)aString {
- return [[NSData alloc] initWithBase64EncodedString:aString options:0];
-}
-
-#pragma mark - UIPopoverControllerDelegate methods
-
-- (void)popoverController:(UIPopoverController *)popoverController willRepositionPopoverToRect:(inout CGRect *)rect inView:(inout UIView **)view {
- NSArray *comps = [[self getIPadPopupCoordinates] componentsSeparatedByString:@","];
- CGRect newRect = [self getPopupRectFromIPadPopupCoordinates:comps];
- rect->origin = newRect.origin;
-}
-
-- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController {
- _popover = nil;
-}
-
-#pragma mark - UIDocumentInteractionControllerDelegate methods
-
-- (void) documentInteractionController: (UIDocumentInteractionController *) controller willBeginSendingToApplication: (NSString *) application {
- // note that the application actually contains the app bundle id which was picked (for whatsapp and instagram only)
- NSLog(@"SocialSharing app selected: %@", application);
-}
-
-- (void) documentInteractionControllerDidDismissOpenInMenu: (UIDocumentInteractionController *) controller {
- if (self.command != nil) {
- CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- [self.commandDelegate sendPluginResult:result callbackId: self.command.callbackId];
- }
-}
-
-@end
diff --git a/cordova/platforms/ios/App/PrivacyInfo.xcprivacy b/cordova/platforms/ios/App/PrivacyInfo.xcprivacy
deleted file mode 100644
index 4b2e70fdd..000000000
--- a/cordova/platforms/ios/App/PrivacyInfo.xcprivacy
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>NSPrivacyTracking</key>
- <false/>
- <key>NSPrivacyCollectedDataTypes</key>
- <array/>
- <key>NSPrivacyAccessedAPITypes</key>
- <array/>
- <key>NSPrivacyTrackingDomains</key>
- <array/>
-</dict>
-</plist>
diff --git a/cordova/platforms/ios/App/Resources/README b/cordova/platforms/ios/App/Resources/README
deleted file mode 100644
index 1872c8e99..000000000
--- a/cordova/platforms/ios/App/Resources/README
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-Put resource files to embed in the app bundle here.
diff --git a/cordova/platforms/ios/App/Resources/appbeep.wav b/cordova/platforms/ios/App/Resources/appbeep.wav
deleted file mode 100755
index 24a13d40e..000000000
Binary files a/cordova/platforms/ios/App/Resources/appbeep.wav and /dev/null differ
diff --git a/cordova/platforms/ios/App/SceneDelegate.swift b/cordova/platforms/ios/App/SceneDelegate.swift
deleted file mode 100644
index 82b592e75..000000000
--- a/cordova/platforms/ios/App/SceneDelegate.swift
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-import Cordova
-
-class SceneDelegate: CDVSceneDelegate {
-}
-
diff --git a/cordova/platforms/ios/App/ViewController.swift b/cordova/platforms/ios/App/ViewController.swift
deleted file mode 100644
index 0f29fed29..000000000
--- a/cordova/platforms/ios/App/ViewController.swift
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-import Cordova
-
-#if compiler(>=6.1)
-@objc @implementation
-#else
-@_objcImplementation
-#endif
-extension MainViewController {
-}
-
-class ViewController: MainViewController {
-}
diff --git a/cordova/platforms/ios/App/config.xml b/cordova/platforms/ios/App/config.xml
deleted file mode 100644
index 0934a87b7..000000000
--- a/cordova/platforms/ios/App/config.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<widget id="org.tagspaces.mobileapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
- <feature name="CDVWebViewEngine">
- <param name="ios-package" value="CDVWebViewEngine" />
- </feature>
- <feature name="LaunchScreen">
- <param name="ios-package" value="CDVLaunchScreen" />
- </feature>
- <feature name="LocalStorage">
- <param name="ios-package" value="CDVLocalStorage" />
- </feature>
- <feature name="Console">
- <param name="ios-package" value="CDVLogger" />
- <param name="onload" value="true" />
- </feature>
- <feature name="HandleOpenUrl">
- <param name="ios-package" value="CDVHandleOpenURL" />
- <param name="onload" value="true" />
- </feature>
- <feature name="IntentAndNavigationFilter">
- <param name="ios-package" value="CDVIntentAndNavigationFilter" />
- <param name="onload" value="true" />
- </feature>
- <feature name="GestureHandler">
- <param name="ios-package" value="CDVGestureHandler" />
- <param name="onload" value="true" />
- </feature>
- <feature name="StatusBarInternal">
- <param name="ios-package" value="CDVStatusBarInternal" />
- <param name="onload" value="true" />
- </feature>
- <feature name="Downloader">
- <param name="ios-package" value="Downloader" />
- </feature>
- <feature name="Device">
- <param name="ios-package" value="CDVDevice" />
- </feature>
- <feature name="BackgroundMode">
- <param name="ios-package" onload="true" value="APPBackgroundMode" />
- <param name="onload" value="true" />
- </feature>
- <feature name="File">
- <param name="ios-package" value="CDVFile" />
- <param name="onload" value="true" />
- </feature>
- <feature name="FileOpener2">
- <param name="ios-package" value="FileOpener2" />
- </feature>
- <feature name="SocialSharing">
- <param name="ios-package" value="SocialSharing" />
- <param name="onload" value="true" />
- </feature>
- <feature name="Camera">
- <param name="ios-package" value="CDVCamera" />
- </feature>
- <name>TagSpaces</name>
- <description>
- Offline file organizer and browser with tagging support.
- </description>
- <author email="[email protected]" href="https://tagspaces.org">
- TagSpaces GmbH
- </author>
- <content src="index.html" />
- <access origin="*" />
- <allow-intent href="http://*/*" />
- <allow-intent href="https://*/*" />
- <allow-intent href="tel:*" />
- <allow-intent href="sms:*" />
- <allow-intent href="mailto:*" />
- <allow-intent href="geo:*" />
- <allow-intent href="itms:*" />
- <allow-intent href="itms-apps:*" />
- <preference name="AllowInlineMediaPlayback" value="false" />
- <preference name="DisallowOverscroll" value="false" />
- <preference name="EnableViewportScale" value="false" />
- <preference name="MediaPermissionGrantType" value="grantIfSameHostElsePrompt" />
- <preference name="MediaTypesRequiringUserActionForPlayback" value="none" />
- <preference name="SuppressesIncrementalRendering" value="false" />
- <preference name="SuppressesLongPressGesture" value="false" />
- <preference name="Suppresses3DTouchGesture" value="false" />
- <preference name="CameraUsesGeolocation" value="false" />
- <preference name="AndroidPersistentFileLocation" value="Compatibility" />
- <preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
- <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
- <preference name="UseSwiftLanguageVersion" value="5" />
-</widget>
diff --git a/cordova/platforms/ios/Podfile b/cordova/platforms/ios/Podfile
deleted file mode 100644
index aad427dc9..000000000
--- a/cordova/platforms/ios/Podfile
+++ /dev/null
@@ -1,8 +0,0 @@
-# DO NOT MODIFY -- auto-generated by Apache Cordova
-
-platform :ios, '13.0'
-
-target 'App' do
- project 'App.xcodeproj'
-
-end
diff --git a/cordova/platforms/ios/cordova/Api.js b/cordova/platforms/ios/cordova/Api.js
deleted file mode 100644
index 204138653..000000000
--- a/cordova/platforms/ios/cordova/Api.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-module.exports = require('cordova-ios');
diff --git a/cordova/platforms/ios/cordova/apple_ios_version b/cordova/platforms/ios/cordova/apple_ios_version
deleted file mode 100755
index 133a73783..000000000
--- a/cordova/platforms/ios/cordova/apple_ios_version
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const versions = require('cordova-ios/lib/versions.js');
-
-versions.printOrDie('apple_ios');
diff --git a/cordova/platforms/ios/cordova/apple_osx_version b/cordova/platforms/ios/cordova/apple_osx_version
deleted file mode 100755
index ad484e63b..000000000
--- a/cordova/platforms/ios/cordova/apple_osx_version
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const versions = require('cordova-ios/lib/versions.js');
-
-versions.printOrDie('apple_osx');
diff --git a/cordova/platforms/ios/cordova/apple_xcode_version b/cordova/platforms/ios/cordova/apple_xcode_version
deleted file mode 100755
index 68908b3c2..000000000
--- a/cordova/platforms/ios/cordova/apple_xcode_version
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const versions = require('cordova-ios/lib/versions.js');
-
-versions.printOrDie('apple_xcode');
diff --git a/cordova/platforms/ios/cordova/build-debug.xcconfig b/cordova/platforms/ios/cordova/build-debug.xcconfig
deleted file mode 100644
index d7ee4f625..000000000
--- a/cordova/platforms/ios/cordova/build-debug.xcconfig
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-
-//
-// XCode Build settings for "Debug" Build Configuration.
-//
-
-#include "build.xcconfig"
-#include "build-extras.xcconfig"
-
-// (CB-11792)
-// @COCOAPODS_SILENCE_WARNINGS@ //
-#include "../pods-debug.xcconfig"
diff --git a/cordova/platforms/ios/cordova/build-extras.xcconfig b/cordova/platforms/ios/cordova/build-extras.xcconfig
deleted file mode 100644
index e69de29bb..000000000
diff --git a/cordova/platforms/ios/cordova/build-release.xcconfig b/cordova/platforms/ios/cordova/build-release.xcconfig
deleted file mode 100644
index 886e82297..000000000
--- a/cordova/platforms/ios/cordova/build-release.xcconfig
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-
-//
-// XCode Build settings for "Release" Build Configuration.
-//
-
-#include "build.xcconfig"
-#include "build-extras.xcconfig"
-
-// (CB-11792)
-// @COCOAPODS_SILENCE_WARNINGS@ //
-#include "../pods-release.xcconfig"
diff --git a/cordova/platforms/ios/cordova/build.xcconfig b/cordova/platforms/ios/cordova/build.xcconfig
deleted file mode 100644
index c96c940a2..000000000
--- a/cordova/platforms/ios/cordova/build.xcconfig
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-
-//
-// XCode build settings shared by all Build Configurations.
-// Settings are overridden by configuration-level .xcconfig file (build-release/build-debug).
-//
diff --git a/cordova/platforms/ios/cordova/defaults.xml b/cordova/platforms/ios/cordova/defaults.xml
deleted file mode 100644
index 63db1be01..000000000
--- a/cordova/platforms/ios/cordova/defaults.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<widget xmlns = "http://www.w3.org/ns/widgets"
- id = "org.apache.cordova.hellocordova"
- version = "2.0.0">
-
- <!-- Preferences for iOS -->
- <preference name="AllowInlineMediaPlayback" value="false" />
- <preference name="DisallowOverscroll" value="false" />
- <preference name="EnableViewportScale" value="false" />
- <preference name="MediaPermissionGrantType" value="grantIfSameHostElsePrompt" />
- <preference name="MediaTypesRequiringUserActionForPlayback" value="none" />
- <preference name="SuppressesIncrementalRendering" value="false" />
- <preference name="SuppressesLongPressGesture" value="false" />
- <preference name="Suppresses3DTouchGesture" value="false" />
-
- <feature name="CDVWebViewEngine">
- <param name="ios-package" value="CDVWebViewEngine" />
- </feature>
- <feature name="LaunchScreen">
- <param name="ios-package" value="CDVLaunchScreen"/>
- </feature>
- <feature name="LocalStorage">
- <param name="ios-package" value="CDVLocalStorage"/>
- </feature>
- <feature name="Console">
- <param name="ios-package" value="CDVLogger"/>
- <param name="onload" value="true"/>
- </feature>
- <feature name="HandleOpenUrl">
- <param name="ios-package" value="CDVHandleOpenURL"/>
- <param name="onload" value="true"/>
- </feature>
- <feature name="IntentAndNavigationFilter">
- <param name="ios-package" value="CDVIntentAndNavigationFilter"/>
- <param name="onload" value="true"/>
- </feature>
- <feature name="GestureHandler">
- <param name="ios-package" value="CDVGestureHandler"/>
- <param name="onload" value="true"/>
- </feature>
- <feature name="StatusBarInternal">
- <param name="ios-package" value="CDVStatusBarInternal"/>
- <param name="onload" value="true"/>
- </feature>
-
-</widget>
diff --git a/cordova/platforms/ios/cordova/lib/list-devices b/cordova/platforms/ios/cordova/lib/list-devices
deleted file mode 100755
index 81c3e3d77..000000000
--- a/cordova/platforms/ios/cordova/lib/list-devices
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { run } = require('cordova-ios/lib/listDevices');
-
-run().then(devices => {
- devices.forEach(device => {
- console.log(device);
- });
-});
diff --git a/cordova/platforms/ios/cordova/lib/list-emulator-images b/cordova/platforms/ios/cordova/lib/list-emulator-images
deleted file mode 100755
index b422269c7..000000000
--- a/cordova/platforms/ios/cordova/lib/list-emulator-images
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { run } = require('cordova-ios/lib/listEmulatorImages');
-
-run().then(names => {
- names.forEach(name => {
- console.log(name);
- });
-});
diff --git a/cordova/platforms/ios/cordova/loggingHelper.js b/cordova/platforms/ios/cordova/loggingHelper.js
deleted file mode 100644
index 871b6cf36..000000000
--- a/cordova/platforms/ios/cordova/loggingHelper.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const CordovaLogger = require('cordova-common').CordovaLogger;
-
-module.exports = {
- adjustLoggerLevel: function (opts) {
- if (opts.verbose || (Array.isArray(opts) && opts.indexOf('--verbose') !== -1)) {
- CordovaLogger.get().setLevel('verbose');
- } else if (opts.silent || (Array.isArray(opts) && opts.indexOf('--silent') !== -1)) {
- CordovaLogger.get().setLevel('error');
- }
- }
-};
diff --git a/cordova/platforms/ios/cordova/version b/cordova/platforms/ios/cordova/version
deleted file mode 100755
index 7234670bc..000000000
--- a/cordova/platforms/ios/cordova/version
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const Api = require('./Api');
-
-console.log(Api.version());
diff --git a/cordova/platforms/ios/frameworks.json b/cordova/platforms/ios/frameworks.json
deleted file mode 100644
index 32e967fc7..000000000
--- a/cordova/platforms/ios/frameworks.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "Social.framework": 1,
- "MessageUI.framework": 1,
- "ImageIO.framework": 1,
- "CoreLocation.framework": 1,
- "AVFoundation.framework": 1
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/ios.json b/cordova/platforms/ios/ios.json
deleted file mode 100644
index 95b32160e..000000000
--- a/cordova/platforms/ios/ios.json
+++ /dev/null
@@ -1,387 +0,0 @@
-{
- "prepare_queue": {
- "installed": [],
- "uninstalled": []
- },
- "config_munge": {
- "files": {
- "config.xml": {
- "parents": {
- "/*": [
- {
- "xml": "<feature name=\"Downloader\"><param name=\"ios-package\" value=\"Downloader\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"Device\"><param name=\"ios-package\" value=\"CDVDevice\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"BackgroundMode\"><param name=\"ios-package\" onload=\"true\" value=\"APPBackgroundMode\" /><param name=\"onload\" value=\"true\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"File\"><param name=\"ios-package\" value=\"CDVFile\" /><param name=\"onload\" value=\"true\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"FileOpener2\"><param name=\"ios-package\" value=\"FileOpener2\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"SocialSharing\"><param name=\"ios-package\" value=\"SocialSharing\" /><param name=\"onload\" value=\"true\" /></feature>",
- "count": 1
- },
- {
- "xml": "<feature name=\"Camera\"><param name=\"ios-package\" value=\"CDVCamera\" /></feature>",
- "count": 1
- },
- {
- "xml": "<preference name=\"CameraUsesGeolocation\" value=\"false\" />",
- "count": 1
- }
- ]
- }
- },
- "*-Info.plist": {
- "parents": {
- "UIBackgroundModes": [
- {
- "xml": "<array><string>audio</string></array>",
- "count": 1
- }
- ],
- "NSPhotoLibraryAddUsageDescription": [
- {
- "xml": "<string>This app requires photo library access to function properly.</string>",
- "count": 1
- }
- ],
- "NSPhotoLibraryUsageDescription": [
- {
- "xml": "<string>This app requires photo library access to function properly.</string>",
- "count": 1
- }
- ]
- }
- }
- }
- },
- "installed_plugins": {
- "com.whebcraft.cordova.plugin.downloader": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "es6-promise-plugin": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-whitelist": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-device": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-background-mode": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-file": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-file-opener2": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-x-socialsharing": {
- "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
- "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-camera": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-androidx-adapter": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "com-darryncampbell-cordova-plugin-intent": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
- "cordova-plugin-androidx": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- }
- },
- "dependent_plugins": {},
- "modules": [
- {
- "id": "com.whebcraft.cordova.plugin.downloader.Downloader",
- "file": "plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js",
- "pluginId": "com.whebcraft.cordova.plugin.downloader",
- "clobbers": [
- "plugins.Downloader"
- ]
- },
- {
- "id": "es6-promise-plugin.Promise",
- "file": "plugins/es6-promise-plugin/www/promise.js",
- "pluginId": "es6-promise-plugin",
- "runs": true
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
- },
- {
- "id": "cordova-plugin-background-mode.BackgroundMode",
- "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
- "pluginId": "cordova-plugin-background-mode",
- "clobbers": [
- "cordova.plugins.backgroundMode",
- "plugin.backgroundMode"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryEntry",
- "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryReader",
- "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryReader"
- ]
- },
- {
- "id": "cordova-plugin-file.Entry",
- "file": "plugins/cordova-plugin-file/www/Entry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Entry"
- ]
- },
- {
- "id": "cordova-plugin-file.File",
- "file": "plugins/cordova-plugin-file/www/File.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.File"
- ]
- },
- {
- "id": "cordova-plugin-file.FileEntry",
- "file": "plugins/cordova-plugin-file/www/FileEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.FileError",
- "file": "plugins/cordova-plugin-file/www/FileError.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileError"
- ]
- },
- {
- "id": "cordova-plugin-file.FileReader",
- "file": "plugins/cordova-plugin-file/www/FileReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileReader"
- ]
- },
- {
- "id": "cordova-plugin-file.FileSystem",
- "file": "plugins/cordova-plugin-file/www/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadOptions",
- "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadOptions"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadResult",
- "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadResult"
- ]
- },
- {
- "id": "cordova-plugin-file.FileWriter",
- "file": "plugins/cordova-plugin-file/www/FileWriter.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileWriter"
- ]
- },
- {
- "id": "cordova-plugin-file.Flags",
- "file": "plugins/cordova-plugin-file/www/Flags.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Flags"
- ]
- },
- {
- "id": "cordova-plugin-file.LocalFileSystem",
- "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.LocalFileSystem"
- ],
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.Metadata",
- "file": "plugins/cordova-plugin-file/www/Metadata.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Metadata"
- ]
- },
- {
- "id": "cordova-plugin-file.ProgressEvent",
- "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.ProgressEvent"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems",
- "file": "plugins/cordova-plugin-file/www/fileSystems.js",
- "pluginId": "cordova-plugin-file"
- },
- {
- "id": "cordova-plugin-file.requestFileSystem",
- "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.requestFileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.resolveLocalFileSystemURI",
- "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.isChrome",
- "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.iosFileSystem",
- "file": "plugins/cordova-plugin-file/www/ios/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems-roots",
- "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.fileSystemPaths",
- "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "cordova"
- ],
- "runs": true
- },
- {
- "id": "cordova-plugin-file-opener2.FileOpener2",
- "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
- "pluginId": "cordova-plugin-file-opener2",
- "clobbers": [
- "cordova.plugins.fileOpener2"
- ]
- },
- {
- "id": "cordova-plugin-x-socialsharing.SocialSharing",
- "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
- "pluginId": "cordova-plugin-x-socialsharing",
- "clobbers": [
- "window.plugins.socialsharing"
- ]
- },
- {
- "id": "cordova-plugin-camera.Camera",
- "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "Camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverOptions",
- "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverOptions"
- ]
- },
- {
- "id": "cordova-plugin-camera.camera",
- "file": "plugins/cordova-plugin-camera/www/Camera.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "navigator.camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverHandle",
- "file": "plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverHandle"
- ]
- },
- {
- "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
- "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
- "pluginId": "com-darryncampbell-cordova-plugin-intent",
- "clobbers": [
- "intentShim"
- ]
- }
- ],
- "plugin_metadata": {
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-whitelist": "1.3.3",
- "cordova-plugin-device": "2.0.2",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.3",
- "cordova-plugin-x-socialsharing": "5.6.8",
- "cordova-plugin-camera": "4.1.0",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "com-darryncampbell-cordova-plugin-intent": "2.0.0",
- "cordova-plugin-androidx": "3.0.0"
- }
-}
diff --git a/cordova/platforms/ios/packages/cordova-ios-plugins/Package.swift b/cordova/platforms/ios/packages/cordova-ios-plugins/Package.swift
deleted file mode 100644
index 705e2778e..000000000
--- a/cordova/platforms/ios/packages/cordova-ios-plugins/Package.swift
+++ /dev/null
@@ -1,37 +0,0 @@
-// swift-tools-version:5.5
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-import PackageDescription
-
-let package = Package(
- name: "CordovaPlugins",
- platforms: [
- .iOS(.v13),
- .macCatalyst(.v13)
- ],
- products: [
- .library(name: "CordovaPlugins", targets: ["CordovaPlugins"])
- ],
- targets: [
- .target(name: "CordovaPlugins")
- ]
-)
-
diff --git a/cordova/platforms/ios/packages/cordova-ios-plugins/Sources/CordovaPlugins/CordovaPlugins.swift b/cordova/platforms/ios/packages/cordova-ios-plugins/Sources/CordovaPlugins/CordovaPlugins.swift
deleted file mode 100644
index 92baa9178..000000000
--- a/cordova/platforms/ios/packages/cordova-ios-plugins/Sources/CordovaPlugins/CordovaPlugins.swift
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-// We need something here so that the empty package will compile successfully
-public let isCordovaApp = true
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.h
deleted file mode 100644
index 00d39c486..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import <Cordova/CDVCommandDelegate.h>
-
-@class CDVViewController;
-@class CDVCommandQueue;
-
-@interface CDVCommandDelegateImpl : NSObject <CDVCommandDelegate>{
- @private
- __weak CDVViewController* _viewController;
- NSRegularExpression* _callbackIdPattern;
- @protected
- __weak CDVCommandQueue* _commandQueue;
- BOOL _delayResponses;
-}
-- (instancetype)initWithViewController:(CDVViewController *)viewController;
-- (void)flushCommandQueueWithDelayedJs;
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.m
deleted file mode 100644
index 70c0c134a..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.m
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVCommandDelegateImpl.h"
-#import "CDVJSON_private.h"
-#import <Cordova/CDVCommandQueue.h>
-#import <Cordova/CDVPluginResult.h>
-#import <Cordova/CDVViewController.h>
-
-@implementation CDVCommandDelegateImpl
-
-- (instancetype)initWithViewController:(CDVViewController *)viewController
-{
- self = [super init];
- if (self != nil) {
- _viewController = viewController;
- _commandQueue = _viewController.commandQueue;
-
- NSError* err = nil;
- _callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err];
- if (err != nil) {
- // Couldn't initialize Regex
- NSLog(@"Error: Couldn't initialize regex");
- _callbackIdPattern = nil;
- }
- }
- return self;
-}
-
-- (NSString*)pathForResource:(NSString*)resourcepath
-{
- NSBundle* mainBundle = [NSBundle mainBundle];
- NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
- NSString* filename = [directoryParts lastObject];
-
- [directoryParts removeLastObject];
-
- NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
- NSString* directoryStr = _viewController.webContentFolderName;
-
- if ([directoryPartsJoined length] > 0) {
- directoryStr = [NSString stringWithFormat:@"%@/%@", _viewController.webContentFolderName, [directoryParts componentsJoinedByString:@"/"]];
- }
-
- return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
-}
-
-- (void)flushCommandQueueWithDelayedJs
-{
- _delayResponses = YES;
- [_commandQueue executePending];
- _delayResponses = NO;
-}
-
-- (void)evalJsHelper2:(NSString*)js
-{
- CDV_EXEC_LOG(@"Exec: evalling: %@", [js substringToIndex:MIN([js length], 160)]);
- [_viewController.webViewEngine evaluateJavaScript:js completionHandler:^(id obj, NSError* error) {
- // TODO: obj can be something other than string
- if ([obj isKindOfClass:[NSString class]]) {
- NSString* commandsJSON = (NSString*)obj;
- if ([commandsJSON length] > 0) {
- CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining.");
- }
-
- [self->_commandQueue enqueueCommandBatch:commandsJSON];
- [self->_commandQueue executePending];
- }
- }];
-}
-
-- (void)evalJsHelper:(NSString*)js
-{
- // Cycle the run-loop before executing the JS.
- // For _delayResponses -
- // This ensures that we don't eval JS during the middle of an existing JS
- // function (possible since WKWebViewDelegate callbacks can be synchronous).
- // For !isMainThread -
- // It's a hard error to eval on the non-UI thread.
- // For !_commandQueue.currentlyExecuting -
- // This works around a bug where sometimes alerts() within callbacks can cause
- // dead-lock.
- // If the commandQueue is currently executing, then we know that it is safe to
- // execute the callback immediately.
- // Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reason,
- // but performSelectorOnMainThread: does.
- if (_delayResponses || ![NSThread isMainThread] || !_commandQueue.currentlyExecuting) {
- [self performSelectorOnMainThread:@selector(evalJsHelper2:) withObject:js waitUntilDone:NO];
- } else {
- [self evalJsHelper2:js];
- }
-}
-
-- (BOOL)isValidCallbackId:(NSString*)callbackId
-{
- if ((callbackId == nil) || (_callbackIdPattern == nil)) {
- return NO;
- }
-
- // Disallow if too long or if any invalid characters were found.
- if (([callbackId length] > 100) || [_callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) {
- return NO;
- }
- return YES;
-}
-
-- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId
-{
- CDV_EXEC_LOG(@"Exec(%@): Sending result. Status=%@", callbackId, result.status);
- // This occurs when there is are no win/fail callbacks for the call.
- if ([@"INVALID" isEqualToString:callbackId]) {
- return;
- }
- // This occurs when the callback id is malformed.
- if (![self isValidCallbackId:callbackId]) {
- NSLog(@"Invalid callback id received by sendPluginResult");
- return;
- }
- int status = [result.status intValue];
- BOOL keepCallback = [result.keepCallback boolValue];
- NSString* argumentsAsJSON = [result argumentsAsJSON];
- BOOL debug = NO;
-
-#ifdef DEBUG
- debug = YES;
-#endif
-
- NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d, %d)", callbackId, status, argumentsAsJSON, keepCallback, debug];
-
- [self evalJsHelper:js];
-}
-
-- (void)evalJs:(NSString*)js
-{
- [self evalJs:js scheduledOnRunLoop:YES];
-}
-
-- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop
-{
- js = [NSString stringWithFormat:@"try{cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})}catch(e){console.log('exception nativeEvalAndFetch : '+e);};", js];
- if (scheduledOnRunLoop) {
- [self evalJsHelper:js];
- } else {
- [self evalJsHelper2:js];
- }
-}
-
-- (id)getCommandInstance:(NSString*)pluginName
-{
- return [_viewController getCommandInstance:pluginName];
-}
-
-- (void)runInBackground:(void (^)(void))block
-{
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
-}
-
-- (CDVSettingsDictionary*)settings
-{
- return _viewController.settings;
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h
deleted file mode 100644
index 4a0d9f929..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#ifdef DEBUG
- #define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
-#else
- #define DLog(...)
-#endif
-#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h
deleted file mode 100644
index aaee42ca7..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface NSArray (CDVJSONSerializingPrivate)
-- (NSString*)cdv_JSONString;
-@end
-
-@interface NSDictionary (CDVJSONSerializingPrivate)
-- (NSString*)cdv_JSONString;
-@end
-
-@interface NSString (CDVJSONSerializingPrivate)
-- (id)cdv_JSONObject;
-- (id)cdv_JSONFragment;
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m
deleted file mode 100644
index 6815e3eab..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVJSON_private.h"
-
-@implementation NSArray (CDVJSONSerializingPrivate)
-
-- (NSString*)cdv_JSONString
-{
- @autoreleasepool {
- NSError* error = nil;
- NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
- options:0
- error:&error];
-
- if (error != nil) {
- NSLog(@"NSArray JSONString error: %@", [error localizedDescription]);
- return nil;
- } else {
- return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
- }
- }
-}
-
-@end
-
-@implementation NSDictionary (CDVJSONSerializingPrivate)
-
-- (NSString*)cdv_JSONString
-{
- @autoreleasepool {
- NSError* error = nil;
- NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
- options:NSJSONWritingPrettyPrinted
- error:&error];
-
- if (error != nil) {
- NSLog(@"NSDictionary JSONString error: %@", [error localizedDescription]);
- return nil;
- } else {
- return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
- }
- }
-}
-
-@end
-
-@implementation NSString (CDVJSONSerializingPrivate)
-
-- (id)cdv_JSONObject
-{
- @autoreleasepool {
- NSError* error = nil;
- id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
- options:NSJSONReadingMutableContainers
- error:&error];
-
- if (error != nil) {
- NSLog(@"NSString JSONObject error: %@, Malformed Data: %@", [error localizedDescription], self);
- }
-
- return object;
- }
-}
-
-- (id)cdv_JSONFragment
-{
- @autoreleasepool {
- NSError* error = nil;
- id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
- options:NSJSONReadingAllowFragments
- error:&error];
-
- if (error != nil) {
- NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
- }
-
- return object;
- }
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
deleted file mode 100644
index a06055ccc..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVPlugin (Private)
-
-- (instancetype)initWithWebViewEngine:(id <CDVWebViewEngineProtocol>)theWebViewEngine;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVViewController+Private.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVViewController+Private.h
deleted file mode 100644
index 27a907f96..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVViewController+Private.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVViewController.h>
-
-@interface CDVViewController (Private)
-
-- (void)setStatusBarWebViewColor:(UIColor *)color;
-
-- (void)showStatusBar:(BOOL)visible;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
deleted file mode 100644
index f39e066a2..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVGestureHandler : CDVPlugin
-
-@property (nonatomic, strong) UILongPressGestureRecognizer* lpgr;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
deleted file mode 100644
index 839afc693..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVGestureHandler.h"
-
-@implementation CDVGestureHandler
-
-- (void)pluginInitialize
-{
- [self applyLongPressFix];
-}
-
-- (void)applyLongPressFix
-{
- // You can't suppress 3D Touch and still have regular longpress,
- // so if this is false, let's not consider the 3D Touch setting at all.
- if (![self.commandDelegate.settings cordovaBoolSettingForKey:@"SuppressesLongPressGesture" defaultValue:NO]) {
- return;
- }
-
- self.lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressGestures:)];
- self.lpgr.minimumPressDuration = 0.45f;
- self.lpgr.allowableMovement = 200.0f;
-
- // 0.45 is ok for 'regular longpress', 0.05-0.08 is required for '3D Touch longpress',
- // but since this will also kill onclick handlers (not ontouchend) it's optional.
- if ([self.commandDelegate.settings cordovaBoolSettingForKey:@"Suppresses3DTouchGesture" defaultValue:NO]) {
- self.lpgr.minimumPressDuration = 0.15f;
- }
-
- NSArray *views = self.webView.subviews;
- if (views.count == 0) {
- NSLog(@"No webview subviews found, not applying the longpress fix.");
- return;
- }
- for (int i=0; i<views.count; i++) {
- UIView *webViewScrollView = views[i];
- if ([webViewScrollView isKindOfClass:[UIScrollView class]]) {
- NSArray *webViewScrollViewSubViews = webViewScrollView.subviews;
- UIView *browser = webViewScrollViewSubViews[0];
- [browser addGestureRecognizer:self.lpgr];
- break;
- }
- }
-}
-
-- (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender
-{
-
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
deleted file mode 100644
index 37dab40b2..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVHandleOpenURL : CDVPlugin
-
-@property (nonatomic, strong) NSURL* url;
-@property (nonatomic, assign) BOOL pageLoaded;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
deleted file mode 100644
index d68e00be2..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVHandleOpenURL.h"
-
-@implementation CDVHandleOpenURL
-
-- (void)pluginInitialize
-{
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationLaunchedWithUrl:) name:CDVPluginHandleOpenURLNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil];
-}
-
-- (void)applicationLaunchedWithUrl:(NSNotification*)notification
-{
- NSURL* url = [notification object];
-
- self.url = url;
-
- // warm-start handler
- if (self.pageLoaded) {
- [self processOpenUrl:self.url pageLoaded:YES];
- self.url = nil;
- }
-}
-
-- (void)applicationPageDidLoad:(NSNotification*)notification
-{
- // cold-start handler
-
- self.pageLoaded = YES;
-
- if (self.url) {
- [self processOpenUrl:self.url pageLoaded:YES];
- self.url = nil;
- }
-}
-
-- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
-{
- __weak __typeof(self) weakSelf = self;
-
- dispatch_block_t handleOpenUrl = ^(void) {
- // calls into javascript global function 'handleOpenURL'
- NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url.absoluteString];
-
- [weakSelf.webViewEngine evaluateJavaScript:jsString completionHandler:nil];
- };
-
- if (!pageLoaded) {
- NSString* jsString = @"document.readyState";
- [self.webViewEngine evaluateJavaScript:jsString
- completionHandler:^(id object, NSError* error) {
- if ((error == nil) && [object isKindOfClass:[NSString class]]) {
- NSString* readyState = (NSString*)object;
- BOOL ready = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
- if (ready) {
- handleOpenUrl();
- } else {
- self.url = url;
- }
- }
- }];
- } else {
- handleOpenUrl();
- }
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.h
deleted file mode 100644
index 57814b1ed..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-extern NSString* const kCDVDefaultAllowListRejectionString;
-
-@interface CDVAllowList : NSObject
-
-@property (nonatomic, copy) NSString* allowListRejectionFormatString;
-
-- (id)initWithArray:(NSArray*)array;
-- (BOOL)schemeIsAllowed:(NSString*)scheme;
-- (BOOL)URLIsAllowed:(NSURL*)url;
-- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure;
-- (NSString*)errorStringForURL:(NSURL*)url;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.m
deleted file mode 100644
index 11567d263..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.m
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVAllowList.h"
-
-NSString* const kCDVDefaultAllowListRejectionString = @"ERROR allowList rejection: url='%@'";
-NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
-
-@interface CDVAllowListPattern : NSObject {
- @private
- NSRegularExpression* _scheme;
- NSRegularExpression* _host;
- NSNumber* _port;
- NSRegularExpression* _path;
-}
-
-+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards;
-- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path;
-- (bool)matches:(NSURL*)url;
-
-@end
-
-@implementation CDVAllowListPattern
-
-+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards
-{
- NSString* regex = [NSRegularExpression escapedPatternForString:pattern];
-
- if (allowWildcards) {
- regex = [regex stringByReplacingOccurrencesOfString:@"\\*" withString:@".*"];
-
- /* [NSURL path] has the peculiarity that a trailing slash at the end of a path
- * will be omitted. This regex tweak compensates for that.
- */
- if ([regex hasSuffix:@"\\/.*"]) {
- regex = [NSString stringWithFormat:@"%@(\\/.*)?", [regex substringToIndex:([regex length] - 4)]];
- }
- }
- return [NSString stringWithFormat:@"%@$", regex];
-}
-
-- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path
-{
- self = [super init]; // Potentially change "self"
- if (self) {
- if ((scheme == nil) || [scheme isEqualToString:@"*"]) {
- _scheme = nil;
- } else {
- _scheme = [NSRegularExpression regularExpressionWithPattern:[CDVAllowListPattern regexFromPattern:scheme allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
- }
- if ([host isEqualToString:@"*"] || host == nil) {
- _host = nil;
- } else if ([host hasPrefix:@"*."]) {
- _host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVAllowListPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:NSRegularExpressionCaseInsensitive error:nil];
- } else {
- _host = [NSRegularExpression regularExpressionWithPattern:[CDVAllowListPattern regexFromPattern:host allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
- }
- if ((port == nil) || [port isEqualToString:@"*"]) {
- _port = nil;
- } else {
- _port = [[NSNumber alloc] initWithInteger:[port integerValue]];
- }
- if ((path == nil) || [path isEqualToString:@"/*"]) {
- _path = nil;
- } else {
- _path = [NSRegularExpression regularExpressionWithPattern:[CDVAllowListPattern regexFromPattern:path allowWildcards:YES] options:0 error:nil];
- }
- }
- return self;
-}
-
-- (bool)matches:(NSURL*)url
-{
- return (_scheme == nil || [_scheme numberOfMatchesInString:[url scheme] options:NSMatchingAnchored range:NSMakeRange(0, [[url scheme] length])]) &&
- (_host == nil || ([url host] != nil && [_host numberOfMatchesInString:[url host] options:NSMatchingAnchored range:NSMakeRange(0, [[url host] length])])) &&
- (_port == nil || [[url port] isEqualToNumber:_port]) &&
- (_path == nil || [_path numberOfMatchesInString:[url path] options:NSMatchingAnchored range:NSMakeRange(0, [[url path] length])])
- ;
-}
-
-@end
-
-@interface CDVAllowList ()
-
-@property (nonatomic, readwrite, strong) NSMutableArray* allowList;
-@property (nonatomic, readwrite, strong) NSMutableSet* permittedSchemes;
-
-- (void)addAllowListEntry:(NSString*)pattern;
-
-@end
-
-@implementation CDVAllowList
-
-@synthesize allowList, permittedSchemes, allowListRejectionFormatString;
-
-- (id)initWithArray:(NSArray*)array
-{
- self = [super init];
- if (self) {
- self.allowList = [[NSMutableArray alloc] init];
- self.permittedSchemes = [[NSMutableSet alloc] init];
- self.allowListRejectionFormatString = kCDVDefaultAllowListRejectionString;
-
- for (NSString* pattern in array) {
- [self addAllowListEntry:pattern];
- }
- }
- return self;
-}
-
-- (BOOL)isIPv4Address:(NSString*)externalHost
-{
- // an IPv4 address has 4 octets b.b.b.b where b is a number between 0 and 255.
- // for our purposes, b can also be the wildcard character '*'
-
- // we could use a regex to solve this problem but then I would have two problems
- // anyways, this is much clearer and maintainable
- NSArray* octets = [externalHost componentsSeparatedByString:@"."];
- NSUInteger num_octets = [octets count];
-
- // quick check
- if (num_octets != 4) {
- return NO;
- }
-
- // restrict number parsing to 0-255
- NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
- [numberFormatter setMinimum:[NSNumber numberWithUnsignedInteger:0]];
- [numberFormatter setMaximum:[NSNumber numberWithUnsignedInteger:255]];
-
- // iterate through each octet, and test for a number between 0-255 or if it equals '*'
- for (NSUInteger i = 0; i < num_octets; ++i) {
- NSString* octet = [octets objectAtIndex:i];
-
- if ([octet isEqualToString:@"*"]) { // passes - check next octet
- continue;
- } else if ([numberFormatter numberFromString:octet] == nil) { // fails - not a number and not within our range, return
- return NO;
- }
- }
-
- return YES;
-}
-
-- (void)addAllowListEntry:(NSString*)origin
-{
- if (self.allowList == nil) {
- return;
- }
-
- if ([origin isEqualToString:@"*"]) {
- NSLog(@"Unlimited access to network resources");
- self.allowList = nil;
- self.permittedSchemes = nil;
- } else { // specific access
- NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|([a-z][a-z0-9+\\-.]*)):/?/?)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil];
- NSTextCheckingResult* m = [parts firstMatchInString:origin options:NSMatchingAnchored range:NSMakeRange(0, [origin length])];
- if (m != nil) {
- NSRange r;
- NSString* scheme = nil;
- r = [m rangeAtIndex:2];
- if (r.location != NSNotFound) {
- scheme = [origin substringWithRange:r];
- }
-
- NSString* host = nil;
- r = [m rangeAtIndex:4];
- if (r.location != NSNotFound) {
- host = [origin substringWithRange:r];
- }
-
- // Special case for two urls which are allowed to have empty hosts
- if (([scheme isEqualToString:@"file"] || [scheme isEqualToString:@"content"]) && (host == nil)) {
- host = @"*";
- }
-
- NSString* port = nil;
- r = [m rangeAtIndex:8];
- if (r.location != NSNotFound) {
- port = [origin substringWithRange:r];
- }
-
- NSString* path = nil;
- r = [m rangeAtIndex:9];
- if (r.location != NSNotFound) {
- path = [origin substringWithRange:r];
- }
-
- if (scheme == nil) {
- // XXX making it stupid friendly for people who forget to include protocol/SSL
- [self.allowList addObject:[[CDVAllowListPattern alloc] initWithScheme:@"http" host:host port:port path:path]];
- [self.allowList addObject:[[CDVAllowListPattern alloc] initWithScheme:@"https" host:host port:port path:path]];
- } else {
- [self.allowList addObject:[[CDVAllowListPattern alloc] initWithScheme:scheme host:host port:port path:path]];
- }
-
- if (self.permittedSchemes != nil) {
- if ([scheme isEqualToString:@"*"]) {
- self.permittedSchemes = nil;
- } else if (scheme != nil) {
- [self.permittedSchemes addObject:scheme];
- }
- }
- }
- }
-}
-
-- (BOOL)schemeIsAllowed:(NSString*)scheme
-{
- if ([scheme isEqualToString:@"http"] ||
- [scheme isEqualToString:@"https"] ||
- [scheme isEqualToString:@"ftp"] ||
- [scheme isEqualToString:@"ftps"]) {
- return YES;
- }
-
- return (self.permittedSchemes == nil) || [self.permittedSchemes containsObject:scheme];
-}
-
-- (BOOL)URLIsAllowed:(NSURL*)url
-{
- return [self URLIsAllowed:url logFailure:YES];
-}
-
-- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure
-{
- // Shortcut acceptance: Are all urls allowListed ("*" in allowList)?
- if (allowList == nil) {
- return YES;
- }
-
- // Shortcut rejection: Check that the scheme is supported
- NSString* scheme = [[url scheme] lowercaseString];
- if (![self schemeIsAllowed:scheme]) {
- if (logFailure) {
- NSLog(@"%@", [self errorStringForURL:url]);
- }
- return NO;
- }
-
- // http[s] and ftp[s] should also validate against the common set in the kCDVDefaultSchemeName list
- if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"] || [scheme isEqualToString:@"ftps"]) {
- NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]]];
- // If it is allowed, we are done. If not, continue to check for the actual scheme-specific list
- if ([self URLIsAllowed:newUrl logFailure:NO]) {
- return YES;
- }
- }
-
- // Check the url against patterns in the allowList
- for (CDVAllowListPattern* p in self.allowList) {
- if ([p matches:url]) {
- return YES;
- }
- }
-
- if (logFailure) {
- NSLog(@"%@", [self errorStringForURL:url]);
- }
- // if we got here, the url host is not in the white-list, do nothing
- return NO;
-}
-
-- (NSString*)errorStringForURL:(NSURL*)url
-{
- return [NSString stringWithFormat:self.allowListRejectionFormatString, [url absoluteString]];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
deleted file mode 100644
index 3f6a1262b..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-#import "CDVAllowList.h"
-
-typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
- CDVIntentAndNavigationFilterValueIntentAllowed,
- CDVIntentAndNavigationFilterValueNavigationAllowed,
- CDVIntentAndNavigationFilterValueNoneAllowed
-};
-
-@interface CDVIntentAndNavigationFilter : CDVPlugin <CDVPluginNavigationHandler, NSXMLParserDelegate>
-
-+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url allowIntentsList:(CDVAllowList*)allowIntentsList navigationsAllowList:(CDVAllowList*)navigationsAllowList;
-+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue;
-+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType;
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
deleted file mode 100644
index 511d618dd..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVIntentAndNavigationFilter.h"
-#import <Cordova/CDVConfigParser.h>
-
-@interface CDVIntentAndNavigationFilter ()
-
-@property (nonatomic, readwrite) NSMutableArray* allowIntents;
-@property (nonatomic, readwrite) NSMutableArray* allowNavigations;
-@property (nonatomic, readwrite) CDVAllowList* allowIntentsList;
-@property (nonatomic, readwrite) CDVAllowList* allowNavigationsList;
-
-@end
-
-@implementation CDVIntentAndNavigationFilter
-
-#pragma mark NSXMLParserDelegate
-
-- (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict
-{
- if ([elementName isEqualToString:@"allow-navigation"]) {
- [self.allowNavigations addObject:attributeDict[@"href"]];
- }
- if ([elementName isEqualToString:@"allow-intent"]) {
- [self.allowIntents addObject:attributeDict[@"href"]];
- }
-}
-
-- (void)parserDidStartDocument:(NSXMLParser*)parser
-{
- // file: url <allow-navigations> are added by default
- // navigation to the scheme used by the app is also allowed
- self.allowNavigations = [[NSMutableArray alloc] initWithArray:@[ @"file://"]];
-
- // If the custom app scheme is defined, append it to the allow navigation as default
- NSString* scheme = ((CDVViewController*)self.viewController).appScheme;
- if (scheme) {
- [self.allowNavigations addObject: [NSString stringWithFormat:@"%@://", scheme]];
- }
-
- // no intents are added by default
- self.allowIntents = [[NSMutableArray alloc] init];
-}
-
-- (void)parserDidEndDocument:(NSXMLParser*)parser
-{
- self.allowIntentsList = [[CDVAllowList alloc] initWithArray:self.allowIntents];
- self.allowNavigationsList = [[CDVAllowList alloc] initWithArray:self.allowNavigations];
-}
-
-- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError
-{
- NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]);
-}
-
-#pragma mark CDVPlugin
-
-- (void)pluginInitialize
-{
- [CDVConfigParser parseConfigFile:self.viewController.configFilePath withDelegate:self];
-}
-
-+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url allowIntentsList:(CDVAllowList*)allowIntentsList navigationsAllowList:(CDVAllowList*)navigationsAllowList
-{
- // a URL can only allow-intent OR allow-navigation, if both are specified,
- // only allow-navigation is allowed
-
- BOOL allowNavigationsPass = [navigationsAllowList URLIsAllowed:url logFailure:NO];
- BOOL allowIntentPass = [allowIntentsList URLIsAllowed:url logFailure:NO];
-
- if (allowNavigationsPass && allowIntentPass) {
- return CDVIntentAndNavigationFilterValueNavigationAllowed;
- } else if (allowNavigationsPass) {
- return CDVIntentAndNavigationFilterValueNavigationAllowed;
- } else if (allowIntentPass) {
- return CDVIntentAndNavigationFilterValueIntentAllowed;
- }
-
- return CDVIntentAndNavigationFilterValueNoneAllowed;
-}
-
-- (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url
-{
- return [[self class] filterUrl:url allowIntentsList:self.allowIntentsList navigationsAllowList:self.allowNavigationsList];
-}
-
-#define CDVWebViewNavigationTypeLinkClicked 0
-#define CDVWebViewNavigationTypeLinkOther -1
-
-+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
-{
- BOOL isMainNavigation = [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]];
-
- return (
- navigationType == CDVWebViewNavigationTypeLinkClicked ||
- (navigationType == CDVWebViewNavigationTypeLinkOther && isMainNavigation)
- );
-}
-
-+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
-{
- NSString* allowIntents_allowListRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
- NSString* allowNavigations_allowListRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
-
- NSURL* url = [request URL];
-
- switch (filterValue) {
- case CDVIntentAndNavigationFilterValueNavigationAllowed:
- return YES;
- case CDVIntentAndNavigationFilterValueIntentAllowed:
- // only allow-intent if it's a CDVWebViewNavigationTypeLinkClicked (anchor tag) or CDVWebViewNavigationTypeOther and it's an internal link
- if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
- }
-
- // consume the request (i.e. no error) if it wasn't handled above
- return NO;
- case CDVIntentAndNavigationFilterValueNoneAllowed:
- // allow-navigation attempt failed for sure
- NSLog(@"%@", [NSString stringWithFormat:allowNavigations_allowListRejectionFormatString, [url absoluteString]]);
- // anchor tag link means it was an allow-intent attempt that failed as well
- if (CDVWebViewNavigationTypeLinkClicked == navigationType) {
- NSLog(@"%@", [NSString stringWithFormat:allowIntents_allowListRejectionFormatString, [url absoluteString]]);
- }
- return NO;
- }
-}
-
-- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType info:(NSDictionary *)navInfo
-{
- return [[self class] shouldOverrideLoadWithRequest:request navigationType:navigationType filterValue:[self filterUrl:request.URL]];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
deleted file mode 100644
index e973e373e..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVLaunchScreen : CDVPlugin
-
-- (void)show:(CDVInvokedUrlCommand*)command;
-- (void)hide:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
deleted file mode 100644
index 0609d6f4b..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVLaunchScreen.h"
-#import "CDVViewController+Private.h"
-
-@implementation CDVLaunchScreen
-
-- (void)show:(CDVInvokedUrlCommand *)command
-{
- [self.viewController showSplashScreen:YES];
-}
-
-- (void)hide:(CDVInvokedUrlCommand *)command
-{
- [self.viewController showSplashScreen:NO];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
deleted file mode 100644
index 7cfb3063e..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVLogger : CDVPlugin
-
-- (void)logLevel:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m
deleted file mode 100644
index 810caa560..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVLogger.h"
-
-@implementation CDVLogger
-
-/* log a message */
-- (void)logLevel:(CDVInvokedUrlCommand*)command
-{
- id level = [command argumentAtIndex:0];
- id message = [command argumentAtIndex:1];
-
- if ([level isEqualToString:@"LOG"]) {
- NSLog(@"%@", message);
- } else {
- NSLog(@"%@: %@", level, message);
- }
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.h
deleted file mode 100644
index 9a83983be..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVStatusBarInternal : CDVPlugin
-
-- (void)setVisible:(CDVInvokedUrlCommand*)command;
-- (void)setBackgroundColor:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.m
deleted file mode 100644
index fc6412bda..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.m
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVStatusBarInternal.h"
-#import "CDVViewController+Private.h"
-
-@implementation CDVStatusBarInternal
-
-- (void)setVisible:(CDVInvokedUrlCommand *)command
-{
- id value = [command argumentAtIndex:0];
- if (!([value isKindOfClass:[NSNumber class]])) {
- value = [NSNumber numberWithBool:YES];
- }
-
- [self.viewController showStatusBar:[value boolValue]];
-}
-
-- (void)setBackgroundColor:(CDVInvokedUrlCommand *)command
-{
- NSInteger valueR = [[command argumentAtIndex:0 withDefault:@0] integerValue];
- NSInteger valueG = [[command argumentAtIndex:1 withDefault:@0] integerValue];
- NSInteger valueB = [[command argumentAtIndex:2 withDefault:@0] integerValue];
-
- UIColor *bgColor = [UIColor colorWithRed:valueR/255.f green:valueG/255.f blue:valueB/255.f alpha:1.f];
- [self.viewController setStatusBarBackgroundColor:bgColor];
-}
-
-@end
-
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.h
deleted file mode 100644
index bb2f998af..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <WebKit/WebKit.h>
-
-@class CDVViewController;
-
-@interface CDVURLSchemeHandler : NSObject <WKURLSchemeHandler>
-NS_ASSUME_NONNULL_BEGIN
-
-- (instancetype)initWithViewController:(CDVViewController *)controller;
-
-NS_ASSUME_NONNULL_END
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.m
deleted file mode 100644
index 19aec026c..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.m
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-
-#import "CDVURLSchemeHandler.h"
-#import <Cordova/CDVViewController.h>
-#import <Cordova/CDVPlugin.h>
-#import <Foundation/Foundation.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
-#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
-#endif
-
-static const NSUInteger FILE_BUFFER_SIZE = 1024 * 1024 * 4; // 4 MiB
-
-@interface CDVURLSchemeHandler ()
-
-@property (nonatomic, weak) CDVViewController *viewController;
-@property (nonatomic) NSMapTable <id <WKURLSchemeTask>, CDVPlugin <CDVPluginSchemeHandler> *> *handlerMap;
-
-@end
-
-@implementation CDVURLSchemeHandler
-
-- (instancetype)initWithViewController:(CDVViewController *)controller
-{
- self = [super init];
- if (self) {
- _viewController = controller;
- _handlerMap = [NSMapTable weakToWeakObjectsMapTable];
- }
- return self;
-}
-
-- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
-{
- // Give plugins the chance to handle the url
- for (CDVPlugin *plugin in self.viewController.enumerablePlugins) {
- if ([plugin respondsToSelector:@selector(overrideSchemeTask:)]) {
- CDVPlugin <CDVPluginSchemeHandler> *schemePlugin = (CDVPlugin<CDVPluginSchemeHandler> *)plugin;
- if ([schemePlugin overrideSchemeTask:urlSchemeTask]) {
- // Store the plugin that is handling this particular request
- [self.handlerMap setObject:schemePlugin forKey:urlSchemeTask];
- return;
- }
- }
- }
-
-
- NSURLRequest *req = urlSchemeTask.request;
- if (![req.URL.scheme isEqualToString:self.viewController.appScheme]) {
- return;
- }
-
- // Indicate that we are handling this task, by adding an entry with a null plugin
- // We do this so that we can (in future) detect if the task is cancelled before we finished feeding it response data
- [self.handlerMap setObject:(id)[NSNull null] forKey:urlSchemeTask];
-
- [self.viewController.commandDelegate runInBackground:^{
- NSURL *fileURL = [self fileURLForRequestURL:req.URL];
- NSError *error;
-
- NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingFromURL:fileURL error:&error];
- if (!fileHandle || error) {
- if ([self taskActive:urlSchemeTask]) {
- [urlSchemeTask didFailWithError:error];
- }
-
- @synchronized(self.handlerMap) {
- [self.handlerMap removeObjectForKey:urlSchemeTask];
- }
- return;
- }
-
- NSInteger statusCode = 200; // Default to 200 OK status
- NSString *mimeType = [self getMimeType:fileURL] ?: @"application/octet-stream";
- NSNumber *fileLength;
- [fileURL getResourceValue:&fileLength forKey:NSURLFileSizeKey error:nil];
-
- NSNumber *responseSize = fileLength;
- NSUInteger responseSent = 0;
-
- NSMutableDictionary *headers = [NSMutableDictionary dictionaryWithCapacity:5];
- headers[@"Content-Type"] = mimeType;
- headers[@"Cache-Control"] = @"no-cache";
- headers[@"Content-Length"] = [responseSize stringValue];
-
- // Check for Range header
- NSString *rangeHeader = [urlSchemeTask.request valueForHTTPHeaderField:@"Range"];
- if (rangeHeader) {
- NSRange range = NSMakeRange(NSNotFound, 0);
-
- if ([rangeHeader hasPrefix:@"bytes="]) {
- NSString *byteRange = [rangeHeader substringFromIndex:6];
- NSArray<NSString *> *rangeParts = [byteRange componentsSeparatedByString:@"-"];
- NSUInteger start = (NSUInteger)[rangeParts[0] integerValue];
- NSUInteger end = rangeParts.count > 1 && ![rangeParts[1] isEqualToString:@""] ? (NSUInteger)[rangeParts[1] integerValue] : [fileLength unsignedIntegerValue] - 1;
- range = NSMakeRange(start, end - start + 1);
- }
-
- if (range.location != NSNotFound) {
- // Ensure range is valid
- if (range.location >= [fileLength unsignedIntegerValue] && [self taskActive:urlSchemeTask]) {
- headers[@"Content-Range"] = [NSString stringWithFormat:@"bytes */%@", fileLength];
- NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:req.URL statusCode:416 HTTPVersion:@"HTTP/1.1" headerFields:headers];
- [urlSchemeTask didReceiveResponse:response];
- [urlSchemeTask didFinish];
-
- @synchronized(self.handlerMap) {
- [self.handlerMap removeObjectForKey:urlSchemeTask];
- }
- return;
- }
-
- [fileHandle seekToFileOffset:range.location];
- responseSize = [NSNumber numberWithUnsignedInteger:range.length];
- statusCode = 206; // Partial Content
- headers[@"Content-Range"] = [NSString stringWithFormat:@"bytes %lu-%lu/%@", (unsigned long)range.location, (unsigned long)(range.location + range.length - 1), fileLength];
- headers[@"Content-Length"] = [NSString stringWithFormat:@"%lu", (unsigned long)range.length];
- }
- }
-
- NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:req.URL statusCode:statusCode HTTPVersion:@"HTTP/1.1" headerFields:headers];
- if ([self taskActive:urlSchemeTask]) {
- [urlSchemeTask didReceiveResponse:response];
- }
-
- while ([self taskActive:urlSchemeTask] && responseSent < [responseSize unsignedIntegerValue]) {
- @autoreleasepool {
- NSData *data = [self readFromFileHandle:fileHandle upTo:FILE_BUFFER_SIZE error:&error];
- if (!data || error) {
- if ([self taskActive:urlSchemeTask]) {
- [urlSchemeTask didFailWithError:error];
- }
- break;
- }
-
- if ([self taskActive:urlSchemeTask]) {
- [urlSchemeTask didReceiveData:data];
- }
-
- responseSent += data.length;
- }
- }
-
- [fileHandle closeFile];
-
- if ([self taskActive:urlSchemeTask]) {
- [urlSchemeTask didFinish];
- }
-
- @synchronized(self.handlerMap) {
- [self.handlerMap removeObjectForKey:urlSchemeTask];
- }
- }];
-}
-
-- (void)webView:(WKWebView *)webView stopURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
-{
- CDVPlugin <CDVPluginSchemeHandler> *plugin;
- @synchronized(self.handlerMap) {
- plugin = [self.handlerMap objectForKey:urlSchemeTask];
- }
-
- if (![plugin isEqual:[NSNull null]] && [plugin respondsToSelector:@selector(stopSchemeTask:)]) {
- [plugin stopSchemeTask:urlSchemeTask];
- }
-
- @synchronized(self.handlerMap) {
- [self.handlerMap removeObjectForKey:urlSchemeTask];
- }
-}
-
-#pragma mark - Utility methods
-
-- (NSURL *)fileURLForRequestURL:(NSURL *)url
-{
- NSURL *resDir = [[NSBundle mainBundle] URLForResource:self.viewController.webContentFolderName withExtension:nil];
- NSURL *filePath;
-
- if ([url.path hasPrefix:@"/_app_file_"]) {
- NSString *path = [url.path stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
- filePath = [resDir URLByAppendingPathComponent:path];
- } else {
- if ([url.path isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
- filePath = [resDir URLByAppendingPathComponent:self.viewController.startPage];
- } else {
- filePath = [resDir URLByAppendingPathComponent:url.path];
- }
- }
-
- return filePath.URLByStandardizingPath;
-}
-
--(NSString *)getMimeType:(NSURL *)url
-{
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
- if (@available(iOS 14.0, *)) {
- UTType *uti;
- [url getResourceValue:&uti forKey:NSURLContentTypeKey error:nil];
- return [uti preferredMIMEType];
- }
-#endif
-
- NSString *type;
- [url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:nil];
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- return (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)type, kUTTagClassMIMEType);
-#pragma clang diagnostic pop
-}
-
-- (nullable NSData *)readFromFileHandle:(NSFileHandle *)handle upTo:(NSUInteger)length error:(NSError **)err
-{
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
- if (@available(iOS 14.0, *)) {
- return [handle readDataUpToLength:length error:err];
- }
-#endif
-
- @try {
- return [handle readDataOfLength:length];
- }
- @catch (NSError *error) {
- if (err != nil) {
- *err = error;
- }
- return nil;
- }
-}
-
-- (BOOL)taskActive:(id <WKURLSchemeTask>)task
-{
- @synchronized(self.handlerMap) {
- return [self.handlerMap objectForKey:task] != nil;
- }
-}
-
-@end
-
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
deleted file mode 100644
index 29e6fd8e1..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <WebKit/WebKit.h>
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate>
-
-@property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate;
-
-- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
deleted file mode 100644
index b62f5f818..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVWebViewEngine.h"
-#import "CDVWebViewUIDelegate.h"
-#import "CDVURLSchemeHandler.h"
-#import <Cordova/CDVWebViewProcessPoolFactory.h>
-#import <Cordova/CDVSettingsDictionary.h>
-#import "CDVViewController+Private.h"
-
-#import <objc/message.h>
-
-#define CDV_BRIDGE_NAME @"cordova"
-
-@interface CDVWebViewWeakScriptMessageHandler : NSObject <WKScriptMessageHandler>
-
-@property (nonatomic, weak, readonly) id<WKScriptMessageHandler>scriptMessageHandler;
-
-- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler;
-
-@end
-
-
-@interface CDVWebViewEngine ()
-
-@property (nonatomic, strong, readwrite) UIView* engineWebView;
-@property (nonatomic, strong, readwrite) id <WKUIDelegate> uiDelegate;
-@property (nonatomic, weak) id <WKScriptMessageHandler> weakScriptMessageHandler;
-@property (nonatomic, strong) CDVURLSchemeHandler * schemeHandler;
-@property (nonatomic, readwrite) NSString *CDV_ASSETS_URL;
-@property (nonatomic, readwrite) Boolean cdvIsFileScheme;
-@property (nullable, nonatomic, strong, readwrite) WKWebViewConfiguration *configuration;
-
-@end
-
-// see forwardingTargetForSelector: selector comment for the reason for this pragma
-#pragma clang diagnostic ignored "-Wprotocol"
-
-@implementation CDVWebViewEngine
-
-@synthesize engineWebView = _engineWebView;
-
-- (nullable instancetype)initWithFrame:(CGRect)frame configuration:(nullable WKWebViewConfiguration *)configuration
-{
- self = [super init];
- if (self) {
- if (NSClassFromString(@"WKWebView") == nil) {
- return nil;
- }
-
- self.configuration = configuration;
- self.engineWebView = configuration ? [[WKWebView alloc] initWithFrame:frame configuration:configuration] : [[WKWebView alloc] initWithFrame:frame];
- }
-
- return self;
-}
-
-- (nullable instancetype)initWithFrame:(CGRect)frame
-{
- return [self initWithFrame:frame configuration:nil];
-}
-
-- (WKWebViewConfiguration*) createConfigurationFromSettings:(CDVSettingsDictionary*)settings
-{
- WKWebViewConfiguration* configuration;
- if (_configuration) {
- configuration = _configuration;
- } else {
- configuration = [[WKWebViewConfiguration alloc] init];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- configuration.processPool = [[CDVWebViewProcessPoolFactory sharedFactory] sharedProcessPool];
-#pragma clang diagnostic pop
- }
-
- if (settings == nil) {
- return configuration;
- }
-
- configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
-
- // Set the media types that are required for user action for playback
- WKAudiovisualMediaTypes mediaType = WKAudiovisualMediaTypeAll; // default
-
- // targetMediaType will always exist, either from user's "config.xml" or default ("defaults.xml").
- id targetMediaType = [settings cordovaSettingForKey:@"MediaTypesRequiringUserActionForPlayback"];
- if ([targetMediaType isEqualToString:@"none"]) {
- mediaType = WKAudiovisualMediaTypeNone;
- } else if ([targetMediaType isEqualToString:@"audio"]) {
- mediaType = WKAudiovisualMediaTypeAudio;
- } else if ([targetMediaType isEqualToString:@"video"]) {
- mediaType = WKAudiovisualMediaTypeVideo;
- } else if ([targetMediaType isEqualToString:@"all"]) {
- mediaType = WKAudiovisualMediaTypeAll;
- } else {
- NSLog(@"Invalid \"MediaTypesRequiringUserActionForPlayback\" was detected. Fallback to default value of \"all\" types.");
- }
- configuration.mediaTypesRequiringUserActionForPlayback = mediaType;
-
- configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
-
- /*
- * If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it or default to "YES".
- * Check if the new preference key "AllowsAirPlayForMediaPlayback" exists and overwrite the "MediaPlaybackAllowsAirPlay" value.
- */
- BOOL allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
- if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != nil) {
- allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowsAirPlayForMediaPlayback" defaultValue:YES];
- }
- configuration.allowsAirPlayForMediaPlayback = allowsAirPlayForMediaPlayback;
-
- /*
- * Sets Custom User Agents
- * - (Default) "userAgent" is set the the clean user agent.
- * E.g.
- * UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
- *
- * - If "OverrideUserAgent" is set, it will overwrite the entire "userAgent" value. The "AppendUserAgent" will be iggnored if set.
- * Notice: The override logic is handled in the "pluginInitialize" method.
- * E.g.
- * OverrideUserAgent = "foobar"
- * UserAgent = "foobar"
- *
- * - If "AppendUserAgent" is set and "OverrideUserAgent" is not set, the user defined "AppendUserAgent" will be appended to the "userAgent"
- * E.g.
- * AppendUserAgent = "foobar"
- * UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 foobar"
- */
- NSString *userAgent = configuration.applicationNameForUserAgent;
- if (
- [settings cordovaSettingForKey:@"OverrideUserAgent"] == nil &&
- [settings cordovaSettingForKey:@"AppendUserAgent"] != nil
- ) {
- userAgent = [NSString stringWithFormat:@"%@ %@", userAgent, [settings cordovaSettingForKey:@"AppendUserAgent"]];
- }
- configuration.applicationNameForUserAgent = userAgent;
-
- NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
- if ([contentMode isEqual: @"mobile"]) {
- configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
- } else if ([contentMode isEqual: @"desktop"]) {
- configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
- }
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
- if (@available(iOS 14.0, *)) {
- configuration.limitsNavigationsToAppBoundDomains = [settings cordovaBoolSettingForKey:@"LimitsNavigationsToAppBoundDomains" defaultValue:NO];
- }
-#endif
-
- return configuration;
-}
-
-- (void)pluginInitialize
-{
- CDVSettingsDictionary* settings = self.commandDelegate.settings;
-
- NSString *scheme = self.viewController.appScheme;
-
- // If scheme is file or nil, then default to file scheme
- self.cdvIsFileScheme = [scheme isEqualToString:@"file"] || scheme == nil;
-
- NSString *hostname = @"";
- if(!self.cdvIsFileScheme) {
- if(scheme == nil || [WKWebView handlesURLScheme:scheme]){
- scheme = @"app";
- self.viewController.appScheme = scheme;
- }
-
- hostname = [settings cordovaSettingForKey:@"hostname"];
- if(hostname == nil){
- hostname = @"localhost";
- }
-
- self.CDV_ASSETS_URL = [NSString stringWithFormat:@"%@://%@", scheme, hostname];
- }
-
- CDVWebViewUIDelegate* uiDelegate = [[CDVWebViewUIDelegate alloc] initWithViewController:self.viewController];
- uiDelegate.title = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
- uiDelegate.mediaPermissionGrantType = [self parsePermissionGrantType:[settings cordovaSettingForKey:@"MediaPermissionGrantType"]];
- uiDelegate.allowNewWindows = [settings cordovaBoolSettingForKey:@"AllowNewWindows" defaultValue:NO];
- self.uiDelegate = uiDelegate;
-
- CDVWebViewWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWebViewWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self];
-
- WKUserContentController* userContentController = [[WKUserContentController alloc] init];
- [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME];
-
- if(self.CDV_ASSETS_URL) {
- NSString *scriptCode = [NSString stringWithFormat:@"window.CDV_ASSETS_URL = '%@';", self.CDV_ASSETS_URL];
- WKUserScript *wkScript = [[WKUserScript alloc] initWithSource:scriptCode injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
-
- if (wkScript) {
- [userContentController addUserScript:wkScript];
- }
- }
-
- WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
- configuration.userContentController = userContentController;
-
- // Do not configure the scheme handler if the scheme is default (file)
- if(!self.cdvIsFileScheme) {
- self.schemeHandler = [[CDVURLSchemeHandler alloc] initWithViewController:self.viewController];
- [configuration setURLSchemeHandler:self.schemeHandler forURLScheme:scheme];
- }
-
- // re-create WKWebView, since we need to update configuration
- WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
- wkWebView.UIDelegate = self.uiDelegate;
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
- // With the introduction of iOS 16.4 the webview is no longer inspectable by default.
- // We'll honor that change for release builds, but will still allow inspection on debug builds by default.
- // We also introduce an override option, so consumers can influence this decision in their own build.
- if (@available(iOS 16.4, *)) {
-#ifdef DEBUG
- BOOL allowWebviewInspectionDefault = YES;
-#else
- BOOL allowWebviewInspectionDefault = NO;
-#endif
- wkWebView.inspectable = [settings cordovaBoolSettingForKey:@"InspectableWebview" defaultValue:allowWebviewInspectionDefault];
- }
-#endif
-
- /*
- * This is where the "OverrideUserAgent" is handled. This will replace the entire UserAgent
- * with the user defined custom UserAgent.
- */
- if ([settings cordovaSettingForKey:@"OverrideUserAgent"] != nil) {
- wkWebView.customUserAgent = [settings cordovaSettingForKey:@"OverrideUserAgent"];
- }
-
- [wkWebView addObserver:self forKeyPath:@"themeColor" options:NSKeyValueObservingOptionInitial context:nil];
-
- self.engineWebView = wkWebView;
-
- if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
- wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController;
- }
-
- if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) {
- wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self.viewController;
- } else {
- wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self;
- }
-
- if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
- [wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME];
- }
-
- [self updateSettings:settings];
-
- NSLog(@"Using WKWebView");
-}
-
-- (void)dispose
-{
- WKWebView* wkWebView = (WKWebView*)_engineWebView;
- [wkWebView.configuration.userContentController removeScriptMessageHandlerForName:CDV_BRIDGE_NAME];
- _engineWebView = nil;
-
- [super dispose];
-}
-
-- (id)loadRequest:(NSURLRequest*)request
-{
- if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes
- if(request.URL.fileURL && self.cdvIsFileScheme) {
- NSURL* readAccessUrl = [request.URL URLByDeletingLastPathComponent];
- return [(WKWebView*)_engineWebView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
- } else if (request.URL.fileURL) {
- NSURL* startURL = [NSURL URLWithString:self.viewController.startPage];
- NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
- NSURL *url = [[NSURL URLWithString:self.CDV_ASSETS_URL] URLByAppendingPathComponent:request.URL.path];
- if ([request.URL.path isEqualToString:startFilePath]) {
- url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.CDV_ASSETS_URL, startURL]];
- }
- if(request.URL.query) {
- url = [NSURL URLWithString:[@"?" stringByAppendingString:request.URL.query] relativeToURL:url];
- }
- if(request.URL.fragment) {
- url = [NSURL URLWithString:[@"#" stringByAppendingString:request.URL.fragment] relativeToURL:url];
- }
- // We ignore any existing cached data, since we're already loading it from the filesystem
- request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:request.timeoutInterval];
- }
- return [(WKWebView*)_engineWebView loadRequest:request];
- } else { // can't load, print out error
- NSString* errorHtml = [NSString stringWithFormat:
- @"<!doctype html>"
- @"<title>Error</title>"
- @"<div style='font-size:2em'>"
- @" <p>The WebView engine '%@' is unable to load the request: %@</p>"
- @" <p>Most likely the cause of the error is that the loading of file urls is not supported in iOS %@.</p>"
- @"</div>",
- NSStringFromClass([self class]),
- [request.URL description],
- [[UIDevice currentDevice] systemVersion]
- ];
- return [self loadHTMLString:errorHtml baseURL:nil];
- }
-}
-
-- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
-{
- return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
-}
-
-- (NSURL*) URL
-{
- return [(WKWebView*)_engineWebView URL];
-}
-
-- (BOOL) canLoadRequest:(NSURLRequest*)request
-{
- return YES;
-}
-
-- (void)updateSettings:(CDVSettingsDictionary*)settings
-{
- WKWebView* wkWebView = (WKWebView*)_engineWebView;
-
- wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0];
-
- /*
- wkWebView.configuration.preferences.javaScriptEnabled = [settings cordovaBoolSettingForKey:@"JavaScriptEnabled" default:YES];
- wkWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = [settings cordovaBoolSettingForKey:@"JavaScriptCanOpenWindowsAutomatically" default:NO];
- */
-
- // By default, DisallowOverscroll is false (thus bounce is allowed)
- BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
-
- // prevent webView from bouncing
- if (!bounceAllowed) {
- if ([wkWebView respondsToSelector:@selector(scrollView)]) {
- UIScrollView* scrollView = [wkWebView scrollView];
- scrollView.bounces = NO;
- scrollView.alwaysBounceVertical = NO; /* iOS 16 workaround */
- scrollView.alwaysBounceHorizontal = NO; /* iOS 16 workaround */
- } else {
- for (id subview in wkWebView.subviews) {
- if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
- ((UIScrollView*)subview).bounces = NO;
- }
- }
- }
- }
-
- NSString* decelerationSetting = [settings cordovaSettingForKey:@"WKWebViewDecelerationSpeed"];
-
- if (![@"fast" isEqualToString:decelerationSetting]) {
- [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
- } else {
- [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
- }
-
- wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
- wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"Allow3DTouchLinkPreview" defaultValue:YES];
-}
-
-- (void)updateWithInfo:(NSDictionary*)info
-{
- NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
- id settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
- id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
- id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
-
- WKWebView* wkWebView = (WKWebView*)_engineWebView;
-
- if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) {
- NSArray* allKeys = [scriptMessageHandlers allKeys];
-
- for (NSString* key in allKeys) {
- id object = [scriptMessageHandlers objectForKey:key];
- if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
- [wkWebView.configuration.userContentController addScriptMessageHandler:object name:key];
- }
- }
- }
-
- if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) {
- wkWebView.navigationDelegate = navigationDelegate;
- }
-
- if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) {
- wkWebView.UIDelegate = uiDelegate;
- }
-
- if (settings && [settings isKindOfClass:[CDVSettingsDictionary class]]) {
- [self updateSettings:settings];
- } else if (settings && [settings isKindOfClass:[NSDictionary class]]) {
- [self updateSettings:[[CDVSettingsDictionary alloc] initWithDictionary:settings]];
- }
-}
-
-// This forwards the methods that are in the header that are not implemented here.
-// Both WKWebView implement the below:
-// loadHTMLString:baseURL:
-// loadRequest:
-- (id)forwardingTargetForSelector:(SEL)aSelector
-{
- return _engineWebView;
-}
-
-- (UIView*)webView
-{
- return self.engineWebView;
-}
-
-- (CDVWebViewPermissionGrantType)parsePermissionGrantType:(NSString*)optionString
-{
- CDVWebViewPermissionGrantType result = CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt;
-
- if (optionString != nil){
- if ([optionString isEqualToString:@"prompt"]) {
- result = CDVWebViewPermissionGrantType_Prompt;
- } else if ([optionString isEqualToString:@"deny"]) {
- result = CDVWebViewPermissionGrantType_Deny;
- } else if ([optionString isEqualToString:@"grant"]) {
- result = CDVWebViewPermissionGrantType_Grant;
- } else if ([optionString isEqualToString:@"grantIfSameHostElsePrompt"]) {
- result = CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt;
- } else if ([optionString isEqualToString:@"grantIfSameHostElseDeny"]) {
- result = CDVWebViewPermissionGrantType_GrantIfSameHost_ElseDeny;
- } else {
- NSLog(@"Invalid \"MediaPermissionGrantType\" was detected. Fallback to default value of \"grantIfSameHostElsePrompt\"");
- }
- }
-
- return result;
-}
-
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
- if ([keyPath isEqualToString:@"themeColor"]) {
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
- if (@available(iOS 15.0, *)) {
- [self.viewController setStatusBarWebViewColor:((WKWebView *)self.engineWebView).themeColor];
- }
-#endif
- }
-}
-
-#pragma mark - WKScriptMessageHandler implementation
-
-- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
-{
- if (![message.name isEqualToString:CDV_BRIDGE_NAME]) {
- return;
- }
-
- CDVViewController* vc = (CDVViewController*)self.viewController;
-
- NSArray* jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args
- CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
- CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
-
- if (![vc.commandQueue execute:command]) {
-#ifdef DEBUG
- NSError* error = nil;
- NSString* commandJson = nil;
- NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry
- options:0
- error:&error];
-
- if (error == nil) {
- commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
- }
-
- static NSUInteger maxLogLength = 1024;
- NSString* commandString = ([commandJson length] > maxLogLength) ?
- [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
- commandJson;
-
- NSLog(@"FAILED pluginJSON = %@", commandString);
-#endif
- }
-}
-
-#pragma mark - WKNavigationDelegate implementation
-
-- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
-{
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]];
-}
-
-- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
-{
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
-}
-
-- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error
-{
- [self webView:theWebView didFailNavigation:navigation withError:error];
-}
-
-- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
-{
- NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
- NSLog(@"%@", message);
-
- if (error.code != NSURLErrorCancelled) {
- NSURL* errorUrl = self.viewController.errorURL;
- if (errorUrl) {
- NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
- errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
- NSLog(@"%@", [errorUrl absoluteString]);
- [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
- }
- }
-}
-
-- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
-{
- CDVSettingsDictionary *settings = self.commandDelegate.settings;
- NSString *recoveryBehavior = [settings cordovaSettingForKey:@"CrashRecoveryBehavior"];
-
- if ([recoveryBehavior isEqualToString:@"reload"]) {
- [self.viewController loadStartPage];
- } else {
- [webView reload];
- }
-}
-
-- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
-{
- // all file:// urls are allowed
- if ([url isFileURL]) {
- return YES;
- }
-
- return NO;
-}
-
-- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
-{
- CDVViewController *vc = (CDVViewController *)self.viewController;
-
- NSURLRequest *request = navigationAction.request;
- CDVWebViewNavigationType navType = (CDVWebViewNavigationType)navigationAction.navigationType;
- NSMutableDictionary *info = [NSMutableDictionary dictionary];
- info[@"sourceFrame"] = navigationAction.sourceFrame;
- info[@"targetFrame"] = navigationAction.targetFrame;
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500
- if (@available(iOS 14.5, *)) {
- info[@"shouldPerformDownload"] = [NSNumber numberWithBool:navigationAction.shouldPerformDownload];
- }
-#endif
-
- // Give plugins the chance to handle the url, as long as this WebViewEngine is still the WKNavigationDelegate.
- // This allows custom delegates to choose to call this method for `default` cordova behavior without querying all plugins.
- if (webView.navigationDelegate == self) {
- BOOL anyPluginsResponded = NO;
- BOOL shouldAllowRequest = NO;
-
- for (CDVPlugin *plugin in vc.enumerablePlugins) {
- if ([plugin respondsToSelector:@selector(shouldOverrideLoadWithRequest:navigationType:info:)] || [plugin respondsToSelector:@selector(shouldOverrideLoadWithRequest:navigationType:)]) {
- CDVPlugin <CDVPluginNavigationHandler> *navPlugin = (CDVPlugin <CDVPluginNavigationHandler> *)plugin;
- anyPluginsResponded = YES;
-
- if ([navPlugin respondsToSelector:@selector(shouldOverrideLoadWithRequest:navigationType:info:)]) {
- shouldAllowRequest = [navPlugin shouldOverrideLoadWithRequest:request navigationType:navType info:info];
- } else {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- shouldAllowRequest = [navPlugin shouldOverrideLoadWithRequest:request navigationType:navType];
-#pragma clang diagnostic pop
- }
-
- if (!shouldAllowRequest) {
- break;
- }
- }
- }
-
- if (anyPluginsResponded) {
- return decisionHandler(shouldAllowRequest ? WKNavigationActionPolicyAllow : WKNavigationActionPolicyCancel);
- }
- } else {
- CDVPlugin <CDVPluginNavigationHandler> *intentAndNavFilter = (CDVPlugin <CDVPluginNavigationHandler> *)[vc getCommandInstance:@"IntentAndNavigationFilter"];
- if (intentAndNavFilter) {
- BOOL shouldAllowRequest = [intentAndNavFilter shouldOverrideLoadWithRequest:request navigationType:navType info:info];
- return decisionHandler(shouldAllowRequest ? WKNavigationActionPolicyAllow : WKNavigationActionPolicyCancel);
- }
- }
-
- // Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
- BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:request.URL];
- if (!shouldAllowNavigation) {
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:request.URL userInfo:@{}]];
- }
- return decisionHandler(shouldAllowNavigation ? WKNavigationActionPolicyAllow : WKNavigationActionPolicyCancel);
-}
-
-- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler
-{
- CDVViewController* vc = (CDVViewController*)self.viewController;
-
- for (CDVPlugin *plugin in vc.enumerablePlugins) {
- if ([plugin respondsToSelector:@selector(willHandleAuthenticationChallenge:completionHandler:)]) {
- CDVPlugin <CDVPluginAuthenticationHandler> *challengePlugin = (CDVPlugin <CDVPluginAuthenticationHandler> *)plugin;
- if ([challengePlugin willHandleAuthenticationChallenge:challenge completionHandler:completionHandler]) {
- return;
- }
- }
- }
-
- completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
-}
-
-#pragma mark - Plugin interface
-
-- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
-{
- id value = [command argumentAtIndex:0];
- if (!([value isKindOfClass:[NSNumber class]])) {
- value = [NSNumber numberWithBool:NO];
- }
-
- WKWebView* wkWebView = (WKWebView*)_engineWebView;
- wkWebView.allowsBackForwardNavigationGestures = [value boolValue];
-}
-
-@end
-
-#pragma mark - CDVWebViewWeakScriptMessageHandler
-
-@implementation CDVWebViewWeakScriptMessageHandler
-
-- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler
-{
- self = [super init];
- if (self) {
- _scriptMessageHandler = scriptMessageHandler;
- }
- return self;
-}
-
-- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
-{
- [self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
deleted file mode 100644
index 2e4ac894e..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <WebKit/WebKit.h>
-
-#ifdef NS_SWIFT_UI_ACTOR
-#define CDV_SWIFT_UI_ACTOR NS_SWIFT_UI_ACTOR
-#else
-#define CDV_SWIFT_UI_ACTOR
-#endif
-
-@class CDVViewController;
-
-NS_ASSUME_NONNULL_BEGIN
-
-CDV_SWIFT_UI_ACTOR
-@interface CDVWebViewUIDelegate : NSObject <WKUIDelegate>
-
-typedef NS_ENUM(NSInteger, CDVWebViewPermissionGrantType) {
- CDVWebViewPermissionGrantType_Prompt,
- CDVWebViewPermissionGrantType_Deny,
- CDVWebViewPermissionGrantType_Grant,
- CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt,
- CDVWebViewPermissionGrantType_GrantIfSameHost_ElseDeny
-};
-
-@property (nonatomic, nullable, copy) NSString* title;
-@property (nonatomic, assign) BOOL allowNewWindows;
-@property (nonatomic, assign) CDVWebViewPermissionGrantType mediaPermissionGrantType;
-
-- (instancetype)initWithViewController:(CDVViewController*)vc;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
deleted file mode 100644
index b07d7aaee..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVWebViewUIDelegate.h"
-#import <Cordova/CDVViewController.h>
-
-@interface CDVWebViewUIDelegate ()
-
-@property (nonatomic, weak) CDVViewController *viewController;
-
-@end
-
-@implementation CDVWebViewUIDelegate
-{
- NSMutableArray<UIViewController *> *windows;
-}
-
-- (instancetype)initWithViewController:(CDVViewController *)vc
-{
- self = [super init];
-
- if (self) {
- self.viewController = vc;
- self.title = vc.title;
- windows = [[NSMutableArray alloc] init];
- }
- return self;
-}
-
-- (void)webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message initiatedByFrame:(WKFrameInfo*)frame completionHandler:(CDV_SWIFT_UI_ACTOR void (^)(void))completionHandler
-{
- UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
- message:message
- preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction* action)
- {
- completionHandler();
- [alert dismissViewControllerAnimated:YES completion:nil];
- }];
-
- [alert addAction:ok];
-
- [[self topViewController] presentViewController:alert animated:YES completion:nil];
-}
-
-- (void)webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message initiatedByFrame:(WKFrameInfo*)frame completionHandler:(CDV_SWIFT_UI_ACTOR void (^)(BOOL result))completionHandler
-{
- UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
- message:message
- preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction* action)
- {
- completionHandler(YES);
- [alert dismissViewControllerAnimated:YES completion:nil];
- }];
-
- [alert addAction:ok];
-
- UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction* action)
- {
- completionHandler(NO);
- [alert dismissViewControllerAnimated:YES completion:nil];
- }];
- [alert addAction:cancel];
-
- [[self topViewController] presentViewController:alert animated:YES completion:nil];
-}
-
-- (void)webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame completionHandler:(CDV_SWIFT_UI_ACTOR void (^)(NSString* result))completionHandler
-{
- UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
- message:prompt
- preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction* action)
- {
- completionHandler(((UITextField*)alert.textFields[0]).text);
- [alert dismissViewControllerAnimated:YES completion:nil];
- }];
-
- [alert addAction:ok];
-
- UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction* action)
- {
- completionHandler(nil);
- [alert dismissViewControllerAnimated:YES completion:nil];
- }];
- [alert addAction:cancel];
-
- [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
- textField.text = defaultText;
- }];
-
- [[self topViewController] presentViewController:alert animated:YES completion:nil];
-}
-
-- (nullable WKWebView*)webView:(WKWebView*)webView createWebViewWithConfiguration:(WKWebViewConfiguration*)configuration forNavigationAction:(WKNavigationAction*)navigationAction windowFeatures:(WKWindowFeatures*)windowFeatures
-{
- if (!navigationAction.targetFrame.isMainFrame) {
- if (self.allowNewWindows) {
- WKWebView* v = [[WKWebView alloc] initWithFrame:webView.frame configuration:configuration];
- v.UIDelegate = webView.UIDelegate;
- v.navigationDelegate = webView.navigationDelegate;
-
- UIViewController* vc = [[UIViewController alloc] init];
- vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
- vc.view = v;
-
- [windows addObject:vc];
-
- [[self topViewController] presentViewController:vc animated:YES completion:nil];
- return v;
- } else {
- [webView loadRequest:navigationAction.request];
- }
- }
-
- return nil;
-}
-
-- (void)webViewDidClose:(WKWebView*)webView
-{
- for (UIViewController* vc in windows) {
- if (vc.view == webView) {
- [vc dismissViewControllerAnimated:YES completion:nil];
- [windows removeObject:vc];
- break;
- }
- }
-
- // We do not allow closing the primary WebView
-}
-
-- (void)webView:(WKWebView *)webView requestMediaCapturePermissionForOrigin:(nonnull WKSecurityOrigin *)origin initiatedByFrame:(nonnull WKFrameInfo *)frame type:(WKMediaCaptureType)type decisionHandler:(nonnull void (^)(WKPermissionDecision))decisionHandler
- API_AVAILABLE(ios(15.0))
-{
- WKPermissionDecision decision;
-
- if (_mediaPermissionGrantType == CDVWebViewPermissionGrantType_Prompt) {
- decision = WKPermissionDecisionPrompt;
- }
- else if (_mediaPermissionGrantType == CDVWebViewPermissionGrantType_Deny) {
- decision = WKPermissionDecisionDeny;
- }
- else if (_mediaPermissionGrantType == CDVWebViewPermissionGrantType_Grant) {
- decision = WKPermissionDecisionGrant;
- }
- else {
- if ([origin.host isEqualToString:webView.URL.host]) {
- decision = WKPermissionDecisionGrant;
- }
- else {
- decision =_mediaPermissionGrantType == CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt ? WKPermissionDecisionPrompt : WKPermissionDecisionDeny;
- }
- }
-
- decisionHandler(decision);
-}
-
-#pragma mark - Utility Methods
-
-- (nullable UIViewController *)topViewController
-{
- UIViewController *vc = self.viewController;
-
- while (vc.presentedViewController != nil && ![vc.presentedViewController isBeingDismissed]) {
- vc = vc.presentedViewController;
- }
-
- return vc;
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m
deleted file mode 100644
index 7dc9c2b1b..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVAppDelegate.h>
-#import <Cordova/CDVAvailability.h>
-#import <Cordova/CDVPluginNotifications.h>
-#import <Cordova/CDVViewController.h>
-
-@implementation CDVAppDelegate
-
-@synthesize window, viewController;
-
-- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions
-{
-#if DEBUG
- NSLog(@"Apache Cordova iOS platform version %@ is starting.", CDV_VERSION);
-#endif
-
- return YES;
-}
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions
-{
- return YES;
-}
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#pragma clang diagnostic ignored "-Wdeprecated-implementations"
-// this happens while we are running ( in the background, or from within our own app )
-// only valid if Info.plist specifies a protocol to handle
-- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
-{
- if (!url) {
- return NO;
- }
-
- // all plugins will get the notification, and their handlers will be called
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVPluginHandleOpenURLNotification object:url userInfo:options];
-
- // TODO: This should be deprecated and removed in Cordova iOS 9, since we're passing this data in the notification userInfo now
- NSMutableDictionary * openURLData = [[NSMutableDictionary alloc] init];
-
- [openURLData setValue:url forKey:@"url"];
-
- if (options[UIApplicationOpenURLOptionsSourceApplicationKey]) {
- [openURLData setValue:options[UIApplicationOpenURLOptionsSourceApplicationKey] forKey:@"sourceApplication"];
- }
-
- if (options[UIApplicationOpenURLOptionsAnnotationKey]) {
- [openURLData setValue:options[UIApplicationOpenURLOptionsAnnotationKey] forKey:@"annotation"];
- }
-
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:openURLData]];
-
- return YES;
-}
-#pragma clang diagnostic pop
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m
deleted file mode 100644
index 2b684c593..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#include <objc/message.h>
-#import <Cordova/CDVCommandQueue.h>
-#import <Cordova/CDVViewController.h>
-#import <Cordova/CDVPlugin.h>
-#import <Cordova/NSMutableArray+QueueAdditions.h>
-#import "CDVCommandDelegateImpl.h"
-#import "CDVJSON_private.h"
-#import "CDVDebug.h"
-
-// Parse JS on the main thread if it's shorter than this.
-static const NSInteger JSON_SIZE_FOR_MAIN_THREAD = 4 * 1024; // Chosen arbitrarily.
-// Execute multiple commands in one go until this many seconds have passed.
-static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame.
-
-@interface CDVCommandQueue () {
- NSInteger _lastCommandQueueFlushRequestId;
- __weak CDVViewController* _viewController;
- NSMutableArray* _queue;
- NSTimeInterval _startExecutionTime;
-}
-@end
-
-@implementation CDVCommandQueue
-
-- (BOOL)currentlyExecuting
-{
- return _startExecutionTime > 0;
-}
-
-- (instancetype)init
-{
- return [self initWithViewController:nil];
-}
-
-- (instancetype)initWithViewController:(CDVViewController *)viewController
-{
- self = [super init];
- if (self != nil) {
- _viewController = viewController;
- _queue = [[NSMutableArray alloc] init];
- }
- return self;
-}
-
-- (void)dispose
-{
- // TODO(agrieve): Make this a zeroing weak ref once we drop support for 4.3.
- _viewController = nil;
-}
-
-- (void)resetRequestId
-{
- _lastCommandQueueFlushRequestId = 0;
-}
-
-- (void)enqueueCommandBatch:(NSString*)batchJSON
-{
- if ([batchJSON length] > 0) {
- NSMutableArray* commandBatchHolder = [[NSMutableArray alloc] init];
- [_queue addObject:commandBatchHolder];
- if ([batchJSON length] < JSON_SIZE_FOR_MAIN_THREAD) {
- [commandBatchHolder addObject:[batchJSON cdv_JSONObject]];
- } else {
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
- NSMutableArray* result = [batchJSON cdv_JSONObject];
- @synchronized(commandBatchHolder) {
- [commandBatchHolder addObject:result];
- }
- [self performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO];
- });
- }
- }
-}
-
-- (void)fetchCommandsFromJs
-{
- __weak CDVCommandQueue* weakSelf = self;
- NSString* js = @"cordova.require('cordova/exec').nativeFetchMessages()";
-
- [_viewController.webViewEngine evaluateJavaScript:js
- completionHandler:^(id obj, NSError* error) {
- if ((error == nil) && [obj isKindOfClass:[NSString class]]) {
- NSString* queuedCommandsJSON = (NSString*)obj;
- CDV_EXEC_LOG(@"Exec: Flushed JS->native queue (hadCommands=%d).", [queuedCommandsJSON length] > 0);
- [weakSelf enqueueCommandBatch:queuedCommandsJSON];
- // this has to be called here now, because fetchCommandsFromJs is now async (previously: synchronous)
- [self executePending];
- }
- }];
-}
-
-- (void)executePending
-{
- // Make us re-entrant-safe.
- if (_startExecutionTime > 0) {
- return;
- }
- @try {
- _startExecutionTime = [NSDate timeIntervalSinceReferenceDate];
-
- while ([_queue count] > 0) {
- NSMutableArray* commandBatchHolder = _queue[0];
- NSMutableArray* commandBatch = nil;
- @synchronized(commandBatchHolder) {
- // If the next-up command is still being decoded, wait for it.
- if ([commandBatchHolder count] == 0) {
- break;
- }
- commandBatch = commandBatchHolder[0];
- }
-
- while ([commandBatch count] > 0) {
- @autoreleasepool {
- // Execute the commands one-at-a-time.
- NSArray* jsonEntry = [commandBatch cdv_dequeue];
- if ([commandBatch count] == 0) {
- [_queue removeObjectAtIndex:0];
- }
- CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
- CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
-
- if (![self execute:command]) {
-#ifdef DEBUG
- NSString* commandJson = [jsonEntry cdv_JSONString];
- static NSUInteger maxLogLength = 1024;
- NSString* commandString = ([commandJson length] > maxLogLength) ?
- [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
- commandJson;
-
- DLog(@"FAILED pluginJSON = %@", commandString);
-#endif
- }
- }
-
- // Yield if we're taking too long.
- if (([_queue count] > 0) && ([NSDate timeIntervalSinceReferenceDate] - _startExecutionTime > MAX_EXECUTION_TIME)) {
- [self performSelector:@selector(executePending) withObject:nil afterDelay:0];
- return;
- }
- }
- }
- } @finally
- {
- _startExecutionTime = 0;
- }
-}
-
-- (BOOL)execute:(CDVInvokedUrlCommand*)command
-{
- if ((command.className == nil) || (command.methodName == nil)) {
- NSLog(@"ERROR: Classname and/or methodName not found for command.");
- return NO;
- }
-
- // Fetch an instance of this class
- CDVPlugin* obj = [_viewController.commandDelegate getCommandInstance:command.className];
-
- if (!([obj isKindOfClass:[CDVPlugin class]])) {
- NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.", command.className);
- return NO;
- }
- BOOL retVal = YES;
- double started = [[NSDate date] timeIntervalSince1970] * 1000.0;
- // Find the proper selector to call.
- NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName];
- SEL normalSelector = NSSelectorFromString(methodName);
- if ([obj respondsToSelector:normalSelector]) {
- // [obj performSelector:normalSelector withObject:command];
- ((void (*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command);
- } else {
- // There's no method to call, so throw an error.
- NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.className);
- retVal = NO;
- }
- double elapsed = [[NSDate date] timeIntervalSince1970] * 1000.0 - started;
- if (elapsed > 10) {
- NSLog(@"THREAD WARNING: ['%@'] took '%f' ms. Plugin should use a background thread.", command.className, elapsed);
- }
- return retVal;
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m
deleted file mode 100644
index 6f8da6a92..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVConfigParser.h>
-
-@interface CDVConfigParser ()
-{
- NSString *featureName;
-}
-
-@property (nonatomic, readwrite, strong) NSMutableDictionary *pluginsDict;
-@property (nonatomic, readwrite, strong) NSMutableDictionary *settings;
-@property (nonatomic, readwrite, strong) NSMutableArray *startupPluginNames;
-@property (nonatomic, readwrite, strong) NSString *startPage;
-
-@end
-
-@implementation CDVConfigParser
-
-@synthesize pluginsDict;
-@synthesize settings;
-@synthesize startPage;
-@synthesize startupPluginNames;
-
-+ (instancetype)parseConfigFile:(NSURL *)filePath
-{
- CDVConfigParser* delegate = [[CDVConfigParser alloc] init];
- [CDVConfigParser parseConfigFile:filePath withDelegate:delegate];
- return delegate;
-}
-
-+ (BOOL)parseConfigFile:(NSURL *)filePath withDelegate:(id <NSXMLParserDelegate>)delegate
-{
- NSXMLParser *configParser = [[NSXMLParser alloc] initWithContentsOfURL:filePath];
-
- if (configParser == nil) {
- NSLog(@"Failed to initialize XML parser.");
- return NO;
- }
-
- [configParser setDelegate:delegate];
- [configParser parse];
-
- return YES;
-}
-
-- (instancetype)init
-{
- self = [super init];
- if (self != nil) {
- self.pluginsDict = [[NSMutableDictionary alloc] initWithCapacity:30];
- self.settings = [[NSMutableDictionary alloc] initWithCapacity:30];
- self.startupPluginNames = [[NSMutableArray alloc] initWithCapacity:8];
- featureName = nil;
- }
- return self;
-}
-
-- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
-{
- if ([elementName isEqualToString:@"preference"]) {
- settings[[attributeDict[@"name"] lowercaseString]] = attributeDict[@"value"];
- } else if ([elementName isEqualToString:@"feature"]) { // store feature name to use with correct parameter set
- featureName = [attributeDict[@"name"] lowercaseString];
- } else if ((featureName != nil) && [elementName isEqualToString:@"param"]) {
- NSString *paramName = [attributeDict[@"name"] lowercaseString];
- id value = attributeDict[@"value"];
- if ([paramName isEqualToString:@"ios-package"]) {
- pluginsDict[featureName] = value;
- }
- BOOL paramIsOnload = ([paramName isEqualToString:@"onload"] && [@"true" isEqualToString : value]);
- BOOL attribIsOnload = [@"true" isEqualToString :[attributeDict[@"onload"] lowercaseString]];
- if (paramIsOnload || attribIsOnload) {
- [self.startupPluginNames addObject:featureName];
- }
- } else if ([elementName isEqualToString:@"content"]) {
- self.startPage = attributeDict[@"src"];
- }
-}
-
-- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
-{
- if ([elementName isEqualToString:@"feature"]) { // no longer handling a feature so release
- featureName = nil;
- }
-}
-
-- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError
-{
- NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]);
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
deleted file mode 100644
index aaad4edb5..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVInvokedUrlCommand.h>
-#import "CDVJSON_private.h"
-
-@implementation CDVInvokedUrlCommand
-
-@synthesize arguments = _arguments;
-@synthesize callbackId = _callbackId;
-@synthesize className = _className;
-@synthesize methodName = _methodName;
-
-+ (instancetype)commandFromJson:(NSArray *)jsonEntry
-{
- return [[CDVInvokedUrlCommand alloc] initFromJson:jsonEntry];
-}
-
-- (instancetype)init
-{
- return [self initWithArguments:nil callbackId:nil className:nil methodName:nil];
-}
-
-- (instancetype)initFromJson:(NSArray *)jsonEntry
-{
- id tmp = [jsonEntry objectAtIndex:0];
- NSString* callbackId = tmp == [NSNull null] ? nil : tmp;
- NSString* className = [jsonEntry objectAtIndex:1];
- NSString* methodName = [jsonEntry objectAtIndex:2];
- NSMutableArray* arguments = [jsonEntry objectAtIndex:3];
-
- return [self initWithArguments:arguments
- callbackId:callbackId
- className:className
- methodName:methodName];
-}
-
-- (instancetype)initWithArguments:(NSArray *)arguments
- callbackId:(NSString *)callbackId
- className:(NSString *)className
- methodName:(NSString *)methodName
-{
- self = [super init];
- if (self != nil) {
- _arguments = arguments;
- _callbackId = callbackId;
- _className = className;
- _methodName = methodName;
- }
- [self massageArguments];
- return self;
-}
-
-- (void)massageArguments
-{
- NSMutableArray* newArgs = nil;
-
- for (NSUInteger i = 0, count = [_arguments count]; i < count; ++i) {
- id arg = [_arguments objectAtIndex:i];
- if (![arg isKindOfClass:[NSDictionary class]]) {
- continue;
- }
- NSDictionary* dict = arg;
- NSString* type = [dict objectForKey:@"CDVType"];
- if (!type || ![type isEqualToString:@"ArrayBuffer"]) {
- continue;
- }
- NSString* data = [dict objectForKey:@"data"];
- if (!data) {
- continue;
- }
- if (newArgs == nil) {
- newArgs = [NSMutableArray arrayWithArray:_arguments];
- _arguments = newArgs;
- }
- [newArgs replaceObjectAtIndex:i withObject:[[NSData alloc] initWithBase64EncodedString:data options:0]];
- }
-}
-
-- (id)argumentAtIndex:(NSUInteger)index
-{
- return [self argumentAtIndex:index withDefault:nil];
-}
-
-- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue
-{
- return [self argumentAtIndex:index withDefault:defaultValue andClass:nil];
-}
-
-- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass
-{
- if (index >= [_arguments count]) {
- return defaultValue;
- }
- id ret = [_arguments objectAtIndex:index];
- if (ret == [NSNull null]) {
- ret = defaultValue;
- }
- if ((aClass != nil) && ![ret isKindOfClass:aClass]) {
- ret = defaultValue;
- }
- return ret;
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m
deleted file mode 100644
index f18f7429f..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin+Resources.h>
-
-@implementation CDVPlugin (CDVPluginResources)
-
-- (NSString*)pluginLocalizedString:(NSString*)key
-{
- NSBundle* bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:NSStringFromClass([self class]) ofType:@"bundle"]];
-
- return [bundle localizedStringForKey:(key) value:nil table:nil];
-}
-
-- (UIImage*)pluginImageResource:(NSString*)name
-{
- NSString* resourceIdentifier = [NSString stringWithFormat:@"%@.bundle/%@", NSStringFromClass([self class]), name];
-
- return [UIImage imageNamed:resourceIdentifier];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m
deleted file mode 100644
index 52d95d344..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-#import <Cordova/CDVPlugin+Resources.h>
-#import "CDVPlugin+Private.h"
-#import <Cordova/CDVViewController.h>
-
-@implementation UIView (org_apache_cordova_UIView_Extension)
-
-@dynamic scrollView;
-
-- (UIScrollView*)scrollView
-{
- static UIView *caller = nil;
-
- if (caller != self && [self respondsToSelector:@selector(scrollView)]) {
- caller = self;
- UIScrollView *sv = [self performSelector:@selector(scrollView)];
- caller = nil;
- return sv;
- }
- caller = nil;
- return nil;
-}
-
-@end
-
-const NSNotificationName CDVPageDidLoadNotification = @"CDVPageDidLoadNotification";
-const NSNotificationName CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification";
-const NSNotificationName CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification = @"CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification";
-const NSNotificationName CDVPluginResetNotification = @"CDVPluginResetNotification";
-const NSNotificationName CDVViewWillAppearNotification = @"CDVViewWillAppearNotification";
-const NSNotificationName CDVViewDidAppearNotification = @"CDVViewDidAppearNotification";
-const NSNotificationName CDVViewWillDisappearNotification = @"CDVViewWillDisappearNotification";
-const NSNotificationName CDVViewDidDisappearNotification = @"CDVViewDidDisappearNotification";
-const NSNotificationName CDVViewWillLayoutSubviewsNotification = @"CDVViewWillLayoutSubviewsNotification";
-const NSNotificationName CDVViewDidLayoutSubviewsNotification = @"CDVViewDidLayoutSubviewsNotification";
-const NSNotificationName CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitionToSizeNotification";
-
-@interface CDVPlugin ()
-
-@property (readwrite, assign) BOOL hasPendingOperation;
-@property (nonatomic, readwrite, weak) id <CDVWebViewEngineProtocol> webViewEngine;
-
-@end
-
-@implementation CDVPlugin
-@synthesize webViewEngine, viewController, commandDelegate, hasPendingOperation;
-@dynamic webView;
-
-// Do not override these methods. Use pluginInitialize instead.
-- (instancetype)initWithWebViewEngine:(id <CDVWebViewEngineProtocol>)theWebViewEngine
-{
- self = [self init];
- if (self) {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:CDVPluginHandleOpenURLNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onReset) name:CDVPluginResetNotification object:theWebViewEngine.engineWebView];
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURLWithApplicationSourceAndAnnotation:) name:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:nil];
-#pragma clang diagnostic pop
-
- self.webViewEngine = theWebViewEngine;
- }
- return self;
-}
-
-- (void)pluginInitialize
-{
- // You can listen to more app notifications, see:
- // http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728-CH3-DontLinkElementID_4
-
- // NOTE: if you want to use these, make sure you uncomment the corresponding notification handler
-
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationWillChange) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
-
- // Added in 2.5.0
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad:) name:CDVPageDidLoadNotification object:self.webView];
- //Added in 4.3.0
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillAppear:) name:CDVViewWillAppearNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidAppear:) name:CDVViewDidAppearNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillDisappear:) name:CDVViewWillDisappearNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidDisappear:) name:CDVViewDidDisappearNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillLayoutSubviews:) name:CDVViewWillLayoutSubviewsNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidLayoutSubviews:) name:CDVViewDidLayoutSubviewsNotification object:nil];
- // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillTransitionToSize:) name:CDVViewWillTransitionToSizeNotification object:nil];
-}
-
-- (void)dispose
-{
- viewController = nil;
- commandDelegate = nil;
-}
-
-- (UIView *)webView
-{
- if (self.webViewEngine != nil) {
- return self.webViewEngine.engineWebView;
- }
-
- return nil;
-}
-
-/*
-// NOTE: for onPause and onResume, calls into JavaScript must not call or trigger any blocking UI, like alerts
-- (void) onPause {}
-- (void) onResume {}
-- (void) onOrientationWillChange {}
-- (void) onOrientationDidChange {}
-*/
-
-/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */
-- (void)handleOpenURL:(NSNotification *)notification
-{
- // override to handle urls sent to your app
- // register your url schemes in your App-Info.plist
-
- NSURL* url = [notification object];
-
- if ([url isKindOfClass:[NSURL class]]) {
- /* Do your thing! */
- }
-}
-
-/*
- NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts
- */
-- (void)handleOpenURLWithApplicationSourceAndAnnotation:(NSNotification *)notification
-{
-
- // override to handle urls sent to your app
- // register your url schemes in your App-Info.plist
-
- // The notification object is an NSDictionary which contains
- // - url which is a type of NSURL
- // - sourceApplication which is a type of NSString and represents the package
- // id of the app that calls our app
- // - annotation which a type of Property list which can be several different types
- // please see https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/PropertyList.html
-
- NSDictionary* notificationData = [notification object];
-
- if ([notificationData isKindOfClass: NSDictionary.class]){
-
- NSURL* url = notificationData[@"url"];
- NSString* sourceApplication = notificationData[@"sourceApplication"];
- id annotation = notificationData[@"annotation"];
-
- if ([url isKindOfClass:NSURL.class] && [sourceApplication isKindOfClass:NSString.class] && annotation) {
- /* Do your thing! */
- }
- }
-}
-
-
-/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */
-- (void)onAppTerminate
-{
- // override this if you need to do any cleanup on app exit
-}
-
-- (void)onMemoryWarning
-{
- // override to remove caches, etc
-}
-
-- (void)onReset
-{
- // Override to cancel any long-running requests when the WebView navigates or refreshes.
-}
-
-- (void)dealloc
-{
- [[NSNotificationCenter defaultCenter] removeObserver:self]; // this will remove all notifications unless added using addObserverForName:object:queue:usingBlock:
-}
-
-- (id)appDelegate
-{
- return [[UIApplication sharedApplication] delegate];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m
deleted file mode 100644
index d79e8bda7..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPluginResult.h>
-#import "CDVJSON_private.h"
-#import "CDVDebug.h"
-
-// This exists to preserve compatibility with early Swift plugins, who are
-// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
-// values.
-// These constants alias the enum values back to their previous names.
-// TODO: Remove in Cordova iOS 9
-#define SWIFT_ENUM_COMPAT_HACK(enumVal) const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal) = enumVal
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR);
-#undef SWIFT_ENUM_COMPAT_HACK
-
-@interface CDVPluginResult ()
-
-- (instancetype)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage;
-
-@end
-
-@implementation CDVPluginResult
-@synthesize status, message, keepCallback, associatedObject;
-
-static NSArray* org_apache_cordova_CommandStatusMsgs;
-
-id messageFromArrayBuffer(NSData* data)
-{
- return @{
- @"CDVType" : @"ArrayBuffer",
- @"data" :[data base64EncodedStringWithOptions:0]
- };
-}
-
-id massageMessage(id message)
-{
- if ([message isKindOfClass:[NSData class]]) {
- return messageFromArrayBuffer(message);
- }
- return message;
-}
-
-id messageFromMultipart(NSArray* theMessages)
-{
- NSMutableArray* messages = [NSMutableArray arrayWithArray:theMessages];
-
- for (NSUInteger i = 0; i < messages.count; ++i) {
- [messages replaceObjectAtIndex:i withObject:massageMessage([messages objectAtIndex:i])];
- }
-
- return @{
- @"CDVType" : @"MultiPart",
- @"messages" : messages
- };
-}
-
-+ (void)initialize
-{
- org_apache_cordova_CommandStatusMsgs = [[NSArray alloc] initWithObjects:@"No result",
- @"OK",
- @"Class not found",
- @"Illegal access",
- @"Instantiation error",
- @"Malformed url",
- @"IO error",
- @"Invalid action",
- @"JSON error",
- @"Error",
- nil];
-}
-
-- (instancetype)init
-{
- return [self initWithStatus:CDVCommandStatus_NO_RESULT message:nil];
-}
-
-- (instancetype)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage
-{
- self = [super init];
- if (self) {
- status = @(statusOrdinal);
- message = theMessage;
- keepCallback = [NSNumber numberWithBool:NO];
- }
- return self;
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal
-{
- return [[self alloc] initWithStatus:statusOrdinal message:nil];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray *)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInt:theMessage]];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInteger:theMessage]];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithUnsignedInteger:theMessage]];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithDouble:theMessage]];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithBool:theMessage]];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary *)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData *)theMessage
-{
- return [[self alloc] initWithStatus:statusOrdinal message:messageFromArrayBuffer(theMessage)];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray *)theMessages
-{
- return [[self alloc] initWithStatus:statusOrdinal message:messageFromMultipart(theMessages)];
-}
-
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode
-{
- NSDictionary* errDict = @{@"code" :[NSNumber numberWithInt:errorCode]};
-
- return [[self alloc] initWithStatus:statusOrdinal message:errDict];
-}
-
-- (void)setKeepCallbackAsBool:(BOOL)bKeepCallback
-{
- [self setKeepCallback:[NSNumber numberWithBool:bKeepCallback]];
-}
-
-- (NSString*)argumentsAsJSON
-{
- id arguments = (self.message == nil ? [NSNull null] : self.message);
- NSArray* argumentsWrappedInArray = [NSArray arrayWithObject:arguments];
-
- NSString* argumentsJSON = [argumentsWrappedInArray cdv_JSONString];
-
- argumentsJSON = [argumentsJSON substringWithRange:NSMakeRange(1, [argumentsJSON length] - 2)];
-
- return argumentsJSON;
-}
-
-static BOOL gIsVerbose = NO;
-+ (void)setVerbose:(BOOL)verbose
-{
- gIsVerbose = verbose;
-}
-
-+ (BOOL)isVerbose
-{
- return gIsVerbose;
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSceneDelegate.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSceneDelegate.m
deleted file mode 100644
index 7492ca1aa..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSceneDelegate.m
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <Cordova/CDVSceneDelegate.h>
-#import <Cordova/CDVPluginNotifications.h>
-
-@implementation CDVSceneDelegate
-
-- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions
-{
- // If the app was launched from a URL, that should also fire the CDVPluginOpenURLNotification
- [self scene:scene openURLContexts:connectionOptions.URLContexts];
-}
-
-- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts
-{
- for (UIOpenURLContext *context in URLContexts) {
- NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
- [options setValue:context.options.sourceApplication forKey:@"sourceApplication"];
- [options setValue:context.options.annotation forKey:@"annotation"];
- [options setValue:@(context.options.openInPlace) forKey:@"openInPlace"];
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500
- if (@available(iOS 14.5, *)) {
- [options setValue:context.options.eventAttribution forKey:@"eventAttribution"];
- }
-#endif
-
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVPluginHandleOpenURLNotification object:context.URL userInfo:options];
-
- }
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSettingsDictionary.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSettingsDictionary.m
deleted file mode 100644
index 0c9e5059e..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSettingsDictionary.m
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <Cordova/CDVSettingsDictionary.h>
-
-@interface CDVSettingsDictionary () {
- // Ideally this should not be mutable, but we've got legacy API that allows
- // plugins to set values in here, so this is the world we have to live in
- NSMutableDictionary *_dict;
-}
-@end
-
-@implementation CDVSettingsDictionary
-
-- (instancetype)init
-{
- return [self initWithDictionary:@{}];
-}
-
-- (instancetype)initWithDictionary:(NSDictionary *)dict
-{
- self = [super init];
- if (self != nil) {
- if ([dict isKindOfClass:[NSMutableDictionary class]]) {
- _dict = (NSMutableDictionary *)dict;
- } else {
- _dict = [NSMutableDictionary dictionaryWithDictionary:dict];
- }
- }
- return self;
-}
-
-- (instancetype)initWithObjects:(const id _Nonnull [ _Nullable ])objects forKeys:(const id <NSCopying> _Nonnull [ _Nullable ])keys count:(NSUInteger)cnt
-{
- self = [self init];
- if (self != nil) {
- _dict = [NSMutableDictionary dictionaryWithObjects:objects forKeys:keys count:cnt];
- }
- return self;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)coder
-{
- NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCoder:coder];
-
- if (dict != nil) {
- self = [self initWithDictionary:dict];
- } else {
- self = [self initWithDictionary:@{}];
- }
- return self;
-}
-
-+ (BOOL)supportsSecureCoding
-{
- return YES;
-}
-
-- (Class)classForCoder
-{
- return [self class];
-}
-
-- (id)forwardingTargetForSelector:(SEL)selector
-{
- return _dict;
-}
-
-- (NSUInteger)count
-{
- return _dict.count;
-}
-
-- (id)objectForKey:(NSString *)key
-{
- return [_dict objectForKey:[key lowercaseString]];
-}
-
-- (NSEnumerator *)keyEnumerator
-{
- return [_dict keyEnumerator];
-}
-
-- (id)cordovaSettingForKey:(NSString *)key
-{
- return [self objectForKey:key];
-}
-
-- (BOOL)cordovaBoolSettingForKey:(NSString *)key defaultValue:(BOOL)defaultValue
-{
- BOOL value = defaultValue;
-
- id prefObj = [self objectForKey:key];
- if (prefObj == nil) {
-#ifdef DEBUG
- NSLog(@"The preference key \"%@\" is not defined and will default to \"%@\"", key, (defaultValue ? @"TRUE" : @"FALSE"));
-#endif
- return value;
- }
-
- if ([prefObj isKindOfClass:NSString.class]) {
- prefObj = [prefObj lowercaseString];
-
- if ([prefObj isEqualToString:@"true"] || [prefObj isEqualToString:@"1"] || [prefObj isEqualToString:@"yes"]) {
- return YES;
- } else if ([prefObj isEqualToString:@"false"] || [prefObj isEqualToString:@"0"] || [prefObj isEqualToString:@"no"]) {
- return NO;
- }
- } else if ([prefObj isKindOfClass:NSNumber.class] && ([prefObj isEqual:@YES] || [prefObj isEqual:@NO])) {
- return [prefObj isEqual:@YES];
- }
-
- return value;
-}
-
-- (CGFloat)cordovaFloatSettingForKey:(NSString *)key defaultValue:(CGFloat)defaultValue
-{
- CGFloat value = defaultValue;
-
- id prefObj = [self objectForKey:key];
- if (prefObj != nil) {
- value = [prefObj floatValue];
- }
-
- return value;
-}
-
-- (void)setObject:(id)value forKey:(NSString *)key
-{
- [_dict setObject:value forKey:[key lowercaseString]];
-}
-
-- (void)setObject:(id)value forKeyedSubscript:(NSString *)key
-{
- [_dict setObject:value forKey:[key lowercaseString]];
-}
-
-- (void)setCordovaSetting:(id)value forKey:(NSString *)key
-{
- [self setObject:value forKey:key];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m
deleted file mode 100644
index 1d62f9520..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVTimer.h>
-
-#pragma mark CDVTimerItem
-
-@interface CDVTimerItem : NSObject
-
-@property (nonatomic, strong) NSString* name;
-@property (nonatomic, strong) NSDate* started;
-@property (nonatomic, strong) NSDate* ended;
-
-- (void)log;
-
-@end
-
-@implementation CDVTimerItem
-
-- (void)log
-{
- NSLog(@"[CDVTimer][%@] %fms", self.name, [self.ended timeIntervalSinceDate:self.started] * 1000.0);
-}
-
-@end
-
-#pragma mark CDVTimer
-
-@interface CDVTimer ()
-
-@property (nonatomic, strong) NSMutableDictionary* items;
-
-@end
-
-@implementation CDVTimer
-
-#pragma mark object methods
-
-- (id)init
-{
- if (self = [super init]) {
- self.items = [NSMutableDictionary dictionaryWithCapacity:6];
- }
-
- return self;
-}
-
-- (void)add:(NSString*)name
-{
- if ([self.items objectForKey:[name lowercaseString]] == nil) {
- CDVTimerItem* item = [CDVTimerItem new];
- item.name = name;
- item.started = [NSDate new];
- [self.items setObject:item forKey:[name lowercaseString]];
- } else {
- NSLog(@"Timer called '%@' already exists.", name);
- }
-}
-
-- (void)remove:(NSString*)name
-{
- CDVTimerItem* item = [self.items objectForKey:[name lowercaseString]];
-
- if (item != nil) {
- item.ended = [NSDate new];
- [item log];
- [self.items removeObjectForKey:[name lowercaseString]];
- } else {
- NSLog(@"Timer called '%@' does not exist.", name);
- }
-}
-
-- (void)removeAll
-{
- [self.items removeAllObjects];
-}
-
-#pragma mark class methods
-
-+ (void)start:(NSString*)name
-{
- [[CDVTimer sharedInstance] add:name];
-}
-
-+ (void)stop:(NSString*)name
-{
- [[CDVTimer sharedInstance] remove:name];
-}
-
-+ (void)clearAll
-{
- [[CDVTimer sharedInstance] removeAll];
-}
-
-+ (CDVTimer*)sharedInstance
-{
- static dispatch_once_t pred = 0;
- __strong static CDVTimer* _sharedObject = nil;
-
- dispatch_once(&pred, ^{
- _sharedObject = [[self alloc] init];
- });
-
- return _sharedObject;
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m
deleted file mode 100644
index 886f9b001..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m
+++ /dev/null
@@ -1,895 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <TargetConditionals.h>
-#import <AVFoundation/AVFoundation.h>
-#import <Foundation/Foundation.h>
-#import <WebKit/WebKit.h>
-
-#import <Cordova/CDVAppDelegate.h>
-#import <Cordova/CDVPlugin.h>
-#import "CDVPlugin+Private.h"
-#import <Cordova/CDVConfigParser.h>
-#import <Cordova/CDVSettingsDictionary.h>
-#import <Cordova/CDVTimer.h>
-#import "CDVCommandDelegateImpl.h"
-
-static UIColor *defaultBackgroundColor(void) {
- return UIColor.systemBackgroundColor;
-}
-
-@interface CDVViewController () <CDVWebViewEngineConfigurationDelegate, UIScrollViewDelegate> {
- id <CDVWebViewEngineProtocol> _webViewEngine;
- id <CDVCommandDelegate> _commandDelegate;
- NSMutableDictionary<NSString *, CDVPlugin *> *_pluginObjects;
- NSMutableDictionary<NSString *, NSString *> *_pluginsMap;
- CDVCommandQueue* _commandQueue;
- UIColor *_backgroundColor;
- UIColor *_splashBackgroundColor;
- UIColor *_statusBarBackgroundColor;
- UIColor *_statusBarWebViewColor;
- UIColor *_statusBarDefaultColor;
- CDVSettingsDictionary* _settings;
-}
-
-@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
-@property (nonatomic, readwrite, strong) UIView *launchView;
-@property (nonatomic, readwrite, strong) UIView *statusBar;
-@property (readwrite, assign) BOOL initialized;
-
-@end
-
-@implementation CDVViewController
-
-@synthesize pluginObjects = _pluginObjects;
-@synthesize pluginsMap = _pluginsMap;
-@synthesize commandDelegate = _commandDelegate;
-@synthesize commandQueue = _commandQueue;
-@synthesize webViewEngine = _webViewEngine;
-@synthesize backgroundColor = _backgroundColor;
-@synthesize splashBackgroundColor = _splashBackgroundColor;
-@synthesize statusBarBackgroundColor = _statusBarBackgroundColor;
-@synthesize settings = _settings;
-@dynamic webView;
-@dynamic enumerablePlugins;
-
-#pragma mark - Initializers
-
-- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self != nil) {
- [self _cdv_init];
- }
- return self;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder
-{
- self = [super initWithCoder:aDecoder];
- if (self != nil) {
- [self _cdv_init];
- }
- return self;
-}
-
-- (instancetype)init
-{
- self = [super init];
- if (self != nil) {
- [self _cdv_init];
- }
- return self;
-}
-
-- (void)_cdv_init
-{
- if (!self.initialized) {
- _commandQueue = [[CDVCommandQueue alloc] initWithViewController:self];
- _commandDelegate = [[CDVCommandDelegateImpl alloc] initWithViewController:self];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillTerminate:)
- name:UIApplicationWillTerminateNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillResignActive:)
- name:UIApplicationWillResignActiveNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidBecomeActive:)
- name:UIApplicationDidBecomeActiveNotification object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillEnterForeground:)
- name:UIApplicationWillEnterForegroundNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:)
- name:UIApplicationDidEnterBackgroundNotification object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onWebViewPageDidLoad:)
- name:CDVPageDidLoadNotification object:nil];
-
- // Default property values
- self.configFile = @"config.xml";
- self.webContentFolderName = @"www";
- self.showInitialSplashScreen = YES;
-
- // Initialize the plugin objects dict.
- _pluginObjects = [[NSMutableDictionary alloc] initWithCapacity:20];
-
- // Prevent reinitializing
- self.initialized = YES;
- }
-}
-
-#pragma mark -
-
-- (void)dealloc
-{
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [_commandQueue dispose];
-
- [self.webViewEngine loadHTMLString:@"about:blank" baseURL:nil];
-
- @synchronized(_pluginObjects) {
- [[_pluginObjects allValues] makeObjectsPerformSelector:@selector(dispose)];
- [_pluginObjects removeAllObjects];
- }
-
- [self.webView removeFromSuperview];
- [self.launchView removeFromSuperview];
-
- _webViewEngine = nil;
-}
-
-#pragma mark - Getters & Setters
-
-- (NSArray <CDVPlugin *> *)enumerablePlugins
-{
- @synchronized(_pluginObjects) {
- return [_pluginObjects allValues];
- }
-}
-
-- (NSString *)wwwFolderName
-{
- return self.webContentFolderName;
-}
-
-- (void)setWwwFolderName:(NSString *)name
-{
- self.webContentFolderName = name;
-}
-
-- (void)setBackgroundColor:(UIColor *)color
-{
- _backgroundColor = color ?: defaultBackgroundColor();
-
- [self.webView setBackgroundColor:self.backgroundColor];
-}
-
-- (void)setSplashBackgroundColor:(UIColor *)color
-{
- _splashBackgroundColor = color ?: self.backgroundColor;
-
- [self.launchView setBackgroundColor:self.splashBackgroundColor];
-}
-
-- (UIColor *)statusBarBackgroundColor
-{
- // If a status bar background color has been explicitly set using the JS API, we always use that.
- // Otherwise, if the webview reports a themeColor meta tag (iOS 15.4+) we use that.
- // Otherwise, we use the status bar background color provided in IB (from config.xml).
- // Otherwise, we use the background color.
- return _statusBarBackgroundColor ?: _statusBarWebViewColor ?: _statusBarDefaultColor ?: self.backgroundColor;
-}
-
-- (void)setStatusBarBackgroundColor:(UIColor *)color
-{
- // We want the initial value from IB to set the statusBarDefaultColor and
- // then all future changes to set the statusBarBackgroundColor.
- //
- // The reason for this is that statusBarBackgroundColor is treated like a
- // forced override when it is set, and we don't want that for the initial
- // value from config.xml set via IB.
-
- if (!_statusBarBackgroundColor && !_statusBarWebViewColor && !_statusBarDefaultColor) {
- _statusBarDefaultColor = color;
- } else {
- _statusBarBackgroundColor = color;
- }
-
- [self.statusBar setBackgroundColor:self.statusBarBackgroundColor];
-}
-
-- (void)setStatusBarWebViewColor:(UIColor *)color
-{
- _statusBarWebViewColor = color;
-
- [self.statusBar setBackgroundColor:self.statusBarBackgroundColor];
-}
-
-// Only for testing
-- (void)setSettings:(CDVSettingsDictionary *)settings
-{
- _settings = settings;
-}
-
-- (nullable NSURL *)configFilePath
-{
- NSString* path = self.configFile;
-
- // if path is relative, resolve it against the main bundle
- if (![path isAbsolutePath]) {
- NSString* absolutePath = [[NSBundle mainBundle] pathForResource:path ofType:nil];
- if(!absolutePath){
- NSAssert(NO, @"ERROR: %@ not found in the main bundle!", path);
- }
- path = absolutePath;
- }
-
- // Assert file exists
- if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
- NSAssert(NO, @"ERROR: %@ does not exist.", path);
- return nil;
- }
-
- return [NSURL fileURLWithPath:path];
-}
-
-- (NSURL *)appUrl
-{
- NSURL* appURL = nil;
-
- if ([self.startPage rangeOfString:@"://"].location != NSNotFound) {
- appURL = [NSURL URLWithString:self.startPage];
- } else if ([self.webContentFolderName rangeOfString:@"://"].location != NSNotFound) {
- appURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.webContentFolderName, self.startPage]];
- } else if([self.webContentFolderName rangeOfString:@".bundle"].location != NSNotFound){
- // www folder is actually a bundle
- NSBundle* bundle = [NSBundle bundleWithPath:self.webContentFolderName];
- appURL = [bundle URLForResource:self.startPage withExtension:nil];
- } else if([self.webContentFolderName rangeOfString:@".framework"].location != NSNotFound){
- // www folder is actually a framework
- NSBundle* bundle = [NSBundle bundleWithPath:self.webContentFolderName];
- appURL = [bundle URLForResource:self.startPage withExtension:nil];
- } else {
- // CB-3005 strip parameters from start page to check if page exists in resources
- NSURL* startURL = [NSURL URLWithString:self.startPage];
- NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
-
- if (startFilePath == nil) {
- appURL = nil;
- } else {
- appURL = [NSURL fileURLWithPath:startFilePath];
- // CB-3005 Add on the query params or fragment.
- NSString* startPageNoParentDirs = self.startPage;
- NSRange r = [startPageNoParentDirs rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"?#"] options:0];
- if (r.location != NSNotFound) {
- NSString* queryAndOrFragment = [self.startPage substringFromIndex:r.location];
- appURL = [NSURL URLWithString:queryAndOrFragment relativeToURL:appURL];
- }
- }
- }
-
- return appURL;
-}
-
-- (nullable NSURL *)errorURL
-{
- NSString *setting = [self.settings cordovaSettingForKey:@"ErrorUrl"];
- if (setting == nil) {
- return nil;
- }
-
- if ([setting rangeOfString:@"://"].location != NSNotFound) {
- return [NSURL URLWithString:setting];
- } else {
- NSURL *url = [NSURL URLWithString:setting];
- NSString *errorFilePath = [self.commandDelegate pathForResource:[url path]];
- if (errorFilePath) {
- return [NSURL fileURLWithPath:errorFilePath];
- }
- }
-
- return nil;
-}
-
-- (nullable UIView *)webView
-{
- if (_webViewEngine != nil) {
- return _webViewEngine.engineWebView;
- }
-
- return nil;
-}
-
-- (nullable NSString *)appURLScheme
-{
- NSString* URLScheme = nil;
-
- NSArray* URLTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"];
-
- if (URLTypes != nil) {
- NSDictionary* dict = [URLTypes objectAtIndex:0];
- if (dict != nil) {
- NSArray* URLSchemes = [dict objectForKey:@"CFBundleURLSchemes"];
- if (URLSchemes != nil) {
- URLScheme = [URLSchemes objectAtIndex:0];
- }
- }
- }
-
- return URLScheme;
-}
-
-#pragma mark - UIViewController & App Lifecycle
-
-// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
-- (void)viewDidLoad
-{
- [super viewDidLoad];
-
- // TODO: Remove in Cordova iOS 9
- if ([UIApplication.sharedApplication.delegate isKindOfClass:[CDVAppDelegate class]]) {
- CDVAppDelegate *appDelegate = (CDVAppDelegate *)UIApplication.sharedApplication.delegate;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- if (appDelegate.viewController == nil) {
- appDelegate.viewController = self;
- }
-#pragma clang diagnostic pop
- }
-
- // Load settings
- [self loadSettings];
-
- // Instantiate the Launch screen
- if (!self.launchView) {
- [self createLaunchView];
- }
-
- // Instantiate the WebView
- if (!self.webView) {
- [self createGapView];
- }
-
- // Instantiate the status bar
- if (!self.statusBar) {
- [self createStatusBarView];
- }
-
- // /////////////////
-
- if ([self.startupPluginNames count] > 0) {
- [CDVTimer start:@"TotalPluginStartup"];
-
- for (NSString* pluginName in self.startupPluginNames) {
- [CDVTimer start:pluginName];
- [self getCommandInstance:pluginName];
- [CDVTimer stop:pluginName];
- }
-
- [CDVTimer stop:@"TotalPluginStartup"];
- }
-
- [self loadStartPage];
-
- [self.webView setBackgroundColor:self.backgroundColor];
- [self.launchView setBackgroundColor:self.splashBackgroundColor];
- [self.statusBar setBackgroundColor:self.statusBarBackgroundColor];
-
- if (self.showInitialSplashScreen) {
- [self.launchView setAlpha:1];
- }
-}
-
--(void)viewWillAppear:(BOOL)animated
-{
- [super viewWillAppear:animated];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillAppearNotification object:nil]];
-}
-
--(void)viewDidAppear:(BOOL)animated
-{
- [super viewDidAppear:animated];
-
-#if TARGET_OS_MACCATALYST
- BOOL hideTitlebar = [self.settings cordovaBoolSettingForKey:@"HideDesktopTitlebar" defaultValue:NO];
- if (hideTitlebar) {
- UIWindowScene *scene = self.view.window.windowScene;
- if (scene) {
- scene.titlebar.titleVisibility = UITitlebarTitleVisibilityHidden;
- scene.titlebar.toolbar = nil;
- }
- } else {
- // We need to fix the web content going behind the title bar
- self.webView.translatesAutoresizingMaskIntoConstraints = NO;
- [self.webView.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor].active = YES;
- [self.webView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor].active = YES;
- [self.webView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor].active = YES;
- [self.webView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor].active = YES;
-
- if ([self.webView respondsToSelector:@selector(scrollView)]) {
- UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
- scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
- }
- }
-#endif
-
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidAppearNotification object:nil]];
-}
-
--(void)viewWillDisappear:(BOOL)animated
-{
- [super viewWillDisappear:animated];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillDisappearNotification object:nil]];
-}
-
--(void)viewDidDisappear:(BOOL)animated
-{
- [super viewDidDisappear:animated];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidDisappearNotification object:nil]];
-}
-
--(void)viewWillLayoutSubviews
-{
- [super viewWillLayoutSubviews];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillLayoutSubviewsNotification object:nil]];
-}
-
--(void)viewDidLayoutSubviews
-{
- [super viewDidLayoutSubviews];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidLayoutSubviewsNotification object:nil]];
-}
-
--(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator
-{
- [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillTransitionToSizeNotification object:[NSValue valueWithCGSize:size]]];
-}
-
-/*
- This method lets your application know that it is about to be terminated and purged from memory entirely
- */
-- (void)onAppWillTerminate:(NSNotification *)notification
-{
- // empty the tmp directory
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- NSError* __autoreleasing err = nil;
-
- // clear contents of NSTemporaryDirectory
- NSString* tempDirectoryPath = NSTemporaryDirectory();
- NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];
- NSString* fileName = nil;
- BOOL result;
-
- while ((fileName = [directoryEnumerator nextObject])) {
- NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
- result = [fileMgr removeItemAtPath:filePath error:&err];
- if (!result && err) {
- NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
- }
- }
-}
-
-/*
- This method is called to let your application know that it is about to move from the active to inactive state.
- You should use this method to pause ongoing tasks, disable timer, ...
- */
-- (void)onAppWillResignActive:(NSNotification *)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationWillResignActive");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resign');" scheduledOnRunLoop:NO];
-}
-
-/*
- In iOS 4.0 and later, this method is called instead of the applicationWillTerminate: method
- when the user quits an application that supports background execution.
- */
-- (void)onAppDidEnterBackground:(NSNotification *)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationDidEnterBackground");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('pause', null, true);" scheduledOnRunLoop:NO];
-}
-
-/*
- In iOS 4.0 and later, this method is called as part of the transition from the background to the inactive state.
- You can use this method to undo many of the changes you made to your application upon entering the background.
- invariably followed by applicationDidBecomeActive
- */
-- (void)onAppWillEnterForeground:(NSNotification *)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationWillEnterForeground");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resume');"];
-}
-
-// This method is called to let your application know that it moved from the inactive to active state.
-- (void)onAppDidBecomeActive:(NSNotification *)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationDidBecomeActive");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('active');"];
-}
-
-- (void)didReceiveMemoryWarning
-{
- BOOL doPurge = YES;
-
- // iterate through all the plugin objects, and call hasPendingOperation
- // if at least one has a pending operation, we don't call [super didReceiveMemoryWarning]
- for (CDVPlugin *plugin in self.enumerablePlugins) {
- if (plugin.hasPendingOperation) {
- NSLog(@"Plugin '%@' has a pending operation, memory purge is delayed for didReceiveMemoryWarning.", NSStringFromClass([plugin class]));
- doPurge = NO;
- }
- }
-
- if (doPurge) {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- }
-
- // Release any cached data, images, etc. that aren't in use.
-}
-
-/**
- Show the webview and fade out the intermediary view
- This is to prevent the flashing of the mainViewController
- */
-- (void)onWebViewPageDidLoad:(NSNotification*)notification
-{
- self.webView.hidden = NO;
-
- if ([self.webView respondsToSelector:@selector(scrollView)]) {
- UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
- [self scrollViewDidChangeAdjustedContentInset:scrollView];
- }
-
- if ([self.settings cordovaBoolSettingForKey:@"AutoHideSplashScreen" defaultValue:YES]) {
- CGFloat splashScreenDelaySetting = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
-
- if (splashScreenDelaySetting == 0) {
- [self showSplashScreen:NO];
- } else {
- // Divide by 1000 because config returns milliseconds and NSTimer takes seconds
- CGFloat splashScreenDelay = splashScreenDelaySetting / 1000;
-
- [NSTimer scheduledTimerWithTimeInterval:splashScreenDelay repeats:NO block:^(NSTimer * _Nonnull timer) {
- [self showSplashScreen:NO];
- }];
- }
- }
-}
-
-- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView
-{
- if (self.webView.hidden) {
- self.statusBar.hidden = true;
- return;
- }
-
- self.statusBar.hidden = (scrollView.contentInsetAdjustmentBehavior == UIScrollViewContentInsetAdjustmentNever);
-}
-
-- (BOOL)prefersStatusBarHidden
-{
- // The CDVStatusBar plugin overrides this in a category extension, and
- // should bypass this implementation entirely
- return self.statusBar.alpha < 0.0001f;
-}
-
-#pragma mark - View Setup
-
-- (void)loadSettings
-{
- CDVConfigParser *parser = [CDVConfigParser parseConfigFile:self.configFilePath];
-
- // Get the plugin dictionary, allowList and settings from the delegate.
- _pluginsMap = parser.pluginsDict;
- self.startupPluginNames = parser.startupPluginNames;
- self.settings = [[CDVSettingsDictionary alloc] initWithDictionary:parser.settings];
-
- // And the start page
- if(parser.startPage && self.startPage == nil){
- self.startPage = parser.startPage;
- }
- if (self.startPage == nil) {
- self.startPage = @"index.html";
- }
-
- self.appScheme = [self.settings cordovaSettingForKey:@"Scheme"] ?: @"app";
-}
-
-/// Retrieves the view from a newwly initialized webViewEngine
-/// @param bounds The bounds with which the webViewEngine will be initialized
-- (nonnull UIView*)newCordovaViewWithFrame:(CGRect)bounds
-{
- NSString* defaultWebViewEngineClassName = [self.settings cordovaSettingForKey:@"CordovaDefaultWebViewEngine"];
- NSString* webViewEngineClassName = [self.settings cordovaSettingForKey:@"CordovaWebViewEngine"];
-
- if (!defaultWebViewEngineClassName) {
- defaultWebViewEngineClassName = @"CDVWebViewEngine";
- }
- if (!webViewEngineClassName) {
- webViewEngineClassName = defaultWebViewEngineClassName;
- }
-
- // Determine if a provided custom web view engine is sufficient
- id <CDVWebViewEngineProtocol> engine;
- Class customWebViewEngineClass = NSClassFromString(webViewEngineClassName);
- if (customWebViewEngineClass) {
- id customWebViewEngine = [self initWebViewEngine:customWebViewEngineClass bounds:bounds];
- BOOL customConformsToProtocol = [customWebViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)];
- BOOL customCanLoad = [customWebViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]];
- if (customConformsToProtocol && customCanLoad) {
- engine = customWebViewEngine;
- }
- }
-
- // Otherwise use the default web view engine
- if (!engine) {
- Class defaultWebViewEngineClass = NSClassFromString(defaultWebViewEngineClassName);
- id defaultWebViewEngine = [self initWebViewEngine:defaultWebViewEngineClass bounds:bounds];
- NSAssert([defaultWebViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)],
- @"we expected the default web view engine to conform to the CDVWebViewEngineProtocol");
- engine = defaultWebViewEngine;
- }
-
- if ([engine isKindOfClass:[CDVPlugin class]]) {
- [self registerPlugin:(CDVPlugin*)engine withClassName:webViewEngineClassName];
- }
-
- _webViewEngine = engine;
- return _webViewEngine.engineWebView;
-}
-
-/// Initialiizes the webViewEngine, with config, if supported and provided
-/// @param engineClass A class that must conform to the `CDVWebViewEngineProtocol`
-/// @param bounds with which the webview will be initialized
-- (id _Nullable) initWebViewEngine:(nonnull Class)engineClass bounds:(CGRect)bounds {
- WKWebViewConfiguration *config = [self respondsToSelector:@selector(configuration)] ? [self configuration] : nil;
- if (config && [engineClass instancesRespondToSelector:@selector(initWithFrame:configuration:)]) {
- return [[engineClass alloc] initWithFrame:bounds configuration:config];
- } else {
- return [[engineClass alloc] initWithFrame:bounds];
- }
-}
-
-- (void)createLaunchView
-{
- CGRect webViewBounds = self.view.bounds;
- webViewBounds.origin = self.view.bounds.origin;
-
- UIView* view = [[UIView alloc] initWithFrame:webViewBounds];
- view.translatesAutoresizingMaskIntoConstraints = NO;
- [view setAlpha:0];
-
- NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
- if (launchStoryboardName != nil) {
- UIStoryboard* storyboard = [UIStoryboard storyboardWithName:launchStoryboardName bundle:[NSBundle mainBundle]];
- UIViewController* vc = [storyboard instantiateInitialViewController];
- [self addChildViewController:vc];
-
- UIView* imgView = vc.view;
- imgView.translatesAutoresizingMaskIntoConstraints = NO;
- [view addSubview:imgView];
-
- [NSLayoutConstraint activateConstraints:@[
- [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeWidth multiplier:1 constant:0],
- [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeHeight multiplier:1 constant:0],
- [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterY multiplier:1 constant:0],
- [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]
- ]];
- }
-
- self.launchView = view;
- [self.view addSubview:view];
-
- [NSLayoutConstraint activateConstraints:@[
- [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeWidth multiplier:1 constant:0],
- [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeHeight multiplier:1 constant:0],
- [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1 constant:0],
- [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]
- ]];
-}
-
-- (void)createGapView
-{
- CGRect webViewBounds = self.view.bounds;
- webViewBounds.origin = self.view.bounds.origin;
-
- UIView* view = [self newCordovaViewWithFrame:webViewBounds];
- view.hidden = YES;
- view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
-
- [self.view addSubview:view];
- [self.view sendSubviewToBack:view];
-
- if ([self.webView respondsToSelector:@selector(scrollView)]) {
- UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
- scrollView.delegate = self;
- }
-}
-
-- (void)createStatusBarView
-{
- // If cordova-plugin-statusbar is loaded, we'll let it handle the status
- // bar to avoid introducing conflict
- if (NSClassFromString(@"CDVStatusBar") != nil)
- return;
-
- self.statusBar = [[UIView alloc] init];
- self.statusBar.translatesAutoresizingMaskIntoConstraints = NO;
-
- [self.view addSubview:self.statusBar];
-
- [self.statusBar.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor].active = YES;
- [self.statusBar.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor].active = YES;
- [self.statusBar.topAnchor constraintEqualToAnchor:self.view.topAnchor].active = YES;
- [self.statusBar.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor].active = YES;
-
- self.statusBar.hidden = YES;
-}
-
-- (void)loadStartPage
-{
- NSURL *appURL = [self appUrl];
-
- if (appURL) {
- NSURLRequest *appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
- [_webViewEngine loadRequest:appReq];
- } else {
- NSString *loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.webContentFolderName, self.startPage];
- NSLog(@"%@", loadErr);
-
- NSURL *errorUrl = [self errorURL];
- if (errorUrl) {
- errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
- NSLog(@"%@", [errorUrl absoluteString]);
- [_webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]];
- } else {
- NSString *html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
- [_webViewEngine loadHTMLString:html baseURL:nil];
- }
- }
-}
-
-#pragma mark CordovaCommands
-
-- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
-{
- plugin.viewController = self;
- plugin.commandDelegate = _commandDelegate;
-
- @synchronized(_pluginObjects) {
- [_pluginObjects setObject:plugin forKey:className];
- }
- [plugin pluginInitialize];
-}
-
-- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName
-{
- plugin.viewController = self;
- plugin.commandDelegate = _commandDelegate;
-
- NSString* className = NSStringFromClass([plugin class]);
-
- @synchronized(_pluginObjects) {
- [_pluginObjects setObject:plugin forKey:className];
- }
- [_pluginsMap setValue:className forKey:[pluginName lowercaseString]];
- [plugin pluginInitialize];
-}
-
-/**
- Returns an instance of a CordovaCommand object, based on its name. If one exists already, it is returned.
- */
-- (nullable CDVPlugin *)getCommandInstance:(NSString *)pluginName
-{
- // first, we try to find the pluginName in the pluginsMap
- // (acts as a allowList as well) if it does not exist, we return nil
- // NOTE: plugin names are matched as lowercase to avoid problems - however, a
- // possible issue is there can be duplicates possible if you had:
- // "org.apache.cordova.Foo" and "org.apache.cordova.foo" - only the lower-cased entry will match
- NSString* className = [_pluginsMap objectForKey:[pluginName lowercaseString]];
-
- if (className == nil) {
- return nil;
- }
-
- id obj = nil;
- @synchronized(_pluginObjects) {
- obj = [_pluginObjects objectForKey:className];
- }
-
- if (!obj) {
- obj = [[NSClassFromString(className) alloc] initWithWebViewEngine:_webViewEngine];
- if (!obj) {
- NSString* fullClassName = [NSString stringWithFormat:@"%@.%@",
- NSBundle.mainBundle.infoDictionary[@"CFBundleExecutable"],
- className];
- obj = [[NSClassFromString(fullClassName)alloc] initWithWebViewEngine:_webViewEngine];
- }
-
- if (obj != nil) {
- [self registerPlugin:obj withClassName:className];
- } else {
- NSLog(@"CDVPlugin class %@ (pluginName: %@) does not exist.", className, pluginName);
- }
- }
- return obj;
-}
-
-#pragma mark -
-
-- (bool)isUrlEmpty:(NSURL *)url
-{
- if (!url || (url == (id) [NSNull null])) {
- return true;
- }
- NSString *urlAsString = [url absoluteString];
- return (urlAsString == (id) [NSNull null] || [urlAsString length]==0 || [urlAsString isEqualToString:@"about:blank"]);
-}
-
-- (bool)checkAndReinitViewUrl
-{
- NSURL* appURL = [self appUrl];
- if ([self isUrlEmpty: [_webViewEngine URL]] && ![self isUrlEmpty: appURL]) {
- [self loadStartPage];
- return true;
- }
- return false;
-}
-
-#pragma mark - API Methods for Plugins
-
-- (void)showLaunchScreen:(BOOL)visible
-{
- [self showSplashScreen:visible];
-}
-
-- (void)showSplashScreen:(BOOL)visible
-{
- CGFloat fadeSplashScreenDuration = [self.settings cordovaFloatSettingForKey:@"FadeSplashScreenDuration" defaultValue:250.f];
-
- // Setting minimum value for fade to 0.25 seconds
- fadeSplashScreenDuration = fadeSplashScreenDuration < 250 ? 250 : fadeSplashScreenDuration;
-
- // AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
- CGFloat fadeDuration = fadeSplashScreenDuration/1000;
-
- [UIView animateWithDuration:fadeDuration animations:^{
- [self.launchView setAlpha:(visible ? 1 : 0)];
-
- if (!visible) {
- [self.webView becomeFirstResponder];
- }
- }];
-}
-
-- (void)showStatusBar:(BOOL)visible
-{
- [self.statusBar setAlpha:(visible ? 1 : 0)];
- [self setNeedsStatusBarAppearanceUpdate];
-}
-
-- (void)parseSettingsWithParser:(id <NSXMLParserDelegate>)delegate
-{
- [CDVConfigParser parseConfigFile:self.configFilePath withDelegate:delegate];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
deleted file mode 100644
index b4107e64f..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <WebKit/WebKit.h>
-#import <Cordova/CDVWebViewProcessPoolFactory.h>
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#pragma clang diagnostic ignored "-Wdeprecated-implementations"
-
-static CDVWebViewProcessPoolFactory *factory = nil;
-
-@implementation CDVWebViewProcessPoolFactory
-
-+ (instancetype)sharedFactory
-{
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- factory = [[CDVWebViewProcessPoolFactory alloc] init];
- });
-
- return factory;
-}
-
-- (instancetype)init
-{
- if (self = [super init]) {
- _sharedPool = [[WKProcessPool alloc] init];
- }
- return self;
-}
-
-- (WKProcessPool*) sharedProcessPool {
- return _sharedPool;
-}
-@end
-
-#pragma clang diagnostic pop
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
deleted file mode 100644
index c508e8417..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#define __CORDOVA_SILENCE_HEADER_DEPRECATIONS
-#import <Cordova/NSDictionary+CordovaPreferences.h>
-#undef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
-
-@implementation NSDictionary (CordovaPreferences)
-
-- (id)cordovaSettingForKey:(NSString*)key
-{
- return [self objectForKey:[key lowercaseString]];
-}
-
-- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue
-{
- BOOL value = defaultValue;
- id prefObj = [self cordovaSettingForKey:key];
-
- if (prefObj == nil) {
- NSLog(@"The preference key \"%@\" is not defined and will default to \"%@\"",
- key,
- (defaultValue ? @"TRUE" : @"FALSE"));
-
- return value;
- }
-
- if ([prefObj isKindOfClass:NSString.class]) {
- prefObj = [prefObj lowercaseString];
-
- if (
- // True Case
- [prefObj isEqualToString:@"true"] ||
- [prefObj isEqualToString:@"1"] ||
- // False Case
- [prefObj isEqualToString:@"false"] ||
- [prefObj isEqualToString:@"0"]
- )
- {
- value = [prefObj isEqualToString:@"true"] || [prefObj isEqualToString:@"1"];
- }
- } else if (
- [prefObj isKindOfClass:NSNumber.class] &&
- (
- [prefObj isEqual: @YES] ||
- [prefObj isEqual: @NO]
- )
- )
- {
- value = [prefObj isEqual: @YES];
- }
-
- return value;
-}
-
-- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue
-{
- CGFloat value = defaultValue;
- id prefObj = [self cordovaSettingForKey:key];
-
- if (prefObj != nil) {
- value = [prefObj floatValue];
- }
-
- return value;
-}
-
-@end
-
-@implementation NSMutableDictionary (CordovaPreferences)
-
-- (void)setCordovaSetting:(id)value forKey:(NSString*)key
-{
- [self setObject:value forKey:[key lowercaseString]];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m
deleted file mode 100644
index 65b97a0e7..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/NSMutableArray+QueueAdditions.h>
-
-@implementation NSMutableArray (QueueAdditions)
-
-- (id)cdv_queueHead
-{
- if ([self count] == 0) {
- return nil;
- }
-
- return [self objectAtIndex:0];
-}
-
-- (__autoreleasing id)cdv_dequeue
-{
- if ([self count] == 0) {
- return nil;
- }
-
- id head = [self objectAtIndex:0];
- if (head != nil) {
- // [[head retain] autorelease]; ARC - the __autoreleasing on the return value should so the same thing
- [self removeObjectAtIndex:0];
- }
-
- return head;
-}
-
-- (id)cdv_pop
-{
- return [self cdv_dequeue];
-}
-
-- (void)cdv_enqueue:(id)object
-{
- [self addObject:object];
-}
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/CordovaLib.md b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/CordovaLib.md
deleted file mode 100644
index eaf8a5648..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/CordovaLib.md
+++ /dev/null
@@ -1,83 +0,0 @@
-# ``Cordova``
-<!--
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
--->
-
-Build your app using web technologies
-
-## Overview
-
-For more information about Apache Cordova, visit [https://cordova.apache.org](https://cordova.apache.org).
-
-## Topics
-
-### Using Cordova in your app
-
-- ``CDVAppDelegate``
-- ``CDVSceneDelegate``
-- ``CDVViewController``
-
-### Cordova plugins
-
-- ``CDVPlugin``
-
-### Plugin communication
-
-- ``CDVPluginResult``
-- ``CDVCommandStatus``
-- ``CDVInvokedUrlCommand``
-
-### Plugin Protocols
-
-- ``CDVPluginAuthenticationHandler``
-- ``CDVPluginNavigationHandler``
-- ``CDVPluginSchemeHandler``
-
-### Web View plugins
-
-- ``CDVWebViewEngineProtocol``
-- ``CDVWebViewEngineConfigurationDelegate``
-
-### Utilities
-
-- ``CDVSettingsDictionary``
-- ``CDVCommandDelegate``
-- ``CDVCommandQueue``
-- ``CDVConfigParser``
-- ``CDVTimer``
-
-### Upgrade Guides
-- <doc:upgrading-8>
-
-### Deprecated
-
-- ``IsAtLeastiOSVersion``
-- ``CDVScreenOrientationDelegate``
-- ``CDVWebViewProcessPoolFactory``
-- ``CDVCommandStatus_NO_RESULT`` <!-- Swift alias -->
-- ``CDVCommandStatus_OK`` <!-- Swift alias -->
-- ``CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION`` <!-- Swift alias -->
-- ``CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION`` <!-- Swift alias -->
-- ``CDVCommandStatus_INSTANTIATION_EXCEPTION`` <!-- Swift alias -->
-- ``CDVCommandStatus_MALFORMED_URL_EXCEPTION`` <!-- Swift alias -->
-- ``CDVCommandStatus_IO_EXCEPTION`` <!-- Swift alias -->
-- ``CDVCommandStatus_INVALID_ACTION`` <!-- Swift alias -->
-- ``CDVCommandStatus_JSON_EXCEPTION`` <!-- Swift alias -->
-- ``CDVCommandStatus_ERROR`` <!-- Swift alias -->
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/upgrading-8.md b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/upgrading-8.md
deleted file mode 100644
index a17529054..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/upgrading-8.md
+++ /dev/null
@@ -1,349 +0,0 @@
-# Upgrading Plugins to Cordova iOS 8.x
-<!--
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
--->
-
-A guide for plugin authors to understand the API changes in Cordova iOS 8.
-
-Cordova iOS 8 introduces some significant changes to the exposed API for plugin authors and framework consumers. Many of these changes have been made to better align the framework with modern iOS development practices, such as adopting the `UIScene` APIs and fixing conflicts with SwiftUI projects, as well as work to improve the API experience for apps that consume Cordova as a framework (sometimes called the "platform centric workflow"). In all cases, great care has been taken to try to minimize the risk of breakage to existing 3rd party plugins.
-
-Many plugins will notice new deprecation warnings when built against Cordova iOS 8, rather than outright breaking changes. This document aims to explain the changes, the rationale behind the changes, and offer sample code for plugin authors to ensure their plugin code is compatible with future versions of Cordova iOS.
-
-In cases where different behavior is required for different Cordova versions, the ``CORDOVA_VERSION_MIN_REQUIRED`` macro can be used in Objective-C code to test the current Cordova version:
-
-```objc
-#if defined(__CORDOVA_8_0_0) && CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_8_0_0
- // Code for Cordova iOS 8 goes here
-#else
- // Code for older versions goes here
-#endif
-```
-
-## Major Breaking Changes
-### Minimum iOS version update
-The Cordova iOS framework has increased the minimum supported iOS version from 11.0 to 13.0.
-
-The minimum supported Xcode version for the Cordova tooling and generated template app is now Xcode 15.
-
-### Change to the generated app project naming
-
-The generated app template is now consistently named "App", including "App.xcodeproj", and "App.xcworkspace". The Xcode build target for the app is also named "App". If you are expecting the name of the Xcode project or target to match the name specified in config.xml, it will now fail to find the project.
-
-Use the cordova-ios nodeJS API to retrieve the Xcode project path and other project details:
-
-```js
-// Old code
-const projectRoot = context.opts.projectRoot;
-const platformPath = path.join(projectRoot, 'platforms', 'ios');
-
-const config = getConfigParser(context, path.join(projectRoot, 'config.xml'));
-const projectName = config.name();
-
-const pbxprojPath = path.join(platformPath, `${projectName}.xcodeproj`, 'project.pbxproj');
-const xcodeProject = xcode.project(pbxprojPath);
-```
-
-```js
-// New code
-const projectRoot = context.opts.projectRoot;
-const platformPath = path.join(projectRoot, 'platforms', 'ios');
-
-const cordova_ios = require('cordova-ios');
-const iosProject = new cordova_ios('ios', platformPath);
-
-const xcodeProject = xcode.project(iosProject.locations.pbxproj);
-```
-
-This updated pattern is backwards compatible with existing versions of Cordova iOS 5.0.0 and newer.
-
-Moving to a consistent name for the Xcode project and target resolves a number of issues around dynamic file lookups, Xcode projects with multiple targets, and Unicode compatibility with other tools such as CocoaPods that have issues with non-ASCII project names. Beyond fixing those issues, it was never actually safe to use the `name` from config.xml directly, because even in previous versions of Cordova iOS the project name could be normalized to remove Unicode characters.
-
-Using the cordova-ios JavaScript API ensures that plugins and the Cordova tooling treat projects the same way. The `locations` object contains properties for several useful paths:
-
-* `root` - The platform root directory
-* `www` - The platform's generated web content folder
-* `pbxproj` - The Xcode project file (the project.pbxproj file)
-* `xcodeProjDir` - The Xcode project path (the .xcodeproj directory)
-* `xcodeCordovaProj` - The platform folder containing the Cordova iOS app code
-
-You can find the app's Info.plist file in a backwards-compatible way by doing something like this:
-
-```javascript
-const projName = path.basename(iosProject.locations.xcodeCordovaProj);
-const infoPlistPath = path.join(iosProject.locations.xcodeCordovaProj, `${projName}-Info.plist`);
-```
-
-### CDVAppDelegate window deprecation
-
-The generated app template now uses the iOS scene API (using `UISceneDelegate`) to support multiple windows, which means that it's no longer a safe assumption that an app has only a single window.
-
-The ``CDVAppDelegate/window`` property of ``CDVAppDelegate`` is deprecated as a result. This property will always have a `nil` value.
-
-In a plugin class, you should retrieve the `UIWindow` for the current view controller:
-
-```objc
-// Old code
-CDVAppDelegate *delegate = (CDVAppDelegate *)[[UIApplication sharedApplication] delegate];
-UIWindow *currentWindow = delegate.window;
-```
-
-```objc
-// New code
-UIWindow *currentWindow = self.viewController.view.window;
-```
-
-There may be other cases where things that previously assumed a single window (such as `UIScreen` bounds) require updating to support iOS scenes.
-
-### CDVAppDelegate viewController deprecation
-
-The ``CDVAppDelegate/viewController`` property of ``CDVAppDelegate`` is deprecated, and may return `nil` if a `CDVViewController` has not yet been initialized.
-
-Plugins should prefer accessing the view controller using their ``CDVPlugin/viewController`` property (which is now typed as ``CDVViewController``).
-
-### UIView scrollView property deprecation
-
-The `scrollView` property added as a global category extension to `UIView` by Cordova is now deprecated in Objective C code and **removed entirely in Swift code**. This is to prevent conflicts with other Swift classes that extend `UIView` and have their own `scrollView` properties. You can read more about the scrollView property in the Cordova discussion [Cordova iOS 8.x Upgrade Guide: UIView scrollView property deprecation](https://github.com/apache/cordova/discussions/565#discussioncomment-14621123).
-
-You can still access the `scrollView` property of the web view by dynamically invoking the method:
-
-```objc
-// Old code
-UIScrollView *scrollView = self.webView.scrollView;
-```
-
-```objc
-// New code (Objective-C)
-if ([self.webView respondsToSelector:@selector(scrollView)]) {
- UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
-}
-```
-
-```swift
-// New code (Swift)
-var scroller : UIScrollView?
-let scrollViewSelector = NSSelectorFromString("scrollView")
-
-if webView.responds(to: scrollViewSelector) {
- scroller = webView.perform(scrollViewSelector)?.takeUnretainedValue() as? UIScrollView
-}
-```
-
-This updated code is compatible with existing versions of Cordova iOS.
-
-### Precompiled prefix header removal
-
-Previously, Cordova projects included a precompiled prefix header that automatically imported the `Foundation` and `UIKit` frameworks. This made these frameworks available globally, without requiring explicit imports in each Objective-C file.
-
-While this may have offered convenience, it also introduced an implicit dependency on the Cordova-managed prefix header and prefix headers have gradually been replaced with module imports in Objective-C and were never supported in Swift.
-
-To align with Xcode defaults and improve long-term maintainability, the precompiled prefix header has been removed from generated Cordova app projects. While this may be a breaking change for some plugins, developers are now expected to explicitly declare the frameworks their code depends on by adding the appropriate import statements directly in their source files.
-
-```objc
-// New code (Objective-C)
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-```
-
-```swift
-// New code (Swift)
-import Foundation
-import UIKit
-```
-
-### `CDVPluginResult` Swift optionality
-
-The `CDVPluginResult` constructors have been annotated as returning a non-null object, which means the constructor in Swift no longer returns an optional value that needs to be unwrapped. However, this means that attempts to unwrap the value will now be errors.
-
-In most cases, you shouldn't need to worry about the optionality of the result before passing it to `commandDelegate.send` but if you are setting other options then you might need to explicitly store as an optional for backwards compatibility:
-
-```swift
-// Old code (Swift)
-let result = CDVPluginResult(status: .ok, messageAs: "some value")!
-result.setKeepCallbackAs(true)
-self.commandDelegate.send(result, callbackId: callback)
-```
-
-```swift
-// New code (Swift)
-let result: CDVPluginResult? = CDVPluginResult(status: .ok, messageAs: "some value")
-result?.setKeepCallbackAs(true)
-self.commandDelegate.send(result, callbackId: callback)
-```
-
-## Other Major Changes
-### Deprecating AppDelegate category extensions
-
-Please extend the ``CDVAppDelegate`` base class instead:
-
-```objc
-// Old code
-#import "AppDelegate.h"
-
-@interface AppDelegate (myplugin)
- // Added extension methods here
-@end
-```
-
-```objc
-// New code
-#import <Cordova/CDVAppDelegate.h>
-
-@interface CDVAppDelegate (myplugin)
- // Added extension methods here
-@end
-```
-
-It was never a completely safe assumption that an app using Cordova would include a class named `AppDelegate` that was a subclass of `CDVAppDelegate` due to the ability to embed CordovaLib in an existing iOS app project as a library. If your plugin needs to add behaviour to the app delegate, it should do so to the ``CDVAppDelegate`` base class.
-
-The updated code is backwards compatible with several existing Cordova iOS versions.
-
-### Deprecating MainViewController category extensions
-
-Please extend the ``CDVViewController`` base class instead:
-
-```objc
-// Old code
-#import "MainViewController.h"
-
-@interface MainViewController (myplugin)
- // Added extension methods here
-@end
-```
-
-```objc
-// New code
-#import <Cordova/CDVViewController.h>
-
-@interface CDVViewController (myplugin)
- // Added extension methods here
-@end
-```
-
-It was never a completely safe assumption that an app using Cordova would include a class named `MainViewController` that was a subclass of `CDVViewController` due to the ability to embed CordovaLib in an existing iOS app project as a library. If your plugin needs to add behaviour to the Cordova view controller, it should do so to the ``CDVViewController`` base class.
-
-This updated code is backwards compatible with several existing Cordova iOS versions.
-
-### Deprecating CDVCommandStatus constants in Swift
-
-For plugins written in Swift, the old `CDVCommandStatus_*` constants are deprecated in favour of the enum based aliases:
-
-```swift
-// Old code
-self.commandDelegate.send(CDVPluginResult(status: CDVCommandStatus_OK), callbackId: command.callbackId);
-```
-
-```swift
-// New code
-self.commandDelegate.send(CDVPluginResult(status: .ok), callbackId: command.callbackId);
-```
-
-These aliases were introduced in and are backwards compatible with all existing versions since Cordova iOS 5.0.0. See ``CDVCommandStatus`` for a list of the enum values.
-
-### Deprecating CDVWebViewProcessPoolFactory
-
-Apple has deprecated the `WKProcessPool` API, saying that it has no effect in iOS 15 and newer. As such, the `CDVWebViewProcessPoolFactory` API is marked as deprecated, but still exists to support iOS 13 and 14.
-
-The `CDVWebViewProcessPoolFactory` API was also problematic because it exposed WebKit-specific API types to the public API interface of Cordova, potentially causing issues if those APIs need to change in the future. With this deprecation and eventual removal, Cordova is better insulated from upstream WebView changes.
-
-## Public API Removals
-The following classes were previously exposed as part of the Cordova iOS public API, but were only used as internal implementation details. To better establish the public/private API boundary within Cordova iOS, they have been removed from the public API in Cordova iOS 8.
-
-* `CDVAllowList`
-* `CDVURLSchemeHandler`
-
-The following headers are deprecated due to adding global category extensions to system classes and will be removed in a future version of Cordova iOS:
-
-* `<Cordova/NSDictionary+CordovaPreferences.h>`
- Use the new ``CDVSettingsDictionary`` class, which provides all the same methods.
-
-* `<Cordova/NSMutableArray+QueueAdditions.h>`
- This was only ever intended as an internal implementation detail.
-
-* `<Cordova/CDV.h>`
- Use `<Cordova/Cordova.h>` instead.
-
-## Other Changes
-* ``CDVCommandDelegate``
- * The ``CDVCommandDelegate/urlTransformer`` property is deprecated.
- This property was never used, and does not need to be a required part of the protocol.
-
- * The ``CDVCommandDelegate/settings`` property is now typed as ``CDVSettingsDictionary``.
-
-* ``CDVConfigParser``
- * Added a ``CDVConfigParser/parseConfigFile:`` class method.
-
- * Added a ``CDVConfigParser/parseConfigFile:withDelegate:`` class method.
-
-* ``CDVPlugin``
- * The ``CDVPlugin/viewController`` property is now typed as ``CDVViewController``.
- Previously this was typed as the more generic `UIViewController`.
-
- * Plugin classes that intend to override WebKit scheme handling should implement the ``CDVPluginSchemeHandler`` protocol to ensure compliance with the required methods.
-
- * The ``CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification`` notification is now deprecated.
- The existing ``CDVPluginHandleOpenURLNotification`` notification now includes the source and annotation in its `userInfo` dictionary.
-
-* ``CDVPluginAuthenticationHandler``
- * Newly added protocol for plugins wishing to handle server authentication requests.
-
-* ``CDVPluginNavigationHandler``
- * Newly added protocol for plugins wishing to handle navigation request permitting or denying within the webview.
-
-* ``CDVPluginSchemeHandler``
- * Newly added protocol for plugins wishing to override WebKit scheme handling for web requests.
-
-* ``CDVScreenOrientationDelegate``
- * This protocol is now deprecated and no longer used.
-
-* ``CDVSettingsDictionary``
- * Newly added class to provide `NSDictionary`-like access to config.xml preferences, without relying on global category extensions to `NSDictionary`.
-
-* ``CDVViewController``
- * The ``CDVViewController/settings`` property is now typed as ``CDVSettingsDictionary``.
-
- * The ``CDVViewController/wwwFolderName`` property is deprecated.
- This property has been renamed to ``CDVViewController/webContentFolderName``.
-
- * The ``CDVViewController/appURLScheme`` property is deprecated.
- This property was not used internally by Cordova iOS and should not be used by plugins.
-
- * The ``CDVViewController/pluginsMap`` and ``CDVViewController/pluginObjects`` properties are deprecated.
- These were internal implementation details that should not have been exposed.
-
- * Added an ``CDVViewController/enumerablePlugins`` property that can safely be iterated to loop over all loaded plugins.
-
- * The ``CDVViewController/configParser`` property is deprecated due to not being used.
-
- * The ``CDVViewController/parseSettingsWithParser:`` method is deprecated.
- Use the ``CDVConfigParser/parseConfigFile:withDelegate:`` class method on ``CDVConfigParser`` instead.
-
- * Added a new ``CDVViewController/showInitialSplashScreen`` property.
- This property is inspectable in Interface Builder for embedding apps to indicate if the splash screen should be displayed during web content loading.
-
- * Added a new ``CDVViewController/backgroundColor`` property.
- This property is inspectable in Interface Builder for embedding apps to set the view controller background color.
-
- * Added a new ``CDVViewController/splashBackgroundColor`` property.
- This property is inspectable in Interface Builder for embedding apps to set the splash screen background color.
-
- * The ``CDVViewController/showLaunchScreen:`` method is deprecated.
- This method has been renamed to ``CDVViewController/showSplashScreen:``.
-
- * Added a new ``CDVViewController/loadStartPage`` method to load the initial starting page in the web view, replacing any existing content.
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
deleted file mode 100644
index 47c5a5ca6..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,932 +0,0 @@
-// !$*UTF8*$!
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 54;
- objects = {
-
-/* Begin PBXBuildFile section */
- 28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
- 28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
- 2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
- 2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
- 3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
- 3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
- 4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */; };
- 4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; };
- 4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */; };
- 4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */; };
- 4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */; };
- 4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; };
- 4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
- 4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
- 4F56D82D254A2EB50063F1D6 /* CDVWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */; };
- 4F56D830254A2ED70063F1D6 /* CDVWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */; };
- 4F56D833254A2ED90063F1D6 /* CDVWebViewProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */; };
- 4F56D836254A2EE10063F1D6 /* CDVWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */; };
- 4F56D839254A2EE40063F1D6 /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
- 7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
- 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
- 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
- 7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
- 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
- 7ED95D351AB9029B008C4574 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
- 7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; };
- 7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; };
- 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; };
- 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; };
- 7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; };
- 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; };
- 7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; };
- 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; };
- 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
- 7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
- 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
- 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; };
- 90227B4C2D499A1B005DB74E /* CDVViewController+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */; };
- 90227B4D2D499A1B005DB74E /* CDVViewController+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */; };
- 90227B512D49A042005DB74E /* CDVStatusBarInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */; };
- 90227B522D49A042005DB74E /* CDVStatusBarInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */; };
- 90227B532D49A042005DB74E /* CDVStatusBarInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */; };
- 90227B542D49A042005DB74E /* CDVStatusBarInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */; };
- 902B30742C6C5A7E00C6804C /* CordovaLib.docc in Sources */ = {isa = PBXBuildFile; fileRef = 902B30732C6C5A7E00C6804C /* CordovaLib.docc */; };
- 902B30752C6C5A7E00C6804C /* CordovaLib.docc in Sources */ = {isa = PBXBuildFile; fileRef = 902B30732C6C5A7E00C6804C /* CordovaLib.docc */; };
- 9036843D2C6EB06500A3338C /* CDVAllowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9036843B2C6EB06500A3338C /* CDVAllowList.h */; };
- 9036843E2C6EB06500A3338C /* CDVAllowList.m in Sources */ = {isa = PBXBuildFile; fileRef = 9036843C2C6EB06500A3338C /* CDVAllowList.m */; };
- 9036843F2C6EB06500A3338C /* CDVAllowList.m in Sources */ = {isa = PBXBuildFile; fileRef = 9036843C2C6EB06500A3338C /* CDVAllowList.m */; };
- 903684402C6EB06500A3338C /* CDVAllowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9036843B2C6EB06500A3338C /* CDVAllowList.h */; };
- 9044ED4C2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9044ED4D2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9044ED4F2E67F821003B58ED /* CDVSceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */; };
- 9044ED502E67F821003B58ED /* CDVSceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */; };
- 9044ED532E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9044ED542E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9047732F2C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */; };
- 904773302C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */; };
- 904773312C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */; };
- 904773322C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */; };
- 9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
- 9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; };
- 9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; };
- 9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; };
- 9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; };
- 9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; };
- 9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; };
- 9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; };
- 9052DE792150D040008E83D4 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
- 9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
- 9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
- 9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; };
- 9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
- 9052DE812150D040008E83D4 /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
- 9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
- 9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
- 9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
- 9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
- 9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
- 9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
- 9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
- 9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
- 9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
- 9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
- 9068B5332C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9068B5342C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9068B5362C6E007400B13532 /* CDVSettingsDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */; };
- 9068B5372C6E007400B13532 /* CDVSettingsDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */; };
- 90B382512AEB72DD00F3F4D7 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */; };
- 90DE61742B8F11D300810C2E /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
- A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
- A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
- C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; };
- C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 28BFF9121F355A4E00DDF01A /* CDVLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLogger.h; sourceTree = "<group>"; };
- 28BFF9131F355A4E00DDF01A /* CDVLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLogger.m; sourceTree = "<group>"; };
- 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVIntentAndNavigationFilter.h; sourceTree = "<group>"; };
- 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVIntentAndNavigationFilter.m; sourceTree = "<group>"; };
- 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewProcessPoolFactory.m; sourceTree = "<group>"; };
- 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewUIDelegate.h; sourceTree = "<group>"; };
- 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewUIDelegate.m; sourceTree = "<group>"; };
- 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewEngine.m; sourceTree = "<group>"; };
- 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewProcessPoolFactory.h; sourceTree = "<group>"; };
- 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngine.h; sourceTree = "<group>"; };
- 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLaunchScreen.h; sourceTree = "<group>"; };
- 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLaunchScreen.m; sourceTree = "<group>"; };
- 68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 7ED95CF21AB9028C008C4574 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = "<group>"; };
- 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON_private.h; sourceTree = "<group>"; };
- 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVJSON_private.m; sourceTree = "<group>"; };
- 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Private.h"; sourceTree = "<group>"; };
- 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVHandleOpenURL.h; sourceTree = "<group>"; };
- 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVHandleOpenURL.m; sourceTree = "<group>"; };
- 7ED95D0F1AB9029B008C4574 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = "<group>"; };
- 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAppDelegate.h; sourceTree = "<group>"; };
- 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVAppDelegate.m; sourceTree = "<group>"; };
- 7ED95D121AB9029B008C4574 /* CDVAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailability.h; sourceTree = "<group>"; };
- 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailabilityDeprecated.h; sourceTree = "<group>"; };
- 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegate.h; sourceTree = "<group>"; };
- 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegateImpl.h; sourceTree = "<group>"; };
- 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandDelegateImpl.m; sourceTree = "<group>"; };
- 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandQueue.h; sourceTree = "<group>"; };
- 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandQueue.m; sourceTree = "<group>"; };
- 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConfigParser.h; sourceTree = "<group>"; };
- 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConfigParser.m; sourceTree = "<group>"; };
- 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVInvokedUrlCommand.h; sourceTree = "<group>"; };
- 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVInvokedUrlCommand.m; sourceTree = "<group>"; };
- 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Resources.h"; sourceTree = "<group>"; };
- 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CDVPlugin+Resources.m"; sourceTree = "<group>"; };
- 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPlugin.h; sourceTree = "<group>"; };
- 7ED95D201AB9029B008C4574 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPlugin.m; sourceTree = "<group>"; };
- 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPluginResult.h; sourceTree = "<group>"; };
- 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPluginResult.m; sourceTree = "<group>"; };
- 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVScreenOrientationDelegate.h; sourceTree = "<group>"; };
- 7ED95D241AB9029B008C4574 /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVTimer.h; sourceTree = "<group>"; };
- 7ED95D251AB9029B008C4574 /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVTimer.m; sourceTree = "<group>"; };
- 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = "<group>"; };
- 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = "<group>"; };
- 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngineProtocol.h; sourceTree = "<group>"; };
- 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+CordovaPreferences.h"; sourceTree = "<group>"; };
- 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CordovaPreferences.m"; sourceTree = "<group>"; };
- 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
- 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
- 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CDVViewController+Private.h"; sourceTree = "<group>"; };
- 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVStatusBarInternal.h; sourceTree = "<group>"; };
- 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVStatusBarInternal.m; sourceTree = "<group>"; };
- 902B30732C6C5A7E00C6804C /* CordovaLib.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = CordovaLib.docc; sourceTree = "<group>"; };
- 902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
- 9036843B2C6EB06500A3338C /* CDVAllowList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVAllowList.h; sourceTree = "<group>"; };
- 9036843C2C6EB06500A3338C /* CDVAllowList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVAllowList.m; sourceTree = "<group>"; };
- 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVSceneDelegate.h; sourceTree = "<group>"; };
- 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVSceneDelegate.m; sourceTree = "<group>"; };
- 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVPluginNotifications.h; sourceTree = "<group>"; };
- 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVURLSchemeHandler.h; sourceTree = "<group>"; };
- 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVURLSchemeHandler.m; sourceTree = "<group>"; };
- 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVSettingsDictionary.h; sourceTree = "<group>"; };
- 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVSettingsDictionary.m; sourceTree = "<group>"; };
- A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVGestureHandler.h; sourceTree = "<group>"; };
- A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVGestureHandler.m; sourceTree = "<group>"; };
- C0C01EB21E3911D50056E6CB /* Cordova.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cordova.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- C0C01EB41E3911D50056E6CB /* Cordova.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cordova.h; sourceTree = "<group>"; };
- C0C01EB51E3911D50056E6CB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- C0C01EAE1E3911D50056E6CB /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2AAC07C0554694100DB518D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 034768DFFF38A50411DB9C8B /* Products */ = {
- isa = PBXGroup;
- children = (
- 68A32D7114102E1C006B237C /* libCordova.a */,
- C0C01EB21E3911D50056E6CB /* Cordova.framework */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 0867D691FE84028FC02AAC07 = {
- isa = PBXGroup;
- children = (
- 902B30732C6C5A7E00C6804C /* CordovaLib.docc */,
- 9064EF5E26FAB74200C9D65B /* include */,
- 7ED95D0E1AB9029B008C4574 /* Public */,
- 7ED95CF11AB9028C008C4574 /* Private */,
- C0C01EB51E3911D50056E6CB /* Info.plist */,
- 902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */,
- 034768DFFF38A50411DB9C8B /* Products */,
- );
- sourceTree = "<group>";
- };
- 28BFF9111F355A1D00DDF01A /* CDVLogger */ = {
- isa = PBXGroup;
- children = (
- 28BFF9121F355A4E00DDF01A /* CDVLogger.h */,
- 28BFF9131F355A4E00DDF01A /* CDVLogger.m */,
- );
- path = CDVLogger;
- sourceTree = "<group>";
- };
- 3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */ = {
- isa = PBXGroup;
- children = (
- 9036843B2C6EB06500A3338C /* CDVAllowList.h */,
- 9036843C2C6EB06500A3338C /* CDVAllowList.m */,
- 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */,
- 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */,
- );
- path = CDVIntentAndNavigationFilter;
- sourceTree = "<group>";
- };
- 4E23F8F423E16D30006CD852 /* CDVWebViewEngine */ = {
- isa = PBXGroup;
- children = (
- 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */,
- 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */,
- 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */,
- 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */,
- 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */,
- 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */,
- );
- path = CDVWebViewEngine;
- sourceTree = "<group>";
- };
- 4E714D3123F5356700A321AF /* CDVLaunchScreen */ = {
- isa = PBXGroup;
- children = (
- 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */,
- 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */,
- );
- path = CDVLaunchScreen;
- sourceTree = "<group>";
- };
- 7ED95CF11AB9028C008C4574 /* Private */ = {
- isa = PBXGroup;
- children = (
- 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */,
- 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */,
- 7ED95CF21AB9028C008C4574 /* CDVDebug.h */,
- 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */,
- 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */,
- 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */,
- 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */,
- 7ED95CF61AB9028C008C4574 /* Plugins */,
- );
- name = Private;
- path = Classes/Private;
- sourceTree = "<group>";
- };
- 7ED95CF61AB9028C008C4574 /* Plugins */ = {
- isa = PBXGroup;
- children = (
- 90227B502D49A042005DB74E /* CDVStatusBarInternal */,
- 4E714D3123F5356700A321AF /* CDVLaunchScreen */,
- 4E23F8F423E16D30006CD852 /* CDVWebViewEngine */,
- 28BFF9111F355A1D00DDF01A /* CDVLogger */,
- A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */,
- 3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */,
- 7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */,
- );
- path = Plugins;
- sourceTree = "<group>";
- };
- 7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */ = {
- isa = PBXGroup;
- children = (
- 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */,
- 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */,
- );
- path = CDVHandleOpenURL;
- sourceTree = "<group>";
- };
- 7ED95D0E1AB9029B008C4574 /* Public */ = {
- isa = PBXGroup;
- children = (
- 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */,
- 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */,
- 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */,
- 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */,
- 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */,
- 7ED95D201AB9029B008C4574 /* CDVPlugin.m */,
- 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */,
- 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */,
- 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */,
- 7ED95D251AB9029B008C4574 /* CDVTimer.m */,
- 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
- 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */,
- 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */,
- 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */,
- );
- name = Public;
- path = Classes/Public;
- sourceTree = "<group>";
- };
- 90227B502D49A042005DB74E /* CDVStatusBarInternal */ = {
- isa = PBXGroup;
- children = (
- 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */,
- 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */,
- );
- path = CDVStatusBarInternal;
- sourceTree = "<group>";
- };
- 9064EF5E26FAB74200C9D65B /* include */ = {
- isa = PBXGroup;
- children = (
- 9064EF5F26FAB74800C9D65B /* Cordova */,
- );
- path = include;
- sourceTree = "<group>";
- };
- 9064EF5F26FAB74800C9D65B /* Cordova */ = {
- isa = PBXGroup;
- children = (
- C0C01EB41E3911D50056E6CB /* Cordova.h */,
- 7ED95D0F1AB9029B008C4574 /* CDV.h */,
- 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */,
- 7ED95D121AB9029B008C4574 /* CDVAvailability.h */,
- 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */,
- 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */,
- 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */,
- 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */,
- 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */,
- 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */,
- 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */,
- 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */,
- 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */,
- 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */,
- 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */,
- 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */,
- 7ED95D241AB9029B008C4574 /* CDVTimer.h */,
- 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */,
- 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */,
- 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */,
- 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */,
- 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */,
- );
- path = Cordova;
- sourceTree = "<group>";
- };
- A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */ = {
- isa = PBXGroup;
- children = (
- A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */,
- A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */,
- );
- path = CDVGestureHandler;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- C0C01EAF1E3911D50056E6CB /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */,
- 90227B4C2D499A1B005DB74E /* CDVViewController+Private.h in Headers */,
- C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */,
- C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */,
- 9068B5332C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */,
- 9044ED532E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */,
- C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */,
- 9044ED4D2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */,
- C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */,
- C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */,
- C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */,
- 4F56D839254A2EE40063F1D6 /* CDVWebViewProcessPoolFactory.h in Headers */,
- C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */,
- C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */,
- C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */,
- C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */,
- C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */,
- C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */,
- C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */,
- 4F56D836254A2EE10063F1D6 /* CDVWebViewEngine.h in Headers */,
- C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */,
- C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */,
- C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */,
- C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */,
- 4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */,
- C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */,
- 9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */,
- 9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */,
- 9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */,
- 9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */,
- 9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */,
- 903684402C6EB06500A3338C /* CDVAllowList.h in Headers */,
- 9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */,
- 9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */,
- 9047732F2C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */,
- 90227B532D49A042005DB74E /* CDVStatusBarInternal.h in Headers */,
- 2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2AAC07A0554694100DB518D /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 7ED95D351AB9029B008C4574 /* CDV.h in Headers */,
- 90227B4D2D499A1B005DB74E /* CDVViewController+Private.h in Headers */,
- 7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */,
- 7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */,
- 9068B5342C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */,
- 9044ED542E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */,
- 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */,
- 9044ED4C2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */,
- 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */,
- 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */,
- 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */,
- 4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */,
- 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */,
- 7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */,
- 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */,
- 7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */,
- 90DE61742B8F11D300810C2E /* Cordova.h in Headers */,
- 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */,
- 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */,
- 4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */,
- 7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */,
- 7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */,
- 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */,
- 4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */,
- 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */,
- 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */,
- 7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */,
- 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */,
- 7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */,
- 28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */,
- A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */,
- 9036843D2C6EB06500A3338C /* CDVAllowList.h in Headers */,
- 3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */,
- 7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */,
- 904773312C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */,
- 90227B512D49A042005DB74E /* CDVStatusBarInternal.h in Headers */,
- 4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- C0C01EB11E3911D50056E6CB /* Cordova */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */;
- buildPhases = (
- C0C01EAF1E3911D50056E6CB /* Headers */,
- C0C01EAD1E3911D50056E6CB /* Sources */,
- C0C01EAE1E3911D50056E6CB /* Frameworks */,
- 90B382502AEB72D300F3F4D7 /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Cordova;
- productName = Cordova;
- productReference = C0C01EB21E3911D50056E6CB /* Cordova.framework */;
- productType = "com.apple.product-type.framework";
- };
- D2AAC07D0554694100DB518D /* CordovaLib */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */;
- buildPhases = (
- D2AAC07A0554694100DB518D /* Headers */,
- D2AAC07B0554694100DB518D /* Sources */,
- D2AAC07C0554694100DB518D /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = CordovaLib;
- productName = CordovaLib;
- productReference = 68A32D7114102E1C006B237C /* libCordova.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 0867D690FE84028FC02AAC07 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- BuildIndependentTargetsInParallel = YES;
- LastUpgradeCheck = 1540;
- TargetAttributes = {
- C0C01EB11E3911D50056E6CB = {
- CreatedOnToolsVersion = 10.1;
- ProvisioningStyle = Automatic;
- };
- D2AAC07D0554694100DB518D = {
- CreatedOnToolsVersion = 10.1;
- ProvisioningStyle = Automatic;
- };
- };
- };
- buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */;
- compatibilityVersion = "Xcode 11.0";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 0867D691FE84028FC02AAC07;
- productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- D2AAC07D0554694100DB518D /* CordovaLib */,
- C0C01EB11E3911D50056E6CB /* Cordova */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 90B382502AEB72D300F3F4D7 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 90B382512AEB72DD00F3F4D7 /* PrivacyInfo.xcprivacy in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- C0C01EAD1E3911D50056E6CB /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 90227B542D49A042005DB74E /* CDVStatusBarInternal.m in Sources */,
- 9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */,
- 9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */,
- 9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */,
- 902B30742C6C5A7E00C6804C /* CordovaLib.docc in Sources */,
- 9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */,
- 9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */,
- 9044ED502E67F821003B58ED /* CDVSceneDelegate.m in Sources */,
- 9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */,
- 9068B5362C6E007400B13532 /* CDVSettingsDictionary.m in Sources */,
- 9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */,
- 9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */,
- 9036843F2C6EB06500A3338C /* CDVAllowList.m in Sources */,
- 4F56D830254A2ED70063F1D6 /* CDVWebViewUIDelegate.m in Sources */,
- 9052DE792150D040008E83D4 /* CDVTimer.m in Sources */,
- 4F56D833254A2ED90063F1D6 /* CDVWebViewProcessPoolFactory.m in Sources */,
- 4F56D82D254A2EB50063F1D6 /* CDVWebViewEngine.m in Sources */,
- 9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */,
- 9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */,
- 9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */,
- 9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */,
- 9052DE812150D040008E83D4 /* CDVLogger.m in Sources */,
- 904773302C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */,
- 9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */,
- 9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */,
- 9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */,
- 2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2AAC07B0554694100DB518D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 90227B522D49A042005DB74E /* CDVStatusBarInternal.m in Sources */,
- 7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */,
- 7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */,
- 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */,
- 902B30752C6C5A7E00C6804C /* CordovaLib.docc in Sources */,
- 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */,
- 7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */,
- 9044ED4F2E67F821003B58ED /* CDVSceneDelegate.m in Sources */,
- 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */,
- 9068B5372C6E007400B13532 /* CDVSettingsDictionary.m in Sources */,
- 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */,
- 9036843E2C6EB06500A3338C /* CDVAllowList.m in Sources */,
- 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */,
- 7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */,
- 4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */,
- 4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */,
- 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */,
- 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */,
- 7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */,
- 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */,
- 4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */,
- 28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */,
- 904773322C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */,
- A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */,
- 3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */,
- 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */,
- 4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB921F08733DC00010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ENABLE_MODULE_VERIFIER = YES;
- MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
- MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
- PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
- SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
- SUPPORTS_MACCATALYST = YES;
- TARGETED_DEVICE_FAMILY = "1,2,7";
- XROS_DEPLOYMENT_TARGET = 1.0;
- };
- name = Debug;
- };
- 1DEB922008733DC00010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ENABLE_MODULE_VERIFIER = YES;
- MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
- MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
- PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
- SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
- SUPPORTS_MACCATALYST = YES;
- TARGETED_DEVICE_FAMILY = "1,2,7";
- XROS_DEPLOYMENT_TARGET = 1.0;
- };
- name = Release;
- };
- 1DEB922308733DC00010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- DEFINES_MODULE = YES;
- DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES;
- ENABLE_MODULE_VERIFIER = YES;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 13.0;
- MERGEABLE_LIBRARY = YES;
- MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
- MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
- MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
- MTL_FAST_MATH = YES;
- ONLY_ACTIVE_ARCH = YES;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = Cordova;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- STRING_CATALOG_GENERATE_SYMBOLS = YES;
- };
- name = Debug;
- };
- 1DEB922408733DC00010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEFINES_MODULE = YES;
- DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES;
- ENABLE_MODULE_VERIFIER = YES;
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 13.0;
- MERGEABLE_LIBRARY = YES;
- MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
- MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
- MTL_ENABLE_DEBUG_INFO = NO;
- MTL_FAST_MATH = YES;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = Cordova;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- STRING_CATALOG_GENERATE_SYMBOLS = YES;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- C0C01EB71E3911D50056E6CB /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_MODULE_VERIFIER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- "@loader_path/Frameworks",
- );
- MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
- MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
- PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
- SKIP_INSTALL = NO;
- SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
- SUPPORTS_MACCATALYST = YES;
- TARGETED_DEVICE_FAMILY = "1,2,7";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- XROS_DEPLOYMENT_TARGET = 1.0;
- };
- name = Debug;
- };
- C0C01EB81E3911D50056E6CB /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_MODULE_VERIFIER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- "@loader_path/Frameworks",
- );
- MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
- MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
- PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
- SKIP_INSTALL = NO;
- SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
- SUPPORTS_MACCATALYST = YES;
- TARGETED_DEVICE_FAMILY = "1,2,7";
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- XROS_DEPLOYMENT_TARGET = 1.0;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB921F08733DC00010E9CD /* Debug */,
- 1DEB922008733DC00010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB922308733DC00010E9CD /* Debug */,
- 1DEB922408733DC00010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C0C01EB71E3911D50056E6CB /* Debug */,
- C0C01EB81E3911D50056E6CB /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 38402560b..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<Workspace
- version = "1.0">
- <FileRef
- location = "self:CordovaLib.xcodeproj">
- </FileRef>
-</Workspace>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IDEDidComputeMac32BitWarning</key>
- <true/>
-</dict>
-</plist>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme
deleted file mode 100644
index 0c8724e2d..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<Scheme
- LastUpgradeVersion = "1540"
- version = "1.3">
- <BuildAction
- parallelizeBuildables = "YES"
- buildImplicitDependencies = "YES">
- <BuildActionEntries>
- <BuildActionEntry
- buildForTesting = "YES"
- buildForRunning = "YES"
- buildForProfiling = "YES"
- buildForArchiving = "YES"
- buildForAnalyzing = "YES">
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "C0C01EB11E3911D50056E6CB"
- BuildableName = "Cordova.framework"
- BlueprintName = "Cordova"
- ReferencedContainer = "container:CordovaLib.xcodeproj">
- </BuildableReference>
- </BuildActionEntry>
- </BuildActionEntries>
- </BuildAction>
- <TestAction
- buildConfiguration = "Debug"
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES">
- <Testables>
- </Testables>
- </TestAction>
- <LaunchAction
- buildConfiguration = "Debug"
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- launchStyle = "0"
- useCustomWorkingDirectory = "NO"
- ignoresPersistentStateOnLaunch = "NO"
- debugDocumentVersioning = "YES"
- debugServiceExtension = "internal"
- allowLocationSimulation = "YES">
- <MacroExpansion>
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "C0C01EB11E3911D50056E6CB"
- BuildableName = "Cordova.framework"
- BlueprintName = "Cordova"
- ReferencedContainer = "container:CordovaLib.xcodeproj">
- </BuildableReference>
- </MacroExpansion>
- </LaunchAction>
- <ProfileAction
- buildConfiguration = "Release"
- shouldUseLaunchSchemeArgsEnv = "YES"
- savedToolIdentifier = ""
- useCustomWorkingDirectory = "NO"
- debugDocumentVersioning = "YES">
- <MacroExpansion>
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "C0C01EB11E3911D50056E6CB"
- BuildableName = "Cordova.framework"
- BlueprintName = "Cordova"
- ReferencedContainer = "container:CordovaLib.xcodeproj">
- </BuildableReference>
- </MacroExpansion>
- </ProfileAction>
- <AnalyzeAction
- buildConfiguration = "Debug">
- </AnalyzeAction>
- <ArchiveAction
- buildConfiguration = "Release"
- revealArchiveInOrganizer = "YES">
- </ArchiveAction>
-</Scheme>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Info.plist b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Info.plist
deleted file mode 100644
index 22d6e2a57..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Info.plist
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>$(DEVELOPMENT_LANGUAGE)</string>
- <key>CFBundleDisplayName</key>
- <string>CordovaLib</string>
- <key>CFBundleExecutable</key>
- <string>$(EXECUTABLE_NAME)</string>
- <key>CFBundleIdentifier</key>
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>$(PRODUCT_NAME)</string>
- <key>CFBundlePackageType</key>
- <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
- <key>CFBundleShortVersionString</key>
- <string>8.0.0</string>
- <key>CFBundleVersion</key>
- <string>$(CURRENT_PROJECT_VERSION)</string>
- <key>NSHumanReadableCopyright</key>
- <string>Copyright 2012 The Apache Software Foundation</string>
-</dict>
-</plist>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/PrivacyInfo.xcprivacy b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/PrivacyInfo.xcprivacy
deleted file mode 100644
index 4b2e70fdd..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/PrivacyInfo.xcprivacy
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>NSPrivacyTracking</key>
- <false/>
- <key>NSPrivacyCollectedDataTypes</key>
- <array/>
- <key>NSPrivacyAccessedAPITypes</key>
- <array/>
- <key>NSPrivacyTrackingDomains</key>
- <array/>
-</dict>
-</plist>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDV.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDV.h
deleted file mode 100644
index 24ed1e5e8..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDV.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
- #warning Import <Cordova/Cordova.h> rather than <Cordova/CDV.h>
-#endif
-
-#import <Cordova/Cordova.h>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAppDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAppDelegate.h
deleted file mode 100644
index 86665c6ea..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAppDelegate.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import <Cordova/CDVAvailabilityDeprecated.h>
-
-@class CDVViewController;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- App delegate class with some additional Cordova-specific behavior.
-
- The app delegate object manages your app’s shared behaviors. Your app should
- include its own AppDelegate class which is a subclass of `CDVAppDelegate`.
-
- `CDVAppDelegate` provides an extension point for Cordova plugins to safely add
- behavior to the app by building on system events such as URL handling, push
- notification registration, and deep linking.
-
- See `UIApplicationDelegate` for more details about app delegates.
-
- @Metadata {
- @Available(Cordova, introduced: "4.0.0")
- }
- */
-@interface CDVAppDelegate : UIResponder <UIApplicationDelegate>
-
-/**
- The application window.
-
- @Metadata {
- @Available(iOS, introduced: "2.0", deprecated: "13.0")
- @Available(iPadOS, introduced: "2.0", deprecated: "13.0")
- @Available(MacCatalyst, introduced: "2.0", deprecated: "13.0")
- @Available(Cordova, introduced: "4.0.0", deprecated: "8.0.0")
- }
- @DeprecationSummary {
- Deprecated in Cordova 8 in favour of UIScene protocols.
- }
- */
-@property (nullable, nonatomic, strong) IBOutlet UIWindow *window API_DEPRECATED_WITH_REPLACEMENT("SceneDelegate:window", ios(2.0, 13.0));
-
-// TODO: Remove in Cordova iOS 9
-/**
- The ``CDVViewController`` instance.
-
- @Metadata {
- @Available(Cordova, introduced: "4.0.0", deprecated: "8.0.0")
- }
- */
-@property (nullable, nonatomic, strong) IBOutlet CDVViewController *viewController CDV_DEPRECATED(8.0.0, "");
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailability.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailability.h
deleted file mode 100644
index 8af746e21..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailability.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVAvailabilityDeprecated.h>
-
-#define __CORDOVA_IOS__
-
-#define __CORDOVA_0_9_6 906
-#define __CORDOVA_1_0_0 10000
-#define __CORDOVA_1_1_0 10100
-#define __CORDOVA_1_2_0 10200
-#define __CORDOVA_1_3_0 10300
-#define __CORDOVA_1_4_0 10400
-#define __CORDOVA_1_4_1 10401
-#define __CORDOVA_1_5_0 10500
-#define __CORDOVA_1_6_0 10600
-#define __CORDOVA_1_6_1 10601
-#define __CORDOVA_1_7_0 10700
-#define __CORDOVA_1_8_0 10800
-#define __CORDOVA_1_8_1 10801
-#define __CORDOVA_1_9_0 10900
-#define __CORDOVA_2_0_0 20000
-#define __CORDOVA_2_1_0 20100
-#define __CORDOVA_2_2_0 20200
-#define __CORDOVA_2_3_0 20300
-#define __CORDOVA_2_4_0 20400
-#define __CORDOVA_2_5_0 20500
-#define __CORDOVA_2_6_0 20600
-#define __CORDOVA_2_7_0 20700
-#define __CORDOVA_2_8_0 20800
-#define __CORDOVA_2_9_0 20900
-#define __CORDOVA_3_0_0 30000
-#define __CORDOVA_3_1_0 30100
-#define __CORDOVA_3_2_0 30200
-#define __CORDOVA_3_3_0 30300
-#define __CORDOVA_3_4_0 30400
-#define __CORDOVA_3_4_1 30401
-#define __CORDOVA_3_5_0 30500
-#define __CORDOVA_3_6_0 30600
-#define __CORDOVA_3_7_0 30700
-#define __CORDOVA_3_8_0 30800
-#define __CORDOVA_3_9_0 30900
-#define __CORDOVA_3_9_1 30901
-#define __CORDOVA_3_9_2 30902
-#define __CORDOVA_4_0_0 40000
-#define __CORDOVA_4_0_1 40001
-#define __CORDOVA_4_1_0 40100
-#define __CORDOVA_4_1_1 40101
-#define __CORDOVA_4_2_0 40200
-#define __CORDOVA_4_2_1 40201
-#define __CORDOVA_4_3_0 40300
-#define __CORDOVA_4_3_1 40301
-#define __CORDOVA_4_4_0 40400
-#define __CORDOVA_4_5_0 40500
-#define __CORDOVA_4_5_1 40501
-#define __CORDOVA_4_5_2 40502
-#define __CORDOVA_4_5_4 40504
-#define __CORDOVA_5_0_0 50000
-#define __CORDOVA_5_0_1 50001
-#define __CORDOVA_5_1_0 50100
-#define __CORDOVA_5_1_1 50101
-#define __CORDOVA_6_0_0 60000
-#define __CORDOVA_6_1_0 60100
-#define __CORDOVA_6_2_0 60200
-#define __CORDOVA_6_3_0 60300
-#define __CORDOVA_7_0_0 70000
-#define __CORDOVA_7_0_1 70001
-#define __CORDOVA_7_1_0 70100
-#define __CORDOVA_7_1_1 70101
-#define __CORDOVA_8_0_0 80000
-/* coho:next-version,insert-before */
-#define __CORDOVA_NA 99999 /* not available */
-
-/*
- #if CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_4_0_0
- // do something when its at least 4.0.0
- #else
- // do something else (non 4.0.0)
- #endif
- */
-#ifndef CORDOVA_VERSION_MIN_REQUIRED
- /* coho:next-version-min-required,replace-after */
- #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_8_0_0
-#endif
-
-// TODO: Remove in Cordova iOS 9
-/**
- Returns YES if it is at least version specified as NSString(X)
- Usage:
- if (IsAtLeastiOSVersion(@"5.1")) {
- // do something for iOS 5.1 or greater
- }
- */
-#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending)
-#pragma clang deprecated(IsAtLeastiOSVersion, "Use the built-in #available syntax")
-
-/** Return the string version of the decimal version */
-#define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \
- (CORDOVA_VERSION_MIN_REQUIRED / 10000), \
- (CORDOVA_VERSION_MIN_REQUIRED % 10000) / 100, \
- (CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100]
-
-// Enable this to log all exec() calls.
-#define CDV_ENABLE_EXEC_LOGGING 0
-#if CDV_ENABLE_EXEC_LOGGING
- #define CDV_EXEC_LOG NSLog
-#else
- #define CDV_EXEC_LOG(...) do { \
-} while (NO)
-#endif
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailabilityDeprecated.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailabilityDeprecated.h
deleted file mode 100644
index 407641b24..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailabilityDeprecated.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg)))
-#define CDV_DEPRECATED_WITH_REPLACEMENT(version, msg, repl) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg, repl)))
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandDelegate.h
deleted file mode 100644
index 10cd12d74..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandDelegate.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVAvailability.h>
-#import <Cordova/CDVInvokedUrlCommand.h>
-
-@class CDVPlugin;
-@class CDVPluginResult;
-@class CDVSettingsDictionary;
-
-NS_ASSUME_NONNULL_BEGIN
-
-@protocol CDVCommandDelegate <NSObject>
-
-@optional
-
-@property (nonatomic, nullable, copy) NSURL *(^urlTransformer)(NSURL *) CDV_DEPRECATED(8.0.0, "");
-
-@required
-/**
- The Cordova preferences for the web view.
-
- This is a dictionary populated from the preference key/value pairs in the
- Cordova XML configuration file.
- */
-@property (nonatomic, readonly) CDVSettingsDictionary* settings;
-
-- (NSString *)pathForResource:(NSString *)resourcepath;
-
-/**
- Returns the CDVPlugin instance of the given plugin name.
-
- - Parameters:
- - pluginName: The name of the plugin to return.
- - Returns: The ``CDVPlugin`` instance, or `nil` if no plugin instance was
- found with the given name.
- */
-- (nullable CDVPlugin *)getCommandInstance:(NSString *)pluginName;
-
-/**
- Sends a plugin result to the web view. This is thread-safe.
-
- - Parameters:
- - result: The plugin result to send to the web view.
- - callbackId: The ID of the JavaScript callback to invoke.
- */
-- (void)sendPluginResult:(CDVPluginResult *)result callbackId:(NSString *)callbackId;
-
-/**
- Evaluates the given JavaScript string in the web view. This is thread-safe.
-
- - Parameters:
- - js: The string of JavaScript code to run.
- */
-- (void)evalJs:(NSString *)js;
-
-/**
- Evaluates the given JavaScript string right away instead of scheduling it on
- the run-loop.
-
- This is required for dispatching `resign` and `pause` events, but should not
- be used without reason. Without the run-loop delay, alerts used in JS callbacks
- may result in dead-lock. This method must be called from the UI thread.
-
- - Parameters:
- - js: The string of JavaScript code to run.
- - scheduledOnRunLoop: Whether to schedule the code to run on the run-loop.
- */
-- (void)evalJs:(NSString *)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
-
-/**
- Runs the given block on a background thread using a shared thread-pool.
-
- - Parameters:
- - block: The block to be run.
- */
-- (void)runInBackground:(void (^)(void))block;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandQueue.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandQueue.h
deleted file mode 100644
index fbf36f6ea..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandQueue.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-@class CDVInvokedUrlCommand;
-@class CDVViewController;
-
-@interface CDVCommandQueue : NSObject
-
-@property (nonatomic, readonly) BOOL currentlyExecuting;
-
-- (instancetype)init NS_UNAVAILABLE;
-- (instancetype)initWithViewController:(CDVViewController *)viewController;
-- (void)dispose;
-
-- (void)resetRequestId;
-- (void)enqueueCommandBatch:(NSString*)batchJSON;
-
-- (void)fetchCommandsFromJs;
-- (void)executePending;
-- (BOOL)execute:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVConfigParser.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVConfigParser.h
deleted file mode 100644
index 84350c27e..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVConfigParser.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- An object that handles parsing Cordova XML configuration files.
-
- ## Overview
- The `CDVConfigParser` class provides methods to parse a Cordova XML
- configuration file and then access the resulting configuration data.
-
- Use ``parseConfigFile:`` to load data from a file path.
-
- Use ``parseConfigFile:withDelegate:`` if you need to intercept the XML parsing
- and handle the data yourself with an `NSXMLParserDelegate`.
-
- @Metadata {
- @Available(Cordova, introduced: "2.3.0")
- }
- */
-@interface CDVConfigParser : NSObject <NSXMLParserDelegate>
-
-/**
- A dictionary mapping Cordova plugin name keys to the plugin classes that implement them.
-
- @Metadata {
- @Available(Cordova, introduced: "2.3.0")
- }
- */
-@property (nonatomic, readonly, strong) NSMutableDictionary *pluginsDict;
-
-/**
- A dictionary of Cordova preference keys and their values.
-
- This should not be used directly, you should only use it to initialize a
- ``CDVSettingsDictionary`` object.
-
- @Metadata {
- @Available(Cordova, introduced: "2.3.0")
- }
- */
-@property (nonatomic, readonly, strong) NSMutableDictionary *settings;
-
-/**
- An array of plugin names to load immediately when Cordova initializes.
-
- @Metadata {
- @Available(Cordova, introduced: "2.5.0")
- }
- */
-@property (nonatomic, readonly, strong) NSMutableArray *startupPluginNames;
-
-/**
- The path to the HTML page to display when the web view loads.
-
- @Metadata {
- @Available(Cordova, introduced: "2.4.0")
- }
- */
-@property (nonatomic, nullable, readonly, strong) NSString *startPage;
-
-/**
- Parses the given path as a Cordova XML configuration file.
-
- If the file could not be loaded or parsed, the resulting ``CDVConfigParser``
- object will have empty values.
-
- - Parameters:
- - filePath: The file path URL to the configuration file.
- - Returns: A ``CDVConfigParser`` with the parsed result.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-+ (instancetype)parseConfigFile:(NSURL *)filePath;
-
-/**
- Parses the given path as a Cordova XML configuration file using the given delegate.
-
- - Parameters:
- - filePath: The file path URL to the configuration file.
- - delegate: The delegate to handle the parsed XML data.
- - Returns: Whether the given file was successfully parsed.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-+ (BOOL)parseConfigFile:(NSURL *)filePath withDelegate:(id <NSXMLParserDelegate>)delegate;
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVInvokedUrlCommand.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVInvokedUrlCommand.h
deleted file mode 100644
index 64637560d..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVInvokedUrlCommand.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface CDVInvokedUrlCommand : NSObject {
- NSString* _callbackId;
- NSString* _className;
- NSString* _methodName;
- NSArray* _arguments;
-}
-
-@property (nonatomic, readonly) NSArray* arguments;
-@property (nonatomic, readonly) NSString* callbackId;
-@property (nonatomic, readonly) NSString* className;
-@property (nonatomic, readonly) NSString* methodName;
-
-+ (instancetype)commandFromJson:(NSArray *)jsonEntry;
-
-- (instancetype)initWithArguments:(NSArray *)arguments
- callbackId:(NSString *)callbackId
- className:(NSString *)className
- methodName:(NSString *)methodName NS_DESIGNATED_INITIALIZER;
-
-- (instancetype)initFromJson:(NSArray *)jsonEntry;
-
-// Returns the argument at the given index.
-// If index >= the number of arguments, returns nil.
-// If the argument at the given index is NSNull, returns nil.
-- (id)argumentAtIndex:(NSUInteger)index;
-// Same as above, but returns defaultValue instead of nil.
-- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue;
-// Same as above, but returns defaultValue instead of nil, and if the argument is not of the expected class, returns defaultValue
-- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin+Resources.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin+Resources.h
deleted file mode 100644
index 16019adf1..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin+Resources.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import <Cordova/CDVPlugin.h>
-
-@interface CDVPlugin (CDVPluginResources)
-
-/**
- Returns the localized string with the given key from a plugin bundle.
-
- The plugin bundle must be named the same as the plugin class.
-
- For example, if your plugin class was called `Foo`, and you have a Spanish
- localized strings file, this method will try to load the desired key from
- `Foo.bundle/es.lproj/Localizable.strings`.
-
- - Parameters:
- - key: The key of the localized string to retrieve.
-
- - Returns: The localized string, or an empty string if the key could not be
- found.
-
- @Metadata {
- @Available(Cordova, introduced: "4.0.0")
- }
- */
-- (NSString *)pluginLocalizedString:(NSString *)key;
-
-/**
- Returns the image with the given name from a plugin bundle.
-
- The plugin bundle must be named the same as the plugin class.
-
- For example, if your plugin class was called `Foo`, and you have an image
- called `"bar"`, this method will try to load the image from
- `Foo.bundle/bar.png` (and appropriately named retina versions).
-
- - Parameters:
- - name: The file name of the image resource to retrieve.
-
- - Returns: The image, or `nil` if an image with the provided name could not be
- found.
-
- @Metadata {
- @Available(Cordova, introduced: "4.0.0")
- }
- */
-- (UIImage *)pluginImageResource:(NSString *)name;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin.h
deleted file mode 100644
index 1e5f10bbe..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin.h
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-#import <Cordova/CDVAvailabilityDeprecated.h>
-#import <Cordova/CDVPluginNotifications.h>
-#import <Cordova/CDVPluginResult.h>
-#import <Cordova/CDVCommandDelegate.h>
-#import <Cordova/CDVSettingsDictionary.h>
-#import <Cordova/CDVViewController.h>
-#import <Cordova/CDVWebViewEngineProtocol.h>
-#import <Cordova/CDVInvokedUrlCommand.h>
-
-// Forward declaration to avoid bringing WebKit API into public headers
-@protocol WKURLSchemeTask;
-
-typedef int CDVWebViewNavigationType;
-
-NS_ASSUME_NONNULL_BEGIN
-
-#ifndef __swift__
-// This global extension to the UIView class causes issues for Swift subclasses
-// of UIView with their own scrollView properties, so we're removing it from
-// the exposed Swift API and marking it as deprecated
-// TODO: Remove in Cordova iOS 9
-@interface UIView (org_apache_cordova_UIView_Extension)
-@property (nonatomic, weak, nullable) UIScrollView *scrollView CDV_DEPRECATED(8.0.0, "Check for a scrollView property on the view object at runtime and invoke it dynamically.");
-@end
-#endif
-
-NS_ASSUME_NONNULL_END
-
-/**
- The base class for all Cordova plugins.
-
- @Metadata {
- @Available("Cordova", introduced: "1.0.0")
- }
- */
-@interface CDVPlugin : NSObject {}
-
-/**
- The web view engine that manages the web view displaying the Cordova
- application's content.
-
- By default, this will be a `CDVWebViewEngine` instance, but could also be a
- custom implementation as well.
-
- @Metadata {
- @Available("Cordova", introduced: "4.0.0")
- }
- */
-@property (nonatomic, readonly, weak) id <CDVWebViewEngineProtocol> webViewEngine;
-
-/**
- The web view that displays the Cordova application's content.
-
- This is a shortcode for the `webView` property of the plugin's
- ``webViewEngine``. If the `webViewEngine` is a `CDVWebViewEngine`, this can
- safely be cast to a `WKWebView`.
-
- @Metadata {
- @Available("Cordova", introduced: "1.0.0")
- }
- */
-@property (nonatomic, readonly, weak) UIView *webView;
-
-/**
- The application view controller the owns the Cordova web view to which this
- plugin belongs.
-
- @Metadata {
- @Available("Cordova", introduced: "1.4.0")
- }
-*/
-@property (nonatomic, weak) CDVViewController *viewController;
-
-/**
- The application's Cordova command delegate instance.
-
- @Metadata {
- @Available("Cordova", introduced: "1.4.0")
- }
-*/
-@property (nonatomic, weak) id <CDVCommandDelegate> commandDelegate;
-
-/**
- Flag for pending plugin work that requires keeping the web view alive.
-
- This flag is used during low memory situations to check if any plugins have
- active work ongoing that prevents jettisoning the web view and associated view
- controller from memory.
-
- @Metadata {
- @Available("Cordova", introduced: "1.7.0")
- }
- */
-@property (readonly, assign) BOOL hasPendingOperation;
-
-/**
- Plugin initializer method. Override this method with your plugin initialization
- logic.
-
- ``CDVPlugin`` objects are constructed by the plugin manager, so it's not safe
- to override the standard `init` method. Instead, use the ``pluginInitialize``
- method to do any initialization logic needed by your plugin.
-
- @Metadata {
- @Available("Cordova", introduced: "2.5.0")
- }
- */
-- (void)pluginInitialize;
-
-/**
- @Metadata {
- @Available("Cordova", introduced: "1.0.0")
- }
- */
-- (void)handleOpenURL:(nonnull NSNotification *)notification;
-
-/**
- @Metadata {
- @Available("Cordova", introduced: "4.5.0", deprecated: "8.0.0")
- }
- @DeprecationSummary {
- Use ``handleOpenURL:`` instead with the notification `userData`.
- }
- */
-- (void)handleOpenURLWithApplicationSourceAndAnnotation:(nonnull NSNotification *)notification CDV_DEPRECATED(8.0.0, "Use the handleOpenUrl method and the notification userInfo data.");
-
-/**
- @Metadata {
- @Available("Cordova", introduced: "1.0.0")
- }
- */
-- (void)onAppTerminate;
-
-/**
- @Metadata {
- @Available("Cordova", introduced: "1.0.0")
- }
- */
-- (void)onMemoryWarning;
-
-/**
- @Metadata {
- @Available("Cordova", introduced: "2.2.0")
- }
- */
-- (void)onReset;
-
-/**
- @Metadata {
- @Available("Cordova", introduced: "2.2.0")
- }
- */
-- (void)dispose;
-
-/*
- // see initWithWebView implementation
- - (void) onPause {}
- - (void) onResume {}
- - (void) onOrientationWillChange {}
- - (void) onOrientationDidChange {}
- */
-
-/**
- The application delegate.
-
- @Metadata {
- @Available("Cordova", introduced: "1.0.0")
- }
- */
-- (nonnull id)appDelegate;
-
-@end
-
-#pragma mark - Plugin protocols
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A protocol for Cordova plugins to intercept and respond to server
- authentication challenges through WebKit.
-
- Your plugin should implement this protocol and the
- ``willHandleAuthenticationChallenge:completionHandler:`` method to return
- `YES` if it wants to support responses to server-side authentication
- challenges, otherwise the default NSURLSession handling for authentication
- challenges will be used.
-
- @Metadata {
- @Available("Cordova", introduced: "8.0.0")
- }
- */
-@protocol CDVPluginAuthenticationHandler <NSObject>
-
-/**
- Asks your plugin to respond to an authentication challenge.
-
- Return `YES` if the plugin is handling the challenge, and `NO` to fallback to
- the default handling.
-
- - Parameters:
- - challenge: The authentication challenge.
- - completionHandler: A completion handler block to execute with the response.
- This handler has no return value and takes the following parameters:
- - disposition: The option to use to handle the challenge. For a list of
- options, see `NSURLSessionAuthChallengeDisposition`.
- - credential: The credential to use for authentication when the
- `disposition` parameter contains the value
- `NSURLSessionAuthChallengeUseCredential`. Specify `nil` to continue
- without a credential.
- - Returns: A Boolean value indicating if the plugin is handling the request.
-
- @Metadata {
- @Available("Cordova", introduced: "8.0.0")
- }
- */
-- (BOOL)willHandleAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler;
-
-@end
-
-
-/**
- A protocol for Cordova plugins to manage permitting and denying of webview
- navigations.
-
- You plugin should implement this protocol if it wants to control whether the
- webview is allowed to navigate to a requested URL.
-
- @Metadata {
- @Available("Cordova", introduced: "8.0.0")
- }
- */
-@protocol CDVPluginNavigationHandler <NSObject>
-
-/**
- Asks your plugin to decide whether a navigation request should be permitted or
- denied.
-
- - Parameters:
- - request: The navigation request.
- - navigationType: The type of action triggering the navigation.
- - navInfo: Descriptive information about the action triggering the navigation.
-
- - Returns: A Boolean representing whether the navigation should be allowed or not.
-
- @Metadata {
- @Available("Cordova", introduced: "8.0.0")
- }
- */
-- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest *)request navigationType:(CDVWebViewNavigationType)navigationType info:(NSDictionary *)navInfo;
-
-@optional
-/**
- Asks your plugin to decide whether a navigation request should be permitted or
- denied.
-
- - Parameters:
- - request: The navigation request.
- - navigationType: The type of action triggering the navigation.
- - navInfo: Descriptive information about the action triggering the navigation.
-
- - Returns: A Boolean representing whether the navigation should be allowed or not.
-
- @Metadata {
- @Available("Cordova", introduced: "4.0.0", deprecated: "8.0.0")
- }
- @DeprecationSummary {
- Use ``shouldOverrideLoadWithRequest:navigationType:info:`` instead.
- }
- */
-- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest *)request navigationType:(CDVWebViewNavigationType)navigationType CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use shouldOverrideLoadWithRequest:navigationType:info: instead", "shouldOverrideLoadWithRequest:navigationType:info:");
-
-@end
-
-
-/**
- A protocol for Cordova plugins to intercept handling of WebKit resource
- loading for a custom URL scheme.
-
- Your plugin should implement this protocol if it wants to intercept requests
- to a custom URL scheme and provide its own resource loading. Otherwise,
- Cordova will use its default resource loading behavior from the app bundle.
-
- When a WebKit-based web view encounters a resource that uses a custom scheme,
- it creates a WKURLSchemeTask object and Cordova passes it to the methods of
- your scheme handler plugin for processing. Use the ``overrideSchemeTask:``
- method to indicate that your plugin will handle the request and to begin
- loading the resource. While your handler loads the object, Cordova may call
- your plugin’s ``stopSchemeTask:`` method to notify you that the resource is no
- longer needed.
-
- @Metadata {
- @Available("Cordova", introduced: "8.0.0")
- }
- */
-@protocol CDVPluginSchemeHandler <NSObject>
-
-/**
- Asks your plugin to handle the specified request and begin loading data.
-
- If your plugin intends to handle the request and return data, this method
- should return `YES` as soon as possible to prevent the default request
- handling. If this method returns `NO`, Cordova will handle the resource
- loading using its default behavior.
-
- - Parameters:
- - task: The task object that identifies the resource to load. You also use
- this object to report the progress of the load operation back to the web
- view.
- - Returns: A Boolean value indicating if the plugin is handling the request.
-
- @Metadata {
- @Available("Cordova", introduced: "6.2.0")
- }
- */
-- (BOOL)overrideSchemeTask:(id <WKURLSchemeTask>)task;
-
-/**
- Asks your plugin to stop loading the data for the specified resource.
-
- - Parameters:
- - task: The task object that identifies the resource the web view no
- longer needs.
-
- @Metadata {
- @Available("Cordova", introduced: "6.2.0")
- }
- */
-- (void)stopSchemeTask:(id <WKURLSchemeTask>)task;
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginNotifications.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginNotifications.h
deleted file mode 100644
index bcdf0979d..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginNotifications.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVAvailabilityDeprecated.h>
-
-extern const NSNotificationName CDVPageDidLoadNotification;
-extern const NSNotificationName CDVPluginHandleOpenURLNotification;
-extern const NSNotificationName CDVPluginResetNotification;
-extern const NSNotificationName CDVViewWillAppearNotification;
-extern const NSNotificationName CDVViewDidAppearNotification;
-extern const NSNotificationName CDVViewWillDisappearNotification;
-extern const NSNotificationName CDVViewDidDisappearNotification;
-extern const NSNotificationName CDVViewWillLayoutSubviewsNotification;
-extern const NSNotificationName CDVViewDidLayoutSubviewsNotification;
-extern const NSNotificationName CDVViewWillTransitionToSizeNotification;
-
-extern const NSNotificationName CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification CDV_DEPRECATED(8.0.0, "Find sourceApplication and annotations in the userInfo of the CDVPluginHandleOpenURLNotification notification.");
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginResult.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginResult.h
deleted file mode 100644
index 81a5039e2..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginResult.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVAvailability.h>
-
-/**
- An enumeration that describes the result of handling a plugin command.
-
- ## See Also
-
- - ``CDVPluginResult``
-
- @Metadata {
- @Available(Cordova, introduced: "5.0.0")
- }
- */
-typedef NS_ENUM(NSUInteger, CDVCommandStatus) {
- /** Status code indicating no command result. */
- CDVCommandStatus_NO_RESULT NS_SWIFT_NAME(noResult) = 0,
-
- /** Status code indicating successful handling of the command. */
- CDVCommandStatus_OK NS_SWIFT_NAME(ok),
-
- /** Status code indicating the command's plugin class could not be found. */
- CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION NS_SWIFT_NAME(classNotFoundException),
-
- /** Status code indicating there was an illegal access exception while handling the command. */
- CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION NS_SWIFT_NAME(illegalAccessException),
-
- /** Status code indicating the command's plugin class could not be instantiated. */
- CDVCommandStatus_INSTANTIATION_EXCEPTION NS_SWIFT_NAME(instantiationException),
-
- /** Status code indicating the command included a malformed URL. */
- CDVCommandStatus_MALFORMED_URL_EXCEPTION NS_SWIFT_NAME(malformedUrlException),
-
- /** Status code indicating there was an I/O exception while handling the command. */
- CDVCommandStatus_IO_EXCEPTION NS_SWIFT_NAME(ioException),
-
- /** Status code indicating the command's action was not valid. */
- CDVCommandStatus_INVALID_ACTION NS_SWIFT_NAME(invalidAction),
-
- /** Status code indicating the command's JSON data was invalid. */
- CDVCommandStatus_JSON_EXCEPTION NS_SWIFT_NAME(jsonException),
-
- /** Status code indicating there was an error handling the command. */
- CDVCommandStatus_ERROR NS_SWIFT_NAME(error)
-};
-
-#ifdef __swift__
-// This exists to preserve compatibility with early Swift plugins, who are
-// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
-// values.
-// This declares extern'ed constants (implemented in CDVPluginResult.m)
-// TODO: Remove this in Cordova iOS 9
-#define SWIFT_ENUM_COMPAT_HACK(enumVal, replacement) extern const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal) CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use the CDVCommandStatus." #replacement " enum value instead", "CDVCommandStatus." #replacement)
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT, noResult);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK, ok);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION, classNotFoundException);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION, illegalAccessException);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION, instantiationException);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION, malformedUrlException);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION, ioException);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION, invalidAction);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION, jsonException);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR, error);
-#undef SWIFT_ENUM_COMPAT_HACK
-#endif
-
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CDVPluginResult : NSObject {}
-
-@property (nonatomic, strong, readonly) NSNumber *status;
-@property (nonatomic, nullable, strong, readonly) id message;
-@property (nonatomic, strong) NSNumber *keepCallback;
-@property (nonatomic, strong) id associatedObject CDV_DEPRECATED(8.0.0, "");
-
-- (instancetype)init;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray *)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary *)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData *)theMessage;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray *)theMessages;
-+ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode;
-
-+ (void)setVerbose:(BOOL)verbose CDV_DEPRECATED(8.0.0, "");
-+ (BOOL)isVerbose CDV_DEPRECATED(8.0.0, "");
-
-- (void)setKeepCallbackAsBool:(BOOL)bKeepCallback;
-
-- (NSString*)argumentsAsJSON;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSceneDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSceneDelegate.h
deleted file mode 100644
index 565e6ad98..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSceneDelegate.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- UI scene delegate class with some additional Cordova-specific behavior.
-
- The scene delegate object manages your app’s window behaviors. Your app should
- include its own SceneDelegate class which is a subclass of `CDVSceneDelegate`.
-
- `CDVSceneDelegate` provides an extension point for Cordova plugins to safely
- add behavior to the app by building on system events such as URL handling and
- scene/window management.
-
- See `UIWindowSceneDelegate` for more details about app delegates.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
-*/
-@interface CDVSceneDelegate : UIResponder <UIWindowSceneDelegate>
-
-/**
- The application window for the current UI scene.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
-*/
-@property (strong, nonatomic) UIWindow *window;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVScreenOrientationDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVScreenOrientationDelegate.h
deleted file mode 100644
index b55a41bd1..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVScreenOrientationDelegate.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVAvailabilityDeprecated.h>
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "2.3.0", deprecated: "8.0.0")
- }
- */
-CDV_DEPRECATED(8.0.0, "")
-@protocol CDVScreenOrientationDelegate <NSObject>
-
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations;
-
-- (BOOL)shouldAutorotate;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSettingsDictionary.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSettingsDictionary.h
deleted file mode 100644
index 66cafe26b..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSettingsDictionary.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A dictionary-like interface providing access to the preference settings for a Cordova web view.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@interface CDVSettingsDictionary : NSDictionary
-
-/**
- The number of entries in the dictionary.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property(readonly) NSUInteger count;
-
-/**
- Initializes a newly allocated dictionary by placing in it the keys and values
- contained in another given dictionary.
-
- - Parameters:
- - dict: A dictionary containing the keys and values with which to initialize
- the new dictionary.
- - Returns: An initialized dictionary containing the keys and values found in `dict`.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (instancetype)initWithDictionary:(NSDictionary *)dict NS_DESIGNATED_INITIALIZER;
-
-/**
- Returns the value associated with a given key.
-
- - Parameters:
- - key: The key for which to return the corresponding value.
- - Returns: The value associated with `key`, or `nil` if no value is associated with `key`.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (id)objectForKey:(NSString *)key;
-
-/**
- Provides an enumerator to access the keys in the dictionary.
-
- - Returns: An enumerator object that lets you access each key in the dictionary.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (NSEnumerator *)keyEnumerator;
-
-/**
- Returns the value associated with a given key.
-
- - Parameters:
- - key: The key for which to return the corresponding value.
- - Returns: The value associated with `key`, or `nil` if no value is associated with `key`.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (id)cordovaSettingForKey:(NSString *)key;
-
-/**
- Returns the boolean value associated with a given key, or the given default
- value if the key is not found.
-
- - Parameters:
- - key: The key for which to return the corresponding value.
- - defaultValue: The default value to return if the key is missing.
- - Returns: The value associated with `key`, or the provided default value.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (BOOL)cordovaBoolSettingForKey:(NSString *)key defaultValue:(BOOL)defaultValue;
-
-/**
- Returns the floating-point numeric value associated with a given key, or the
- given default value if the key is not found.
-
- - Parameters:
- - key: The key for which to return the corresponding value.
- - defaultValue: The default value to return if the key is missing.
- - Returns: The value associated with `key`, or the provided default value.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (CGFloat)cordovaFloatSettingForKey:(NSString *)key defaultValue:(CGFloat)defaultValue;
-
-/**
- Adds a preference with the given name and value to the dictionary.
-
- > Warning: Use of this method is highly discouraged. Preferences should be set
- > and customized by app authors in the Cordova XML configuration file, not
- > changed at runtime by plugins.
-
- - Parameters:
- - value: The value to be stored with the given key.
- - key: The preference name.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (void)setObject:(id)value forKey:(NSString *)key;
-
-/**
- Adds a preference with the given name and value to the dictionary.
-
- You shouldn’t need to call this method directly. Instead, this method is called
- when setting an object for a key using subscripting.
-
- > Warning: Use of this method is highly discouraged. Preferences should be set
- > and customized by app authors in the Cordova XML configuration file, not
- > changed at runtime by plugins.
-
- - Parameters:
- - value: The value to be stored with the given key.
- - key: The preference name.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (void)setObject:(id)value forKeyedSubscript:(NSString *)key;
-
-/**
- Adds a preference with the given name and value to the dictionary.
-
- > Warning: Use of this method is highly discouraged. Preferences should be set
- > and customized by app authors in the Cordova XML configuration file, not
- > changed at runtime by plugins.
-
- - Parameters:
- - value: The value to be stored with the given key.
- - key: The preference name.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (void)setCordovaSetting:(id)value forKey:(NSString *)key;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVTimer.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVTimer.h
deleted file mode 100644
index 5be94a187..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVTimer.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-/**
- Utility class for measuring the time spent on an operation.
-
- You can use `CDVTimer` to measure named operations, and it will print the
- elapsed time to the application log upon completion of the operation. This
- allows for simple benchmarking of potentially expensive operations like plugin
- loading and initialization.
-
- At the start of an operation, call ``start:`` with a unique name, then when the
- operation finishes, call ``stop:`` with the same name:
-
- @TabNavigator {
- @Tab("Swift") {
- ```swift
- CDVTimer.start("ExpensiveOperation")
-
- doExpensiveOperation();
-
- CDVTimer.stop("ExpensiveOperation")
- ```
- }
- @Tab("Objective-C") {
- ```objc
- [CDVTimer start:@"ExpensiveOperation"];
-
- doExpensiveOperation();
-
- [CDVTimer stop:@"ExpensiveOperation"];
- ```
- }
- }
-
- @Metadata {
- @Available(Cordova, introduced: "2.7.0")
- }
- */
-@interface CDVTimer : NSObject
-
-/**
- Begins measuring elapsed time for the named operation.
-
- - Parameters:
- - name: A unique name to identify the timed operation.
-
- @Metadata {
- @Available(Cordova, introduced: "2.7.0")
- }
- */
-+ (void)start:(NSString *)name;
-
-/**
- Stops measuring elapsed time for the named operation, and prints the elapsed
- time to the log.
-
- - Parameters:
- - name: The unique name to identify the timed operation.
-
- @Metadata {
- @Available(Cordova, introduced: "2.7.0")
- }
- */
-+ (void)stop:(NSString *)name;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVViewController.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVViewController.h
deleted file mode 100644
index 00cc9e201..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVViewController.h
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import <Cordova/CDVAvailability.h>
-#import <Cordova/CDVInvokedUrlCommand.h>
-#import <Cordova/CDVCommandDelegate.h>
-#import <Cordova/CDVCommandQueue.h>
-#import <Cordova/CDVSettingsDictionary.h>
-#import <Cordova/CDVScreenOrientationDelegate.h>
-#import <Cordova/CDVWebViewEngineProtocol.h>
-
-@class CDVPlugin;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- A view controller that specializes in displaying Cordova web content.
-
- ## Overview
- `CDVViewController` presents a view that displays Cordova web content in a
- web view. Although often presented as the root view controller for an app,
- a `CDVViewController` can safely be placed within view controller
- hierarchies—such as navigation and tabbed controllers—or presented modally.
-
- The behavior preferences and web content to be loaded are defined in a Cordova
- XML configuration file, for which a separate [reference
- guide](https://cordova.apache.org/docs/en/latest/config_ref/index.html)
- exists. The web content displayed within the view has access to Cordova
- plugins via their exposed JavaScript APIs.
-
- > Important: In accordance with [App Store review
- > guidelines](https://developer.apple.com/app-store/review/guidelines/), you
- > must not expose Apple device APIs to web content that is not bundled within
- > the app.
-
- @Metadata {
- @Available(Cordova, introduced: "2.0.0")
- }
- */
-@interface CDVViewController : UIViewController
-
-#pragma mark - Properties
-
-/**
- The view displaying web content for this Cordova controller.
-
- The exact type of this UIView subclass varies based on which
- plugin is being used to provide the web view implementation. Interactions
- with the web view and its content should be done through the ``webViewEngine``
- property.
-
- @Metadata {
- @Available(Cordova, introduced: "2.0.0")
- }
- */
-@property (nonatomic, readonly, nullable, weak) IBOutlet UIView *webView;
-
-/**
- An array of loaded Cordova plugin instances.
-
- This array is safe to iterate using a `for...in` loop.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property (nonatomic, readonly, copy) NSArray <CDVPlugin *> *enumerablePlugins;
-
-/**
- The scheme being used to load web content from the app bundle into the Cordova
- web view.
-
- The default value is `app` but can be customized via the `Scheme` preference
- in the Cordova XML configuration file. Setting this to `file` will results in
- web content being loaded using the File URL protocol, which has inherent
- security limitations. It is encouraged that you use a custom scheme to load
- your app content.
-
- It is not valid to set this to an existing protocol scheme such as `http` or
- `https`.
-
- @Metadata {
- @Available(Cordova, introduced: "6.0.0")
- }
- */
-@property (nonatomic, nullable, readwrite, copy) NSString *appScheme;
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "3.0.0")
- }
- */
-@property (nonatomic, readonly, strong) CDVCommandQueue *commandQueue;
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "2.0.0")
- }
- */
-@property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
-
-/**
- The associated web view engine implementation.
-
- This provides a reference to the web view plugin class, which
- implements ``CDVWebViewEngineProtocol`` and allows for interaction with the
- web view.
-
- @Metadata {
- @Available(Cordova, introduced: "4.0.0")
- }
- */
-@property (nonatomic, readonly, strong) id <CDVWebViewEngineProtocol> webViewEngine;
-
-/**
- The Cordova preferences for this view.
-
- This is a dictionary populated from the preference key/value pairs in the
- Cordova XML configuration file.
-
- @Metadata {
- @Available(Cordova, introduced: "2.0.0")
- }
- */
-@property (nonatomic, readonly, strong) CDVSettingsDictionary *settings;
-
-/**
- The filename of the Cordova XML configuration file.
-
- The default value is `"config.xml"`.
-
- This can be set in the storyboard file as a view controller attribute.
-
- @Metadata {
- @Available(Cordova, introduced: "5.0.0")
- }
- */
-@property (nonatomic, readwrite, copy) IBInspectable NSString *configFile;
-
-/**
- The file path to the Cordova XML configuration file.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property (nonatomic, nullable, readonly, copy) NSURL *configFilePath;
-
-/**
- The file path to the HTML error fallback page, if one has been provided.
-
- @Metadata {
- @Available(Cordova, introduced: "4.0.0")
- }
- */
-@property (nonatomic, nullable, readonly, copy) NSURL *errorURL;
-
-/**
- The folder path containing the web content to be displayed.
-
- The default value is `"www"`.
-
- This can be set in the storyboard file as a view controller attribute.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property (nonatomic, readwrite, copy) IBInspectable NSString *webContentFolderName;
-
-/**
- The filename of the HTML file to load into the web view.
-
- The default value will be read from the Cordova XML configuration file, and
- fall back to `"index.html"` if not specified.
-
- This can be set in the storyboard file as a view controller attribute.
-
- @Metadata {
- @Available(Cordova, introduced: "2.0.0")
- }
- */
-@property (nonatomic, nullable, readwrite, copy) IBInspectable NSString *startPage;
-
-/**
- A boolean value indicating whether to show the splash screen while the web view
- is initially loading.
-
- The default value is `YES`.
-
- This can be set in the storyboard file as a view controller attribute.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property (nonatomic) IBInspectable BOOL showInitialSplashScreen;
-
-/**
- The color drawn behind the web content.
-
- This is used as the background color for the web view behind any HTML content
- and during loading before web content has been rendered. The default value is
- the system background color.
-
- This can be set in the storyboard file as a view controller attribute.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property (nonatomic, null_resettable, copy) IBInspectable UIColor *backgroundColor;
-
-/**
- The color drawn behind the splash screen content.
-
- This is used as the background color for the splash screen while the web
- content is loading. If a page background color has been specified, that will
- be used as the default value, otherwise the system background color is used.
-
- This can be set in the storyboard file as a view controller attribute.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property (nonatomic, null_resettable, copy) IBInspectable UIColor *splashBackgroundColor;
-
-/**
- The color drawn behind the status bar.
-
- This can be set in the storyboard file as a view controller attribute.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-@property (nonatomic, null_resettable, copy) IBInspectable UIColor *statusBarBackgroundColor;
-
-#pragma mark - Methods
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "2.0.0")
- }
- */
-- (UIView*)newCordovaViewWithFrame:(CGRect)bounds;
-
-/**
- Loads the starting page in the web view, replacing any existing content.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (void)loadStartPage;
-
-/**
- Returns the ``CDVPlugin`` instance of the given plugin name, creating the
- instance if one does not exist.
-
- - Parameters:
- - pluginName: The name of the plugin to return.
- - Returns: The ``CDVPlugin`` instance, or `nil` if no plugin exists with the
- given name.
-
- @Metadata {
- @Available(Cordova, introduced: "3.0.0")
- }
- */
-- (nullable CDVPlugin *)getCommandInstance:(NSString *)pluginName;
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "3.0.0")
- }
- */
-- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className;
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "3.0.0")
- }
- */
-- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName;
-
-/**
- Toggles the display of the splash screen overtop of the web view.
-
- - Parameters:
- - visible: Whether to make the splash screen visible or not.
-
- @Metadata {
- @Available(Cordova, introduced: "8.0.0")
- }
- */
-- (void)showSplashScreen:(BOOL)visible;
-
-
-#pragma mark - Deprecated
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "3.0.0", deprecated: "8.0.0")
- }
- */
-@property (nonatomic, nullable, readonly, strong) NSXMLParser *configParser CDV_DEPRECATED(8.0.0, "");
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
- }
- */
-@property (nonatomic, nullable, readonly, copy) NSString *appURLScheme CDV_DEPRECATED(8.0.0, "");
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
- }
- */
-@property (nonatomic, readonly, strong) NSDictionary<NSString *, CDVPlugin *> *pluginObjects CDV_DEPRECATED(8.0.0, "Internal implementation detail, should not be used");
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
- }
- */
-@property (nullable, nonatomic, readonly, strong) NSDictionary<NSString *, NSString *> *pluginsMap CDV_DEPRECATED(8.0.0, "Internal implementation detail, should not be used");
-
-/**
- The folder path containing the web content to be displayed.
-
- The default value is `"www"`.
-
- @Metadata {
- @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
- }
- @DeprecationSummary {
- Use ``webContentFolderName`` instead.
- }
- */
-@property (nonatomic, readwrite, copy) NSString *wwwFolderName CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use webContentFolderName instead", "webContentFolderName");
-
-/**
- Toggles the display of the splash screen overtop of the web view.
-
- - Parameters:
- - visible: Whether to make the splash screen visible or not.
-
- @Metadata {
- @Available(Cordova, introduced: "6.0.0", deprecated: "8.0.0")
- }
- @DeprecationSummary {
- Use ``showSplashScreen:`` instead.
- }
- */
-- (void)showLaunchScreen:(BOOL)visible CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use showSplashScreen: instead", "showSplashScreen");
-
-/**
- Parses the Cordova XML configuration file using the given delegate.
-
- @Metadata {
- @Available(Cordova, introduced: "4.0.0", deprecated: "8.0.0")
- }
- @DeprecationSummary {
- Use `CDVConfigParser` ``CDVConfigParser/parseConfigFile:withDelegate:`` instead.
- }
- */
-- (void)parseSettingsWithParser:(id <NSXMLParserDelegate>)delegate CDV_DEPRECATED(8.0.0, "Use CDVConfigParser parseConfigFile:withDelegate: instead");
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewEngineProtocol.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewEngineProtocol.h
deleted file mode 100644
index d7110536f..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewEngineProtocol.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-
-#define kCDVWebViewEngineScriptMessageHandlers @"kCDVWebViewEngineScriptMessageHandlers"
-#define kCDVWebViewEngineWKNavigationDelegate @"kCDVWebViewEngineWKNavigationDelegate"
-#define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate"
-#define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences"
-
-@class WKWebViewConfiguration;
-
-@protocol CDVWebViewEngineProtocol <NSObject>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@property (nonatomic, strong, readonly) UIView* engineWebView;
-
-- (id)loadRequest:(NSURLRequest*)request;
-- (id)loadHTMLString:(NSString*)string baseURL:(nullable NSURL*)baseURL;
-- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^_Nullable)(id, NSError*))completionHandler;
-
-- (NSURL*)URL;
-- (BOOL)canLoadRequest:(NSURLRequest*)request;
-- (nullable instancetype)initWithFrame:(CGRect)frame;
-
-/// Convenience Initializer
-/// @param frame The frame for the new web view.
-/// @param configuration The configuration for the new web view.
-- (nullable instancetype)initWithFrame:(CGRect)frame configuration:(nullable WKWebViewConfiguration *)configuration;
-
-- (void)updateWithInfo:(NSDictionary*)info;
-
-NS_ASSUME_NONNULL_END
-
-@end
-
-
-@protocol CDVWebViewEngineConfigurationDelegate <NSObject>
-
-@optional
-/**
- Provides a fully configured WKWebViewConfiguration which will be overridden
- with any related settings you add to config.xml (e.g., `PreferredContentMode`).
- This is useful for more complex configuration, including `websiteDataStore`.
-
- ## Example usage
-
- ```swift
- extension CDVViewController: CDVWebViewEngineConfigurationDelegate {
- public func configuration() -> WKWebViewConfiguration {
- // return your config here
- }
- }
- ```
- */
-- (nonnull WKWebViewConfiguration*)configuration;
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewProcessPoolFactory.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewProcessPoolFactory.h
deleted file mode 100644
index cfdec1989..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewProcessPoolFactory.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVAvailabilityDeprecated.h>
-
-@class WKProcessPool;
-
-/**
- @Metadata {
- @Available(Cordova, introduced: "6.2.0", deprecated: "8.0.0")
- }
- */
-CDV_DEPRECATED(8.0.0, "WebKit WKProcessPool is deprecated in iOS")
-@interface CDVWebViewProcessPoolFactory : NSObject
-@property (nonatomic, retain) WKProcessPool* sharedPool;
-
-+(instancetype) sharedFactory;
--(WKProcessPool*) sharedProcessPool;
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/Cordova.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/Cordova.h
deleted file mode 100644
index 321b29483..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/Cordova.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#define __CORDOVA_SILENCE_HEADER_DEPRECATIONS
-
-#import <Cordova/CDVAvailability.h>
-#import <Cordova/CDVAvailabilityDeprecated.h>
-#import <Cordova/CDVAppDelegate.h>
-#import <Cordova/CDVSceneDelegate.h>
-#import <Cordova/CDVPlugin.h>
-#import <Cordova/CDVPluginNotifications.h>
-#import <Cordova/CDVPluginResult.h>
-#import <Cordova/CDVViewController.h>
-#import <Cordova/CDVCommandDelegate.h>
-#import <Cordova/CDVCommandQueue.h>
-#import <Cordova/CDVConfigParser.h>
-#import <Cordova/CDVInvokedUrlCommand.h>
-#import <Cordova/CDVPlugin+Resources.h>
-#import <Cordova/CDVSettingsDictionary.h>
-#import <Cordova/CDVWebViewEngineProtocol.h>
-#import <Cordova/CDVWebViewProcessPoolFactory.h>
-#import <Cordova/CDVScreenOrientationDelegate.h>
-#import <Cordova/CDVTimer.h>
-
-// Deprecated
-#import <Cordova/CDV.h>
-#import <Cordova/NSDictionary+CordovaPreferences.h>
-#import <Cordova/NSMutableArray+QueueAdditions.h>
-
-#undef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSDictionary+CordovaPreferences.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSDictionary+CordovaPreferences.h
deleted file mode 100644
index 894508911..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSDictionary+CordovaPreferences.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVAvailabilityDeprecated.h>
-
-#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
-#warning "Use CDVSettingsDictionary.h and the CDVSettingsDictionary class instead"
-#endif
-
-@interface NSDictionary (CordovaPreferences)
-
-- (id)cordovaSettingForKey:(NSString*)key CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
-- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
-- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
-
-@end
-
-@interface NSMutableDictionary (CordovaPreferences)
-
-- (void)setCordovaSetting:(id)value forKey:(NSString*)key CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSMutableArray+QueueAdditions.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSMutableArray+QueueAdditions.h
deleted file mode 100644
index df471f968..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSMutableArray+QueueAdditions.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVAvailabilityDeprecated.h>
-
-#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
-//#warning "This should not be used"
-#endif
-
-@interface NSMutableArray (QueueAdditions)
-
-- (id)cdv_pop CDV_DEPRECATED(8.0.0, "");
-- (id)cdv_queueHead CDV_DEPRECATED(8.0.0, "");
-- (id)cdv_dequeue;
-- (void)cdv_enqueue:(id)obj CDV_DEPRECATED(8.0.0, "");
-
-@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/Package.swift b/cordova/platforms/ios/packages/cordova-ios/Package.swift
deleted file mode 100644
index 6571d093c..000000000
--- a/cordova/platforms/ios/packages/cordova-ios/Package.swift
+++ /dev/null
@@ -1,47 +0,0 @@
-// swift-tools-version:5.5
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-import PackageDescription
-
-let package = Package(
- name: "Cordova",
- platforms: [
- .iOS(.v13),
- .macCatalyst(.v13)
- ],
- products: [
- .library(name: "Cordova", targets: ["Cordova"])
- ],
- dependencies: [],
- targets: [
- .target(
- name: "Cordova",
- path: "CordovaLib/",
- exclude: ["Info.plist"],
- resources: [
- .copy("PrivacyInfo.xcprivacy")
- ],
- cSettings: [
- .headerSearchPath("Classes/Private")
- ]
- )
- ]
-)
diff --git a/cordova/platforms/ios/platform_www/cordova.js b/cordova/platforms/ios/platform_www/cordova.js
deleted file mode 100644
index 136d639b6..000000000
--- a/cordova/platforms/ios/platform_www/cordova.js
+++ /dev/null
@@ -1,2175 +0,0 @@
-// Platform: cordova-ios
-// cordova-js 6.1.0
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '8.0.0';
-// file: src/scripts/require.js
-var require;
-var define;
-
-(function () {
- var modules = {};
- // Stack of moduleIds currently being built.
- var requireStack = [];
- // Map of module ID -> index into requireStack of modules currently being built.
- var inProgressModules = {};
- var SEPARATOR = '.';
-
- function build (module) {
- var factory = module.factory;
- var localRequire = function (id) {
- var resultantId = id;
- // Its a relative path, so lop off the last portion and add the id (minus "./")
- if (id.charAt(0) === '.') {
- resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
- }
- return require(resultantId);
- };
- module.exports = {};
- delete module.factory;
- factory(localRequire, module.exports, module);
- return module.exports;
- }
-
- require = function (id) {
- if (!modules[id]) {
- throw new Error('module ' + id + ' not found');
- } else if (id in inProgressModules) {
- var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
- throw new Error('Cycle in require graph: ' + cycle);
- }
- if (modules[id].factory) {
- try {
- inProgressModules[id] = requireStack.length;
- requireStack.push(id);
- return build(modules[id]);
- } finally {
- delete inProgressModules[id];
- requireStack.pop();
- }
- }
- return modules[id].exports;
- };
-
- define = function (id, factory) {
- if (Object.prototype.hasOwnProperty.call(modules, id)) {
- throw new Error('module ' + id + ' already defined');
- }
-
- modules[id] = {
- id: id,
- factory: factory
- };
- };
-
- define.remove = function (id) {
- delete modules[id];
- };
-
- define.moduleMap = modules;
-})();
-
-// Export for use in node
-if (typeof module === 'object' && typeof require === 'function') {
- module.exports.require = require;
- module.exports.define = define;
-}
-
-// file: src/cordova.js
-define("cordova", function(require, exports, module) {
-
-// Workaround for Windows 10 in hosted environment case
-// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
-if (window.cordova && !(window.cordova instanceof HTMLElement)) {
- throw new Error('cordova already defined');
-}
-
-var channel = require('cordova/channel');
-var platform = require('cordova/platform');
-
-/**
- * Intercept calls to addEventListener + removeEventListener and handle deviceready,
- * resume, and pause events.
- */
-var m_document_addEventListener = document.addEventListener;
-var m_document_removeEventListener = document.removeEventListener;
-var m_window_addEventListener = window.addEventListener;
-var m_window_removeEventListener = window.removeEventListener;
-
-/**
- * Houses custom event handlers to intercept on document + window event listeners.
- */
-var documentEventHandlers = {};
-var windowEventHandlers = {};
-
-document.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].subscribe(handler);
- } else {
- m_document_addEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].subscribe(handler);
- } else {
- m_window_addEventListener.call(window, evt, handler, capture);
- }
-};
-
-document.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].unsubscribe(handler);
- } else {
- m_document_removeEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].unsubscribe(handler);
- } else {
- m_window_removeEventListener.call(window, evt, handler, capture);
- }
-};
-
-function createEvent (type, data) {
- var event = document.createEvent('Events');
- event.initEvent(type, false, false);
- if (data) {
- for (var i in data) {
- if (Object.prototype.hasOwnProperty.call(data, i)) {
- event[i] = data[i];
- }
- }
- }
- return event;
-}
-
-var cordova = {
- define: define,
- require: require,
- version: PLATFORM_VERSION_BUILD_LABEL,
- platformVersion: PLATFORM_VERSION_BUILD_LABEL,
- platformId: platform.id,
-
- /**
- * Methods to add/remove your own addEventListener hijacking on document + window.
- */
- addWindowEventHandler: function (event) {
- return (windowEventHandlers[event] = channel.create(event));
- },
- addStickyDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.createSticky(event));
- },
- addDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.create(event));
- },
- removeWindowEventHandler: function (event) {
- delete windowEventHandlers[event];
- },
- removeDocumentEventHandler: function (event) {
- delete documentEventHandlers[event];
- },
-
- /**
- * Retrieve original event handlers that were replaced by Cordova
- *
- * @return object
- */
- getOriginalHandlers: function () {
- return {
- document: {
- addEventListener: m_document_addEventListener,
- removeEventListener: m_document_removeEventListener
- },
- window: {
- addEventListener: m_window_addEventListener,
- removeEventListener: m_window_removeEventListener
- }
- };
- },
-
- /**
- * Method to fire event from native code
- * bNoDetach is required for events which cause an exception which needs to be caught in native code
- */
- fireDocumentEvent: function (type, data, bNoDetach) {
- var evt = createEvent(type, data);
- if (typeof documentEventHandlers[type] !== 'undefined') {
- if (bNoDetach) {
- documentEventHandlers[type].fire(evt);
- } else {
- setTimeout(function () {
- // Fire deviceready on listeners that were registered before cordova.js was loaded.
- if (type === 'deviceready') {
- document.dispatchEvent(evt);
- }
- documentEventHandlers[type].fire(evt);
- }, 0);
- }
- } else {
- document.dispatchEvent(evt);
- }
- },
-
- fireWindowEvent: function (type, data) {
- var evt = createEvent(type, data);
- if (typeof windowEventHandlers[type] !== 'undefined') {
- setTimeout(function () {
- windowEventHandlers[type].fire(evt);
- }, 0);
- } else {
- window.dispatchEvent(evt);
- }
- },
-
- /**
- * Plugin callback mechanism.
- */
- // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
- // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
- callbackId: Math.floor(Math.random() * 2000000000),
- callbacks: {},
- callbackStatus: {
- NO_RESULT: 0,
- OK: 1,
- CLASS_NOT_FOUND_EXCEPTION: 2,
- ILLEGAL_ACCESS_EXCEPTION: 3,
- INSTANTIATION_EXCEPTION: 4,
- MALFORMED_URL_EXCEPTION: 5,
- IO_EXCEPTION: 6,
- INVALID_ACTION: 7,
- JSON_EXCEPTION: 8,
- ERROR: 9
- },
-
- /**
- * Called by native code when returning successful result from an action.
- */
- callbackSuccess: function (callbackId, args) {
- cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning error result from an action.
- */
- callbackError: function (callbackId, args) {
- // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
- // Derive success from status.
- cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning the result from an action.
- */
- callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) {
- try {
- var callback = cordova.callbacks[callbackId];
- if (callback) {
- if (isSuccess && status === cordova.callbackStatus.OK) {
- callback.success && callback.success.apply(null, args);
- } else if (!isSuccess) {
- callback.fail && callback.fail.apply(null, args);
- }
- /*
- else
- Note, this case is intentionally not caught.
- this can happen if isSuccess is true, but callbackStatus is NO_RESULT
- which is used to remove a callback from the list without calling the callbacks
- typically keepCallback is false in this case
- */
- // Clear callback if not expecting any more results
- if (!keepCallback) {
- delete cordova.callbacks[callbackId];
- }
- }
- } catch (err) {
- var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
- cordova.fireWindowEvent('cordovacallbackerror', { message: msg, error: err });
- throw err;
- }
- },
-
- addConstructor: function (func) {
- channel.onCordovaReady.subscribe(function () {
- try {
- func();
- } catch (e) {
- console.log('Failed to run constructor: ' + e);
- }
- });
- }
-};
-
-module.exports = cordova;
-
-});
-
-// file: src/common/argscheck.js
-define("cordova/argscheck", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-var moduleExports = module.exports;
-
-var typeMap = {
- A: 'Array',
- D: 'Date',
- N: 'Number',
- S: 'String',
- F: 'Function',
- O: 'Object'
-};
-
-function extractParamName (callee, argIndex) {
- return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex];
-}
-
-/**
- * Checks the given arguments' types and throws if they are not as expected.
- *
- * `spec` is a string where each character stands for the required type of the
- * argument at the same position. In other words: the character at `spec[i]`
- * specifies the required type for `args[i]`. The characters in `spec` are the
- * first letter of the required type's name. The supported types are:
- *
- * Array, Date, Number, String, Function, Object
- *
- * Lowercase characters specify arguments that must not be `null` or `undefined`
- * while uppercase characters allow those values to be passed.
- *
- * Finally, `*` can be used to allow any type at the corresponding position.
- *
- * @example
- * function foo (arr, opts) {
- * // require `arr` to be an Array and `opts` an Object, null or undefined
- * checkArgs('aO', 'my.package.foo', arguments);
- * // ...
- * }
- * @param {String} spec - the type specification for `args` as described above
- * @param {String} functionName - full name of the callee.
- * Used in the error message
- * @param {Array|arguments} args - the arguments to be checked against `spec`
- * @param {Function} [opt_callee=args.callee] - the recipient of `args`.
- * Used to extract parameter names for the error message
- * @throws {TypeError} if args do not satisfy spec
- */
-function checkArgs (spec, functionName, args, opt_callee) {
- if (!moduleExports.enableChecks) {
- return;
- }
- var errMsg = null;
- var typeName;
- for (var i = 0; i < spec.length; ++i) {
- var c = spec.charAt(i);
- var cUpper = c.toUpperCase();
- var arg = args[i];
- // Asterix means allow anything.
- if (c === '*') {
- continue;
- }
- typeName = utils.typeName(arg);
- if ((arg === null || arg === undefined) && c === cUpper) {
- continue;
- }
- if (typeName !== typeMap[cUpper]) {
- errMsg = 'Expected ' + typeMap[cUpper];
- break;
- }
- }
- if (errMsg) {
- errMsg += ', but got ' + typeName + '.';
- errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
- // Don't log when running unit tests.
- if (typeof jasmine === 'undefined') {
- console.error(errMsg);
- }
- throw TypeError(errMsg);
- }
-}
-
-function getValue (value, defaultValue) {
- return value === undefined ? defaultValue : value;
-}
-
-moduleExports.checkArgs = checkArgs;
-moduleExports.getValue = getValue;
-moduleExports.enableChecks = true;
-
-});
-
-// file: src/common/base64.js
-define("cordova/base64", function(require, exports, module) {
-
-var base64 = exports;
-
-base64.fromArrayBuffer = function (arrayBuffer) {
- var array = new Uint8Array(arrayBuffer);
- return uint8ToBase64(array);
-};
-
-base64.toArrayBuffer = function (str) {
- var decodedStr = atob(str);
- var arrayBuffer = new ArrayBuffer(decodedStr.length);
- var array = new Uint8Array(arrayBuffer);
- for (var i = 0, len = decodedStr.length; i < len; i++) {
- array[i] = decodedStr.charCodeAt(i);
- }
- return arrayBuffer;
-};
-
-// ------------------------------------------------------------------------------
-
-/* This code is based on the performance tests at http://jsperf.com/b64tests
- * This 12-bit-at-a-time algorithm was the best performing version on all
- * platforms tested.
- */
-
-var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
-var b64_12bit;
-
-var b64_12bitTable = function () {
- b64_12bit = [];
- for (var i = 0; i < 64; i++) {
- for (var j = 0; j < 64; j++) {
- b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j];
- }
- }
- b64_12bitTable = function () { return b64_12bit; };
- return b64_12bit;
-};
-
-function uint8ToBase64 (rawData) {
- var numBytes = rawData.byteLength;
- var output = '';
- var segment;
- var table = b64_12bitTable();
- for (var i = 0; i < numBytes - 2; i += 3) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2];
- output += table[segment >> 12];
- output += table[segment & 0xfff];
- }
- if (numBytes - i === 2) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8);
- output += table[segment >> 12];
- output += b64_6bit[(segment & 0xfff) >> 6];
- output += '=';
- } else if (numBytes - i === 1) {
- segment = (rawData[i] << 16);
- output += table[segment >> 12];
- output += '==';
- }
- return output;
-}
-
-});
-
-// file: src/common/builder.js
-define("cordova/builder", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-function each (objects, func, context) {
- for (var prop in objects) {
- if (Object.prototype.hasOwnProperty.call(objects, prop)) {
- func.apply(context, [objects[prop], prop]);
- }
- }
-}
-
-function clobber (obj, key, value) {
- var needsProperty = false;
- try {
- obj[key] = value;
- } catch (e) {
- needsProperty = true;
- }
- // Getters can only be overridden by getters.
- if (needsProperty || obj[key] !== value) {
- utils.defineGetter(obj, key, function () {
- return value;
- });
- }
-}
-
-function assignOrWrapInDeprecateGetter (obj, key, value, message) {
- if (message) {
- utils.defineGetter(obj, key, function () {
- console.log(message);
- delete obj[key];
- clobber(obj, key, value);
- return value;
- });
- } else {
- clobber(obj, key, value);
- }
-}
-
-function include (parent, objects, clobber, merge) {
- each(objects, function (obj, key) {
- try {
- var result = obj.path ? require(obj.path) : {};
-
- if (clobber) {
- // Clobber if it doesn't exist.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (typeof obj.path !== 'undefined') {
- // If merging, merge properties onto parent, otherwise, clobber.
- if (merge) {
- recursiveMerge(parent[key], result);
- } else {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- }
- }
- result = parent[key];
- } else {
- // Overwrite if not currently defined.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else {
- // Set result to what already exists, so we can build children into it if they exist.
- result = parent[key];
- }
- }
-
- if (obj.children) {
- include(result, obj.children, clobber, merge);
- }
- } catch (e) {
- utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
- }
- });
-}
-
-/**
- * Merge properties from one object onto another recursively. Properties from
- * the src object will overwrite existing target property.
- *
- * @param target Object to merge properties into.
- * @param src Object to merge properties from.
- */
-function recursiveMerge (target, src) {
- for (var prop in src) {
- if (Object.prototype.hasOwnProperty.call(src, prop)) {
- if (target.prototype && target.prototype.constructor === target) {
- // If the target object is a constructor override off prototype.
- clobber(target.prototype, prop, src[prop]);
- } else {
- if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
- recursiveMerge(target[prop], src[prop]);
- } else {
- clobber(target, prop, src[prop]);
- }
- }
- }
- }
-}
-
-exports.buildIntoButDoNotClobber = function (objects, target) {
- include(target, objects, false, false);
-};
-exports.buildIntoAndClobber = function (objects, target) {
- include(target, objects, true, false);
-};
-exports.buildIntoAndMerge = function (objects, target) {
- include(target, objects, true, true);
-};
-exports.recursiveMerge = recursiveMerge;
-exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
-
-});
-
-// file: src/common/channel.js
-define("cordova/channel", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-var nextGuid = 1;
-
-/**
- * Custom pub-sub "channel" that can have functions subscribed to it
- * This object is used to define and control firing of events for
- * cordova initialization, as well as for custom events thereafter.
- *
- * The order of events during page load and Cordova startup is as follows:
- *
- * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed.
- * onNativeReady* Internal event that indicates the Cordova native side is ready.
- * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created.
- * onDeviceReady* User event fired to indicate that Cordova is ready
- * onResume User event fired to indicate a start/resume lifecycle event
- * onPause User event fired to indicate a pause lifecycle event
- *
- * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
- * All listeners that subscribe after the event is fired will be executed right away.
- *
- * The only Cordova events that user code should register for are:
- * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
- * pause App has moved to background
- * resume App has returned to foreground
- *
- * Listeners can be registered as:
- * document.addEventListener("deviceready", myDeviceReadyListener, false);
- * document.addEventListener("resume", myResumeListener, false);
- * document.addEventListener("pause", myPauseListener, false);
- *
- * The DOM lifecycle events should be used for saving and restoring state
- * window.onload
- * window.onunload
- *
- */
-
-/**
- * Channel
- * @constructor
- * @param type String the channel name
- */
-var Channel = function (type, sticky) {
- this.type = type;
- // Map of guid -> function.
- this.handlers = {};
- // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
- this.state = sticky ? 1 : 0;
- // Used in sticky mode to remember args passed to fire().
- this.fireArgs = null;
- // Used by onHasSubscribersChange to know if there are any listeners.
- this.numHandlers = 0;
- // Function that is called when the first listener is subscribed, or when
- // the last listener is unsubscribed.
- this.onHasSubscribersChange = null;
-};
-var channel = {
- /**
- * Calls the provided function only after all of the channels specified
- * have been fired. All channels must be sticky channels.
- */
- join: function (h, c) {
- var len = c.length;
- var i = len;
- var f = function () {
- if (!(--i)) h();
- };
- for (var j = 0; j < len; j++) {
- if (c[j].state === 0) {
- throw Error('Can only use join with sticky channels.');
- }
- c[j].subscribe(f);
- }
- if (!len) h();
- },
-
- create: function (type) {
- return (channel[type] = new Channel(type, false));
- },
- createSticky: function (type) {
- return (channel[type] = new Channel(type, true));
- },
-
- /**
- * cordova Channels that must fire before "deviceready" is fired.
- */
- deviceReadyChannelsArray: [],
- deviceReadyChannelsMap: {},
-
- /**
- * Indicate that a feature needs to be initialized before it is ready to be used.
- * This holds up Cordova's "deviceready" event until the feature has been initialized
- * and Cordova.initComplete(feature) is called.
- *
- * @param feature {String} The unique feature name
- */
- waitForInitialization: function (feature) {
- if (feature) {
- var c = channel[feature] || this.createSticky(feature);
- this.deviceReadyChannelsMap[feature] = c;
- this.deviceReadyChannelsArray.push(c);
- }
- },
-
- /**
- * Indicate that initialization code has completed and the feature is ready to be used.
- *
- * @param feature {String} The unique feature name
- */
- initializationComplete: function (feature) {
- var c = this.deviceReadyChannelsMap[feature];
- if (c) {
- c.fire();
- }
- }
-};
-
-function checkSubscriptionArgument (argument) {
- if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') {
- throw new Error(
- 'Must provide a function or an EventListener object ' +
- 'implementing the handleEvent interface.'
- );
- }
-}
-
-/**
- * Subscribes the given function to the channel. Any time that
- * Channel.fire is called so too will the function.
- * Optionally specify an execution context for the function
- * and a guid that can be used to stop subscribing to the channel.
- * Returns the guid.
- */
-Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- eventListener = eventListenerOrFunction;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- if (this.state === 2) {
- handleEvent.apply(eventListener || this, this.fireArgs);
- return;
- }
-
- guid = eventListenerOrFunction.observer_guid;
- if (typeof eventListener === 'object') {
- handleEvent = utils.close(eventListener, handleEvent);
- }
-
- if (!guid) {
- // First time any channel has seen this subscriber
- guid = '' + nextGuid++;
- }
- handleEvent.observer_guid = guid;
- eventListenerOrFunction.observer_guid = guid;
-
- // Don't add the same handler more than once.
- if (!this.handlers[guid]) {
- this.handlers[guid] = handleEvent;
- this.numHandlers++;
- if (this.numHandlers === 1) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Unsubscribes the function with the given guid from the channel.
- */
-Channel.prototype.unsubscribe = function (eventListenerOrFunction) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid, handler;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- guid = handleEvent.observer_guid;
- handler = this.handlers[guid];
- if (handler) {
- delete this.handlers[guid];
- this.numHandlers--;
- if (this.numHandlers === 0) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Calls all functions subscribed to this channel.
- */
-Channel.prototype.fire = function (e) {
- var fireArgs = Array.prototype.slice.call(arguments);
- // Apply stickiness.
- if (this.state === 1) {
- this.state = 2;
- this.fireArgs = fireArgs;
- }
- if (this.numHandlers) {
- // Copy the values first so that it is safe to modify it from within
- // callbacks.
- var toCall = [];
- for (var item in this.handlers) {
- toCall.push(this.handlers[item]);
- }
- for (var i = 0; i < toCall.length; ++i) {
- toCall[i].apply(this, fireArgs);
- }
- if (this.state === 2 && this.numHandlers) {
- this.numHandlers = 0;
- this.handlers = {};
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-// defining them here so they are ready super fast!
-// DOM event that is received when the web page is loaded and parsed.
-channel.createSticky('onDOMContentLoaded');
-
-// Event to indicate the Cordova native side is ready.
-channel.createSticky('onNativeReady');
-
-// Event to indicate that all Cordova JavaScript objects have been created
-// and it's time to run plugin constructors.
-channel.createSticky('onCordovaReady');
-
-// Event to indicate that all automatically loaded JS plugins are loaded and ready.
-// FIXME remove this
-channel.createSticky('onPluginsReady');
-
-// Event to indicate that Cordova is ready
-channel.createSticky('onDeviceReady');
-
-// Event to indicate a resume lifecycle event
-channel.create('onResume');
-
-// Event to indicate a pause lifecycle event
-channel.create('onPause');
-
-// Channels that must fire before "deviceready" is fired.
-channel.waitForInitialization('onCordovaReady');
-channel.waitForInitialization('onDOMContentLoaded');
-
-module.exports = channel;
-
-});
-
-// file: ../../cordova-js-src/exec.js
-define("cordova/exec", function(require, exports, module) {
-
-/**
- * Creates the exec bridge used to notify the native code of
- * commands.
- */
-var cordova = require('cordova');
-var utils = require('cordova/utils');
-var base64 = require('cordova/base64');
-
-function massageArgsJsToNative (args) {
- if (!args || utils.typeName(args) !== 'Array') {
- return args;
- }
- var ret = [];
- args.forEach(function (arg, i) {
- if (utils.typeName(arg) === 'ArrayBuffer') {
- ret.push({
- CDVType: 'ArrayBuffer',
- data: base64.fromArrayBuffer(arg)
- });
- } else {
- ret.push(arg);
- }
- });
- return ret;
-}
-
-function massageMessageNativeToJs (message) {
- if (message.CDVType === 'ArrayBuffer') {
- var stringToArrayBuffer = function (str) {
- var ret = new Uint8Array(str.length);
- for (var i = 0; i < str.length; i++) {
- ret[i] = str.charCodeAt(i);
- }
- return ret.buffer;
- };
- var base64ToArrayBuffer = function (b64) {
- return stringToArrayBuffer(atob(b64));
- };
- message = base64ToArrayBuffer(message.data);
- }
- return message;
-}
-
-function convertMessageToArgsNativeToJs (message) {
- var args = [];
- if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) {
- args.push(message);
- } else if (message.CDVType === 'MultiPart') {
- message.messages.forEach(function (e) {
- args.push(massageMessageNativeToJs(e));
- });
- } else {
- args.push(massageMessageNativeToJs(message));
- }
- return args;
-}
-
-var iOSExec = function () {
- var successCallback, failCallback, service, action, actionArgs;
- var callbackId = null;
- if (typeof arguments[0] !== 'string') {
- // FORMAT ONE
- successCallback = arguments[0];
- failCallback = arguments[1];
- service = arguments[2];
- action = arguments[3];
- actionArgs = arguments[4];
-
- // Since we need to maintain backwards compatibility, we have to pass
- // an invalid callbackId even if no callback was provided since plugins
- // will be expecting it. The Cordova.exec() implementation allocates
- // an invalid callbackId and passes it even if no callbacks were given.
- callbackId = 'INVALID';
- } else {
- throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
- 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
- }
-
- // If actionArgs is not provided, default to an empty array
- actionArgs = actionArgs || [];
-
- // Register the callbacks and add the callbackId to the positional
- // arguments if given.
- if (successCallback || failCallback) {
- callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
- { success: successCallback, fail: failCallback };
- }
-
- actionArgs = massageArgsJsToNative(actionArgs);
-
- // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
- var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
- window.webkit.messageHandlers.cordova.postMessage(command);
-};
-
-iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
- var success = status === 0 || status === 1;
- var args = convertMessageToArgsNativeToJs(message);
- Promise.resolve().then(function () {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
- });
-};
-
-// for backwards compatibility
-iOSExec.nativeEvalAndFetch = function (func) {
- try {
- func();
- } catch (e) {
- console.log(e);
- }
-};
-
-// Proxy the exec for bridge changes. See CB-10106
-
-function cordovaExec () {
- var cexec = require('cordova/exec');
- var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
- return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
-}
-
-function execProxy () {
- cordovaExec().apply(null, arguments);
-}
-
-execProxy.nativeFetchMessages = function () {
- return cordovaExec().nativeFetchMessages.apply(null, arguments);
-};
-
-execProxy.nativeEvalAndFetch = function () {
- return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
-};
-
-execProxy.nativeCallback = function () {
- return cordovaExec().nativeCallback.apply(null, arguments);
-};
-
-module.exports = execProxy;
-
-});
-
-// file: src/common/exec/proxy.js
-define("cordova/exec/proxy", function(require, exports, module) {
-
-// internal map of proxy function
-var CommandProxyMap = {};
-
-module.exports = {
-
- // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
- add: function (id, proxyObj) {
- console.log('adding proxy for ' + id);
- CommandProxyMap[id] = proxyObj;
- return proxyObj;
- },
-
- // cordova.commandProxy.remove("Accelerometer");
- remove: function (id) {
- var proxy = CommandProxyMap[id];
- delete CommandProxyMap[id];
- CommandProxyMap[id] = null;
- return proxy;
- },
-
- get: function (service, action) {
- return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null);
- }
-};
-
-});
-
-// file: src/common/init.js
-define("cordova/init", function(require, exports, module) {
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-
-var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
-
-function logUnfiredChannels (arr) {
- for (var i = 0; i < arr.length; ++i) {
- if (arr[i].state !== 2) {
- console.log('Channel not fired: ' + arr[i].type);
- }
- }
-}
-
-window.setTimeout(function () {
- if (channel.onDeviceReady.state !== 2) {
- console.log('deviceready has not fired after 5 seconds.');
- logUnfiredChannels(platformInitChannelsArray);
- logUnfiredChannels(channel.deviceReadyChannelsArray);
- }
-}, 5000);
-
-if (!window.console) {
- window.console = {
- log: function () {}
- };
-}
-if (!window.console.warn) {
- window.console.warn = function (msg) {
- this.log('warn: ' + msg);
- };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onActivated = cordova.addDocumentEventHandler('activated');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState === 'complete' || document.readyState === 'interactive') {
- channel.onDOMContentLoaded.fire();
-} else {
- document.addEventListener('DOMContentLoaded', function () {
- channel.onDOMContentLoaded.fire();
- }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
- channel.onNativeReady.fire();
-}
-
-modulemapper.clobbers('cordova', 'cordova');
-modulemapper.clobbers('cordova/exec', 'cordova.exec');
-modulemapper.clobbers('cordova/exec', 'Cordova.exec');
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
-// The delay allows the attached modules to be defined before the plugin loader looks for them.
-setTimeout(function () {
- pluginloader.load(function () {
- channel.onPluginsReady.fire();
- });
-}, 0);
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function () {
- modulemapper.mapModules(window);
-
- platform.initialize && platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once page has fully loaded, all
- // constructors have run and cordova info has been received from native
- // side.
- channel.join(function () {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-}, platformInitChannelsArray);
-
-});
-
-// file: src/common/modulemapper.js
-define("cordova/modulemapper", function(require, exports, module) {
-
-var builder = require('cordova/builder');
-var moduleMap = define.moduleMap;
-var symbolList;
-var deprecationMap;
-
-exports.reset = function () {
- symbolList = [];
- deprecationMap = {};
-};
-
-function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) {
- if (!(moduleName in moduleMap)) {
- throw new Error('Module ' + moduleName + ' does not exist.');
- }
- symbolList.push(strategy, moduleName, symbolPath);
- if (opt_deprecationMessage) {
- deprecationMap[symbolPath] = opt_deprecationMessage;
- }
-}
-
-// Note: Android 2.3 does have Function.bind().
-exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.runs = function (moduleName) {
- addEntry('r', moduleName, null);
-};
-
-function prepareNamespace (symbolPath, context) {
- if (!symbolPath) {
- return context;
- }
- return symbolPath.split('.').reduce(function (cur, part) {
- return (cur[part] = cur[part] || {});
- }, context);
-}
-
-exports.mapModules = function (context) {
- var origSymbols = {};
- context.CDV_origSymbols = origSymbols;
- for (var i = 0, len = symbolList.length; i < len; i += 3) {
- var strategy = symbolList[i];
- var moduleName = symbolList[i + 1];
- var module = require(moduleName);
- // <runs/>
- if (strategy === 'r') {
- continue;
- }
- var symbolPath = symbolList[i + 2];
- var lastDot = symbolPath.lastIndexOf('.');
- var namespace = symbolPath.substr(0, lastDot);
- var lastName = symbolPath.substr(lastDot + 1);
-
- var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
- var parentObj = prepareNamespace(namespace, context);
- var target = parentObj[lastName];
-
- if (strategy === 'm' && target) {
- builder.recursiveMerge(target, module);
- } else if ((strategy === 'd' && !target) || (strategy !== 'd')) {
- if (!(symbolPath in origSymbols)) {
- origSymbols[symbolPath] = target;
- }
- builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
- }
- }
-};
-
-exports.getOriginalSymbol = function (context, symbolPath) {
- var origSymbols = context.CDV_origSymbols;
- if (origSymbols && (symbolPath in origSymbols)) {
- return origSymbols[symbolPath];
- }
- var parts = symbolPath.split('.');
- var obj = context;
- for (var i = 0; i < parts.length; ++i) {
- obj = obj && obj[parts[i]];
- }
- return obj;
-};
-
-exports.reset();
-
-});
-
-// file: ../../cordova-js-src/platform.js
-define("cordova/platform", function(require, exports, module) {
-
-module.exports = {
- id: 'ios',
- bootstrap: function () {
- // Attach the console polyfill that is iOS-only to window.console
- // see the file under plugin/ios/console.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
-
- // Attach the wkwebkit utility to window.WkWebView
- // see the file under plugin/ios/wkwebkit.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView');
-
- // Attach the splashscreen utility to window.navigator.splashscreen
- // see the file under plugin/ios/launchscreen.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
-
- // Attach the internal statusBar utility to window.statusbar
- // see the file under plugin/ios/statusbar.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/statusbar', 'window.statusbar');
-
- require('cordova/channel').onNativeReady.fire();
- }
-};
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/console.js
-define("cordova/plugin/ios/console", function(require, exports, module) {
-
-// ------------------------------------------------------------------------------
-
-var logger = require('cordova/plugin/ios/logger');
-
-// ------------------------------------------------------------------------------
-// object that we're exporting
-// ------------------------------------------------------------------------------
-var console = module.exports;
-
-// ------------------------------------------------------------------------------
-// copy of the original console object
-// ------------------------------------------------------------------------------
-var WinConsole = window.console;
-
-// ------------------------------------------------------------------------------
-// whether to use the logger
-// ------------------------------------------------------------------------------
-var UseLogger = false;
-
-// ------------------------------------------------------------------------------
-// Timers
-// ------------------------------------------------------------------------------
-var Timers = {};
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-function noop () {}
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-console.useLogger = function (value) {
- if (arguments.length) UseLogger = !!value;
-
- if (UseLogger) {
- if (logger.useConsole()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
-
- return UseLogger;
-};
-
-// ------------------------------------------------------------------------------
-console.log = function () {
- if (logger.useConsole()) return;
- logger.log.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.error = function () {
- if (logger.useConsole()) return;
- logger.error.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.warn = function () {
- if (logger.useConsole()) return;
- logger.warn.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.info = function () {
- if (logger.useConsole()) return;
- logger.info.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.debug = function () {
- if (logger.useConsole()) return;
- logger.debug.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.assert = function (expression) {
- if (expression) return;
-
- var message = logger.format.apply(logger.format, [].slice.call(arguments, 1));
- console.log('ASSERT: ' + message);
-};
-
-// ------------------------------------------------------------------------------
-console.clear = function () {};
-
-// ------------------------------------------------------------------------------
-console.dir = function (object) {
- console.log('%o', object);
-};
-
-// ------------------------------------------------------------------------------
-console.dirxml = function (node) {
- console.log(node.innerHTML);
-};
-
-// ------------------------------------------------------------------------------
-console.trace = noop;
-
-// ------------------------------------------------------------------------------
-console.group = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupCollapsed = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.time = function (name) {
- Timers[name] = new Date().valueOf();
-};
-
-// ------------------------------------------------------------------------------
-console.timeEnd = function (name) {
- var timeStart = Timers[name];
- if (!timeStart) {
- console.warn('unknown timer: ' + name);
- return;
- }
-
- var timeElapsed = new Date().valueOf() - timeStart;
- console.log(name + ': ' + timeElapsed + 'ms');
-};
-
-// ------------------------------------------------------------------------------
-console.timeStamp = noop;
-
-// ------------------------------------------------------------------------------
-console.profile = noop;
-
-// ------------------------------------------------------------------------------
-console.profileEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.count = noop;
-
-// ------------------------------------------------------------------------------
-console.exception = console.log;
-
-// ------------------------------------------------------------------------------
-console.table = function (data, columns) {
- console.log('%o', data);
-};
-
-// ------------------------------------------------------------------------------
-// return a new function that calls both functions passed as args
-// ------------------------------------------------------------------------------
-function wrappedOrigCall (orgFunc, newFunc) {
- return function () {
- var args = [].slice.call(arguments);
- try { orgFunc.apply(WinConsole, args); } catch (e) {}
- try { newFunc.apply(console, args); } catch (e) {}
- };
-}
-
-// ------------------------------------------------------------------------------
-// For every function that exists in the original console object, that
-// also exists in the new console object, wrap the new console method
-// with one that calls both
-// ------------------------------------------------------------------------------
-for (var key in console) {
- if (typeof WinConsole[key] === 'function') {
- console[key] = wrappedOrigCall(WinConsole[key], console[key]);
- }
-}
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/launchscreen.js
-define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var launchscreen = {
- show: function () {
- exec(null, null, 'LaunchScreen', 'show', []);
- },
- hide: function () {
- exec(null, null, 'LaunchScreen', 'hide', []);
- }
-};
-
-module.exports = launchscreen;
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/logger.js
-define("cordova/plugin/ios/logger", function(require, exports, module) {
-
-// ------------------------------------------------------------------------------
-// The logger module exports the following properties/functions:
-//
-// LOG - constant for the level LOG
-// ERROR - constant for the level ERROR
-// WARN - constant for the level WARN
-// INFO - constant for the level INFO
-// DEBUG - constant for the level DEBUG
-// logLevel() - returns current log level
-// logLevel(value) - sets and returns a new log level
-// useConsole() - returns whether logger is using console
-// useConsole(value) - sets and returns whether logger is using console
-// log(message,...) - logs a message at level LOG
-// error(message,...) - logs a message at level ERROR
-// warn(message,...) - logs a message at level WARN
-// info(message,...) - logs a message at level INFO
-// debug(message,...) - logs a message at level DEBUG
-// logLevel(level,message,...) - logs a message specified level
-//
-// ------------------------------------------------------------------------------
-
-var logger = exports;
-
-var exec = require('cordova/exec');
-
-var UseConsole = false;
-var UseLogger = true;
-var Queued = [];
-var DeviceReady = false;
-var CurrentLevel;
-
-var originalConsole = console;
-
-/**
- * Logging levels
- */
-
-var Levels = [
- 'LOG',
- 'ERROR',
- 'WARN',
- 'INFO',
- 'DEBUG'
-];
-
-/*
- * add the logging levels to the logger object and
- * to a separate levelsMap object for testing
- */
-
-var LevelsMap = {};
-for (var i = 0; i < Levels.length; i++) {
- var level = Levels[i];
- LevelsMap[level] = i;
- logger[level] = level;
-}
-
-CurrentLevel = LevelsMap.WARN;
-
-/**
- * Getter/Setter for the logging level
- *
- * Returns the current logging level.
- *
- * When a value is passed, sets the logging level to that value.
- * The values should be one of the following constants:
- * logger.LOG
- * logger.ERROR
- * logger.WARN
- * logger.INFO
- * logger.DEBUG
- *
- * The value used determines which messages get printed. The logging
- * values above are in order, and only messages logged at the logging
- * level or above will actually be displayed to the user. E.g., the
- * default level is WARN, so only messages logged with LOG, ERROR, or
- * WARN will be displayed; INFO and DEBUG messages will be ignored.
- */
-logger.level = function (value) {
- if (arguments.length) {
- if (LevelsMap[value] === null) {
- throw new Error('invalid logging level: ' + value);
- }
- CurrentLevel = LevelsMap[value];
- }
-
- return Levels[CurrentLevel];
-};
-
-/**
- * Getter/Setter for the useConsole functionality
- *
- * When useConsole is true, the logger will log via the
- * browser 'console' object.
- */
-logger.useConsole = function (value) {
- if (arguments.length) UseConsole = !!value;
-
- if (UseConsole) {
- if (typeof console === 'undefined') {
- throw new Error('global console object is not defined');
- }
-
- if (typeof console.log !== 'function') {
- throw new Error('global console object does not have a log function');
- }
-
- if (typeof console.useLogger === 'function') {
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
- }
-
- return UseConsole;
-};
-
-/**
- * Getter/Setter for the useLogger functionality
- *
- * When useLogger is true, the logger will log via the
- * native Logger plugin.
- */
-logger.useLogger = function (value) {
- // Enforce boolean
- if (arguments.length) UseLogger = !!value;
- return UseLogger;
-};
-
-/**
- * Logs a message at the LOG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.log = function (message) { logWithArgs('LOG', arguments); };
-
-/**
- * Logs a message at the ERROR level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.error = function (message) { logWithArgs('ERROR', arguments); };
-
-/**
- * Logs a message at the WARN level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.warn = function (message) { logWithArgs('WARN', arguments); };
-
-/**
- * Logs a message at the INFO level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.info = function (message) { logWithArgs('INFO', arguments); };
-
-/**
- * Logs a message at the DEBUG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.debug = function (message) { logWithArgs('DEBUG', arguments); };
-
-// log at the specified level with args
-function logWithArgs (level, args) {
- args = [level].concat([].slice.call(args));
- logger.logLevel.apply(logger, args);
-}
-
-// return the correct formatString for an object
-function formatStringForMessage (message) {
- return (typeof message === 'string') ? '' : '%o';
-}
-
-/**
- * Logs a message at the specified level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.logLevel = function (level /* , ... */) {
- // format the message with the parameters
- var formatArgs = [].slice.call(arguments, 1);
- var fmtString = formatStringForMessage(formatArgs[0]);
- if (fmtString.length > 0) {
- formatArgs.unshift(fmtString); // add formatString
- }
-
- var message = logger.format.apply(logger.format, formatArgs);
-
- if (LevelsMap[level] === null) {
- throw new Error('invalid logging level: ' + level);
- }
-
- if (LevelsMap[level] > CurrentLevel) return;
-
- // queue the message if not yet at deviceready
- if (!DeviceReady && !UseConsole) {
- Queued.push([level, message]);
- return;
- }
-
- // Log using the native logger if that is enabled
- if (UseLogger) {
- exec(null, null, 'Console', 'logLevel', [level, message]);
- }
-
- // Log using the console if that is enabled
- if (UseConsole) {
- // make sure console is not using logger
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
-
- // log to the console
- switch (level) {
- case logger.LOG: originalConsole.log(message); break;
- case logger.ERROR: originalConsole.log('ERROR: ' + message); break;
- case logger.WARN: originalConsole.log('WARN: ' + message); break;
- case logger.INFO: originalConsole.log('INFO: ' + message); break;
- case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break;
- }
- }
-};
-
-/**
- * Formats a string and arguments following it ala console.log()
- *
- * Any remaining arguments will be appended to the formatted string.
- *
- * for rationale, see FireBug's Console API:
- * http://getfirebug.com/wiki/index.php/Console_API
- */
-logger.format = function (formatString, args) {
- return __format(arguments[0], [].slice.call(arguments, 1)).join(' ');
-};
-
-// ------------------------------------------------------------------------------
-/**
- * Formats a string and arguments following it ala vsprintf()
- *
- * format chars:
- * %j - format arg as JSON
- * %o - format arg as JSON
- * %c - format arg as ''
- * %% - replace with '%'
- * any other char following % will format it's
- * arg via toString().
- *
- * Returns an array containing the formatted string and any remaining
- * arguments.
- */
-function __format (formatString, args) {
- if (formatString === null || formatString === undefined) return [''];
- if (arguments.length === 1) return [formatString.toString()];
-
- if (typeof formatString !== 'string') { formatString = formatString.toString(); }
-
- var pattern = /(.*?)%(.)(.*)/;
- var rest = formatString;
- var result = [];
-
- while (args.length) {
- var match = pattern.exec(rest);
- if (!match) break;
-
- var arg = args.shift();
- rest = match[3];
- result.push(match[1]);
-
- if (match[2] === '%') {
- result.push('%');
- args.unshift(arg);
- continue;
- }
-
- result.push(__formatted(arg, match[2]));
- }
-
- result.push(rest);
-
- var remainingArgs = [].slice.call(args);
- remainingArgs.unshift(result.join(''));
- return remainingArgs;
-}
-
-function __formatted (object, formatChar) {
- try {
- switch (formatChar) {
- case 'j':
- case 'o': return JSON.stringify(object);
- case 'c': return '';
- }
- } catch (e) {
- return 'error JSON.stringify()ing argument: ' + e;
- }
-
- if ((object === null) || (object === undefined)) {
- return Object.prototype.toString.call(object);
- }
-
- return object.toString();
-}
-
-// ------------------------------------------------------------------------------
-// when deviceready fires, log queued messages
-logger.__onDeviceReady = function () {
- if (DeviceReady) return;
-
- DeviceReady = true;
-
- for (var i = 0; i < Queued.length; i++) {
- var messageArgs = Queued[i];
- logger.logLevel(messageArgs[0], messageArgs[1]);
- }
-
- Queued = null;
-};
-
-// add a deviceready event to log queued messages
-document.addEventListener('deviceready', logger.__onDeviceReady, false);
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/statusbar.js
-define("cordova/plugin/ios/statusbar", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var statusBarVisible = true;
-var statusBar = {};
-
-// This <script> element is explicitly used by Cordova's statusbar for computing color. (Do not use this element)
-const statusBarScript = document.createElement('script');
-document.head.appendChild(statusBarScript);
-
-Object.defineProperty(statusBar, 'visible', {
- configurable: false,
- enumerable: true,
- get: function () {
- if (window.StatusBar) {
- // Let the CDVStatusBar plugin handle it
- return window.StatusBar.isVisible;
- }
-
- return statusBarVisible;
- },
- set: function (value) {
- if (window.StatusBar) {
- // Let the CDVStatusBar plugin handle it
- if (value) {
- window.StatusBar.show();
- } else {
- window.StatusBar.hide();
- }
- } else {
- statusBarVisible = value;
- exec(null, null, 'StatusBarInternal', 'setVisible', [!!value]);
- }
- }
-});
-
-Object.defineProperty(statusBar, 'setBackgroundColor', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: function (value) {
- statusBarScript.style.color = value;
- var rgbStr = window.getComputedStyle(statusBarScript).getPropertyValue('color');
-
- if (!rgbStr.match(/^rgb/)) {
- return;
- }
-
- var rgbVals = rgbStr.match(/\d+/g).map(function (v) { return parseInt(v, 10); });
- if (rgbVals.length < 3) {
- return;
- }
-
- if (window.StatusBar) {
- window.StatusBar.backgroundColorByHexString('#' + rgbVals[0].toString(16).padStart(2, '0') + rgbVals[1].toString(16).padStart(2, '0') + rgbVals[2].toString(16).padStart(2, '0'));
- } else {
- exec(null, null, 'StatusBarInternal', 'setBackgroundColor', rgbVals);
- }
- }
-});
-
-module.exports = statusBar;
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/wkwebkit.js
-define("cordova/plugin/ios/wkwebkit", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var WkWebKit = {
- allowsBackForwardNavigationGestures: function (allow) {
- exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
- },
- convertFilePath: function (path) {
- if (!path || !window.CDV_ASSETS_URL) {
- return path;
- }
- if (path.startsWith('/')) {
- return window.CDV_ASSETS_URL + '/_app_file_' + path;
- }
- if (path.startsWith('file://')) {
- return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_');
- }
- return path;
- }
-};
-
-module.exports = WkWebKit;
-
-});
-
-// file: src/common/pluginloader.js
-define("cordova/pluginloader", function(require, exports, module) {
-
-var modulemapper = require('cordova/modulemapper');
-
-// Helper function to inject a <script> tag.
-// Exported for testing.
-exports.injectScript = function (url, onload, onerror) {
- var script = document.createElement('script');
- // onload fires even when script fails loads with an error.
- script.onload = onload;
- // onerror fires for malformed URLs.
- script.onerror = onerror;
- script.src = url;
- document.head.appendChild(script);
-};
-
-function injectIfNecessary (id, url, onload, onerror) {
- onerror = onerror || onload;
- if (id in define.moduleMap) {
- onload();
- } else {
- exports.injectScript(url, function () {
- if (id in define.moduleMap) {
- onload();
- } else {
- onerror();
- }
- }, onerror);
- }
-}
-
-function onScriptLoadingComplete (moduleList, finishPluginLoading) {
- // Loop through all the plugins and then through their clobbers and merges.
- for (var i = 0, module; (module = moduleList[i]); i++) {
- if (module.clobbers && module.clobbers.length) {
- for (var j = 0; j < module.clobbers.length; j++) {
- modulemapper.clobbers(module.id, module.clobbers[j]);
- }
- }
-
- if (module.merges && module.merges.length) {
- for (var k = 0; k < module.merges.length; k++) {
- modulemapper.merges(module.id, module.merges[k]);
- }
- }
-
- // Finally, if runs is truthy we want to simply require() the module.
- if (module.runs) {
- modulemapper.runs(module.id);
- }
- }
-
- finishPluginLoading();
-}
-
-// Handler for the cordova_plugins.js content.
-// See plugman's plugin_loader.js for the details of this object.
-// This function is only called if the really is a plugins array that isn't empty.
-// Otherwise the onerror response handler will just call finishPluginLoading().
-function handlePluginsObject (path, moduleList, finishPluginLoading) {
- // Now inject the scripts.
- var scriptCounter = moduleList.length;
-
- if (!scriptCounter) {
- finishPluginLoading();
- return;
- }
- function scriptLoadedCallback () {
- if (!--scriptCounter) {
- onScriptLoadingComplete(moduleList, finishPluginLoading);
- }
- }
-
- for (var i = 0; i < moduleList.length; i++) {
- injectIfNecessary(moduleList[i].id, path + moduleList[i].file, scriptLoadedCallback);
- }
-}
-
-function findCordovaPath () {
- var path = null;
- var scripts = document.getElementsByTagName('script');
- var term = '/cordova.js';
- for (var n = scripts.length - 1; n > -1; n--) {
- var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
- if (src.indexOf(term) === (src.length - term.length)) {
- path = src.substring(0, src.length - term.length) + '/';
- break;
- }
- }
- return path;
-}
-
-// Tries to load all plugins' js-modules.
-// This is an async process, but onDeviceReady is blocked on onPluginsReady.
-// onPluginsReady is fired when there are no plugins to load, or they are all done.
-exports.load = function (callback) {
- var pathPrefix = findCordovaPath();
- if (pathPrefix === null) {
- console.log('Could not find cordova.js script tag. Plugin loading may fail.');
- pathPrefix = '';
- }
- injectIfNecessary('cordova/plugin_list', pathPrefix + 'cordova_plugins.js', function () {
- var moduleList = require('cordova/plugin_list');
- handlePluginsObject(pathPrefix, moduleList, callback);
- }, callback);
-};
-
-});
-
-// file: src/common/urlutil.js
-define("cordova/urlutil", function(require, exports, module) {
-
-/**
- * For already absolute URLs, returns what is passed in.
- * For relative URLs, converts them to absolute ones.
- */
-exports.makeAbsolute = function makeAbsolute (url) {
- var anchorEl = document.createElement('a');
- anchorEl.href = url;
- return anchorEl.href;
-};
-
-});
-
-// file: src/common/utils.js
-define("cordova/utils", function(require, exports, module) {
-
-var utils = exports;
-
-/**
- * Defines a property getter / setter for obj[key].
- */
-utils.defineGetterSetter = function (obj, key, getFunc, opt_setFunc) {
- if (Object.defineProperty) {
- var desc = {
- get: getFunc,
- configurable: true
- };
- if (opt_setFunc) {
- desc.set = opt_setFunc;
- }
- Object.defineProperty(obj, key, desc);
- } else {
- obj.__defineGetter__(key, getFunc);
- if (opt_setFunc) {
- obj.__defineSetter__(key, opt_setFunc);
- }
- }
-};
-
-/**
- * Defines a property getter for obj[key].
- */
-utils.defineGetter = utils.defineGetterSetter;
-
-utils.arrayIndexOf = function (a, item) {
- if (a.indexOf) {
- return a.indexOf(item);
- }
- var len = a.length;
- for (var i = 0; i < len; ++i) {
- if (a[i] === item) {
- return i;
- }
- }
- return -1;
-};
-
-/**
- * Returns whether the item was found in the array.
- */
-utils.arrayRemove = function (a, item) {
- var index = utils.arrayIndexOf(a, item);
- if (index !== -1) {
- a.splice(index, 1);
- }
- return index !== -1;
-};
-
-utils.typeName = function (val) {
- return Object.prototype.toString.call(val).slice(8, -1);
-};
-
-/**
- * Returns an indication of whether the argument is an array or not
- */
-utils.isArray = Array.isArray ||
- function (a) { return utils.typeName(a) === 'Array'; };
-
-/**
- * Returns an indication of whether the argument is a Date or not
- */
-utils.isDate = function (d) {
- return (d instanceof Date);
-};
-
-/**
- * Does a deep clone of the object.
- */
-utils.clone = function (obj) {
- if (!obj || typeof obj === 'function' || utils.isDate(obj) || typeof obj !== 'object') {
- return obj;
- }
-
- var retVal, i;
-
- if (utils.isArray(obj)) {
- retVal = [];
- for (i = 0; i < obj.length; ++i) {
- retVal.push(utils.clone(obj[i]));
- }
- return retVal;
- }
-
- retVal = {};
- for (i in obj) {
- // 'unknown' type may be returned in custom protocol activation case on
- // Windows Phone 8.1 causing "No such interface supported" exception on
- // cloning (https://issues.apache.org/jira/browse/CB-11522)
- // eslint-disable-next-line valid-typeof
- if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') {
- retVal[i] = utils.clone(obj[i]);
- }
- }
- return retVal;
-};
-
-/**
- * Returns a wrapped version of the function
- */
-utils.close = function (context, func, params) {
- return function () {
- var args = params || arguments;
- return func.apply(context, args);
- };
-};
-
-// ------------------------------------------------------------------------------
-function UUIDcreatePart (length) {
- var uuidpart = '';
- for (var i = 0; i < length; i++) {
- var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
- if (uuidchar.length === 1) {
- uuidchar = '0' + uuidchar;
- }
- uuidpart += uuidchar;
- }
- return uuidpart;
-}
-
-/**
- * Create a UUID
- */
-utils.createUUID = function () {
- return UUIDcreatePart(4) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(6);
-};
-
-/**
- * Extends a child object from a parent object using classical inheritance
- * pattern.
- */
-utils.extend = (function () {
- // proxy used to establish prototype chain
- var F = function () {};
- // extend Child from Parent
- return function (Child, Parent) {
- F.prototype = Parent.prototype;
- Child.prototype = new F();
- Child.__super__ = Parent.prototype;
- Child.prototype.constructor = Child;
- };
-}());
-
-/**
- * Alerts a message in any available way: alert or console.log.
- */
-utils.alert = function (msg) {
- if (window.alert) {
- window.alert(msg);
- } else if (console && console.log) {
- console.log(msg);
- }
-};
-
-});
-
-window.cordova = require('cordova');
-// file: src/scripts/bootstrap.js
-require('cordova/init');
-
-})();
diff --git a/cordova/platforms/ios/platform_www/cordova_plugins.js b/cordova/platforms/ios/platform_www/cordova_plugins.js
deleted file mode 100644
index 89efbb690..000000000
--- a/cordova/platforms/ios/platform_www/cordova_plugins.js
+++ /dev/null
@@ -1,278 +0,0 @@
-cordova.define('cordova/plugin_list', function(require, exports, module) {
- module.exports = [
- {
- "id": "com.whebcraft.cordova.plugin.downloader.Downloader",
- "file": "plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js",
- "pluginId": "com.whebcraft.cordova.plugin.downloader",
- "clobbers": [
- "plugins.Downloader"
- ]
- },
- {
- "id": "es6-promise-plugin.Promise",
- "file": "plugins/es6-promise-plugin/www/promise.js",
- "pluginId": "es6-promise-plugin",
- "runs": true
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
- },
- {
- "id": "cordova-plugin-background-mode.BackgroundMode",
- "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
- "pluginId": "cordova-plugin-background-mode",
- "clobbers": [
- "cordova.plugins.backgroundMode",
- "plugin.backgroundMode"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryEntry",
- "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryReader",
- "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryReader"
- ]
- },
- {
- "id": "cordova-plugin-file.Entry",
- "file": "plugins/cordova-plugin-file/www/Entry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Entry"
- ]
- },
- {
- "id": "cordova-plugin-file.File",
- "file": "plugins/cordova-plugin-file/www/File.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.File"
- ]
- },
- {
- "id": "cordova-plugin-file.FileEntry",
- "file": "plugins/cordova-plugin-file/www/FileEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.FileError",
- "file": "plugins/cordova-plugin-file/www/FileError.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileError"
- ]
- },
- {
- "id": "cordova-plugin-file.FileReader",
- "file": "plugins/cordova-plugin-file/www/FileReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileReader"
- ]
- },
- {
- "id": "cordova-plugin-file.FileSystem",
- "file": "plugins/cordova-plugin-file/www/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadOptions",
- "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadOptions"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadResult",
- "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadResult"
- ]
- },
- {
- "id": "cordova-plugin-file.FileWriter",
- "file": "plugins/cordova-plugin-file/www/FileWriter.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileWriter"
- ]
- },
- {
- "id": "cordova-plugin-file.Flags",
- "file": "plugins/cordova-plugin-file/www/Flags.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Flags"
- ]
- },
- {
- "id": "cordova-plugin-file.LocalFileSystem",
- "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.LocalFileSystem"
- ],
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.Metadata",
- "file": "plugins/cordova-plugin-file/www/Metadata.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Metadata"
- ]
- },
- {
- "id": "cordova-plugin-file.ProgressEvent",
- "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.ProgressEvent"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems",
- "file": "plugins/cordova-plugin-file/www/fileSystems.js",
- "pluginId": "cordova-plugin-file"
- },
- {
- "id": "cordova-plugin-file.requestFileSystem",
- "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.requestFileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.resolveLocalFileSystemURI",
- "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.isChrome",
- "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.iosFileSystem",
- "file": "plugins/cordova-plugin-file/www/ios/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems-roots",
- "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.fileSystemPaths",
- "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "cordova"
- ],
- "runs": true
- },
- {
- "id": "cordova-plugin-file-opener2.FileOpener2",
- "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
- "pluginId": "cordova-plugin-file-opener2",
- "clobbers": [
- "cordova.plugins.fileOpener2"
- ]
- },
- {
- "id": "cordova-plugin-x-socialsharing.SocialSharing",
- "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
- "pluginId": "cordova-plugin-x-socialsharing",
- "clobbers": [
- "window.plugins.socialsharing"
- ]
- },
- {
- "id": "cordova-plugin-camera.Camera",
- "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "Camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverOptions",
- "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverOptions"
- ]
- },
- {
- "id": "cordova-plugin-camera.camera",
- "file": "plugins/cordova-plugin-camera/www/Camera.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "navigator.camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverHandle",
- "file": "plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverHandle"
- ]
- },
- {
- "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
- "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
- "pluginId": "com-darryncampbell-cordova-plugin-intent",
- "clobbers": [
- "intentShim"
- ]
- }
- ];
- module.exports.metadata = {
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-whitelist": "1.3.3",
- "cordova-plugin-device": "2.0.2",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.3",
- "cordova-plugin-x-socialsharing": "5.6.8",
- "cordova-plugin-camera": "4.1.0",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "com-darryncampbell-cordova-plugin-intent": "2.0.0",
- "cordova-plugin-androidx": "3.0.0"
- };
-});
\ No newline at end of file
diff --git a/cordova/platforms/ios/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js b/cordova/platforms/ios/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
deleted file mode 100644
index 67be5340c..000000000
--- a/cordova/platforms/ios/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
+++ /dev/null
@@ -1,91 +0,0 @@
-cordova.define("com-darryncampbell-cordova-plugin-intent.IntentShim", function(require, exports, module) {
-var argscheck = require('cordova/argscheck'),
- channel = require('cordova/channel'),
- utils = require('cordova/utils'),
- exec = require('cordova/exec'),
- cordova = require('cordova');
-
-
-/**
- * This represents a thin shim layer over the Android Intent implementation
- * @constructor
- */
-function IntentShim() {
- var me = this;
-}
-
-IntentShim.prototype.ACTION_SEND = "android.intent.action.SEND";
-IntentShim.prototype.ACTION_VIEW= "android.intent.action.VIEW";
-IntentShim.prototype.ACTION_INSTALL_PACKAGE="android.intent.action.INSTALL_PACKAGE";
-IntentShim.prototype.ACTION_UNINSTALL_PACKAGE= "android.intent.action.UNINSTALL_PACKAGE";
-IntentShim.prototype.EXTRA_TEXT = "android.intent.extra.TEXT";
-IntentShim.prototype.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
-IntentShim.prototype.EXTRA_STREAM = "android.intent.extra.STREAM";
-IntentShim.prototype.EXTRA_EMAIL = "android.intent.extra.EMAIL";
-IntentShim.prototype.ACTION_CALL = "android.intent.action.CALL";
-IntentShim.prototype.ACTION_SENDTO = "android.intent.action.SENDTO";
-// StartActivityForResult
-IntentShim.prototype.ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
-IntentShim.prototype.ACTION_PICK = "android.intent.action.PICK";
-IntentShim.prototype.RESULT_CANCELED = 0; // Activity.RESULT_CANCELED
-IntentShim.prototype.RESULT_OK = -1; // Activity.RESULT_OK
-
-IntentShim.prototype.startActivity = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startActivity', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startActivity", [params]);
-};
-
-IntentShim.prototype.startActivityForResult = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startActivityForResult', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startActivityForResult", [params]);
-};
-
-IntentShim.prototype.sendBroadcast = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.sendBroadcast', arguments);
- exec(successCallback, errorCallback, "IntentShim", "sendBroadcast", [params]);
-};
-
-IntentShim.prototype.startService = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startService', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startService", [params]);
-};
-
-IntentShim.prototype.registerBroadcastReceiver = function(params, callback) {
- argscheck.checkArgs('of', 'IntentShim.registerBroadcastReceiver', arguments);
- exec(callback, null, "IntentShim", "registerBroadcastReceiver", [params]);
-};
-
-IntentShim.prototype.unregisterBroadcastReceiver = function() {
- argscheck.checkArgs('', 'IntentShim.unregisterBroadcastReceiver', arguments);
- exec(null, null, "IntentShim", "unregisterBroadcastReceiver", []);
-};
-
-IntentShim.prototype.onIntent = function(callback) {
- argscheck.checkArgs('f', 'IntentShim.onIntent', arguments);
- exec(callback, null, "IntentShim", "onIntent", [callback]);
-};
-
-IntentShim.prototype.onActivityResult = function(callback) {
- argscheck.checkArgs('f', 'IntentShim.onActivityResult', arguments);
- exec(callback, null, "IntentShim", "onActivityResult", [callback]);
-};
-
-IntentShim.prototype.getIntent = function(successCallback, failureCallback) {
- argscheck.checkArgs('ff', 'IntentShim.getIntent', arguments);
- exec(successCallback, failureCallback, "IntentShim", "getIntent", []);
-};
-
-IntentShim.prototype.sendResult = function(params, callback) {
- argscheck.checkArgs('of', 'IntentShim.sendResult', arguments);
- exec(callback, null, "IntentShim", "sendResult", [params]);
-}
-
-IntentShim.prototype.realPathFromUri = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.realPathFromUri', arguments);
- exec(successCallback, errorCallback, "IntentShim", "realPathFromUri", [params]);
-};
-
-window.intentShim = new IntentShim();
-window.plugins = window.plugins || {};
-window.plugins.intentShim = window.intentShim;
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js b/cordova/platforms/ios/platform_www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js
deleted file mode 100644
index b8dad0882..000000000
--- a/cordova/platforms/ios/platform_www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js
+++ /dev/null
@@ -1,25 +0,0 @@
-cordova.define("com.whebcraft.cordova.plugin.downloader.Downloader", function(require, exports, module) {
-var Downloader = {
- download: function (arguments, successCallback, errorCallback) {
- cordova.exec(
- successCallback,
- errorCallback,
- 'Downloader',
- 'download',
- [arguments]
- );
- }
-};
-
-function install() {
- if (!window.plugins) {
- window.plugins = {};
- }
-
- window.plugins.Downloader = Downloader;
- return window.plugins.Downloader;
-};
-
-cordova.addConstructor(install);
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js
deleted file mode 100644
index 7895b27ad..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js
+++ /dev/null
@@ -1,513 +0,0 @@
-cordova.define("cordova-plugin-background-mode.BackgroundMode", function(require, exports, module) {
-/*
- Copyright 2013-2017 appPlant GmbH
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var exec = require('cordova/exec'),
- channel = require('cordova/channel');
-
-/**
- * Activates the background mode. When activated the application
- * will be prevented from going to sleep while in background
- * for the next time.
- *
- * @return [ Void ]
- */
-exports.enable = function()
-{
- if (this.isEnabled())
- return;
-
- var fn = function() {
- exports._isEnabled = true;
- exports.fireEvent('enable');
- };
-
- cordova.exec(fn, null, 'BackgroundMode', 'enable', []);
-};
-
-/**
- * Deactivates the background mode. When deactivated the application
- * will not stay awake while in background.
- *
- * @return [ Void ]
- */
-exports.disable = function()
-{
- if (!this.isEnabled())
- return;
-
- var fn = function() {
- exports._isEnabled = false;
- exports.fireEvent('disable');
- };
-
- cordova.exec(fn, null, 'BackgroundMode', 'disable', []);
-};
-
-/**
- * Enable or disable the background mode.
- *
- * @param [ Bool ] enable The status to set for.
- *
- * @return [ Void ]
- */
-exports.setEnabled = function (enable)
-{
- if (enable) {
- this.enable();
- } else {
- this.disable();
- }
-};
-
-/**
- * List of all available options with their default value.
- *
- * @return [ Object ]
- */
-exports.getDefaults = function()
-{
- return this._defaults;
-};
-
-/**
- * The actual applied settings.
- *
- * @return [ Object ]
- */
-exports.getSettings = function()
-{
- return this._settings || {};
-};
-
-/**
- * Overwrite the default settings.
- *
- * @param [ Object ] overrides Dict of options to be overridden.
- *
- * @return [ Void ]
- */
-exports.setDefaults = function (overrides)
-{
- var defaults = this.getDefaults();
-
- for (var key in defaults)
- {
- if (overrides.hasOwnProperty(key))
- {
- defaults[key] = overrides[key];
- }
- }
-
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundMode', 'configure', [defaults, false]);
- }
-};
-
-/**
- * Configures the notification settings for Android.
- * Will be merged with the defaults.
- *
- * @param [ Object ] options Dict of options to be overridden.
- *
- * @return [ Void ]
- */
-exports.configure = function (options)
-{
- var settings = this.getSettings(),
- defaults = this.getDefaults();
-
- if (!this._isAndroid)
- return;
-
- if (!this._isActive)
- {
- console.log('BackgroundMode is not active, skipped...');
- return;
- }
-
- this._mergeObjects(options, settings);
- this._mergeObjects(options, defaults);
- this._settings = options;
-
- cordova.exec(null, null, 'BackgroundMode', 'configure', [options, true]);
-};
-
-/**
- * Enable GPS-tracking in background (Android).
- *
- * @return [ Void ]
- */
-exports.disableWebViewOptimizations = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'webview', []);
- }
-};
-
-/**
- * Disables battery optimazation mode for the app.
- *
- * @return [ Void ]
- */
-exports.disableBatteryOptimizations = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'battery', []);
- }
-};
-
-/**
- * Opens the system settings dialog where the user can tweak or turn off any
- * custom app start settings added by the manufacturer if available.
- *
- * @param [ Object|Bool ] options Set to false if you dont want to display an
- * alert dialog first.
- *
- * @return [ Void ]
- */
-exports.openAppStartSettings = function (options)
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'appstart', [options]);
- }
-};
-
-/**
- * Move app to background (Android only).
- *
- * @return [ Void ]
- */
-exports.moveToBackground = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'background', []);
- }
-};
-
-/**
- * Move app to foreground when in background (Android only).
- *
- * @return [ Void ]
- */
-exports.moveToForeground = function()
-{
- if (this.isActive() && this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'foreground', []);
- }
-};
-
-/**
- * Exclude the app from the recent tasks list (Android only).
- *
- * @return [ Void ]
- */
-exports.excludeFromTaskList = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'tasklist', []);
- }
-};
-
-/**
- * Override the back button on Android to go to background
- * instead of closing the app.
- *
- * @return [ Void ]
- */
-exports.overrideBackButton = function()
-{
- document.addEventListener('backbutton', function() {
- exports.moveToBackground();
- }, false);
-};
-
-/**
- * If the screen is off.
- *
- * @param [ Function ] fn Callback function to invoke with boolean arg.
- *
- * @return [ Void ]
- */
-exports.isScreenOff = function (fn)
-{
- if (this._isAndroid)
- {
- cordova.exec(fn, null, 'BackgroundModeExt', 'dimmed', []);
- }
- else
- {
- fn(undefined);
- }
-};
-
-/**
- * Wake up the device.
- *
- * @return [ Void ]
- */
-exports.wakeUp = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'wakeup', []);
- }
-};
-
-/**
- * Wake up and unlock the device.
- *
- * @return [ Void ]
- */
-exports.unlock = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'unlock', []);
- }
-};
-
-/**
- * If the mode is enabled or disabled.
- *
- * @return [ Boolean ]
- */
-exports.isEnabled = function()
-{
- return this._isEnabled !== false;
-};
-
-/**
- * If the mode is active.
- *
- * @return [ Boolean ]
- */
-exports.isActive = function()
-{
- return this._isActive !== false;
-};
-
-exports._listener = {};
-
-/**
- * Fire event with given arguments.
- *
- * @param [ String ] event The event's name.
- * @param [ Array<Object> ] The callback's arguments.
- *
- * @return [ Void ]
- */
-exports.fireEvent = function (event)
-{
- var args = Array.apply(null, arguments).slice(1),
- listener = this._listener[event];
-
- if (!listener)
- return;
-
- for (var i = 0; i < listener.length; i++)
- {
- var fn = listener[i][0],
- scope = listener[i][1];
-
- fn.apply(scope, args);
- }
-};
-
-/**
- * Register callback for given event.
- *
- * @param [ String ] event The event's name.
- * @param [ Function ] callback The function to be exec as callback.
- * @param [ Object ] scope The callback function's scope.
- *
- * @return [ Void ]
- */
-exports.on = function (event, callback, scope)
-{
- if (typeof callback !== "function")
- return;
-
- if (!this._listener[event])
- {
- this._listener[event] = [];
- }
-
- var item = [callback, scope || window];
-
- this._listener[event].push(item);
-};
-
-/**
- * Unregister callback for given event.
- *
- * @param [ String ] event The event's name.
- * @param [ Function ] callback The function to be exec as callback.
- *
- * @return [ Void ]
- */
-exports.un = function (event, callback)
-{
- var listener = this._listener[event];
-
- if (!listener)
- return;
-
- for (var i = 0; i < listener.length; i++)
- {
- var fn = listener[i][0];
-
- if (fn == callback)
- {
- listener.splice(i, 1);
- break;
- }
- }
-};
-
-/**
- * @private
- *
- * Flag indicates if the mode is enabled.
- */
-exports._isEnabled = false;
-
-/**
- * @private
- *
- * Flag indicates if the mode is active.
- */
-exports._isActive = false;
-
-/**
- * @private
- *
- * Default values of all available options.
- */
-exports._defaults =
-{
- title: 'App is running in background',
- text: 'Doing heavy tasks.',
- bigText: false,
- resume: true,
- silent: false,
- hidden: true,
- color: undefined,
- icon: 'icon'
-};
-
-/**
- * @private
- *
- * Merge settings with default values.
- *
- * @param [ Object ] options The custom options.
- * @param [ Object ] toMergeIn The options to merge in.
- *
- * @return [ Object ] Default values merged with custom values.
- */
-exports._mergeObjects = function (options, toMergeIn)
-{
- for (var key in toMergeIn)
- {
- if (!options.hasOwnProperty(key))
- {
- options[key] = toMergeIn[key];
- continue;
- }
- }
-
- return options;
-};
-
-/**
- * @private
- *
- * Setter for the isActive flag. Resets the
- * settings if the mode isnt active anymore.
- *
- * @param [ Boolean] value The new value for the flag.
- *
- * @return [ Void ]
- */
-exports._setActive = function(value)
-{
- if (this._isActive == value)
- return;
-
- this._isActive = value;
- this._settings = value ? this._mergeObjects({}, this._defaults) : {};
-};
-
-/**
- * @private
- *
- * Initialize the plugin.
- *
- * Method should be called after the 'deviceready' event
- * but before the event listeners will be called.
- *
- * @return [ Void ]
- */
-exports._pluginInitialize = function()
-{
- this._isAndroid = device.platform.match(/^android|amazon/i) !== null;
- this.setDefaults({});
-
- if (device.platform == 'browser')
- {
- this.enable();
- this._isEnabled = true;
- }
-
- this._isActive = this._isActive || device.platform == 'browser';
-};
-
-// Called before 'deviceready' listener will be called
-channel.onCordovaReady.subscribe(function()
-{
- channel.onCordovaInfoReady.subscribe(function() {
- exports._pluginInitialize();
- });
-});
-
-// Called after 'deviceready' event
-channel.deviceready.subscribe(function()
-{
- if (exports.isEnabled())
- {
- exports.fireEvent('enable');
- }
-
- if (exports.isActive())
- {
- exports.fireEvent('activate');
- }
-});
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/Camera.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/Camera.js
deleted file mode 100644
index 3f614ec80..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/Camera.js
+++ /dev/null
@@ -1,188 +0,0 @@
-cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var exec = require('cordova/exec');
-var Camera = require('./Camera');
-// XXX: commented out
-// CameraPopoverHandle = require('./CameraPopoverHandle');
-
-/**
- * @namespace navigator
- */
-
-/**
- * @exports camera
- */
-var cameraExport = {};
-
-// Tack on the Camera Constants to the base camera plugin.
-for (var key in Camera) {
- cameraExport[key] = Camera[key];
-}
-
-/**
- * Callback function that provides an error message.
- * @callback module:camera.onError
- * @param {string} message - The message is provided by the device's native code.
- */
-
-/**
- * Callback function that provides the image data.
- * @callback module:camera.onSuccess
- * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
- * @example
- * // Show image
- * //
- * function cameraCallback(imageData) {
- * var image = document.getElementById('myImage');
- * image.src = "data:image/jpeg;base64," + imageData;
- * }
- */
-
-/**
- * Optional parameters to customize the camera settings.
- * * [Quirks](#CameraOptions-quirks)
- * @typedef module:camera.CameraOptions
- * @type {Object}
- * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
- * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
- * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
- * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
- * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
- * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
- * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
- * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
- * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
- * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
- * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
- * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
- */
-
-/**
- * @description Takes a photo using the camera, or retrieves a photo from the device's
- * image gallery. The image is passed to the success callback as a
- * Base64-encoded `String`, or as the URI for the image file.
- *
- * The `camera.getPicture` function opens the device's default camera
- * application that allows users to snap pictures by default - this behavior occurs,
- * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
- * Once the user snaps the photo, the camera application closes and the application is restored.
- *
- * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
- * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
- * that allows users to select an existing image.
- *
- * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
- * one of the following formats, depending on the specified
- * `cameraOptions`:
- *
- * - A `String` containing the Base64-encoded photo image.
- * - A `String` representing the image file location on local storage (default).
- *
- * You can do whatever you want with the encoded image or URI, for
- * example:
- *
- * - Render the image in an `<img>` tag, as in the example below
- * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
- * - Post the data to a remote server
- *
- * __NOTE__: Photo resolution on newer devices is quite good. Photos
- * selected from the device's gallery are not downscaled to a lower
- * quality, even if a `quality` parameter is specified. To avoid common
- * memory problems, set `Camera.destinationType` to `FILE_URI` rather
- * than `DATA_URL`.
- *
- * __Supported Platforms__
- *
- * - Android
- * - BlackBerry
- * - Browser
- * - Firefox
- * - FireOS
- * - iOS
- * - Windows
- * - WP8
- * - Ubuntu
- *
- * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
- *
- * @example
- * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
- * @param {module:camera.onSuccess} successCallback
- * @param {module:camera.onError} errorCallback
- * @param {module:camera.CameraOptions} options CameraOptions
- */
-cameraExport.getPicture = function (successCallback, errorCallback, options) {
- argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
- options = options || {};
- var getValue = argscheck.getValue;
-
- var quality = getValue(options.quality, 50);
- var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
- var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
- var targetWidth = getValue(options.targetWidth, -1);
- var targetHeight = getValue(options.targetHeight, -1);
- var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
- var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
- var allowEdit = !!options.allowEdit;
- var correctOrientation = !!options.correctOrientation;
- var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
- var popoverOptions = getValue(options.popoverOptions, null);
- var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
-
- var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
- mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
-
- exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
- // XXX: commented out
- // return new CameraPopoverHandle();
-};
-
-/**
- * Removes intermediate image files that are kept in temporary storage
- * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
- * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
- * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
- *
- * __Supported Platforms__
- *
- * - iOS
- *
- * @example
- * navigator.camera.cleanup(onSuccess, onFail);
- *
- * function onSuccess() {
- * console.log("Camera cleanup success.")
- * }
- *
- * function onFail(message) {
- * alert('Failed because: ' + message);
- * }
- */
-cameraExport.cleanup = function (successCallback, errorCallback) {
- exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
-};
-
-module.exports = cameraExport;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
deleted file mode 100644
index 4f4b046f1..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
+++ /dev/null
@@ -1,104 +0,0 @@
-cordova.define("cordova-plugin-camera.Camera", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * @module Camera
- */
-module.exports = {
- /**
- * @description
- * Defines the output format of `Camera.getPicture` call.
- * _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
- * `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
- * disable any image modifications (resize, quality change, cropping, etc.) due
- * to implementation specific.
- *
- * @enum {number}
- */
- DestinationType: {
- /** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
- DATA_URL: 0,
- /** Return file uri (content://media/external/images/media/2 for Android) */
- FILE_URI: 1,
- /** Return native uri (eg. asset-library://... for iOS) */
- NATIVE_URI: 2
- },
- /**
- * @enum {number}
- */
- EncodingType: {
- /** Return JPEG encoded image */
- JPEG: 0,
- /** Return PNG encoded image */
- PNG: 1
- },
- /**
- * @enum {number}
- */
- MediaType: {
- /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
- PICTURE: 0,
- /** Allow selection of video only, ONLY RETURNS URL */
- VIDEO: 1,
- /** Allow selection from all media types */
- ALLMEDIA: 2
- },
- /**
- * @description
- * Defines the output format of `Camera.getPicture` call.
- * _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
- * along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
- * change, cropping, etc.) due to implementation specific.
- *
- * @enum {number}
- */
- PictureSourceType: {
- /** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
- PHOTOLIBRARY: 0,
- /** Take picture from camera */
- CAMERA: 1,
- /** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
- SAVEDPHOTOALBUM: 2
- },
- /**
- * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
- * @enum {number}
- */
- PopoverArrowDirection: {
- ARROW_UP: 1,
- ARROW_DOWN: 2,
- ARROW_LEFT: 4,
- ARROW_RIGHT: 8,
- ARROW_ANY: 15
- },
- /**
- * @enum {number}
- */
- Direction: {
- /** Use the back-facing camera */
- BACK: 0,
- /** Use the front-facing camera */
- FRONT: 1
- }
-};
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
deleted file mode 100644
index 6e03c52ee..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
+++ /dev/null
@@ -1,59 +0,0 @@
-cordova.define("cordova-plugin-camera.CameraPopoverOptions", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Camera = require('./Camera');
-
-/**
- * @namespace navigator
- */
-
-/**
- * iOS-only parameters that specify the anchor element location and arrow
- * direction of the popover when selecting images from an iPad's library
- * or album.
- * Note that the size of the popover may change to adjust to the
- * direction of the arrow and orientation of the screen. Make sure to
- * account for orientation changes when specifying the anchor element
- * location.
- * @module CameraPopoverOptions
- * @param {Number} [x=0] - x pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [y=32] - y pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [width=320] - width, in pixels, of the screen element onto which to anchor the popover.
- * @param {Number} [height=480] - height, in pixels, of the screen element onto which to anchor the popover.
- * @param {module:Camera.PopoverArrowDirection} [arrowDir=ARROW_ANY] - Direction the arrow on the popover should point.
- * @param {Number} [popoverWidth=0] - width of the popover (0 or not specified will use apple's default width).
- * @param {Number} [popoverHeight=0] - height of the popover (0 or not specified will use apple's default height).
- */
-var CameraPopoverOptions = function (x, y, width, height, arrowDir, popoverWidth, popoverHeight) {
- // information of rectangle that popover should be anchored to
- this.x = x || 0;
- this.y = y || 32;
- this.width = width || 320;
- this.height = height || 480;
- this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
- this.popoverWidth = popoverWidth || 0;
- this.popoverHeight = popoverHeight || 0;
-};
-
-module.exports = CameraPopoverOptions;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
deleted file mode 100644
index 6da9fa35d..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
+++ /dev/null
@@ -1,69 +0,0 @@
-cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-/**
- * @namespace navigator
- */
-
-/**
- * A handle to an image picker popover.
- *
- * __Supported Platforms__
- *
- * - iOS
- *
- * @example
- * navigator.camera.getPicture(onSuccess, onFail,
- * {
- * destinationType: Camera.DestinationType.FILE_URI,
- * sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- * popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 300, 600)
- * });
- *
- * // Reposition the popover if the orientation changes.
- * window.onorientationchange = function() {
- * var cameraPopoverHandle = new CameraPopoverHandle();
- * var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 400, 500);
- * cameraPopoverHandle.setPosition(cameraPopoverOptions);
- * }
- * @module CameraPopoverHandle
- */
-var CameraPopoverHandle = function () {
- /**
- * Can be used to reposition the image selection dialog,
- * for example, when the device orientation changes.
- * @memberof CameraPopoverHandle
- * @instance
- * @method setPosition
- * @param {module:CameraPopoverOptions} popoverOptions
- */
- this.setPosition = function (popoverOptions) {
- var args = [ popoverOptions ];
- exec(null, null, 'Camera', 'repositionPopover', args);
- };
-};
-
-module.exports = CameraPopoverHandle;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js
deleted file mode 100644
index ae48e3546..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js
+++ /dev/null
@@ -1,86 +0,0 @@
-cordova.define("cordova-plugin-device.device", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var channel = require('cordova/channel');
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var cordova = require('cordova');
-
-channel.createSticky('onCordovaInfoReady');
-// Tell cordova channel to wait on the CordovaInfoReady event
-channel.waitForInitialization('onCordovaInfoReady');
-
-/**
- * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
- * phone, etc.
- * @constructor
- */
-function Device () {
- this.available = false;
- this.platform = null;
- this.version = null;
- this.uuid = null;
- this.cordova = null;
- this.model = null;
- this.manufacturer = null;
- this.isVirtual = null;
- this.serial = null;
-
- var me = this;
-
- channel.onCordovaReady.subscribe(function () {
- me.getInfo(function (info) {
- // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
- // TODO: CB-5105 native implementations should not return info.cordova
- var buildLabel = cordova.version;
- me.available = true;
- me.platform = info.platform;
- me.version = info.version;
- me.uuid = info.uuid;
- me.cordova = buildLabel;
- me.model = info.model;
- me.isVirtual = info.isVirtual;
- me.manufacturer = info.manufacturer || 'unknown';
- me.serial = info.serial || 'unknown';
- channel.onCordovaInfoReady.fire();
- }, function (e) {
- me.available = false;
- utils.alert('[ERROR] Error initializing Cordova: ' + e);
- });
- });
-}
-
-/**
- * Get device info
- *
- * @param {Function} successCallback The function to call when the heading data is available
- * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
- */
-Device.prototype.getInfo = function (successCallback, errorCallback) {
- argscheck.checkArgs('fF', 'Device.getInfo', arguments);
- exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
-};
-
-module.exports = new Device();
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
deleted file mode 100644
index 395c4d973..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
+++ /dev/null
@@ -1,54 +0,0 @@
-cordova.define("cordova-plugin-file-opener2.FileOpener2", function(require, exports, module) {
-/*jslint browser: true, devel: true, node: true, sloppy: true, plusplus: true*/
-/*global require, cordova */
-/*
-The MIT License (MIT)
-
-Copyright (c) 2013 pwlin - [email protected]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-var exec = require('cordova/exec');
-
-function FileOpener2() {}
-
-FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
- contentType = contentType || '';
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
-};
-
-FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
- contentType = contentType || '';
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position || [0, 0]]);
-};
-
-FileOpener2.prototype.uninstall = function (packageId, callbackContext) {
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'uninstall', [packageId]);
-};
-
-FileOpener2.prototype.appIsInstalled = function (packageId, callbackContext) {
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'appIsInstalled', [packageId]);
-};
-
-module.exports = new FileOpener2();
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js
deleted file mode 100644
index bb676eb6c..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js
+++ /dev/null
@@ -1,120 +0,0 @@
-cordova.define("cordova-plugin-file.DirectoryEntry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var Entry = require('./Entry');
-var FileError = require('./FileError');
-var DirectoryReader = require('./DirectoryReader');
-
-/**
- * An interface representing a directory on the file system.
- *
- * {boolean} isFile always false (readonly)
- * {boolean} isDirectory always true (readonly)
- * {DOMString} name of the directory, excluding the path leading to it (readonly)
- * {DOMString} fullPath the absolute full path to the directory (readonly)
- * {FileSystem} filesystem on which the directory resides (readonly)
- */
-var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
-
- // add trailing slash if it is missing
- if ((fullPath) && !/\/$/.test(fullPath)) {
- fullPath += '/';
- }
- // add trailing slash if it is missing
- if (nativeURL && !/\/$/.test(nativeURL)) {
- nativeURL += '/';
- }
- DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
-};
-
-utils.extend(DirectoryEntry, Entry);
-
-/**
- * Creates a new DirectoryReader to read entries from this directory
- */
-DirectoryEntry.prototype.createReader = function () {
- return new DirectoryReader(this.toInternalURL());
-};
-
-/**
- * Creates or looks up a directory
- *
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory
- * @param {Flags} options to create or exclusively create the directory
- * @param {Function} successCallback is called with the new entry
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
- argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getDirectory', [this.toInternalURL(), path, options]);
-};
-
-/**
- * Deletes a directory and all of it's contents
- *
- * @param {Function} successCallback is called with no parameters
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(successCallback, fail, 'File', 'removeRecursively', [this.toInternalURL()]);
-};
-
-/**
- * Creates or looks up a file
- *
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file
- * @param {Flags} options to create or exclusively create the file
- * @param {Function} successCallback is called with the new entry
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
- argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var FileEntry = require('./FileEntry');
- var entry = new FileEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getFile', [this.toInternalURL(), path, options]);
-};
-
-module.exports = DirectoryEntry;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js
deleted file mode 100644
index 417c85f10..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js
+++ /dev/null
@@ -1,75 +0,0 @@
-cordova.define("cordova-plugin-file.DirectoryReader", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-
-/**
- * An interface that lists the files and directories in a directory.
- */
-function DirectoryReader (localURL) {
- this.localURL = localURL || null;
- this.hasReadEntries = false;
-}
-
-/**
- * Returns a list of entries from a directory.
- *
- * @param {Function} successCallback is called with a list of entries
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryReader.prototype.readEntries = function (successCallback, errorCallback) {
- // If we've already read and passed on this directory's entries, return an empty list.
- if (this.hasReadEntries) {
- successCallback([]);
- return;
- }
- var reader = this;
- var win = typeof successCallback !== 'function' ? null : function (result) {
- var retVal = [];
- for (var i = 0; i < result.length; i++) {
- var entry = null;
- if (result[i].isDirectory) {
- entry = new (require('./DirectoryEntry'))();
- } else if (result[i].isFile) {
- entry = new (require('./FileEntry'))();
- }
- entry.isDirectory = result[i].isDirectory;
- entry.isFile = result[i].isFile;
- entry.name = result[i].name;
- entry.fullPath = result[i].fullPath;
- entry.filesystem = new (require('./FileSystem'))(result[i].filesystemName);
- entry.nativeURL = result[i].nativeURL;
- retVal.push(entry);
- }
- reader.hasReadEntries = true;
- successCallback(retVal);
- };
- var fail = typeof errorCallback !== 'function' ? null : function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'readEntries', [this.localURL]);
-};
-
-module.exports = DirectoryReader;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Entry.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Entry.js
deleted file mode 100644
index b296d999e..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Entry.js
+++ /dev/null
@@ -1,263 +0,0 @@
-cordova.define("cordova-plugin-file.Entry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-var Metadata = require('./Metadata');
-
-/**
- * Represents a file or directory on the local file system.
- *
- * @param isFile
- * {boolean} true if Entry is a file (readonly)
- * @param isDirectory
- * {boolean} true if Entry is a directory (readonly)
- * @param name
- * {DOMString} name of the file or directory, excluding the path
- * leading to it (readonly)
- * @param fullPath
- * {DOMString} the absolute full path to the file or directory
- * (readonly)
- * @param fileSystem
- * {FileSystem} the filesystem on which this entry resides
- * (readonly)
- * @param nativeURL
- * {DOMString} an alternate URL which can be used by native
- * webview controls, for example media players.
- * (optional, readonly)
- */
-function Entry (isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
- this.isFile = !!isFile;
- this.isDirectory = !!isDirectory;
- this.name = name || '';
- this.fullPath = fullPath || '';
- this.filesystem = fileSystem || null;
- this.nativeURL = nativeURL || null;
-}
-
-/**
- * Look up the metadata of the entry.
- *
- * @param successCallback
- * {Function} is called with a Metadata object
- * @param errorCallback
- * {Function} is called with a FileError
- */
-Entry.prototype.getMetadata = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
- var success = successCallback && function (entryMetadata) {
- var metadata = new Metadata({
- size: entryMetadata.size,
- modificationTime: entryMetadata.lastModifiedDate
- });
- successCallback(metadata);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(success, fail, 'File', 'getFileMetadata', [this.toInternalURL()]);
-};
-
-/**
- * Set the metadata of the entry.
- *
- * @param successCallback
- * {Function} is called with a Metadata object
- * @param errorCallback
- * {Function} is called with a FileError
- * @param metadataObject
- * {Object} keys and values to set
- */
-Entry.prototype.setMetadata = function (successCallback, errorCallback, metadataObject) {
- argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
- exec(successCallback, errorCallback, 'File', 'setMetadata', [this.toInternalURL(), metadataObject]);
-};
-
-/**
- * Move a file or directory to a new location.
- *
- * @param parent
- * {DirectoryEntry} the directory to which to move this entry
- * @param newName
- * {DOMString} new name of the entry, defaults to the current name
- * @param successCallback
- * {Function} called with the new DirectoryEntry object
- * @param errorCallback
- * {Function} called with a FileError
- */
-Entry.prototype.moveTo = function (parent, newName, successCallback, errorCallback) {
- argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- var srcURL = this.toInternalURL();
- // entry name
- var name = newName || this.name;
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
- var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
- var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- }
- } else {
- // no Entry object returned
- if (fail) {
- fail(FileError.NOT_FOUND_ERR);
- }
- }
- };
-
- // copy
- exec(success, fail, 'File', 'moveTo', [srcURL, parent.toInternalURL(), name]);
-};
-
-/**
- * Copy a directory to a different location.
- *
- * @param parent
- * {DirectoryEntry} the directory to which to copy the entry
- * @param newName
- * {DOMString} new name of the entry, defaults to the current name
- * @param successCallback
- * {Function} called with the new Entry object
- * @param errorCallback
- * {Function} called with a FileError
- */
-Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallback) {
- argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- var srcURL = this.toInternalURL();
- // entry name
- var name = newName || this.name;
- // success callback
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
- var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
- var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- }
- } else {
- // no Entry object returned
- if (fail) {
- fail(FileError.NOT_FOUND_ERR);
- }
- }
- };
-
- // copy
- exec(success, fail, 'File', 'copyTo', [srcURL, parent.toInternalURL(), name]);
-};
-
-/**
- * Return a URL that can be passed across the bridge to identify this entry.
- */
-Entry.prototype.toInternalURL = function () {
- if (this.filesystem && this.filesystem.__format__) {
- return this.filesystem.__format__(this.fullPath, this.nativeURL);
- }
-};
-
-/**
- * Return a URL that can be used to identify this entry.
- * Use a URL that can be used to as the src attribute of a <video> or
- * <audio> tag. If that is not possible, construct a cdvfile:// URL.
- */
-Entry.prototype.toURL = function () {
- if (this.nativeURL) {
- return this.nativeURL;
- }
- // fullPath attribute may contain the full URL in the case that
- // toInternalURL fails.
- return this.toInternalURL() || 'file://localhost' + this.fullPath;
-};
-
-/**
- * Backwards-compatibility: In v1.0.0 - 1.0.2, .toURL would only return a
- * cdvfile:// URL, and this method was necessary to obtain URLs usable by the
- * webview.
- * See CB-6051, CB-6106, CB-6117, CB-6152, CB-6199, CB-6201, CB-6243, CB-6249,
- * and CB-6300.
- */
-Entry.prototype.toNativeURL = function () {
- console.log("DEPRECATED: Update your code to use 'toURL'");
- return this.toURL();
-};
-
-/**
- * Returns a URI that can be used to identify this entry.
- *
- * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.
- * @return uri
- */
-Entry.prototype.toURI = function (mimeType) {
- console.log("DEPRECATED: Update your code to use 'toURL'");
- return this.toURL();
-};
-
-/**
- * Remove a file or directory. It is an error to attempt to delete a
- * directory that is not empty. It is an error to attempt to delete a
- * root directory of a file system.
- *
- * @param successCallback {Function} called with no parameters
- * @param errorCallback {Function} called with a FileError
- */
-Entry.prototype.remove = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.remove', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(successCallback, fail, 'File', 'remove', [this.toInternalURL()]);
-};
-
-/**
- * Look up the parent DirectoryEntry of this entry.
- *
- * @param successCallback {Function} called with the parent DirectoryEntry object
- * @param errorCallback {Function} called with a FileError
- */
-Entry.prototype.getParent = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.getParent', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var DirectoryEntry = require('./DirectoryEntry');
- var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getParent', [this.toInternalURL()]);
-};
-
-module.exports = Entry;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/File.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/File.js
deleted file mode 100644
index c77178653..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/File.js
+++ /dev/null
@@ -1,81 +0,0 @@
-cordova.define("cordova-plugin-file.File", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Constructor.
- * name {DOMString} name of the file, without path information
- * fullPath {DOMString} the full path of the file, including the name
- * type {DOMString} mime type
- * lastModifiedDate {Date} last modified date
- * size {Number} size of the file in bytes
- */
-
-var File = function (name, localURL, type, lastModifiedDate, size) {
- this.name = name || '';
- this.localURL = localURL || null;
- this.type = type || null;
- this.lastModified = lastModifiedDate || null;
- // For backwards compatibility, store the timestamp in lastModifiedDate as well
- this.lastModifiedDate = lastModifiedDate || null;
- this.size = size || 0;
-
- // These store the absolute start and end for slicing the file.
- this.start = 0;
- this.end = this.size;
-};
-
-/**
- * Returns a "slice" of the file. Since Cordova Files don't contain the actual
- * content, this really returns a File with adjusted start and end.
- * Slices of slices are supported.
- * start {Number} The index at which to start the slice (inclusive).
- * end {Number} The index at which to end the slice (exclusive).
- */
-File.prototype.slice = function (start, end) {
- var size = this.end - this.start;
- var newStart = 0;
- var newEnd = size;
- if (arguments.length) {
- if (start < 0) {
- newStart = Math.max(size + start, 0);
- } else {
- newStart = Math.min(size, start);
- }
- }
-
- if (arguments.length >= 2) {
- if (end < 0) {
- newEnd = Math.max(size + end, 0);
- } else {
- newEnd = Math.min(end, size);
- }
- }
-
- var newFile = new File(this.name, this.localURL, this.type, this.lastModified, this.size);
- newFile.start = this.start + newStart;
- newFile.end = this.start + newEnd;
- return newFile;
-};
-
-module.exports = File;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileEntry.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileEntry.js
deleted file mode 100644
index 6651b5542..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileEntry.js
+++ /dev/null
@@ -1,95 +0,0 @@
-cordova.define("cordova-plugin-file.FileEntry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var Entry = require('./Entry');
-var FileWriter = require('./FileWriter');
-var File = require('./File');
-var FileError = require('./FileError');
-
-/**
- * An interface representing a file on the file system.
- *
- * {boolean} isFile always true (readonly)
- * {boolean} isDirectory always false (readonly)
- * {DOMString} name of the file, excluding the path leading to it (readonly)
- * {DOMString} fullPath the absolute full path to the file (readonly)
- * {FileSystem} filesystem on which the file resides (readonly)
- */
-var FileEntry = function (name, fullPath, fileSystem, nativeURL) {
- // remove trailing slash if it is present
- if (fullPath && /\/$/.test(fullPath)) {
- fullPath = fullPath.substring(0, fullPath.length - 1);
- }
- if (nativeURL && /\/$/.test(nativeURL)) {
- nativeURL = nativeURL.substring(0, nativeURL.length - 1);
- }
-
- FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem, nativeURL]);
-};
-
-utils.extend(FileEntry, Entry);
-
-/**
- * Creates a new FileWriter associated with the file that this FileEntry represents.
- *
- * @param {Function} successCallback is called with the new FileWriter
- * @param {Function} errorCallback is called with a FileError
- */
-FileEntry.prototype.createWriter = function (successCallback, errorCallback) {
- this.file(function (filePointer) {
- var writer = new FileWriter(filePointer);
-
- if (writer.localURL === null || writer.localURL === '') {
- if (errorCallback) {
- errorCallback(new FileError(FileError.INVALID_STATE_ERR));
- }
- } else {
- if (successCallback) {
- successCallback(writer);
- }
- }
- }, errorCallback);
-};
-
-/**
- * Returns a File that represents the current state of the file that this FileEntry represents.
- *
- * @param {Function} successCallback is called with the new File object
- * @param {Function} errorCallback is called with a FileError
- */
-FileEntry.prototype.file = function (successCallback, errorCallback) {
- var localURL = this.toInternalURL();
- var win = successCallback && function (f) {
- var file = new File(f.name, localURL, f.type, f.lastModifiedDate, f.size);
- successCallback(file);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getFileMetadata', [localURL]);
-};
-
-module.exports = FileEntry;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileError.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileError.js
deleted file mode 100644
index f378c3874..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileError.js
+++ /dev/null
@@ -1,49 +0,0 @@
-cordova.define("cordova-plugin-file.FileError", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * FileError
- */
-function FileError (error) {
- this.code = error || null;
-}
-
-// File error codes
-// Found in DOMException
-FileError.NOT_FOUND_ERR = 1;
-FileError.SECURITY_ERR = 2;
-FileError.ABORT_ERR = 3;
-
-// Added by File API specification
-FileError.NOT_READABLE_ERR = 4;
-FileError.ENCODING_ERR = 5;
-FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
-FileError.INVALID_STATE_ERR = 7;
-FileError.SYNTAX_ERR = 8;
-FileError.INVALID_MODIFICATION_ERR = 9;
-FileError.QUOTA_EXCEEDED_ERR = 10;
-FileError.TYPE_MISMATCH_ERR = 11;
-FileError.PATH_EXISTS_ERR = 12;
-
-module.exports = FileError;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileReader.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileReader.js
deleted file mode 100644
index 5c030913b..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileReader.js
+++ /dev/null
@@ -1,301 +0,0 @@
-cordova.define("cordova-plugin-file.FileReader", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var modulemapper = require('cordova/modulemapper');
-var utils = require('cordova/utils');
-var FileError = require('./FileError');
-var ProgressEvent = require('./ProgressEvent');
-var origFileReader = modulemapper.getOriginalSymbol(window, 'FileReader');
-
-/**
- * This class reads the mobile device file system.
- *
- * For Android:
- * The root directory is the root of the file system.
- * To read from the SD card, the file name is "sdcard/my_file.txt"
- * @constructor
- */
-var FileReader = function () {
- this._readyState = 0;
- this._error = null;
- this._result = null;
- this._progress = null;
- this._localURL = '';
- this._realReader = origFileReader ? new origFileReader() : {}; // eslint-disable-line new-cap
-};
-
-/**
- * Defines the maximum size to read at a time via the native API. The default value is a compromise between
- * minimizing the overhead of many exec() calls while still reporting progress frequently enough for large files.
- * (Note attempts to allocate more than a few MB of contiguous memory on the native side are likely to cause
- * OOM exceptions, while the JS engine seems to have fewer problems managing large strings or ArrayBuffers.)
- */
-FileReader.READ_CHUNK_SIZE = 256 * 1024;
-
-// States
-FileReader.EMPTY = 0;
-FileReader.LOADING = 1;
-FileReader.DONE = 2;
-
-utils.defineGetter(FileReader.prototype, 'readyState', function () {
- return this._localURL ? this._readyState : this._realReader.readyState;
-});
-
-utils.defineGetter(FileReader.prototype, 'error', function () {
- return this._localURL ? this._error : this._realReader.error;
-});
-
-utils.defineGetter(FileReader.prototype, 'result', function () {
- return this._localURL ? this._result : this._realReader.result;
-});
-
-function defineEvent (eventName) {
- utils.defineGetterSetter(FileReader.prototype, eventName, function () {
- return this._realReader[eventName] || null;
- }, function (value) {
- this._realReader[eventName] = value;
- });
-}
-defineEvent('onloadstart'); // When the read starts.
-defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
-defineEvent('onload'); // When the read has successfully completed.
-defineEvent('onerror'); // When the read has failed (see errors).
-defineEvent('onloadend'); // When the request has completed (either in success or failure).
-defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method.
-
-function initRead (reader, file) {
- // Already loading something
- if (reader.readyState === FileReader.LOADING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- reader._result = null;
- reader._error = null;
- reader._progress = 0;
- reader._readyState = FileReader.LOADING;
-
- if (typeof file.localURL === 'string') {
- reader._localURL = file.localURL;
- } else {
- reader._localURL = '';
- return true;
- }
-
- if (reader.onloadstart) {
- reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
- }
-}
-
-/**
- * Callback used by the following read* functions to handle incremental or final success.
- * Must be bound to the FileReader's this along with all but the last parameter,
- * e.g. readSuccessCallback.bind(this, "readAsText", "UTF-8", offset, totalSize, accumulate)
- * @param readType The name of the read function to call.
- * @param encoding Text encoding, or null if this is not a text type read.
- * @param offset Starting offset of the read.
- * @param totalSize Total number of bytes or chars to read.
- * @param accumulate A function that takes the callback result and accumulates it in this._result.
- * @param r Callback result returned by the last read exec() call, or null to begin reading.
- */
-function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, r) {
- if (this._readyState === FileReader.DONE) {
- return;
- }
-
- var CHUNK_SIZE = FileReader.READ_CHUNK_SIZE;
- if (readType === 'readAsDataURL') {
- // Windows proxy does not support reading file slices as Data URLs
- // so read the whole file at once.
- CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
- // Calculate new chunk size for data URLs to be multiply of 3
- // Otherwise concatenated base64 chunks won't be valid base64 data
- FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
- }
-
- if (typeof r !== 'undefined') {
- accumulate(r);
- this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
-
- if (typeof this.onprogress === 'function') {
- this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
- }
- }
-
- if (typeof r === 'undefined' || this._progress < totalSize) {
- var execArgs = [
- this._localURL,
- offset + this._progress,
- offset + this._progress + Math.min(totalSize - this._progress, CHUNK_SIZE)];
- if (encoding) {
- execArgs.splice(1, 0, encoding);
- }
- exec(
- readSuccessCallback.bind(this, readType, encoding, offset, totalSize, accumulate),
- readFailureCallback.bind(this),
- 'File', readType, execArgs);
- } else {
- this._readyState = FileReader.DONE;
-
- if (typeof this.onload === 'function') {
- this.onload(new ProgressEvent('load', {target: this}));
- }
-
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
- }
-}
-
-/**
- * Callback used by the following read* functions to handle errors.
- * Must be bound to the FileReader's this, e.g. readFailureCallback.bind(this)
- */
-function readFailureCallback (e) {
- if (this._readyState === FileReader.DONE) {
- return;
- }
-
- this._readyState = FileReader.DONE;
- this._result = null;
- this._error = new FileError(e);
-
- if (typeof this.onerror === 'function') {
- this.onerror(new ProgressEvent('error', {target: this}));
- }
-
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
-}
-
-/**
- * Abort reading file.
- */
-FileReader.prototype.abort = function () {
- if (origFileReader && !this._localURL) {
- return this._realReader.abort();
- }
- this._result = null;
-
- if (this._readyState === FileReader.DONE || this._readyState === FileReader.EMPTY) {
- return;
- }
-
- this._readyState = FileReader.DONE;
-
- // If abort callback
- if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', {target: this}));
- }
- // If load end callback
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
-};
-
-/**
- * Read text file.
- *
- * @param file {File} File object containing file properties
- * @param encoding [Optional] (see http://www.iana.org/assignments/character-sets)
- */
-FileReader.prototype.readAsText = function (file, encoding) {
- if (initRead(this, file)) {
- return this._realReader.readAsText(file, encoding);
- }
-
- // Default encoding is UTF-8
- var enc = encoding || 'UTF-8';
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsText', enc, file.start, totalSize, function (r) {
- if (this._progress === 0) {
- this._result = '';
- }
- this._result += r;
- }.bind(this));
-};
-
-/**
- * Read file and return data as a base64 encoded data url.
- * A data url is of the form:
- * data:[<mediatype>][;base64],<data>
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsDataURL = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsDataURL(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsDataURL', null, file.start, totalSize, function (r) {
- var commaIndex = r.indexOf(',');
- if (this._progress === 0) {
- this._result = r;
- } else {
- this._result += r.substring(commaIndex + 1);
- }
- }.bind(this));
-};
-
-/**
- * Read file and return data as a binary data.
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsBinaryString = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsBinaryString(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsBinaryString', null, file.start, totalSize, function (r) {
- if (this._progress === 0) {
- this._result = '';
- }
- this._result += r;
- }.bind(this));
-};
-
-/**
- * Read file and return data as a binary data.
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsArrayBuffer = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsArrayBuffer(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsArrayBuffer', null, file.start, totalSize, function (r) {
- var resultArray = (this._progress === 0 ? new Uint8Array(totalSize) : new Uint8Array(this._result));
- resultArray.set(new Uint8Array(r), this._progress);
- this._result = resultArray.buffer;
- }.bind(this));
-};
-
-module.exports = FileReader;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileSystem.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileSystem.js
deleted file mode 100644
index ad9ea7859..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileSystem.js
+++ /dev/null
@@ -1,58 +0,0 @@
-cordova.define("cordova-plugin-file.FileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var DirectoryEntry = require('./DirectoryEntry');
-
-/**
- * An interface representing a file system
- *
- * @constructor
- * {DOMString} name the unique name of the file system (readonly)
- * {DirectoryEntry} root directory of the file system (readonly)
- */
-var FileSystem = function (name, root) {
- this.name = name;
- if (root) {
- this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
- } else {
- this.root = new DirectoryEntry(this.name, '/', this);
- }
-};
-
-FileSystem.prototype.__format__ = function (fullPath, nativeUrl) {
- return fullPath;
-};
-
-FileSystem.prototype.toJSON = function () {
- return '<FileSystem: ' + this.name + '>';
-};
-
-// Use instead of encodeURI() when encoding just the path part of a URI rather than an entire URI.
-FileSystem.encodeURIPath = function (path) {
- // Because # is a valid filename character, it must be encoded to prevent part of the
- // path from being parsed as a URI fragment.
- return encodeURI(path).replace(/#/g, '%23');
-};
-
-module.exports = FileSystem;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js
deleted file mode 100644
index 6acd09334..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js
+++ /dev/null
@@ -1,44 +0,0 @@
-cordova.define("cordova-plugin-file.FileUploadOptions", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Options to customize the HTTP request used to upload files.
- * @constructor
- * @param fileKey {String} Name of file request parameter.
- * @param fileName {String} Filename to be used by the server. Defaults to image.jpg.
- * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg.
- * @param params {Object} Object with key: value params to send to the server.
- * @param headers {Object} Keys are header names, values are header values. Multiple
- * headers of the same name are not supported.
- */
-var FileUploadOptions = function (fileKey, fileName, mimeType, params, headers, httpMethod) {
- this.fileKey = fileKey || null;
- this.fileName = fileName || null;
- this.mimeType = mimeType || null;
- this.params = params || null;
- this.headers = headers || null;
- this.httpMethod = httpMethod || null;
-};
-
-module.exports = FileUploadOptions;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js
deleted file mode 100644
index e3c3a7431..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js
+++ /dev/null
@@ -1,33 +0,0 @@
-cordova.define("cordova-plugin-file.FileUploadResult", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * FileUploadResult
- * @constructor
- */
-module.exports = function FileUploadResult (size, code, content) {
- this.bytesSent = size;
- this.responseCode = code;
- this.response = content;
-};
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileWriter.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileWriter.js
deleted file mode 100644
index c3e856219..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileWriter.js
+++ /dev/null
@@ -1,328 +0,0 @@
-cordova.define("cordova-plugin-file.FileWriter", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-var FileReader = require('./FileReader');
-var ProgressEvent = require('./ProgressEvent');
-
-/**
- * This class writes to the mobile device file system.
- *
- * For Android:
- * The root directory is the root of the file system.
- * To write to the SD card, the file name is "sdcard/my_file.txt"
- *
- * @constructor
- * @param file {File} File object containing file properties
- * @param append if true write to the end of the file, otherwise overwrite the file
- */
-var FileWriter = function (file) {
- this.fileName = '';
- this.length = 0;
- if (file) {
- this.localURL = file.localURL || file;
- this.length = file.size || 0;
- }
- // default is to write at the beginning of the file
- this.position = 0;
-
- this.readyState = 0; // EMPTY
-
- this.result = null;
-
- // Error
- this.error = null;
-
- // Event handlers
- this.onwritestart = null; // When writing starts
- this.onprogress = null; // While writing the file, and reporting partial file data
- this.onwrite = null; // When the write has successfully completed.
- this.onwriteend = null; // When the request has completed (either in success or failure).
- this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method.
- this.onerror = null; // When the write has failed (see errors).
-};
-
-// States
-FileWriter.INIT = 0;
-FileWriter.WRITING = 1;
-FileWriter.DONE = 2;
-
-/**
- * Abort writing file.
- */
-FileWriter.prototype.abort = function () {
- // check for invalid state
- if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // set error
- this.error = new FileError(FileError.ABORT_ERR);
-
- this.readyState = FileWriter.DONE;
-
- // If abort callback
- if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', {'target': this}));
- }
-
- // If write end callback
- if (typeof this.onwriteend === 'function') {
- this.onwriteend(new ProgressEvent('writeend', {'target': this}));
- }
-};
-
-/**
- * Writes data to the file
- *
- * @param data text or blob to be written
- * @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
- */
-FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
-
- var that = this;
- var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
- /* eslint-disable no-undef */
- var isProxySupportBlobNatively = (cordova.platformId === 'windows8' || cordova.platformId === 'windows');
- var isBinary;
-
- // Check to see if the incoming data is a blob
- if (data instanceof File || (!isProxySupportBlobNatively && supportsBinary && data instanceof Blob)) {
- var fileReader = new FileReader();
- /* eslint-enable no-undef */
- fileReader.onload = function () {
- // Call this method again, with the arraybuffer as argument
- FileWriter.prototype.write.call(that, this.result, true /* isPendingBlobReadResult */);
- };
- fileReader.onerror = function () {
- // DONE state
- that.readyState = FileWriter.DONE;
-
- // Save error
- that.error = this.error;
-
- // If onerror callback
- if (typeof that.onerror === 'function') {
- that.onerror(new ProgressEvent('error', {'target': that}));
- }
-
- // If onwriteend callback
- if (typeof that.onwriteend === 'function') {
- that.onwriteend(new ProgressEvent('writeend', {'target': that}));
- }
- };
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- if (supportsBinary) {
- fileReader.readAsArrayBuffer(data);
- } else {
- fileReader.readAsText(data);
- }
- return;
- }
-
- // Mark data type for safer transport over the binary bridge
- isBinary = supportsBinary && (data instanceof ArrayBuffer);
- if (isBinary && cordova.platformId === 'windowsphone') { // eslint-disable-line no-undef
- // create a plain array, using the keys from the Uint8Array view so that we can serialize it
- data = Array.apply(null, new Uint8Array(data));
- }
-
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING && !isPendingBlobReadResult) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- var me = this;
-
- // If onwritestart callback
- if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', {'target': me}));
- }
-
- // Write file
- exec(
- // Success callback
- function (r) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // position always increases by bytes written because file would be extended
- me.position += r;
- // The length of the file is now where we are done writing.
-
- me.length = me.position;
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // If onwrite callback
- if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- },
- // Error callback
- function (e) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Save error
- me.error = new FileError(e);
-
- // If onerror callback
- if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- }, 'File', 'write', [this.localURL, data, this.position, isBinary]);
-};
-
-/**
- * Moves the file pointer to the location specified.
- *
- * If the offset is a negative number the position of the file
- * pointer is rewound. If the offset is greater than the file
- * size the position is set to the end of the file.
- *
- * @param offset is the location to move the file pointer to.
- */
-FileWriter.prototype.seek = function (offset) {
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- if (!offset && offset !== 0) {
- return;
- }
-
- // See back from end of file.
- if (offset < 0) {
- this.position = Math.max(offset + this.length, 0);
- // Offset is bigger than file size so set position
- // to the end of the file.
- } else if (offset > this.length) {
- this.position = this.length;
- // Offset is between 0 and file size so set the position
- // to start writing.
- } else {
- this.position = offset;
- }
-};
-
-/**
- * Truncates the file to the size specified.
- *
- * @param size to chop the file at.
- */
-FileWriter.prototype.truncate = function (size) {
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- var me = this;
-
- // If onwritestart callback
- if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', {'target': this}));
- }
-
- // Write file
- exec(
- // Success callback
- function (r) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Update the length of the file
- me.length = r;
- me.position = Math.min(me.position, r);
-
- // If onwrite callback
- if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- },
- // Error callback
- function (e) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Save error
- me.error = new FileError(e);
-
- // If onerror callback
- if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- }, 'File', 'truncate', [this.localURL, size]);
-};
-
-module.exports = FileWriter;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Flags.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Flags.js
deleted file mode 100644
index cdb12bb73..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Flags.js
+++ /dev/null
@@ -1,39 +0,0 @@
-cordova.define("cordova-plugin-file.Flags", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Supplies arguments to methods that lookup or create files and directories.
- *
- * @param create
- * {boolean} file or directory if it doesn't exist
- * @param exclusive
- * {boolean} used with create; if true the command will fail if
- * target path exists
- */
-function Flags (create, exclusive) {
- this.create = create || false;
- this.exclusive = exclusive || false;
-}
-
-module.exports = Flags;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js
deleted file mode 100644
index 4ce684812..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js
+++ /dev/null
@@ -1,26 +0,0 @@
-cordova.define("cordova-plugin-file.LocalFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-exports.TEMPORARY = 0;
-exports.PERSISTENT = 1;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Metadata.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Metadata.js
deleted file mode 100644
index 22366e167..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Metadata.js
+++ /dev/null
@@ -1,43 +0,0 @@
-cordova.define("cordova-plugin-file.Metadata", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Information about the state of the file or directory
- *
- * {Date} modificationTime (readonly)
- */
-var Metadata = function (metadata) {
- if (typeof metadata === 'object') {
- this.modificationTime = new Date(metadata.modificationTime);
- this.size = metadata.size || 0;
- } else if (typeof metadata === 'undefined') {
- this.modificationTime = null;
- this.size = 0;
- } else {
- /* Backwards compatiblity with platforms that only return a timestamp */
- this.modificationTime = new Date(metadata);
- }
-};
-
-module.exports = Metadata;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js
deleted file mode 100644
index cbecdb12b..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js
+++ /dev/null
@@ -1,70 +0,0 @@
-cordova.define("cordova-plugin-file.ProgressEvent", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
-// Feature test: See if we can instantiate a native ProgressEvent;
-// if so, use that approach,
-// otherwise fill-in with our own implementation.
-//
-// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview.
-var ProgressEvent = (function () {
- /*
- var createEvent = function(data) {
- var event = document.createEvent('Events');
- event.initEvent('ProgressEvent', false, false);
- if (data) {
- for (var i in data) {
- if (data.hasOwnProperty(i)) {
- event[i] = data[i];
- }
- }
- if (data.target) {
- // TODO: cannot call <some_custom_object>.dispatchEvent
- // need to first figure out how to implement EventTarget
- }
- }
- return event;
- };
- try {
- var ev = createEvent({type:"abort",target:document});
- return function ProgressEvent(type, data) {
- data.type = type;
- return createEvent(data);
- };
- } catch(e){
- */
- return function ProgressEvent (type, dict) {
- this.type = type;
- this.bubbles = false;
- this.cancelBubble = false;
- this.cancelable = false;
- this.lengthComputable = false;
- this.loaded = dict && dict.loaded ? dict.loaded : 0;
- this.total = dict && dict.total ? dict.total : 0;
- this.target = dict && dict.target ? dict.target : null;
- };
- // }
-})();
-
-module.exports = ProgressEvent;
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js
deleted file mode 100644
index 90450d862..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js
+++ /dev/null
@@ -1,29 +0,0 @@
-cordova.define("cordova-plugin-file.isChrome", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-module.exports = function () {
- // window.webkitRequestFileSystem and window.webkitResolveLocalFileSystemURL are available only in Chrome and
- // possibly a good flag to indicate that we're running in Chrome
- return window.webkitRequestFileSystem && window.webkitResolveLocalFileSystemURL;
-};
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js
deleted file mode 100644
index 4bfc0f629..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js
+++ /dev/null
@@ -1,65 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystemPaths", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var channel = require('cordova/channel');
-
-exports.file = {
- // Read-only directory where the application is installed.
- applicationDirectory: null,
- // Root of app's private writable storage
- applicationStorageDirectory: null,
- // Where to put app-specific data files.
- dataDirectory: null,
- // Cached files that should survive app restarts.
- // Apps should not rely on the OS to delete files in here.
- cacheDirectory: null,
- // Android: the application space on external storage.
- externalApplicationStorageDirectory: null,
- // Android: Where to put app-specific data files on external storage.
- externalDataDirectory: null,
- // Android: the application cache on external storage.
- externalCacheDirectory: null,
- // Android: the external storage (SD card) root.
- externalRootDirectory: null,
- // iOS: Temp directory that the OS can clear at will.
- tempDirectory: null,
- // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
- syncedDataDirectory: null,
- // iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
- documentsDirectory: null,
- // BlackBerry10: Files globally available to all apps
- sharedDirectory: null
-};
-
-channel.waitForInitialization('onFileSystemPathsReady');
-channel.onCordovaReady.subscribe(function () {
- function after (paths) {
- for (var k in paths) {
- exports.file[k] = paths[k];
- }
- channel.initializationComplete('onFileSystemPathsReady');
- }
- exec(after, null, 'File', 'requestAllPaths', []);
-});
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js
deleted file mode 100644
index 6e02953e8..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js
+++ /dev/null
@@ -1,49 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystems-roots", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Map of fsName -> FileSystem.
-var fsMap = null;
-var FileSystem = require('./FileSystem');
-var exec = require('cordova/exec');
-
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-require('./fileSystems').getFs = function (name, callback) {
- function success (response) {
- fsMap = {};
- for (var i = 0; i < response.length; ++i) {
- var fsRoot = response[i];
- if (fsRoot) {
- var fs = new FileSystem(fsRoot.filesystemName, fsRoot);
- fsMap[fs.name] = fs;
- }
- }
- callback(fsMap[name]);
- }
-
- if (fsMap) {
- callback(fsMap[name]);
- } else {
- exec(success, null, 'File', 'requestAllFileSystems', []);
- }
-};
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystems.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystems.js
deleted file mode 100644
index e61ceafc8..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/fileSystems.js
+++ /dev/null
@@ -1,28 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystems", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-module.exports.getFs = function (name, callback) {
- callback(null);
-};
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/ios/FileSystem.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/ios/FileSystem.js
deleted file mode 100644
index 551b51545..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/ios/FileSystem.js
+++ /dev/null
@@ -1,32 +0,0 @@
-cordova.define("cordova-plugin-file.iosFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-/* eslint no-undef : 0 */
-FILESYSTEM_PROTOCOL = 'cdvfile';
-
-module.exports = {
- __format__: function (fullPath) {
- var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
- return FILESYSTEM_PROTOCOL + '://localhost' + path;
- }
-};
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js
deleted file mode 100644
index 7f652193c..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js
+++ /dev/null
@@ -1,84 +0,0 @@
-cordova.define("cordova-plugin-file.requestFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-(function () {
- // For browser platform: not all browsers use this file.
- function checkBrowser () {
- if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
- module.exports = window.requestFileSystem || window.webkitRequestFileSystem;
- return true;
- }
- return false;
- }
- if (checkBrowser()) {
- return;
- }
-
- var argscheck = require('cordova/argscheck');
- var FileError = require('./FileError');
- var FileSystem = require('./FileSystem');
- var exec = require('cordova/exec');
- var fileSystems = require('./fileSystems');
-
- /**
- * Request a file system in which to store application data.
- * @param type local file system type
- * @param size indicates how much storage space, in bytes, the application expects to need
- * @param successCallback invoked with a FileSystem object
- * @param errorCallback invoked if error occurs retrieving file system
- */
- var requestFileSystem = function (type, size, successCallback, errorCallback) {
- argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
- var fail = function (code) {
- if (errorCallback) {
- errorCallback(new FileError(code));
- }
- };
-
- if (type < 0) {
- fail(FileError.SYNTAX_ERR);
- } else {
- // if successful, return a FileSystem object
- var success = function (file_system) {
- if (file_system) {
- if (successCallback) {
- fileSystems.getFs(file_system.name, function (fs) {
- // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
- if (!fs) {
- fs = new FileSystem(file_system.name, file_system.root);
- }
- successCallback(fs);
- });
- }
- } else {
- // no FileSystem object returned
- fail(FileError.NOT_FOUND_ERR);
- }
- };
- exec(success, fail, 'File', 'requestFileSystem', [type, size]);
- }
- };
-
- module.exports = requestFileSystem;
-})();
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
deleted file mode 100644
index 73715bc0e..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
+++ /dev/null
@@ -1,94 +0,0 @@
-cordova.define("cordova-plugin-file.resolveLocalFileSystemURI", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-(function () {
- // For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`.
- function checkBrowser () {
- if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
- module.exports.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
- return true;
- }
- return false;
- }
- if (checkBrowser()) {
- return;
- }
-
- var argscheck = require('cordova/argscheck');
- var DirectoryEntry = require('./DirectoryEntry');
- var FileEntry = require('./FileEntry');
- var FileError = require('./FileError');
- var exec = require('cordova/exec');
- var fileSystems = require('./fileSystems');
-
- /**
- * Look up file system Entry referred to by local URI.
- * @param {DOMString} uri URI referring to a local file or directory
- * @param successCallback invoked with Entry object corresponding to URI
- * @param errorCallback invoked if error occurs retrieving file system entry
- */
- module.exports.resolveLocalFileSystemURL = module.exports.resolveLocalFileSystemURL || function (uri, successCallback, errorCallback) {
- argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments);
- // error callback
- var fail = function (error) {
- if (errorCallback) {
- errorCallback(new FileError(error));
- }
- };
- // sanity check for 'not:valid:filename' or '/not:valid:filename'
- // file.spec.12 window.resolveLocalFileSystemURI should error (ENCODING_ERR) when resolving invalid URI with leading /.
- if (!uri || uri.split(':').length > 2) {
- setTimeout(function () {
- fail(FileError.ENCODING_ERR);
- }, 0);
- return;
- }
- // if successful, return either a file or directory entry
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var fsName = entry.filesystemName || (entry.filesystem && entry.filesystem.name) || (entry.filesystem === window.PERSISTENT ? 'persistent' : 'temporary'); // eslint-disable-line no-undef
- fileSystems.getFs(fsName, function (fs) {
- // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
- if (!fs) {
- fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
- }
- var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- });
- }
- } else {
- // no Entry object returned
- fail(FileError.NOT_FOUND_ERR);
- }
- };
-
- exec(success, fail, 'File', 'resolveLocalFileSystemURI', [uri]);
- };
-
- module.exports.resolveLocalFileSystemURI = function () {
- console.log('resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.');
- module.exports.resolveLocalFileSystemURL.apply(this, arguments);
- };
-})();
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
deleted file mode 100644
index d16bfdc1c..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
+++ /dev/null
@@ -1,160 +0,0 @@
-cordova.define("cordova-plugin-x-socialsharing.SocialSharing", function(require, exports, module) {
-function SocialSharing() {
-}
-
-// Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear.
-// If not overridden with different values, the popup is not used. Example:
-//
-// window.plugins.socialsharing.iPadPopupCoordinates = function() {
-// return "100,100,200,300";
-// };
-SocialSharing.prototype.iPadPopupCoordinates = function () {
- // left,top,width,height
- return "-1,-1,-1,-1";
-};
-
-SocialSharing.prototype.setIPadPopupCoordinates = function (coords) {
- console.log("Deprecated - setIPadPopupCoordinates no longer works since plugin version 5.5.0. See https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/1052");
- // left,top,width,height
- cordova.exec(function() {}, this._getErrorCallback(function() {}, "setIPadPopupCoordinates"), "SocialSharing", "setIPadPopupCoordinates", [coords]);
-};
-
-SocialSharing.prototype.available = function (callback) {
- cordova.exec(function (avail) {
- callback(avail ? true : false);
- }, null, "SocialSharing", "available", []);
-};
-
-// this is the recommended way to share as it is the most feature-rich with respect to what you pass in and get back
-SocialSharing.prototype.shareWithOptions = function (options, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareWithOptions"), "SocialSharing", "shareWithOptions", [options]);
-};
-
-SocialSharing.prototype.shareW3C = function (sharedata) {
- return new Promise(function(resolve, reject) {
- var options = {
- subject: sharedata.title,
- message: sharedata.text,
- url: sharedata.url,
- iPadCoordinates: sharedata.iPadCoordinates || undefined
- };
- if(sharedata.hasOwnProperty('title') ||
- sharedata.hasOwnProperty('text') ||
- sharedata.hasOwnProperty('url')) {
- cordova.exec(resolve, reject, "SocialSharing", "shareWithOptions", [options]);
- } else {
- reject();
- }
- });
-};
-
-SocialSharing.prototype.share = function (message, subject, fileOrFileArray, url, iPadCoordinates, successCallback, errorCallback) {
- if (typeof iPadCoordinates === 'function') {
- errorCallback = successCallback;
- successCallback = iPadCoordinates;
- iPadCoordinates = "";
- }
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "share"), "SocialSharing", "share", [message, subject, this._asArray(fileOrFileArray), url, iPadCoordinates]);
-};
-
-SocialSharing.prototype.shareViaTwitter = function (message, file /* multiple not allowed by twitter */, url, successCallback, errorCallback) {
- var fileArray = this._asArray(file);
- var ecb = this._getErrorCallback(errorCallback, "shareViaTwitter");
- if (fileArray.length > 1) {
- ecb("shareViaTwitter supports max one file");
- } else {
- cordova.exec(successCallback, ecb, "SocialSharing", "shareViaTwitter", [message, null, fileArray, url]);
- }
-};
-
-SocialSharing.prototype.shareViaFacebook = function (message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebook"), "SocialSharing", "shareViaFacebook", [message, null, this._asArray(fileOrFileArray), url]);
-};
-
-SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message, fileOrFileArray, url, pasteMessageHint, successCallback, errorCallback) {
- pasteMessageHint = pasteMessageHint || "If you like you can paste a message from your clipboard";
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebookWithPasteMessageHint"), "SocialSharing", "shareViaFacebookWithPasteMessageHint", [message, null, this._asArray(fileOrFileArray), url, pasteMessageHint]);
-};
-
-SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, null]);
-};
-
-SocialSharing.prototype.shareViaWhatsAppToReceiver = function (receiver, message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToReceiver"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, receiver, null]);
-};
-
-SocialSharing.prototype.shareViaWhatsAppToPhone = function (phone, message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToPhone"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, phone]);
-};
-
-SocialSharing.prototype.shareViaSMS = function (options, phonenumbers, successCallback, errorCallback) {
- var opts = options;
- if (typeof options === "string") {
- opts = {"message":options}; // for backward compatibility as the options param used to be the message
- }
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaSMS"), "SocialSharing", "shareViaSMS", [opts, phonenumbers]);
-};
-
-SocialSharing.prototype.shareViaEmail = function (message, subject, toArray, ccArray, bccArray, fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaEmail"), "SocialSharing", "shareViaEmail", [message, subject, this._asArray(toArray), this._asArray(ccArray), this._asArray(bccArray), this._asArray(fileOrFileArray)]);
-};
-
-SocialSharing.prototype.canShareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareVia"), "SocialSharing", "canShareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
-};
-
-SocialSharing.prototype.canShareViaEmail = function (successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareViaEmail"), "SocialSharing", "canShareViaEmail", []);
-};
-
-SocialSharing.prototype.shareViaInstagram = function (message, fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaInstagram"), "SocialSharing", "shareViaInstagram", [message, null, this._asArray(fileOrFileArray), null]);
-};
-
-SocialSharing.prototype.shareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareVia"), "SocialSharing", "shareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
-};
-
-SocialSharing.prototype.saveToPhotoAlbum = function (fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "saveToPhotoAlbum"), "SocialSharing", "saveToPhotoAlbum", [this._asArray(fileOrFileArray)]);
-};
-
-SocialSharing.prototype._asArray = function (param) {
- if (param == null) {
- param = [];
- } else if (typeof param === 'string') {
- param = new Array(param);
- }
- return param;
-};
-
-SocialSharing.prototype._getErrorCallback = function (ecb, functionName) {
- if (typeof ecb === 'function') {
- return ecb;
- } else {
- return function (result) {
- console.log("The injected error callback of '" + functionName + "' received: " + JSON.stringify(result));
- }
- }
-};
-
-SocialSharing.install = function () {
- if (!window.plugins) {
- window.plugins = {};
- }
-
- window.plugins.socialsharing = new SocialSharing();
-
- // Note only polyfill navigator.share if it is not defined, since shareW3C implements L1 of the spec,
- // and an existing navigator.share method could implement L2.
- if (!navigator.share) {
- navigator.share = window.plugins.socialsharing.shareW3C;
- }
-
- return window.plugins.socialsharing;
-};
-
-cordova.addConstructor(SocialSharing.install);
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/es6-promise-plugin/www/promise.js b/cordova/platforms/ios/platform_www/plugins/es6-promise-plugin/www/promise.js
deleted file mode 100644
index 6cce47ae8..000000000
--- a/cordova/platforms/ios/platform_www/plugins/es6-promise-plugin/www/promise.js
+++ /dev/null
@@ -1,13 +0,0 @@
-cordova.define("es6-promise-plugin.Promise", function(require, exports, module) {
-/*!
- * @overview es6-promise - a tiny implementation of Promises/A+.
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
- * @license Licensed under MIT license
- * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
- * @version v4.2.2+97478eb6
- */
-
-!function t(e,n,r){function o(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(t){var n=e[u][1][t];return o(n?n:t)},a,a.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t){void 0===window.Promise&&t("es6-promise").polyfill()},{"es6-promise":2}],2:[function(t,e,n){(function(r,o){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.ES6Promise=r()}(this,function(){"use strict";function e(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function n(t){return"function"==typeof t}function i(t){J=t}function u(t){Q=t}function s(){return function(){return r.nextTick(h)}}function c(){return"undefined"!=typeof I?function(){I(h)}:l()}function f(){var t=0,e=new X(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function a(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function l(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;H>t;t+=2){var e=te[t],n=te[t+1];e(n),te[t]=void 0,te[t+1]=void 0}H=0}function p(){try{var e=t,n=e("vertx");return I=n.runOnLoop||n.runOnContext,c()}catch(r){return l()}}function d(t,e){var n=this,r=new this.constructor(y);void 0===r[ne]&&D(r);var o=n._state;if(o){var i=arguments[o-1];Q(function(){return L(o,r,i,n._result)})}else O(n,r,t,e);return r}function v(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(y);return E(n,t),n}function y(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ue.error=e,ue}}function g(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function b(t,e,n){Q(function(t){var r=!1,o=g(n,e,function(n){r||(r=!0,e!==n?E(t,n):j(t,n))},function(e){r||(r=!0,x(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,x(t,o))},t)}function T(t,e){e._state===oe?j(t,e._result):e._state===ie?x(t,e._result):O(e,void 0,function(e){return E(t,e)},function(e){return x(t,e)})}function A(t,e,r){e.constructor===t.constructor&&r===d&&e.constructor.resolve===v?T(t,e):r===ue?(x(t,ue.error),ue.error=null):void 0===r?j(t,e):n(r)?b(t,e,r):j(t,e)}function E(t,n){t===n?x(t,m()):e(n)?A(t,n,w(n)):j(t,n)}function S(t){t._onerror&&t._onerror(t._result),M(t)}function j(t,e){t._state===re&&(t._result=e,t._state=oe,0!==t._subscribers.length&&Q(M,t))}function x(t,e){t._state===re&&(t._state=ie,t._result=e,Q(S,t))}function O(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+oe]=n,o[i+ie]=r,0===i&&t._state&&Q(M,t)}function M(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)r=e[u],o=e[u+n],r?L(n,r,o,i):o(i);t._subscribers.length=0}}function P(){this.error=null}function C(t,e){try{return t(e)}catch(n){return se.error=n,se}}function L(t,e,r,o){var i=n(r),u=void 0,s=void 0,c=void 0,f=void 0;if(i){if(u=C(r,o),u===se?(f=!0,s=u.error,u.error=null):c=!0,e===u)return x(e,_()),void 0}else u=o,c=!0;e._state!==re||(i&&c?E(e,u):f?x(e,s):t===oe?j(e,u):t===ie&&x(e,u))}function k(t,e){try{e(function(e){E(t,e)},function(e){x(t,e)})}catch(n){x(t,n)}}function q(){return ce++}function D(t){t[ne]=ce++,t._state=void 0,t._result=void 0,t._subscribers=[]}function F(){return new Error("Array Methods must be provided an Array")}function F(){return new Error("Array Methods must be provided an Array")}function N(t){return new fe(this,t).promise}function U(t){var e=this;return G(t)?new e(function(n,r){for(var o=t.length,i=0;o>i;i++)e.resolve(t[i]).then(n,r)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})}function Y(t){var e=this,n=new e(y);return x(n,t),n}function K(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function z(){var t=void 0;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=ae}var B=void 0;B=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=B,H=0,I=void 0,J=void 0,Q=function(t,e){te[H]=t,te[H+1]=e,H+=2,2===H&&(J?J(h):ee())},R="undefined"!=typeof window?window:void 0,V=R||{},X=V.MutationObserver||V.WebKitMutationObserver,Z="undefined"==typeof self&&"undefined"!=typeof r&&"[object process]"==={}.toString.call(r),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3),ee=void 0;ee=Z?s():X?f():$?a():void 0===R&&"function"==typeof t?p():l();var ne=Math.random().toString(36).substring(16),re=void 0,oe=1,ie=2,ue=new P,se=new P,ce=0,fe=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(y),this.promise[ne]||D(this.promise),G(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&j(this.promise,this._result))):x(this.promise,F())}return t.prototype._enumerate=function(t){for(var e=0;this._state===re&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===v){var o=w(t);if(o===d&&t._state!==re)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===ae){var i=new n(y);A(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===re&&(this._remaining--,t===ie?x(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){return n._settledAt(oe,e,t)},function(t){return n._settledAt(ie,e,t)})},t}(),ae=function(){function t(e){this[ne]=q(),this._result=this._state=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&K(),this instanceof t?k(this,e):W())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this,n=e.constructor;return e.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})},t}();return ae.prototype.then=d,ae.all=N,ae.race=U,ae.resolve=v,ae.reject=Y,ae._setScheduler=i,ae._setAsap=u,ae._asap=Q,ae.polyfill=z,ae.Promise=ae,ae})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],3:[function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(a===setTimeout)return setTimeout(t,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(t,0);try{return a(t,0)}catch(e){try{return a.call(null,t,0)}catch(e){return a.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!v){var t=o(u);v=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var a,l,h=e.exports={};!function(){try{a="function"==typeof setTimeout?setTimeout:n}catch(t){a=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,d=[],v=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(){return[]},h.binding=function(){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}]},{},[1]);
-
-
-});
diff --git a/cordova/platforms/ios/pods-debug.xcconfig b/cordova/platforms/ios/pods-debug.xcconfig
deleted file mode 100644
index 12c706516..000000000
--- a/cordova/platforms/ios/pods-debug.xcconfig
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-
-// DO NOT MODIFY -- auto-generated by Apache Cordova
diff --git a/cordova/platforms/ios/pods-release.xcconfig b/cordova/platforms/ios/pods-release.xcconfig
deleted file mode 100644
index 12e2b13f9..000000000
--- a/cordova/platforms/ios/pods-release.xcconfig
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-
-// DO NOT MODIFY -- auto-generated by Apache Cordova
\ No newline at end of file
diff --git a/cordova/platforms/ios/pods.json b/cordova/platforms/ios/pods.json
deleted file mode 100644
index ae83877b4..000000000
--- a/cordova/platforms/ios/pods.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "declarations": {},
- "sources": {},
- "libraries": {}
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/www/LICENSE.txt b/cordova/platforms/ios/www/LICENSE.txt
deleted file mode 100644
index 177328168..000000000
--- a/cordova/platforms/ios/www/LICENSE.txt
+++ /dev/null
@@ -1,661 +0,0 @@
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero 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 Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-<http://www.gnu.org/licenses/>.
diff --git a/cordova/platforms/ios/www/cordova.js b/cordova/platforms/ios/www/cordova.js
deleted file mode 100644
index 136d639b6..000000000
--- a/cordova/platforms/ios/www/cordova.js
+++ /dev/null
@@ -1,2175 +0,0 @@
-// Platform: cordova-ios
-// cordova-js 6.1.0
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '8.0.0';
-// file: src/scripts/require.js
-var require;
-var define;
-
-(function () {
- var modules = {};
- // Stack of moduleIds currently being built.
- var requireStack = [];
- // Map of module ID -> index into requireStack of modules currently being built.
- var inProgressModules = {};
- var SEPARATOR = '.';
-
- function build (module) {
- var factory = module.factory;
- var localRequire = function (id) {
- var resultantId = id;
- // Its a relative path, so lop off the last portion and add the id (minus "./")
- if (id.charAt(0) === '.') {
- resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
- }
- return require(resultantId);
- };
- module.exports = {};
- delete module.factory;
- factory(localRequire, module.exports, module);
- return module.exports;
- }
-
- require = function (id) {
- if (!modules[id]) {
- throw new Error('module ' + id + ' not found');
- } else if (id in inProgressModules) {
- var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
- throw new Error('Cycle in require graph: ' + cycle);
- }
- if (modules[id].factory) {
- try {
- inProgressModules[id] = requireStack.length;
- requireStack.push(id);
- return build(modules[id]);
- } finally {
- delete inProgressModules[id];
- requireStack.pop();
- }
- }
- return modules[id].exports;
- };
-
- define = function (id, factory) {
- if (Object.prototype.hasOwnProperty.call(modules, id)) {
- throw new Error('module ' + id + ' already defined');
- }
-
- modules[id] = {
- id: id,
- factory: factory
- };
- };
-
- define.remove = function (id) {
- delete modules[id];
- };
-
- define.moduleMap = modules;
-})();
-
-// Export for use in node
-if (typeof module === 'object' && typeof require === 'function') {
- module.exports.require = require;
- module.exports.define = define;
-}
-
-// file: src/cordova.js
-define("cordova", function(require, exports, module) {
-
-// Workaround for Windows 10 in hosted environment case
-// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
-if (window.cordova && !(window.cordova instanceof HTMLElement)) {
- throw new Error('cordova already defined');
-}
-
-var channel = require('cordova/channel');
-var platform = require('cordova/platform');
-
-/**
- * Intercept calls to addEventListener + removeEventListener and handle deviceready,
- * resume, and pause events.
- */
-var m_document_addEventListener = document.addEventListener;
-var m_document_removeEventListener = document.removeEventListener;
-var m_window_addEventListener = window.addEventListener;
-var m_window_removeEventListener = window.removeEventListener;
-
-/**
- * Houses custom event handlers to intercept on document + window event listeners.
- */
-var documentEventHandlers = {};
-var windowEventHandlers = {};
-
-document.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].subscribe(handler);
- } else {
- m_document_addEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].subscribe(handler);
- } else {
- m_window_addEventListener.call(window, evt, handler, capture);
- }
-};
-
-document.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].unsubscribe(handler);
- } else {
- m_document_removeEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].unsubscribe(handler);
- } else {
- m_window_removeEventListener.call(window, evt, handler, capture);
- }
-};
-
-function createEvent (type, data) {
- var event = document.createEvent('Events');
- event.initEvent(type, false, false);
- if (data) {
- for (var i in data) {
- if (Object.prototype.hasOwnProperty.call(data, i)) {
- event[i] = data[i];
- }
- }
- }
- return event;
-}
-
-var cordova = {
- define: define,
- require: require,
- version: PLATFORM_VERSION_BUILD_LABEL,
- platformVersion: PLATFORM_VERSION_BUILD_LABEL,
- platformId: platform.id,
-
- /**
- * Methods to add/remove your own addEventListener hijacking on document + window.
- */
- addWindowEventHandler: function (event) {
- return (windowEventHandlers[event] = channel.create(event));
- },
- addStickyDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.createSticky(event));
- },
- addDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.create(event));
- },
- removeWindowEventHandler: function (event) {
- delete windowEventHandlers[event];
- },
- removeDocumentEventHandler: function (event) {
- delete documentEventHandlers[event];
- },
-
- /**
- * Retrieve original event handlers that were replaced by Cordova
- *
- * @return object
- */
- getOriginalHandlers: function () {
- return {
- document: {
- addEventListener: m_document_addEventListener,
- removeEventListener: m_document_removeEventListener
- },
- window: {
- addEventListener: m_window_addEventListener,
- removeEventListener: m_window_removeEventListener
- }
- };
- },
-
- /**
- * Method to fire event from native code
- * bNoDetach is required for events which cause an exception which needs to be caught in native code
- */
- fireDocumentEvent: function (type, data, bNoDetach) {
- var evt = createEvent(type, data);
- if (typeof documentEventHandlers[type] !== 'undefined') {
- if (bNoDetach) {
- documentEventHandlers[type].fire(evt);
- } else {
- setTimeout(function () {
- // Fire deviceready on listeners that were registered before cordova.js was loaded.
- if (type === 'deviceready') {
- document.dispatchEvent(evt);
- }
- documentEventHandlers[type].fire(evt);
- }, 0);
- }
- } else {
- document.dispatchEvent(evt);
- }
- },
-
- fireWindowEvent: function (type, data) {
- var evt = createEvent(type, data);
- if (typeof windowEventHandlers[type] !== 'undefined') {
- setTimeout(function () {
- windowEventHandlers[type].fire(evt);
- }, 0);
- } else {
- window.dispatchEvent(evt);
- }
- },
-
- /**
- * Plugin callback mechanism.
- */
- // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
- // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
- callbackId: Math.floor(Math.random() * 2000000000),
- callbacks: {},
- callbackStatus: {
- NO_RESULT: 0,
- OK: 1,
- CLASS_NOT_FOUND_EXCEPTION: 2,
- ILLEGAL_ACCESS_EXCEPTION: 3,
- INSTANTIATION_EXCEPTION: 4,
- MALFORMED_URL_EXCEPTION: 5,
- IO_EXCEPTION: 6,
- INVALID_ACTION: 7,
- JSON_EXCEPTION: 8,
- ERROR: 9
- },
-
- /**
- * Called by native code when returning successful result from an action.
- */
- callbackSuccess: function (callbackId, args) {
- cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning error result from an action.
- */
- callbackError: function (callbackId, args) {
- // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
- // Derive success from status.
- cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning the result from an action.
- */
- callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) {
- try {
- var callback = cordova.callbacks[callbackId];
- if (callback) {
- if (isSuccess && status === cordova.callbackStatus.OK) {
- callback.success && callback.success.apply(null, args);
- } else if (!isSuccess) {
- callback.fail && callback.fail.apply(null, args);
- }
- /*
- else
- Note, this case is intentionally not caught.
- this can happen if isSuccess is true, but callbackStatus is NO_RESULT
- which is used to remove a callback from the list without calling the callbacks
- typically keepCallback is false in this case
- */
- // Clear callback if not expecting any more results
- if (!keepCallback) {
- delete cordova.callbacks[callbackId];
- }
- }
- } catch (err) {
- var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
- cordova.fireWindowEvent('cordovacallbackerror', { message: msg, error: err });
- throw err;
- }
- },
-
- addConstructor: function (func) {
- channel.onCordovaReady.subscribe(function () {
- try {
- func();
- } catch (e) {
- console.log('Failed to run constructor: ' + e);
- }
- });
- }
-};
-
-module.exports = cordova;
-
-});
-
-// file: src/common/argscheck.js
-define("cordova/argscheck", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-var moduleExports = module.exports;
-
-var typeMap = {
- A: 'Array',
- D: 'Date',
- N: 'Number',
- S: 'String',
- F: 'Function',
- O: 'Object'
-};
-
-function extractParamName (callee, argIndex) {
- return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex];
-}
-
-/**
- * Checks the given arguments' types and throws if they are not as expected.
- *
- * `spec` is a string where each character stands for the required type of the
- * argument at the same position. In other words: the character at `spec[i]`
- * specifies the required type for `args[i]`. The characters in `spec` are the
- * first letter of the required type's name. The supported types are:
- *
- * Array, Date, Number, String, Function, Object
- *
- * Lowercase characters specify arguments that must not be `null` or `undefined`
- * while uppercase characters allow those values to be passed.
- *
- * Finally, `*` can be used to allow any type at the corresponding position.
- *
- * @example
- * function foo (arr, opts) {
- * // require `arr` to be an Array and `opts` an Object, null or undefined
- * checkArgs('aO', 'my.package.foo', arguments);
- * // ...
- * }
- * @param {String} spec - the type specification for `args` as described above
- * @param {String} functionName - full name of the callee.
- * Used in the error message
- * @param {Array|arguments} args - the arguments to be checked against `spec`
- * @param {Function} [opt_callee=args.callee] - the recipient of `args`.
- * Used to extract parameter names for the error message
- * @throws {TypeError} if args do not satisfy spec
- */
-function checkArgs (spec, functionName, args, opt_callee) {
- if (!moduleExports.enableChecks) {
- return;
- }
- var errMsg = null;
- var typeName;
- for (var i = 0; i < spec.length; ++i) {
- var c = spec.charAt(i);
- var cUpper = c.toUpperCase();
- var arg = args[i];
- // Asterix means allow anything.
- if (c === '*') {
- continue;
- }
- typeName = utils.typeName(arg);
- if ((arg === null || arg === undefined) && c === cUpper) {
- continue;
- }
- if (typeName !== typeMap[cUpper]) {
- errMsg = 'Expected ' + typeMap[cUpper];
- break;
- }
- }
- if (errMsg) {
- errMsg += ', but got ' + typeName + '.';
- errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
- // Don't log when running unit tests.
- if (typeof jasmine === 'undefined') {
- console.error(errMsg);
- }
- throw TypeError(errMsg);
- }
-}
-
-function getValue (value, defaultValue) {
- return value === undefined ? defaultValue : value;
-}
-
-moduleExports.checkArgs = checkArgs;
-moduleExports.getValue = getValue;
-moduleExports.enableChecks = true;
-
-});
-
-// file: src/common/base64.js
-define("cordova/base64", function(require, exports, module) {
-
-var base64 = exports;
-
-base64.fromArrayBuffer = function (arrayBuffer) {
- var array = new Uint8Array(arrayBuffer);
- return uint8ToBase64(array);
-};
-
-base64.toArrayBuffer = function (str) {
- var decodedStr = atob(str);
- var arrayBuffer = new ArrayBuffer(decodedStr.length);
- var array = new Uint8Array(arrayBuffer);
- for (var i = 0, len = decodedStr.length; i < len; i++) {
- array[i] = decodedStr.charCodeAt(i);
- }
- return arrayBuffer;
-};
-
-// ------------------------------------------------------------------------------
-
-/* This code is based on the performance tests at http://jsperf.com/b64tests
- * This 12-bit-at-a-time algorithm was the best performing version on all
- * platforms tested.
- */
-
-var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
-var b64_12bit;
-
-var b64_12bitTable = function () {
- b64_12bit = [];
- for (var i = 0; i < 64; i++) {
- for (var j = 0; j < 64; j++) {
- b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j];
- }
- }
- b64_12bitTable = function () { return b64_12bit; };
- return b64_12bit;
-};
-
-function uint8ToBase64 (rawData) {
- var numBytes = rawData.byteLength;
- var output = '';
- var segment;
- var table = b64_12bitTable();
- for (var i = 0; i < numBytes - 2; i += 3) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2];
- output += table[segment >> 12];
- output += table[segment & 0xfff];
- }
- if (numBytes - i === 2) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8);
- output += table[segment >> 12];
- output += b64_6bit[(segment & 0xfff) >> 6];
- output += '=';
- } else if (numBytes - i === 1) {
- segment = (rawData[i] << 16);
- output += table[segment >> 12];
- output += '==';
- }
- return output;
-}
-
-});
-
-// file: src/common/builder.js
-define("cordova/builder", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-function each (objects, func, context) {
- for (var prop in objects) {
- if (Object.prototype.hasOwnProperty.call(objects, prop)) {
- func.apply(context, [objects[prop], prop]);
- }
- }
-}
-
-function clobber (obj, key, value) {
- var needsProperty = false;
- try {
- obj[key] = value;
- } catch (e) {
- needsProperty = true;
- }
- // Getters can only be overridden by getters.
- if (needsProperty || obj[key] !== value) {
- utils.defineGetter(obj, key, function () {
- return value;
- });
- }
-}
-
-function assignOrWrapInDeprecateGetter (obj, key, value, message) {
- if (message) {
- utils.defineGetter(obj, key, function () {
- console.log(message);
- delete obj[key];
- clobber(obj, key, value);
- return value;
- });
- } else {
- clobber(obj, key, value);
- }
-}
-
-function include (parent, objects, clobber, merge) {
- each(objects, function (obj, key) {
- try {
- var result = obj.path ? require(obj.path) : {};
-
- if (clobber) {
- // Clobber if it doesn't exist.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (typeof obj.path !== 'undefined') {
- // If merging, merge properties onto parent, otherwise, clobber.
- if (merge) {
- recursiveMerge(parent[key], result);
- } else {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- }
- }
- result = parent[key];
- } else {
- // Overwrite if not currently defined.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else {
- // Set result to what already exists, so we can build children into it if they exist.
- result = parent[key];
- }
- }
-
- if (obj.children) {
- include(result, obj.children, clobber, merge);
- }
- } catch (e) {
- utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
- }
- });
-}
-
-/**
- * Merge properties from one object onto another recursively. Properties from
- * the src object will overwrite existing target property.
- *
- * @param target Object to merge properties into.
- * @param src Object to merge properties from.
- */
-function recursiveMerge (target, src) {
- for (var prop in src) {
- if (Object.prototype.hasOwnProperty.call(src, prop)) {
- if (target.prototype && target.prototype.constructor === target) {
- // If the target object is a constructor override off prototype.
- clobber(target.prototype, prop, src[prop]);
- } else {
- if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
- recursiveMerge(target[prop], src[prop]);
- } else {
- clobber(target, prop, src[prop]);
- }
- }
- }
- }
-}
-
-exports.buildIntoButDoNotClobber = function (objects, target) {
- include(target, objects, false, false);
-};
-exports.buildIntoAndClobber = function (objects, target) {
- include(target, objects, true, false);
-};
-exports.buildIntoAndMerge = function (objects, target) {
- include(target, objects, true, true);
-};
-exports.recursiveMerge = recursiveMerge;
-exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
-
-});
-
-// file: src/common/channel.js
-define("cordova/channel", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-var nextGuid = 1;
-
-/**
- * Custom pub-sub "channel" that can have functions subscribed to it
- * This object is used to define and control firing of events for
- * cordova initialization, as well as for custom events thereafter.
- *
- * The order of events during page load and Cordova startup is as follows:
- *
- * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed.
- * onNativeReady* Internal event that indicates the Cordova native side is ready.
- * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created.
- * onDeviceReady* User event fired to indicate that Cordova is ready
- * onResume User event fired to indicate a start/resume lifecycle event
- * onPause User event fired to indicate a pause lifecycle event
- *
- * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
- * All listeners that subscribe after the event is fired will be executed right away.
- *
- * The only Cordova events that user code should register for are:
- * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
- * pause App has moved to background
- * resume App has returned to foreground
- *
- * Listeners can be registered as:
- * document.addEventListener("deviceready", myDeviceReadyListener, false);
- * document.addEventListener("resume", myResumeListener, false);
- * document.addEventListener("pause", myPauseListener, false);
- *
- * The DOM lifecycle events should be used for saving and restoring state
- * window.onload
- * window.onunload
- *
- */
-
-/**
- * Channel
- * @constructor
- * @param type String the channel name
- */
-var Channel = function (type, sticky) {
- this.type = type;
- // Map of guid -> function.
- this.handlers = {};
- // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
- this.state = sticky ? 1 : 0;
- // Used in sticky mode to remember args passed to fire().
- this.fireArgs = null;
- // Used by onHasSubscribersChange to know if there are any listeners.
- this.numHandlers = 0;
- // Function that is called when the first listener is subscribed, or when
- // the last listener is unsubscribed.
- this.onHasSubscribersChange = null;
-};
-var channel = {
- /**
- * Calls the provided function only after all of the channels specified
- * have been fired. All channels must be sticky channels.
- */
- join: function (h, c) {
- var len = c.length;
- var i = len;
- var f = function () {
- if (!(--i)) h();
- };
- for (var j = 0; j < len; j++) {
- if (c[j].state === 0) {
- throw Error('Can only use join with sticky channels.');
- }
- c[j].subscribe(f);
- }
- if (!len) h();
- },
-
- create: function (type) {
- return (channel[type] = new Channel(type, false));
- },
- createSticky: function (type) {
- return (channel[type] = new Channel(type, true));
- },
-
- /**
- * cordova Channels that must fire before "deviceready" is fired.
- */
- deviceReadyChannelsArray: [],
- deviceReadyChannelsMap: {},
-
- /**
- * Indicate that a feature needs to be initialized before it is ready to be used.
- * This holds up Cordova's "deviceready" event until the feature has been initialized
- * and Cordova.initComplete(feature) is called.
- *
- * @param feature {String} The unique feature name
- */
- waitForInitialization: function (feature) {
- if (feature) {
- var c = channel[feature] || this.createSticky(feature);
- this.deviceReadyChannelsMap[feature] = c;
- this.deviceReadyChannelsArray.push(c);
- }
- },
-
- /**
- * Indicate that initialization code has completed and the feature is ready to be used.
- *
- * @param feature {String} The unique feature name
- */
- initializationComplete: function (feature) {
- var c = this.deviceReadyChannelsMap[feature];
- if (c) {
- c.fire();
- }
- }
-};
-
-function checkSubscriptionArgument (argument) {
- if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') {
- throw new Error(
- 'Must provide a function or an EventListener object ' +
- 'implementing the handleEvent interface.'
- );
- }
-}
-
-/**
- * Subscribes the given function to the channel. Any time that
- * Channel.fire is called so too will the function.
- * Optionally specify an execution context for the function
- * and a guid that can be used to stop subscribing to the channel.
- * Returns the guid.
- */
-Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- eventListener = eventListenerOrFunction;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- if (this.state === 2) {
- handleEvent.apply(eventListener || this, this.fireArgs);
- return;
- }
-
- guid = eventListenerOrFunction.observer_guid;
- if (typeof eventListener === 'object') {
- handleEvent = utils.close(eventListener, handleEvent);
- }
-
- if (!guid) {
- // First time any channel has seen this subscriber
- guid = '' + nextGuid++;
- }
- handleEvent.observer_guid = guid;
- eventListenerOrFunction.observer_guid = guid;
-
- // Don't add the same handler more than once.
- if (!this.handlers[guid]) {
- this.handlers[guid] = handleEvent;
- this.numHandlers++;
- if (this.numHandlers === 1) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Unsubscribes the function with the given guid from the channel.
- */
-Channel.prototype.unsubscribe = function (eventListenerOrFunction) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid, handler;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- guid = handleEvent.observer_guid;
- handler = this.handlers[guid];
- if (handler) {
- delete this.handlers[guid];
- this.numHandlers--;
- if (this.numHandlers === 0) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Calls all functions subscribed to this channel.
- */
-Channel.prototype.fire = function (e) {
- var fireArgs = Array.prototype.slice.call(arguments);
- // Apply stickiness.
- if (this.state === 1) {
- this.state = 2;
- this.fireArgs = fireArgs;
- }
- if (this.numHandlers) {
- // Copy the values first so that it is safe to modify it from within
- // callbacks.
- var toCall = [];
- for (var item in this.handlers) {
- toCall.push(this.handlers[item]);
- }
- for (var i = 0; i < toCall.length; ++i) {
- toCall[i].apply(this, fireArgs);
- }
- if (this.state === 2 && this.numHandlers) {
- this.numHandlers = 0;
- this.handlers = {};
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-// defining them here so they are ready super fast!
-// DOM event that is received when the web page is loaded and parsed.
-channel.createSticky('onDOMContentLoaded');
-
-// Event to indicate the Cordova native side is ready.
-channel.createSticky('onNativeReady');
-
-// Event to indicate that all Cordova JavaScript objects have been created
-// and it's time to run plugin constructors.
-channel.createSticky('onCordovaReady');
-
-// Event to indicate that all automatically loaded JS plugins are loaded and ready.
-// FIXME remove this
-channel.createSticky('onPluginsReady');
-
-// Event to indicate that Cordova is ready
-channel.createSticky('onDeviceReady');
-
-// Event to indicate a resume lifecycle event
-channel.create('onResume');
-
-// Event to indicate a pause lifecycle event
-channel.create('onPause');
-
-// Channels that must fire before "deviceready" is fired.
-channel.waitForInitialization('onCordovaReady');
-channel.waitForInitialization('onDOMContentLoaded');
-
-module.exports = channel;
-
-});
-
-// file: ../../cordova-js-src/exec.js
-define("cordova/exec", function(require, exports, module) {
-
-/**
- * Creates the exec bridge used to notify the native code of
- * commands.
- */
-var cordova = require('cordova');
-var utils = require('cordova/utils');
-var base64 = require('cordova/base64');
-
-function massageArgsJsToNative (args) {
- if (!args || utils.typeName(args) !== 'Array') {
- return args;
- }
- var ret = [];
- args.forEach(function (arg, i) {
- if (utils.typeName(arg) === 'ArrayBuffer') {
- ret.push({
- CDVType: 'ArrayBuffer',
- data: base64.fromArrayBuffer(arg)
- });
- } else {
- ret.push(arg);
- }
- });
- return ret;
-}
-
-function massageMessageNativeToJs (message) {
- if (message.CDVType === 'ArrayBuffer') {
- var stringToArrayBuffer = function (str) {
- var ret = new Uint8Array(str.length);
- for (var i = 0; i < str.length; i++) {
- ret[i] = str.charCodeAt(i);
- }
- return ret.buffer;
- };
- var base64ToArrayBuffer = function (b64) {
- return stringToArrayBuffer(atob(b64));
- };
- message = base64ToArrayBuffer(message.data);
- }
- return message;
-}
-
-function convertMessageToArgsNativeToJs (message) {
- var args = [];
- if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) {
- args.push(message);
- } else if (message.CDVType === 'MultiPart') {
- message.messages.forEach(function (e) {
- args.push(massageMessageNativeToJs(e));
- });
- } else {
- args.push(massageMessageNativeToJs(message));
- }
- return args;
-}
-
-var iOSExec = function () {
- var successCallback, failCallback, service, action, actionArgs;
- var callbackId = null;
- if (typeof arguments[0] !== 'string') {
- // FORMAT ONE
- successCallback = arguments[0];
- failCallback = arguments[1];
- service = arguments[2];
- action = arguments[3];
- actionArgs = arguments[4];
-
- // Since we need to maintain backwards compatibility, we have to pass
- // an invalid callbackId even if no callback was provided since plugins
- // will be expecting it. The Cordova.exec() implementation allocates
- // an invalid callbackId and passes it even if no callbacks were given.
- callbackId = 'INVALID';
- } else {
- throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
- 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
- }
-
- // If actionArgs is not provided, default to an empty array
- actionArgs = actionArgs || [];
-
- // Register the callbacks and add the callbackId to the positional
- // arguments if given.
- if (successCallback || failCallback) {
- callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
- { success: successCallback, fail: failCallback };
- }
-
- actionArgs = massageArgsJsToNative(actionArgs);
-
- // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
- var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
- window.webkit.messageHandlers.cordova.postMessage(command);
-};
-
-iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
- var success = status === 0 || status === 1;
- var args = convertMessageToArgsNativeToJs(message);
- Promise.resolve().then(function () {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
- });
-};
-
-// for backwards compatibility
-iOSExec.nativeEvalAndFetch = function (func) {
- try {
- func();
- } catch (e) {
- console.log(e);
- }
-};
-
-// Proxy the exec for bridge changes. See CB-10106
-
-function cordovaExec () {
- var cexec = require('cordova/exec');
- var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
- return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
-}
-
-function execProxy () {
- cordovaExec().apply(null, arguments);
-}
-
-execProxy.nativeFetchMessages = function () {
- return cordovaExec().nativeFetchMessages.apply(null, arguments);
-};
-
-execProxy.nativeEvalAndFetch = function () {
- return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
-};
-
-execProxy.nativeCallback = function () {
- return cordovaExec().nativeCallback.apply(null, arguments);
-};
-
-module.exports = execProxy;
-
-});
-
-// file: src/common/exec/proxy.js
-define("cordova/exec/proxy", function(require, exports, module) {
-
-// internal map of proxy function
-var CommandProxyMap = {};
-
-module.exports = {
-
- // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
- add: function (id, proxyObj) {
- console.log('adding proxy for ' + id);
- CommandProxyMap[id] = proxyObj;
- return proxyObj;
- },
-
- // cordova.commandProxy.remove("Accelerometer");
- remove: function (id) {
- var proxy = CommandProxyMap[id];
- delete CommandProxyMap[id];
- CommandProxyMap[id] = null;
- return proxy;
- },
-
- get: function (service, action) {
- return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null);
- }
-};
-
-});
-
-// file: src/common/init.js
-define("cordova/init", function(require, exports, module) {
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-
-var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
-
-function logUnfiredChannels (arr) {
- for (var i = 0; i < arr.length; ++i) {
- if (arr[i].state !== 2) {
- console.log('Channel not fired: ' + arr[i].type);
- }
- }
-}
-
-window.setTimeout(function () {
- if (channel.onDeviceReady.state !== 2) {
- console.log('deviceready has not fired after 5 seconds.');
- logUnfiredChannels(platformInitChannelsArray);
- logUnfiredChannels(channel.deviceReadyChannelsArray);
- }
-}, 5000);
-
-if (!window.console) {
- window.console = {
- log: function () {}
- };
-}
-if (!window.console.warn) {
- window.console.warn = function (msg) {
- this.log('warn: ' + msg);
- };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onActivated = cordova.addDocumentEventHandler('activated');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState === 'complete' || document.readyState === 'interactive') {
- channel.onDOMContentLoaded.fire();
-} else {
- document.addEventListener('DOMContentLoaded', function () {
- channel.onDOMContentLoaded.fire();
- }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
- channel.onNativeReady.fire();
-}
-
-modulemapper.clobbers('cordova', 'cordova');
-modulemapper.clobbers('cordova/exec', 'cordova.exec');
-modulemapper.clobbers('cordova/exec', 'Cordova.exec');
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
-// The delay allows the attached modules to be defined before the plugin loader looks for them.
-setTimeout(function () {
- pluginloader.load(function () {
- channel.onPluginsReady.fire();
- });
-}, 0);
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function () {
- modulemapper.mapModules(window);
-
- platform.initialize && platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once page has fully loaded, all
- // constructors have run and cordova info has been received from native
- // side.
- channel.join(function () {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-}, platformInitChannelsArray);
-
-});
-
-// file: src/common/modulemapper.js
-define("cordova/modulemapper", function(require, exports, module) {
-
-var builder = require('cordova/builder');
-var moduleMap = define.moduleMap;
-var symbolList;
-var deprecationMap;
-
-exports.reset = function () {
- symbolList = [];
- deprecationMap = {};
-};
-
-function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) {
- if (!(moduleName in moduleMap)) {
- throw new Error('Module ' + moduleName + ' does not exist.');
- }
- symbolList.push(strategy, moduleName, symbolPath);
- if (opt_deprecationMessage) {
- deprecationMap[symbolPath] = opt_deprecationMessage;
- }
-}
-
-// Note: Android 2.3 does have Function.bind().
-exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.runs = function (moduleName) {
- addEntry('r', moduleName, null);
-};
-
-function prepareNamespace (symbolPath, context) {
- if (!symbolPath) {
- return context;
- }
- return symbolPath.split('.').reduce(function (cur, part) {
- return (cur[part] = cur[part] || {});
- }, context);
-}
-
-exports.mapModules = function (context) {
- var origSymbols = {};
- context.CDV_origSymbols = origSymbols;
- for (var i = 0, len = symbolList.length; i < len; i += 3) {
- var strategy = symbolList[i];
- var moduleName = symbolList[i + 1];
- var module = require(moduleName);
- // <runs/>
- if (strategy === 'r') {
- continue;
- }
- var symbolPath = symbolList[i + 2];
- var lastDot = symbolPath.lastIndexOf('.');
- var namespace = symbolPath.substr(0, lastDot);
- var lastName = symbolPath.substr(lastDot + 1);
-
- var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
- var parentObj = prepareNamespace(namespace, context);
- var target = parentObj[lastName];
-
- if (strategy === 'm' && target) {
- builder.recursiveMerge(target, module);
- } else if ((strategy === 'd' && !target) || (strategy !== 'd')) {
- if (!(symbolPath in origSymbols)) {
- origSymbols[symbolPath] = target;
- }
- builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
- }
- }
-};
-
-exports.getOriginalSymbol = function (context, symbolPath) {
- var origSymbols = context.CDV_origSymbols;
- if (origSymbols && (symbolPath in origSymbols)) {
- return origSymbols[symbolPath];
- }
- var parts = symbolPath.split('.');
- var obj = context;
- for (var i = 0; i < parts.length; ++i) {
- obj = obj && obj[parts[i]];
- }
- return obj;
-};
-
-exports.reset();
-
-});
-
-// file: ../../cordova-js-src/platform.js
-define("cordova/platform", function(require, exports, module) {
-
-module.exports = {
- id: 'ios',
- bootstrap: function () {
- // Attach the console polyfill that is iOS-only to window.console
- // see the file under plugin/ios/console.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
-
- // Attach the wkwebkit utility to window.WkWebView
- // see the file under plugin/ios/wkwebkit.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView');
-
- // Attach the splashscreen utility to window.navigator.splashscreen
- // see the file under plugin/ios/launchscreen.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
-
- // Attach the internal statusBar utility to window.statusbar
- // see the file under plugin/ios/statusbar.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/statusbar', 'window.statusbar');
-
- require('cordova/channel').onNativeReady.fire();
- }
-};
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/console.js
-define("cordova/plugin/ios/console", function(require, exports, module) {
-
-// ------------------------------------------------------------------------------
-
-var logger = require('cordova/plugin/ios/logger');
-
-// ------------------------------------------------------------------------------
-// object that we're exporting
-// ------------------------------------------------------------------------------
-var console = module.exports;
-
-// ------------------------------------------------------------------------------
-// copy of the original console object
-// ------------------------------------------------------------------------------
-var WinConsole = window.console;
-
-// ------------------------------------------------------------------------------
-// whether to use the logger
-// ------------------------------------------------------------------------------
-var UseLogger = false;
-
-// ------------------------------------------------------------------------------
-// Timers
-// ------------------------------------------------------------------------------
-var Timers = {};
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-function noop () {}
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-console.useLogger = function (value) {
- if (arguments.length) UseLogger = !!value;
-
- if (UseLogger) {
- if (logger.useConsole()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
-
- return UseLogger;
-};
-
-// ------------------------------------------------------------------------------
-console.log = function () {
- if (logger.useConsole()) return;
- logger.log.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.error = function () {
- if (logger.useConsole()) return;
- logger.error.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.warn = function () {
- if (logger.useConsole()) return;
- logger.warn.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.info = function () {
- if (logger.useConsole()) return;
- logger.info.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.debug = function () {
- if (logger.useConsole()) return;
- logger.debug.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.assert = function (expression) {
- if (expression) return;
-
- var message = logger.format.apply(logger.format, [].slice.call(arguments, 1));
- console.log('ASSERT: ' + message);
-};
-
-// ------------------------------------------------------------------------------
-console.clear = function () {};
-
-// ------------------------------------------------------------------------------
-console.dir = function (object) {
- console.log('%o', object);
-};
-
-// ------------------------------------------------------------------------------
-console.dirxml = function (node) {
- console.log(node.innerHTML);
-};
-
-// ------------------------------------------------------------------------------
-console.trace = noop;
-
-// ------------------------------------------------------------------------------
-console.group = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupCollapsed = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.time = function (name) {
- Timers[name] = new Date().valueOf();
-};
-
-// ------------------------------------------------------------------------------
-console.timeEnd = function (name) {
- var timeStart = Timers[name];
- if (!timeStart) {
- console.warn('unknown timer: ' + name);
- return;
- }
-
- var timeElapsed = new Date().valueOf() - timeStart;
- console.log(name + ': ' + timeElapsed + 'ms');
-};
-
-// ------------------------------------------------------------------------------
-console.timeStamp = noop;
-
-// ------------------------------------------------------------------------------
-console.profile = noop;
-
-// ------------------------------------------------------------------------------
-console.profileEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.count = noop;
-
-// ------------------------------------------------------------------------------
-console.exception = console.log;
-
-// ------------------------------------------------------------------------------
-console.table = function (data, columns) {
- console.log('%o', data);
-};
-
-// ------------------------------------------------------------------------------
-// return a new function that calls both functions passed as args
-// ------------------------------------------------------------------------------
-function wrappedOrigCall (orgFunc, newFunc) {
- return function () {
- var args = [].slice.call(arguments);
- try { orgFunc.apply(WinConsole, args); } catch (e) {}
- try { newFunc.apply(console, args); } catch (e) {}
- };
-}
-
-// ------------------------------------------------------------------------------
-// For every function that exists in the original console object, that
-// also exists in the new console object, wrap the new console method
-// with one that calls both
-// ------------------------------------------------------------------------------
-for (var key in console) {
- if (typeof WinConsole[key] === 'function') {
- console[key] = wrappedOrigCall(WinConsole[key], console[key]);
- }
-}
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/launchscreen.js
-define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var launchscreen = {
- show: function () {
- exec(null, null, 'LaunchScreen', 'show', []);
- },
- hide: function () {
- exec(null, null, 'LaunchScreen', 'hide', []);
- }
-};
-
-module.exports = launchscreen;
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/logger.js
-define("cordova/plugin/ios/logger", function(require, exports, module) {
-
-// ------------------------------------------------------------------------------
-// The logger module exports the following properties/functions:
-//
-// LOG - constant for the level LOG
-// ERROR - constant for the level ERROR
-// WARN - constant for the level WARN
-// INFO - constant for the level INFO
-// DEBUG - constant for the level DEBUG
-// logLevel() - returns current log level
-// logLevel(value) - sets and returns a new log level
-// useConsole() - returns whether logger is using console
-// useConsole(value) - sets and returns whether logger is using console
-// log(message,...) - logs a message at level LOG
-// error(message,...) - logs a message at level ERROR
-// warn(message,...) - logs a message at level WARN
-// info(message,...) - logs a message at level INFO
-// debug(message,...) - logs a message at level DEBUG
-// logLevel(level,message,...) - logs a message specified level
-//
-// ------------------------------------------------------------------------------
-
-var logger = exports;
-
-var exec = require('cordova/exec');
-
-var UseConsole = false;
-var UseLogger = true;
-var Queued = [];
-var DeviceReady = false;
-var CurrentLevel;
-
-var originalConsole = console;
-
-/**
- * Logging levels
- */
-
-var Levels = [
- 'LOG',
- 'ERROR',
- 'WARN',
- 'INFO',
- 'DEBUG'
-];
-
-/*
- * add the logging levels to the logger object and
- * to a separate levelsMap object for testing
- */
-
-var LevelsMap = {};
-for (var i = 0; i < Levels.length; i++) {
- var level = Levels[i];
- LevelsMap[level] = i;
- logger[level] = level;
-}
-
-CurrentLevel = LevelsMap.WARN;
-
-/**
- * Getter/Setter for the logging level
- *
- * Returns the current logging level.
- *
- * When a value is passed, sets the logging level to that value.
- * The values should be one of the following constants:
- * logger.LOG
- * logger.ERROR
- * logger.WARN
- * logger.INFO
- * logger.DEBUG
- *
- * The value used determines which messages get printed. The logging
- * values above are in order, and only messages logged at the logging
- * level or above will actually be displayed to the user. E.g., the
- * default level is WARN, so only messages logged with LOG, ERROR, or
- * WARN will be displayed; INFO and DEBUG messages will be ignored.
- */
-logger.level = function (value) {
- if (arguments.length) {
- if (LevelsMap[value] === null) {
- throw new Error('invalid logging level: ' + value);
- }
- CurrentLevel = LevelsMap[value];
- }
-
- return Levels[CurrentLevel];
-};
-
-/**
- * Getter/Setter for the useConsole functionality
- *
- * When useConsole is true, the logger will log via the
- * browser 'console' object.
- */
-logger.useConsole = function (value) {
- if (arguments.length) UseConsole = !!value;
-
- if (UseConsole) {
- if (typeof console === 'undefined') {
- throw new Error('global console object is not defined');
- }
-
- if (typeof console.log !== 'function') {
- throw new Error('global console object does not have a log function');
- }
-
- if (typeof console.useLogger === 'function') {
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
- }
-
- return UseConsole;
-};
-
-/**
- * Getter/Setter for the useLogger functionality
- *
- * When useLogger is true, the logger will log via the
- * native Logger plugin.
- */
-logger.useLogger = function (value) {
- // Enforce boolean
- if (arguments.length) UseLogger = !!value;
- return UseLogger;
-};
-
-/**
- * Logs a message at the LOG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.log = function (message) { logWithArgs('LOG', arguments); };
-
-/**
- * Logs a message at the ERROR level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.error = function (message) { logWithArgs('ERROR', arguments); };
-
-/**
- * Logs a message at the WARN level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.warn = function (message) { logWithArgs('WARN', arguments); };
-
-/**
- * Logs a message at the INFO level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.info = function (message) { logWithArgs('INFO', arguments); };
-
-/**
- * Logs a message at the DEBUG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.debug = function (message) { logWithArgs('DEBUG', arguments); };
-
-// log at the specified level with args
-function logWithArgs (level, args) {
- args = [level].concat([].slice.call(args));
- logger.logLevel.apply(logger, args);
-}
-
-// return the correct formatString for an object
-function formatStringForMessage (message) {
- return (typeof message === 'string') ? '' : '%o';
-}
-
-/**
- * Logs a message at the specified level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.logLevel = function (level /* , ... */) {
- // format the message with the parameters
- var formatArgs = [].slice.call(arguments, 1);
- var fmtString = formatStringForMessage(formatArgs[0]);
- if (fmtString.length > 0) {
- formatArgs.unshift(fmtString); // add formatString
- }
-
- var message = logger.format.apply(logger.format, formatArgs);
-
- if (LevelsMap[level] === null) {
- throw new Error('invalid logging level: ' + level);
- }
-
- if (LevelsMap[level] > CurrentLevel) return;
-
- // queue the message if not yet at deviceready
- if (!DeviceReady && !UseConsole) {
- Queued.push([level, message]);
- return;
- }
-
- // Log using the native logger if that is enabled
- if (UseLogger) {
- exec(null, null, 'Console', 'logLevel', [level, message]);
- }
-
- // Log using the console if that is enabled
- if (UseConsole) {
- // make sure console is not using logger
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
-
- // log to the console
- switch (level) {
- case logger.LOG: originalConsole.log(message); break;
- case logger.ERROR: originalConsole.log('ERROR: ' + message); break;
- case logger.WARN: originalConsole.log('WARN: ' + message); break;
- case logger.INFO: originalConsole.log('INFO: ' + message); break;
- case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break;
- }
- }
-};
-
-/**
- * Formats a string and arguments following it ala console.log()
- *
- * Any remaining arguments will be appended to the formatted string.
- *
- * for rationale, see FireBug's Console API:
- * http://getfirebug.com/wiki/index.php/Console_API
- */
-logger.format = function (formatString, args) {
- return __format(arguments[0], [].slice.call(arguments, 1)).join(' ');
-};
-
-// ------------------------------------------------------------------------------
-/**
- * Formats a string and arguments following it ala vsprintf()
- *
- * format chars:
- * %j - format arg as JSON
- * %o - format arg as JSON
- * %c - format arg as ''
- * %% - replace with '%'
- * any other char following % will format it's
- * arg via toString().
- *
- * Returns an array containing the formatted string and any remaining
- * arguments.
- */
-function __format (formatString, args) {
- if (formatString === null || formatString === undefined) return [''];
- if (arguments.length === 1) return [formatString.toString()];
-
- if (typeof formatString !== 'string') { formatString = formatString.toString(); }
-
- var pattern = /(.*?)%(.)(.*)/;
- var rest = formatString;
- var result = [];
-
- while (args.length) {
- var match = pattern.exec(rest);
- if (!match) break;
-
- var arg = args.shift();
- rest = match[3];
- result.push(match[1]);
-
- if (match[2] === '%') {
- result.push('%');
- args.unshift(arg);
- continue;
- }
-
- result.push(__formatted(arg, match[2]));
- }
-
- result.push(rest);
-
- var remainingArgs = [].slice.call(args);
- remainingArgs.unshift(result.join(''));
- return remainingArgs;
-}
-
-function __formatted (object, formatChar) {
- try {
- switch (formatChar) {
- case 'j':
- case 'o': return JSON.stringify(object);
- case 'c': return '';
- }
- } catch (e) {
- return 'error JSON.stringify()ing argument: ' + e;
- }
-
- if ((object === null) || (object === undefined)) {
- return Object.prototype.toString.call(object);
- }
-
- return object.toString();
-}
-
-// ------------------------------------------------------------------------------
-// when deviceready fires, log queued messages
-logger.__onDeviceReady = function () {
- if (DeviceReady) return;
-
- DeviceReady = true;
-
- for (var i = 0; i < Queued.length; i++) {
- var messageArgs = Queued[i];
- logger.logLevel(messageArgs[0], messageArgs[1]);
- }
-
- Queued = null;
-};
-
-// add a deviceready event to log queued messages
-document.addEventListener('deviceready', logger.__onDeviceReady, false);
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/statusbar.js
-define("cordova/plugin/ios/statusbar", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var statusBarVisible = true;
-var statusBar = {};
-
-// This <script> element is explicitly used by Cordova's statusbar for computing color. (Do not use this element)
-const statusBarScript = document.createElement('script');
-document.head.appendChild(statusBarScript);
-
-Object.defineProperty(statusBar, 'visible', {
- configurable: false,
- enumerable: true,
- get: function () {
- if (window.StatusBar) {
- // Let the CDVStatusBar plugin handle it
- return window.StatusBar.isVisible;
- }
-
- return statusBarVisible;
- },
- set: function (value) {
- if (window.StatusBar) {
- // Let the CDVStatusBar plugin handle it
- if (value) {
- window.StatusBar.show();
- } else {
- window.StatusBar.hide();
- }
- } else {
- statusBarVisible = value;
- exec(null, null, 'StatusBarInternal', 'setVisible', [!!value]);
- }
- }
-});
-
-Object.defineProperty(statusBar, 'setBackgroundColor', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: function (value) {
- statusBarScript.style.color = value;
- var rgbStr = window.getComputedStyle(statusBarScript).getPropertyValue('color');
-
- if (!rgbStr.match(/^rgb/)) {
- return;
- }
-
- var rgbVals = rgbStr.match(/\d+/g).map(function (v) { return parseInt(v, 10); });
- if (rgbVals.length < 3) {
- return;
- }
-
- if (window.StatusBar) {
- window.StatusBar.backgroundColorByHexString('#' + rgbVals[0].toString(16).padStart(2, '0') + rgbVals[1].toString(16).padStart(2, '0') + rgbVals[2].toString(16).padStart(2, '0'));
- } else {
- exec(null, null, 'StatusBarInternal', 'setBackgroundColor', rgbVals);
- }
- }
-});
-
-module.exports = statusBar;
-
-});
-
-// file: ../../cordova-js-src/plugin/ios/wkwebkit.js
-define("cordova/plugin/ios/wkwebkit", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var WkWebKit = {
- allowsBackForwardNavigationGestures: function (allow) {
- exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
- },
- convertFilePath: function (path) {
- if (!path || !window.CDV_ASSETS_URL) {
- return path;
- }
- if (path.startsWith('/')) {
- return window.CDV_ASSETS_URL + '/_app_file_' + path;
- }
- if (path.startsWith('file://')) {
- return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_');
- }
- return path;
- }
-};
-
-module.exports = WkWebKit;
-
-});
-
-// file: src/common/pluginloader.js
-define("cordova/pluginloader", function(require, exports, module) {
-
-var modulemapper = require('cordova/modulemapper');
-
-// Helper function to inject a <script> tag.
-// Exported for testing.
-exports.injectScript = function (url, onload, onerror) {
- var script = document.createElement('script');
- // onload fires even when script fails loads with an error.
- script.onload = onload;
- // onerror fires for malformed URLs.
- script.onerror = onerror;
- script.src = url;
- document.head.appendChild(script);
-};
-
-function injectIfNecessary (id, url, onload, onerror) {
- onerror = onerror || onload;
- if (id in define.moduleMap) {
- onload();
- } else {
- exports.injectScript(url, function () {
- if (id in define.moduleMap) {
- onload();
- } else {
- onerror();
- }
- }, onerror);
- }
-}
-
-function onScriptLoadingComplete (moduleList, finishPluginLoading) {
- // Loop through all the plugins and then through their clobbers and merges.
- for (var i = 0, module; (module = moduleList[i]); i++) {
- if (module.clobbers && module.clobbers.length) {
- for (var j = 0; j < module.clobbers.length; j++) {
- modulemapper.clobbers(module.id, module.clobbers[j]);
- }
- }
-
- if (module.merges && module.merges.length) {
- for (var k = 0; k < module.merges.length; k++) {
- modulemapper.merges(module.id, module.merges[k]);
- }
- }
-
- // Finally, if runs is truthy we want to simply require() the module.
- if (module.runs) {
- modulemapper.runs(module.id);
- }
- }
-
- finishPluginLoading();
-}
-
-// Handler for the cordova_plugins.js content.
-// See plugman's plugin_loader.js for the details of this object.
-// This function is only called if the really is a plugins array that isn't empty.
-// Otherwise the onerror response handler will just call finishPluginLoading().
-function handlePluginsObject (path, moduleList, finishPluginLoading) {
- // Now inject the scripts.
- var scriptCounter = moduleList.length;
-
- if (!scriptCounter) {
- finishPluginLoading();
- return;
- }
- function scriptLoadedCallback () {
- if (!--scriptCounter) {
- onScriptLoadingComplete(moduleList, finishPluginLoading);
- }
- }
-
- for (var i = 0; i < moduleList.length; i++) {
- injectIfNecessary(moduleList[i].id, path + moduleList[i].file, scriptLoadedCallback);
- }
-}
-
-function findCordovaPath () {
- var path = null;
- var scripts = document.getElementsByTagName('script');
- var term = '/cordova.js';
- for (var n = scripts.length - 1; n > -1; n--) {
- var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
- if (src.indexOf(term) === (src.length - term.length)) {
- path = src.substring(0, src.length - term.length) + '/';
- break;
- }
- }
- return path;
-}
-
-// Tries to load all plugins' js-modules.
-// This is an async process, but onDeviceReady is blocked on onPluginsReady.
-// onPluginsReady is fired when there are no plugins to load, or they are all done.
-exports.load = function (callback) {
- var pathPrefix = findCordovaPath();
- if (pathPrefix === null) {
- console.log('Could not find cordova.js script tag. Plugin loading may fail.');
- pathPrefix = '';
- }
- injectIfNecessary('cordova/plugin_list', pathPrefix + 'cordova_plugins.js', function () {
- var moduleList = require('cordova/plugin_list');
- handlePluginsObject(pathPrefix, moduleList, callback);
- }, callback);
-};
-
-});
-
-// file: src/common/urlutil.js
-define("cordova/urlutil", function(require, exports, module) {
-
-/**
- * For already absolute URLs, returns what is passed in.
- * For relative URLs, converts them to absolute ones.
- */
-exports.makeAbsolute = function makeAbsolute (url) {
- var anchorEl = document.createElement('a');
- anchorEl.href = url;
- return anchorEl.href;
-};
-
-});
-
-// file: src/common/utils.js
-define("cordova/utils", function(require, exports, module) {
-
-var utils = exports;
-
-/**
- * Defines a property getter / setter for obj[key].
- */
-utils.defineGetterSetter = function (obj, key, getFunc, opt_setFunc) {
- if (Object.defineProperty) {
- var desc = {
- get: getFunc,
- configurable: true
- };
- if (opt_setFunc) {
- desc.set = opt_setFunc;
- }
- Object.defineProperty(obj, key, desc);
- } else {
- obj.__defineGetter__(key, getFunc);
- if (opt_setFunc) {
- obj.__defineSetter__(key, opt_setFunc);
- }
- }
-};
-
-/**
- * Defines a property getter for obj[key].
- */
-utils.defineGetter = utils.defineGetterSetter;
-
-utils.arrayIndexOf = function (a, item) {
- if (a.indexOf) {
- return a.indexOf(item);
- }
- var len = a.length;
- for (var i = 0; i < len; ++i) {
- if (a[i] === item) {
- return i;
- }
- }
- return -1;
-};
-
-/**
- * Returns whether the item was found in the array.
- */
-utils.arrayRemove = function (a, item) {
- var index = utils.arrayIndexOf(a, item);
- if (index !== -1) {
- a.splice(index, 1);
- }
- return index !== -1;
-};
-
-utils.typeName = function (val) {
- return Object.prototype.toString.call(val).slice(8, -1);
-};
-
-/**
- * Returns an indication of whether the argument is an array or not
- */
-utils.isArray = Array.isArray ||
- function (a) { return utils.typeName(a) === 'Array'; };
-
-/**
- * Returns an indication of whether the argument is a Date or not
- */
-utils.isDate = function (d) {
- return (d instanceof Date);
-};
-
-/**
- * Does a deep clone of the object.
- */
-utils.clone = function (obj) {
- if (!obj || typeof obj === 'function' || utils.isDate(obj) || typeof obj !== 'object') {
- return obj;
- }
-
- var retVal, i;
-
- if (utils.isArray(obj)) {
- retVal = [];
- for (i = 0; i < obj.length; ++i) {
- retVal.push(utils.clone(obj[i]));
- }
- return retVal;
- }
-
- retVal = {};
- for (i in obj) {
- // 'unknown' type may be returned in custom protocol activation case on
- // Windows Phone 8.1 causing "No such interface supported" exception on
- // cloning (https://issues.apache.org/jira/browse/CB-11522)
- // eslint-disable-next-line valid-typeof
- if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') {
- retVal[i] = utils.clone(obj[i]);
- }
- }
- return retVal;
-};
-
-/**
- * Returns a wrapped version of the function
- */
-utils.close = function (context, func, params) {
- return function () {
- var args = params || arguments;
- return func.apply(context, args);
- };
-};
-
-// ------------------------------------------------------------------------------
-function UUIDcreatePart (length) {
- var uuidpart = '';
- for (var i = 0; i < length; i++) {
- var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
- if (uuidchar.length === 1) {
- uuidchar = '0' + uuidchar;
- }
- uuidpart += uuidchar;
- }
- return uuidpart;
-}
-
-/**
- * Create a UUID
- */
-utils.createUUID = function () {
- return UUIDcreatePart(4) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(6);
-};
-
-/**
- * Extends a child object from a parent object using classical inheritance
- * pattern.
- */
-utils.extend = (function () {
- // proxy used to establish prototype chain
- var F = function () {};
- // extend Child from Parent
- return function (Child, Parent) {
- F.prototype = Parent.prototype;
- Child.prototype = new F();
- Child.__super__ = Parent.prototype;
- Child.prototype.constructor = Child;
- };
-}());
-
-/**
- * Alerts a message in any available way: alert or console.log.
- */
-utils.alert = function (msg) {
- if (window.alert) {
- window.alert(msg);
- } else if (console && console.log) {
- console.log(msg);
- }
-};
-
-});
-
-window.cordova = require('cordova');
-// file: src/scripts/bootstrap.js
-require('cordova/init');
-
-})();
diff --git a/cordova/platforms/ios/www/cordova_plugins.js b/cordova/platforms/ios/www/cordova_plugins.js
deleted file mode 100644
index 89efbb690..000000000
--- a/cordova/platforms/ios/www/cordova_plugins.js
+++ /dev/null
@@ -1,278 +0,0 @@
-cordova.define('cordova/plugin_list', function(require, exports, module) {
- module.exports = [
- {
- "id": "com.whebcraft.cordova.plugin.downloader.Downloader",
- "file": "plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js",
- "pluginId": "com.whebcraft.cordova.plugin.downloader",
- "clobbers": [
- "plugins.Downloader"
- ]
- },
- {
- "id": "es6-promise-plugin.Promise",
- "file": "plugins/es6-promise-plugin/www/promise.js",
- "pluginId": "es6-promise-plugin",
- "runs": true
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
- },
- {
- "id": "cordova-plugin-background-mode.BackgroundMode",
- "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
- "pluginId": "cordova-plugin-background-mode",
- "clobbers": [
- "cordova.plugins.backgroundMode",
- "plugin.backgroundMode"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryEntry",
- "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryReader",
- "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryReader"
- ]
- },
- {
- "id": "cordova-plugin-file.Entry",
- "file": "plugins/cordova-plugin-file/www/Entry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Entry"
- ]
- },
- {
- "id": "cordova-plugin-file.File",
- "file": "plugins/cordova-plugin-file/www/File.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.File"
- ]
- },
- {
- "id": "cordova-plugin-file.FileEntry",
- "file": "plugins/cordova-plugin-file/www/FileEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.FileError",
- "file": "plugins/cordova-plugin-file/www/FileError.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileError"
- ]
- },
- {
- "id": "cordova-plugin-file.FileReader",
- "file": "plugins/cordova-plugin-file/www/FileReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileReader"
- ]
- },
- {
- "id": "cordova-plugin-file.FileSystem",
- "file": "plugins/cordova-plugin-file/www/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadOptions",
- "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadOptions"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadResult",
- "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadResult"
- ]
- },
- {
- "id": "cordova-plugin-file.FileWriter",
- "file": "plugins/cordova-plugin-file/www/FileWriter.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileWriter"
- ]
- },
- {
- "id": "cordova-plugin-file.Flags",
- "file": "plugins/cordova-plugin-file/www/Flags.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Flags"
- ]
- },
- {
- "id": "cordova-plugin-file.LocalFileSystem",
- "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.LocalFileSystem"
- ],
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.Metadata",
- "file": "plugins/cordova-plugin-file/www/Metadata.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Metadata"
- ]
- },
- {
- "id": "cordova-plugin-file.ProgressEvent",
- "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.ProgressEvent"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems",
- "file": "plugins/cordova-plugin-file/www/fileSystems.js",
- "pluginId": "cordova-plugin-file"
- },
- {
- "id": "cordova-plugin-file.requestFileSystem",
- "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.requestFileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.resolveLocalFileSystemURI",
- "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.isChrome",
- "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.iosFileSystem",
- "file": "plugins/cordova-plugin-file/www/ios/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems-roots",
- "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.fileSystemPaths",
- "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "cordova"
- ],
- "runs": true
- },
- {
- "id": "cordova-plugin-file-opener2.FileOpener2",
- "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
- "pluginId": "cordova-plugin-file-opener2",
- "clobbers": [
- "cordova.plugins.fileOpener2"
- ]
- },
- {
- "id": "cordova-plugin-x-socialsharing.SocialSharing",
- "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
- "pluginId": "cordova-plugin-x-socialsharing",
- "clobbers": [
- "window.plugins.socialsharing"
- ]
- },
- {
- "id": "cordova-plugin-camera.Camera",
- "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "Camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverOptions",
- "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverOptions"
- ]
- },
- {
- "id": "cordova-plugin-camera.camera",
- "file": "plugins/cordova-plugin-camera/www/Camera.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "navigator.camera"
- ]
- },
- {
- "id": "cordova-plugin-camera.CameraPopoverHandle",
- "file": "plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js",
- "pluginId": "cordova-plugin-camera",
- "clobbers": [
- "CameraPopoverHandle"
- ]
- },
- {
- "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
- "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
- "pluginId": "com-darryncampbell-cordova-plugin-intent",
- "clobbers": [
- "intentShim"
- ]
- }
- ];
- module.exports.metadata = {
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-whitelist": "1.3.3",
- "cordova-plugin-device": "2.0.2",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.3",
- "cordova-plugin-x-socialsharing": "5.6.8",
- "cordova-plugin-camera": "4.1.0",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "com-darryncampbell-cordova-plugin-intent": "2.0.0",
- "cordova-plugin-androidx": "3.0.0"
- };
-});
\ No newline at end of file
diff --git a/cordova/platforms/ios/www/index.html b/cordova/platforms/ios/www/index.html
deleted file mode 100644
index ad5da122c..000000000
--- a/cordova/platforms/ios/www/index.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>TagSpaces Mobile</title>
- <meta
- http-equiv="Content-Security-Policy"
- content="connect-src files: *; default-src 'self' data: gap: cdvfile: ; script-src 'self' 'unsafe-inline' ; style-src 'self' 'unsafe-inline' data: blob: ; media-src * blob: ; img-src * blob: data: content:;"
- >
-
-
- <meta charset="utf-8">
- <meta name="format-detection" content="telephone=yes">
- <meta name="msapplication-tap-highlight" content="no">
- <meta
- name="viewport"
- content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"
-/>
- <meta name="theme-color" content="#1DD19F">
- <meta name="description" content="TagSpaces Mobile">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta name="mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="apple-mobile-web-app-title" content="TagSpaces">
- <link rel="stylesheet" type="text/css" href="dist/style.css">
- <script type="text/javascript" src="extconfig.js"></script>
-</head>
-
-<body style="overflow: hidden; margin: 0; padding: 0;">
- <noscript>This app requires JavaScript</noscript>
- <div id="root" style="height: 100%">
- <div
- style="text-align: center; width: 100%; height: 100%; font-size: 1.4em; position:absolute; z-index: 999999; background-color: #F5F5F5; user-select: none; -webkit-user-select: none; -moz-user-select: none; -webkit-app-region: drag"
- class="appBackgroundTile"
- >
- <div
- style="top:45%; width: 100%; text-align: center; position:absolute;"
- >
- <svg
- style="vertical-align: middle"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100"
- height="100"
- >
- <g
- id="layer1"
- transform="matrix(0.33346217,0,0,0.33346217,-0.01300084,-250.91)"
- >
- <rect
- style="fill:none;fill-opacity:1;stroke:none"
- id="rect3052-8-1"
- width="299.42227"
- height="299.42227"
- x="-0.019505024"
- y="752.95935"
- />
- <path
- style="fill:#ffffff;fill-opacity:1;stroke:none"
- d="m 181.90177,787.75394 70.88695,43.53834 C 180.29225,977.67059 187.41436,950.59754 124.58989,989.154 L 65.05006,905.90077 Z"
- id="rect3052-8-2-2"
- />
- <ellipse
- style="fill:#616577;fill-opacity:1;stroke:none"
- id="path4875-4-7-5-6-2"
- cx="192.4187"
- cy="851.11481"
- rx="15.970615"
- ry="15.782593"
- />
- <path
- style="fill:none;stroke:#a466aa;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 159.73623,964.91671 134.54529,941.61879"
- id="path3108-5-39-8"
- />
- <path
- style="fill:none;stroke:#ffffff;stroke-width:34.19813538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 162.16161,795.17204 90.03628,0.34544 0,86.1724 -115.50748,117.79375 -88.457192,-81.6665 z"
- id="path3923-1-1-4-9-8"
- />
- <path
- style="fill:#f7901e;fill-opacity:1;stroke:#33b5be;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 204.81469,910.87834 -50.38182,-45.3016"
- id="path3108-9-1-76-7"
- />
- <path
- style="fill:#616577;fill-opacity:1;stroke:#f7901e;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 182.93838,938.7066 144.48907,904.40668"
- id="path3108-0-7-9-8"
- />
- <path
- style="fill:none;stroke:#616577;stroke-width:31.96374702;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 164.34385,800.70161 83.03644,0 0,79.10209 -110.49206,113.42316 -82.031957,-75.83333 z"
- id="path3923-1-1-4-9"
- />
- </g>
- </svg>
- </div>
- </div>
- </div>
- <script type="text/javascript" src="cordova.js"></script>
- <script type="text/javascript" src="dist/bundle.js"></script>
-</body>
-</html>
diff --git a/cordova/platforms/ios/www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js b/cordova/platforms/ios/www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
deleted file mode 100644
index 67be5340c..000000000
--- a/cordova/platforms/ios/www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
+++ /dev/null
@@ -1,91 +0,0 @@
-cordova.define("com-darryncampbell-cordova-plugin-intent.IntentShim", function(require, exports, module) {
-var argscheck = require('cordova/argscheck'),
- channel = require('cordova/channel'),
- utils = require('cordova/utils'),
- exec = require('cordova/exec'),
- cordova = require('cordova');
-
-
-/**
- * This represents a thin shim layer over the Android Intent implementation
- * @constructor
- */
-function IntentShim() {
- var me = this;
-}
-
-IntentShim.prototype.ACTION_SEND = "android.intent.action.SEND";
-IntentShim.prototype.ACTION_VIEW= "android.intent.action.VIEW";
-IntentShim.prototype.ACTION_INSTALL_PACKAGE="android.intent.action.INSTALL_PACKAGE";
-IntentShim.prototype.ACTION_UNINSTALL_PACKAGE= "android.intent.action.UNINSTALL_PACKAGE";
-IntentShim.prototype.EXTRA_TEXT = "android.intent.extra.TEXT";
-IntentShim.prototype.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
-IntentShim.prototype.EXTRA_STREAM = "android.intent.extra.STREAM";
-IntentShim.prototype.EXTRA_EMAIL = "android.intent.extra.EMAIL";
-IntentShim.prototype.ACTION_CALL = "android.intent.action.CALL";
-IntentShim.prototype.ACTION_SENDTO = "android.intent.action.SENDTO";
-// StartActivityForResult
-IntentShim.prototype.ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
-IntentShim.prototype.ACTION_PICK = "android.intent.action.PICK";
-IntentShim.prototype.RESULT_CANCELED = 0; // Activity.RESULT_CANCELED
-IntentShim.prototype.RESULT_OK = -1; // Activity.RESULT_OK
-
-IntentShim.prototype.startActivity = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startActivity', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startActivity", [params]);
-};
-
-IntentShim.prototype.startActivityForResult = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startActivityForResult', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startActivityForResult", [params]);
-};
-
-IntentShim.prototype.sendBroadcast = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.sendBroadcast', arguments);
- exec(successCallback, errorCallback, "IntentShim", "sendBroadcast", [params]);
-};
-
-IntentShim.prototype.startService = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.startService', arguments);
- exec(successCallback, errorCallback, "IntentShim", "startService", [params]);
-};
-
-IntentShim.prototype.registerBroadcastReceiver = function(params, callback) {
- argscheck.checkArgs('of', 'IntentShim.registerBroadcastReceiver', arguments);
- exec(callback, null, "IntentShim", "registerBroadcastReceiver", [params]);
-};
-
-IntentShim.prototype.unregisterBroadcastReceiver = function() {
- argscheck.checkArgs('', 'IntentShim.unregisterBroadcastReceiver', arguments);
- exec(null, null, "IntentShim", "unregisterBroadcastReceiver", []);
-};
-
-IntentShim.prototype.onIntent = function(callback) {
- argscheck.checkArgs('f', 'IntentShim.onIntent', arguments);
- exec(callback, null, "IntentShim", "onIntent", [callback]);
-};
-
-IntentShim.prototype.onActivityResult = function(callback) {
- argscheck.checkArgs('f', 'IntentShim.onActivityResult', arguments);
- exec(callback, null, "IntentShim", "onActivityResult", [callback]);
-};
-
-IntentShim.prototype.getIntent = function(successCallback, failureCallback) {
- argscheck.checkArgs('ff', 'IntentShim.getIntent', arguments);
- exec(successCallback, failureCallback, "IntentShim", "getIntent", []);
-};
-
-IntentShim.prototype.sendResult = function(params, callback) {
- argscheck.checkArgs('of', 'IntentShim.sendResult', arguments);
- exec(callback, null, "IntentShim", "sendResult", [params]);
-}
-
-IntentShim.prototype.realPathFromUri = function(params, successCallback, errorCallback) {
- argscheck.checkArgs('off', 'IntentShim.realPathFromUri', arguments);
- exec(successCallback, errorCallback, "IntentShim", "realPathFromUri", [params]);
-};
-
-window.intentShim = new IntentShim();
-window.plugins = window.plugins || {};
-window.plugins.intentShim = window.intentShim;
-});
diff --git a/cordova/platforms/ios/www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js b/cordova/platforms/ios/www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js
deleted file mode 100644
index b8dad0882..000000000
--- a/cordova/platforms/ios/www/plugins/com.whebcraft.cordova.plugin.downloader/www/Downloader.js
+++ /dev/null
@@ -1,25 +0,0 @@
-cordova.define("com.whebcraft.cordova.plugin.downloader.Downloader", function(require, exports, module) {
-var Downloader = {
- download: function (arguments, successCallback, errorCallback) {
- cordova.exec(
- successCallback,
- errorCallback,
- 'Downloader',
- 'download',
- [arguments]
- );
- }
-};
-
-function install() {
- if (!window.plugins) {
- window.plugins = {};
- }
-
- window.plugins.Downloader = Downloader;
- return window.plugins.Downloader;
-};
-
-cordova.addConstructor(install);
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-background-mode/www/background-mode.js b/cordova/platforms/ios/www/plugins/cordova-plugin-background-mode/www/background-mode.js
deleted file mode 100644
index 7895b27ad..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-background-mode/www/background-mode.js
+++ /dev/null
@@ -1,513 +0,0 @@
-cordova.define("cordova-plugin-background-mode.BackgroundMode", function(require, exports, module) {
-/*
- Copyright 2013-2017 appPlant GmbH
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var exec = require('cordova/exec'),
- channel = require('cordova/channel');
-
-/**
- * Activates the background mode. When activated the application
- * will be prevented from going to sleep while in background
- * for the next time.
- *
- * @return [ Void ]
- */
-exports.enable = function()
-{
- if (this.isEnabled())
- return;
-
- var fn = function() {
- exports._isEnabled = true;
- exports.fireEvent('enable');
- };
-
- cordova.exec(fn, null, 'BackgroundMode', 'enable', []);
-};
-
-/**
- * Deactivates the background mode. When deactivated the application
- * will not stay awake while in background.
- *
- * @return [ Void ]
- */
-exports.disable = function()
-{
- if (!this.isEnabled())
- return;
-
- var fn = function() {
- exports._isEnabled = false;
- exports.fireEvent('disable');
- };
-
- cordova.exec(fn, null, 'BackgroundMode', 'disable', []);
-};
-
-/**
- * Enable or disable the background mode.
- *
- * @param [ Bool ] enable The status to set for.
- *
- * @return [ Void ]
- */
-exports.setEnabled = function (enable)
-{
- if (enable) {
- this.enable();
- } else {
- this.disable();
- }
-};
-
-/**
- * List of all available options with their default value.
- *
- * @return [ Object ]
- */
-exports.getDefaults = function()
-{
- return this._defaults;
-};
-
-/**
- * The actual applied settings.
- *
- * @return [ Object ]
- */
-exports.getSettings = function()
-{
- return this._settings || {};
-};
-
-/**
- * Overwrite the default settings.
- *
- * @param [ Object ] overrides Dict of options to be overridden.
- *
- * @return [ Void ]
- */
-exports.setDefaults = function (overrides)
-{
- var defaults = this.getDefaults();
-
- for (var key in defaults)
- {
- if (overrides.hasOwnProperty(key))
- {
- defaults[key] = overrides[key];
- }
- }
-
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundMode', 'configure', [defaults, false]);
- }
-};
-
-/**
- * Configures the notification settings for Android.
- * Will be merged with the defaults.
- *
- * @param [ Object ] options Dict of options to be overridden.
- *
- * @return [ Void ]
- */
-exports.configure = function (options)
-{
- var settings = this.getSettings(),
- defaults = this.getDefaults();
-
- if (!this._isAndroid)
- return;
-
- if (!this._isActive)
- {
- console.log('BackgroundMode is not active, skipped...');
- return;
- }
-
- this._mergeObjects(options, settings);
- this._mergeObjects(options, defaults);
- this._settings = options;
-
- cordova.exec(null, null, 'BackgroundMode', 'configure', [options, true]);
-};
-
-/**
- * Enable GPS-tracking in background (Android).
- *
- * @return [ Void ]
- */
-exports.disableWebViewOptimizations = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'webview', []);
- }
-};
-
-/**
- * Disables battery optimazation mode for the app.
- *
- * @return [ Void ]
- */
-exports.disableBatteryOptimizations = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'battery', []);
- }
-};
-
-/**
- * Opens the system settings dialog where the user can tweak or turn off any
- * custom app start settings added by the manufacturer if available.
- *
- * @param [ Object|Bool ] options Set to false if you dont want to display an
- * alert dialog first.
- *
- * @return [ Void ]
- */
-exports.openAppStartSettings = function (options)
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'appstart', [options]);
- }
-};
-
-/**
- * Move app to background (Android only).
- *
- * @return [ Void ]
- */
-exports.moveToBackground = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'background', []);
- }
-};
-
-/**
- * Move app to foreground when in background (Android only).
- *
- * @return [ Void ]
- */
-exports.moveToForeground = function()
-{
- if (this.isActive() && this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'foreground', []);
- }
-};
-
-/**
- * Exclude the app from the recent tasks list (Android only).
- *
- * @return [ Void ]
- */
-exports.excludeFromTaskList = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'tasklist', []);
- }
-};
-
-/**
- * Override the back button on Android to go to background
- * instead of closing the app.
- *
- * @return [ Void ]
- */
-exports.overrideBackButton = function()
-{
- document.addEventListener('backbutton', function() {
- exports.moveToBackground();
- }, false);
-};
-
-/**
- * If the screen is off.
- *
- * @param [ Function ] fn Callback function to invoke with boolean arg.
- *
- * @return [ Void ]
- */
-exports.isScreenOff = function (fn)
-{
- if (this._isAndroid)
- {
- cordova.exec(fn, null, 'BackgroundModeExt', 'dimmed', []);
- }
- else
- {
- fn(undefined);
- }
-};
-
-/**
- * Wake up the device.
- *
- * @return [ Void ]
- */
-exports.wakeUp = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'wakeup', []);
- }
-};
-
-/**
- * Wake up and unlock the device.
- *
- * @return [ Void ]
- */
-exports.unlock = function()
-{
- if (this._isAndroid)
- {
- cordova.exec(null, null, 'BackgroundModeExt', 'unlock', []);
- }
-};
-
-/**
- * If the mode is enabled or disabled.
- *
- * @return [ Boolean ]
- */
-exports.isEnabled = function()
-{
- return this._isEnabled !== false;
-};
-
-/**
- * If the mode is active.
- *
- * @return [ Boolean ]
- */
-exports.isActive = function()
-{
- return this._isActive !== false;
-};
-
-exports._listener = {};
-
-/**
- * Fire event with given arguments.
- *
- * @param [ String ] event The event's name.
- * @param [ Array<Object> ] The callback's arguments.
- *
- * @return [ Void ]
- */
-exports.fireEvent = function (event)
-{
- var args = Array.apply(null, arguments).slice(1),
- listener = this._listener[event];
-
- if (!listener)
- return;
-
- for (var i = 0; i < listener.length; i++)
- {
- var fn = listener[i][0],
- scope = listener[i][1];
-
- fn.apply(scope, args);
- }
-};
-
-/**
- * Register callback for given event.
- *
- * @param [ String ] event The event's name.
- * @param [ Function ] callback The function to be exec as callback.
- * @param [ Object ] scope The callback function's scope.
- *
- * @return [ Void ]
- */
-exports.on = function (event, callback, scope)
-{
- if (typeof callback !== "function")
- return;
-
- if (!this._listener[event])
- {
- this._listener[event] = [];
- }
-
- var item = [callback, scope || window];
-
- this._listener[event].push(item);
-};
-
-/**
- * Unregister callback for given event.
- *
- * @param [ String ] event The event's name.
- * @param [ Function ] callback The function to be exec as callback.
- *
- * @return [ Void ]
- */
-exports.un = function (event, callback)
-{
- var listener = this._listener[event];
-
- if (!listener)
- return;
-
- for (var i = 0; i < listener.length; i++)
- {
- var fn = listener[i][0];
-
- if (fn == callback)
- {
- listener.splice(i, 1);
- break;
- }
- }
-};
-
-/**
- * @private
- *
- * Flag indicates if the mode is enabled.
- */
-exports._isEnabled = false;
-
-/**
- * @private
- *
- * Flag indicates if the mode is active.
- */
-exports._isActive = false;
-
-/**
- * @private
- *
- * Default values of all available options.
- */
-exports._defaults =
-{
- title: 'App is running in background',
- text: 'Doing heavy tasks.',
- bigText: false,
- resume: true,
- silent: false,
- hidden: true,
- color: undefined,
- icon: 'icon'
-};
-
-/**
- * @private
- *
- * Merge settings with default values.
- *
- * @param [ Object ] options The custom options.
- * @param [ Object ] toMergeIn The options to merge in.
- *
- * @return [ Object ] Default values merged with custom values.
- */
-exports._mergeObjects = function (options, toMergeIn)
-{
- for (var key in toMergeIn)
- {
- if (!options.hasOwnProperty(key))
- {
- options[key] = toMergeIn[key];
- continue;
- }
- }
-
- return options;
-};
-
-/**
- * @private
- *
- * Setter for the isActive flag. Resets the
- * settings if the mode isnt active anymore.
- *
- * @param [ Boolean] value The new value for the flag.
- *
- * @return [ Void ]
- */
-exports._setActive = function(value)
-{
- if (this._isActive == value)
- return;
-
- this._isActive = value;
- this._settings = value ? this._mergeObjects({}, this._defaults) : {};
-};
-
-/**
- * @private
- *
- * Initialize the plugin.
- *
- * Method should be called after the 'deviceready' event
- * but before the event listeners will be called.
- *
- * @return [ Void ]
- */
-exports._pluginInitialize = function()
-{
- this._isAndroid = device.platform.match(/^android|amazon/i) !== null;
- this.setDefaults({});
-
- if (device.platform == 'browser')
- {
- this.enable();
- this._isEnabled = true;
- }
-
- this._isActive = this._isActive || device.platform == 'browser';
-};
-
-// Called before 'deviceready' listener will be called
-channel.onCordovaReady.subscribe(function()
-{
- channel.onCordovaInfoReady.subscribe(function() {
- exports._pluginInitialize();
- });
-});
-
-// Called after 'deviceready' event
-channel.deviceready.subscribe(function()
-{
- if (exports.isEnabled())
- {
- exports.fireEvent('enable');
- }
-
- if (exports.isActive())
- {
- exports.fireEvent('activate');
- }
-});
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/Camera.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/Camera.js
deleted file mode 100644
index 3f614ec80..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/Camera.js
+++ /dev/null
@@ -1,188 +0,0 @@
-cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var exec = require('cordova/exec');
-var Camera = require('./Camera');
-// XXX: commented out
-// CameraPopoverHandle = require('./CameraPopoverHandle');
-
-/**
- * @namespace navigator
- */
-
-/**
- * @exports camera
- */
-var cameraExport = {};
-
-// Tack on the Camera Constants to the base camera plugin.
-for (var key in Camera) {
- cameraExport[key] = Camera[key];
-}
-
-/**
- * Callback function that provides an error message.
- * @callback module:camera.onError
- * @param {string} message - The message is provided by the device's native code.
- */
-
-/**
- * Callback function that provides the image data.
- * @callback module:camera.onSuccess
- * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
- * @example
- * // Show image
- * //
- * function cameraCallback(imageData) {
- * var image = document.getElementById('myImage');
- * image.src = "data:image/jpeg;base64," + imageData;
- * }
- */
-
-/**
- * Optional parameters to customize the camera settings.
- * * [Quirks](#CameraOptions-quirks)
- * @typedef module:camera.CameraOptions
- * @type {Object}
- * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
- * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
- * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
- * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
- * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
- * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
- * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
- * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
- * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
- * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
- * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
- * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
- */
-
-/**
- * @description Takes a photo using the camera, or retrieves a photo from the device's
- * image gallery. The image is passed to the success callback as a
- * Base64-encoded `String`, or as the URI for the image file.
- *
- * The `camera.getPicture` function opens the device's default camera
- * application that allows users to snap pictures by default - this behavior occurs,
- * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
- * Once the user snaps the photo, the camera application closes and the application is restored.
- *
- * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
- * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
- * that allows users to select an existing image.
- *
- * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
- * one of the following formats, depending on the specified
- * `cameraOptions`:
- *
- * - A `String` containing the Base64-encoded photo image.
- * - A `String` representing the image file location on local storage (default).
- *
- * You can do whatever you want with the encoded image or URI, for
- * example:
- *
- * - Render the image in an `<img>` tag, as in the example below
- * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
- * - Post the data to a remote server
- *
- * __NOTE__: Photo resolution on newer devices is quite good. Photos
- * selected from the device's gallery are not downscaled to a lower
- * quality, even if a `quality` parameter is specified. To avoid common
- * memory problems, set `Camera.destinationType` to `FILE_URI` rather
- * than `DATA_URL`.
- *
- * __Supported Platforms__
- *
- * - Android
- * - BlackBerry
- * - Browser
- * - Firefox
- * - FireOS
- * - iOS
- * - Windows
- * - WP8
- * - Ubuntu
- *
- * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
- *
- * @example
- * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
- * @param {module:camera.onSuccess} successCallback
- * @param {module:camera.onError} errorCallback
- * @param {module:camera.CameraOptions} options CameraOptions
- */
-cameraExport.getPicture = function (successCallback, errorCallback, options) {
- argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
- options = options || {};
- var getValue = argscheck.getValue;
-
- var quality = getValue(options.quality, 50);
- var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
- var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
- var targetWidth = getValue(options.targetWidth, -1);
- var targetHeight = getValue(options.targetHeight, -1);
- var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
- var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
- var allowEdit = !!options.allowEdit;
- var correctOrientation = !!options.correctOrientation;
- var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
- var popoverOptions = getValue(options.popoverOptions, null);
- var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
-
- var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
- mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
-
- exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
- // XXX: commented out
- // return new CameraPopoverHandle();
-};
-
-/**
- * Removes intermediate image files that are kept in temporary storage
- * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
- * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
- * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
- *
- * __Supported Platforms__
- *
- * - iOS
- *
- * @example
- * navigator.camera.cleanup(onSuccess, onFail);
- *
- * function onSuccess() {
- * console.log("Camera cleanup success.")
- * }
- *
- * function onFail(message) {
- * alert('Failed because: ' + message);
- * }
- */
-cameraExport.cleanup = function (successCallback, errorCallback) {
- exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
-};
-
-module.exports = cameraExport;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraConstants.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraConstants.js
deleted file mode 100644
index 4f4b046f1..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraConstants.js
+++ /dev/null
@@ -1,104 +0,0 @@
-cordova.define("cordova-plugin-camera.Camera", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * @module Camera
- */
-module.exports = {
- /**
- * @description
- * Defines the output format of `Camera.getPicture` call.
- * _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
- * `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
- * disable any image modifications (resize, quality change, cropping, etc.) due
- * to implementation specific.
- *
- * @enum {number}
- */
- DestinationType: {
- /** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
- DATA_URL: 0,
- /** Return file uri (content://media/external/images/media/2 for Android) */
- FILE_URI: 1,
- /** Return native uri (eg. asset-library://... for iOS) */
- NATIVE_URI: 2
- },
- /**
- * @enum {number}
- */
- EncodingType: {
- /** Return JPEG encoded image */
- JPEG: 0,
- /** Return PNG encoded image */
- PNG: 1
- },
- /**
- * @enum {number}
- */
- MediaType: {
- /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
- PICTURE: 0,
- /** Allow selection of video only, ONLY RETURNS URL */
- VIDEO: 1,
- /** Allow selection from all media types */
- ALLMEDIA: 2
- },
- /**
- * @description
- * Defines the output format of `Camera.getPicture` call.
- * _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
- * along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
- * change, cropping, etc.) due to implementation specific.
- *
- * @enum {number}
- */
- PictureSourceType: {
- /** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
- PHOTOLIBRARY: 0,
- /** Take picture from camera */
- CAMERA: 1,
- /** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
- SAVEDPHOTOALBUM: 2
- },
- /**
- * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
- * @enum {number}
- */
- PopoverArrowDirection: {
- ARROW_UP: 1,
- ARROW_DOWN: 2,
- ARROW_LEFT: 4,
- ARROW_RIGHT: 8,
- ARROW_ANY: 15
- },
- /**
- * @enum {number}
- */
- Direction: {
- /** Use the back-facing camera */
- BACK: 0,
- /** Use the front-facing camera */
- FRONT: 1
- }
-};
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
deleted file mode 100644
index 6e03c52ee..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
+++ /dev/null
@@ -1,59 +0,0 @@
-cordova.define("cordova-plugin-camera.CameraPopoverOptions", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Camera = require('./Camera');
-
-/**
- * @namespace navigator
- */
-
-/**
- * iOS-only parameters that specify the anchor element location and arrow
- * direction of the popover when selecting images from an iPad's library
- * or album.
- * Note that the size of the popover may change to adjust to the
- * direction of the arrow and orientation of the screen. Make sure to
- * account for orientation changes when specifying the anchor element
- * location.
- * @module CameraPopoverOptions
- * @param {Number} [x=0] - x pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [y=32] - y pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [width=320] - width, in pixels, of the screen element onto which to anchor the popover.
- * @param {Number} [height=480] - height, in pixels, of the screen element onto which to anchor the popover.
- * @param {module:Camera.PopoverArrowDirection} [arrowDir=ARROW_ANY] - Direction the arrow on the popover should point.
- * @param {Number} [popoverWidth=0] - width of the popover (0 or not specified will use apple's default width).
- * @param {Number} [popoverHeight=0] - height of the popover (0 or not specified will use apple's default height).
- */
-var CameraPopoverOptions = function (x, y, width, height, arrowDir, popoverWidth, popoverHeight) {
- // information of rectangle that popover should be anchored to
- this.x = x || 0;
- this.y = y || 32;
- this.width = width || 320;
- this.height = height || 480;
- this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
- this.popoverWidth = popoverWidth || 0;
- this.popoverHeight = popoverHeight || 0;
-};
-
-module.exports = CameraPopoverOptions;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
deleted file mode 100644
index 6da9fa35d..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
+++ /dev/null
@@ -1,69 +0,0 @@
-cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-/**
- * @namespace navigator
- */
-
-/**
- * A handle to an image picker popover.
- *
- * __Supported Platforms__
- *
- * - iOS
- *
- * @example
- * navigator.camera.getPicture(onSuccess, onFail,
- * {
- * destinationType: Camera.DestinationType.FILE_URI,
- * sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- * popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 300, 600)
- * });
- *
- * // Reposition the popover if the orientation changes.
- * window.onorientationchange = function() {
- * var cameraPopoverHandle = new CameraPopoverHandle();
- * var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 400, 500);
- * cameraPopoverHandle.setPosition(cameraPopoverOptions);
- * }
- * @module CameraPopoverHandle
- */
-var CameraPopoverHandle = function () {
- /**
- * Can be used to reposition the image selection dialog,
- * for example, when the device orientation changes.
- * @memberof CameraPopoverHandle
- * @instance
- * @method setPosition
- * @param {module:CameraPopoverOptions} popoverOptions
- */
- this.setPosition = function (popoverOptions) {
- var args = [ popoverOptions ];
- exec(null, null, 'Camera', 'repositionPopover', args);
- };
-};
-
-module.exports = CameraPopoverHandle;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-device/www/device.js b/cordova/platforms/ios/www/plugins/cordova-plugin-device/www/device.js
deleted file mode 100644
index ae48e3546..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-device/www/device.js
+++ /dev/null
@@ -1,86 +0,0 @@
-cordova.define("cordova-plugin-device.device", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var channel = require('cordova/channel');
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var cordova = require('cordova');
-
-channel.createSticky('onCordovaInfoReady');
-// Tell cordova channel to wait on the CordovaInfoReady event
-channel.waitForInitialization('onCordovaInfoReady');
-
-/**
- * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
- * phone, etc.
- * @constructor
- */
-function Device () {
- this.available = false;
- this.platform = null;
- this.version = null;
- this.uuid = null;
- this.cordova = null;
- this.model = null;
- this.manufacturer = null;
- this.isVirtual = null;
- this.serial = null;
-
- var me = this;
-
- channel.onCordovaReady.subscribe(function () {
- me.getInfo(function (info) {
- // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
- // TODO: CB-5105 native implementations should not return info.cordova
- var buildLabel = cordova.version;
- me.available = true;
- me.platform = info.platform;
- me.version = info.version;
- me.uuid = info.uuid;
- me.cordova = buildLabel;
- me.model = info.model;
- me.isVirtual = info.isVirtual;
- me.manufacturer = info.manufacturer || 'unknown';
- me.serial = info.serial || 'unknown';
- channel.onCordovaInfoReady.fire();
- }, function (e) {
- me.available = false;
- utils.alert('[ERROR] Error initializing Cordova: ' + e);
- });
- });
-}
-
-/**
- * Get device info
- *
- * @param {Function} successCallback The function to call when the heading data is available
- * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
- */
-Device.prototype.getInfo = function (successCallback, errorCallback) {
- argscheck.checkArgs('fF', 'Device.getInfo', arguments);
- exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
-};
-
-module.exports = new Device();
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
deleted file mode 100644
index 395c4d973..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
+++ /dev/null
@@ -1,54 +0,0 @@
-cordova.define("cordova-plugin-file-opener2.FileOpener2", function(require, exports, module) {
-/*jslint browser: true, devel: true, node: true, sloppy: true, plusplus: true*/
-/*global require, cordova */
-/*
-The MIT License (MIT)
-
-Copyright (c) 2013 pwlin - [email protected]
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-var exec = require('cordova/exec');
-
-function FileOpener2() {}
-
-FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
- contentType = contentType || '';
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
-};
-
-FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
- contentType = contentType || '';
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position || [0, 0]]);
-};
-
-FileOpener2.prototype.uninstall = function (packageId, callbackContext) {
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'uninstall', [packageId]);
-};
-
-FileOpener2.prototype.appIsInstalled = function (packageId, callbackContext) {
- callbackContext = callbackContext || {};
- exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'appIsInstalled', [packageId]);
-};
-
-module.exports = new FileOpener2();
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryEntry.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryEntry.js
deleted file mode 100644
index bb676eb6c..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryEntry.js
+++ /dev/null
@@ -1,120 +0,0 @@
-cordova.define("cordova-plugin-file.DirectoryEntry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var Entry = require('./Entry');
-var FileError = require('./FileError');
-var DirectoryReader = require('./DirectoryReader');
-
-/**
- * An interface representing a directory on the file system.
- *
- * {boolean} isFile always false (readonly)
- * {boolean} isDirectory always true (readonly)
- * {DOMString} name of the directory, excluding the path leading to it (readonly)
- * {DOMString} fullPath the absolute full path to the directory (readonly)
- * {FileSystem} filesystem on which the directory resides (readonly)
- */
-var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
-
- // add trailing slash if it is missing
- if ((fullPath) && !/\/$/.test(fullPath)) {
- fullPath += '/';
- }
- // add trailing slash if it is missing
- if (nativeURL && !/\/$/.test(nativeURL)) {
- nativeURL += '/';
- }
- DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
-};
-
-utils.extend(DirectoryEntry, Entry);
-
-/**
- * Creates a new DirectoryReader to read entries from this directory
- */
-DirectoryEntry.prototype.createReader = function () {
- return new DirectoryReader(this.toInternalURL());
-};
-
-/**
- * Creates or looks up a directory
- *
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory
- * @param {Flags} options to create or exclusively create the directory
- * @param {Function} successCallback is called with the new entry
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
- argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getDirectory', [this.toInternalURL(), path, options]);
-};
-
-/**
- * Deletes a directory and all of it's contents
- *
- * @param {Function} successCallback is called with no parameters
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(successCallback, fail, 'File', 'removeRecursively', [this.toInternalURL()]);
-};
-
-/**
- * Creates or looks up a file
- *
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file
- * @param {Flags} options to create or exclusively create the file
- * @param {Function} successCallback is called with the new entry
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
- argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var FileEntry = require('./FileEntry');
- var entry = new FileEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getFile', [this.toInternalURL(), path, options]);
-};
-
-module.exports = DirectoryEntry;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryReader.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryReader.js
deleted file mode 100644
index 417c85f10..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryReader.js
+++ /dev/null
@@ -1,75 +0,0 @@
-cordova.define("cordova-plugin-file.DirectoryReader", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-
-/**
- * An interface that lists the files and directories in a directory.
- */
-function DirectoryReader (localURL) {
- this.localURL = localURL || null;
- this.hasReadEntries = false;
-}
-
-/**
- * Returns a list of entries from a directory.
- *
- * @param {Function} successCallback is called with a list of entries
- * @param {Function} errorCallback is called with a FileError
- */
-DirectoryReader.prototype.readEntries = function (successCallback, errorCallback) {
- // If we've already read and passed on this directory's entries, return an empty list.
- if (this.hasReadEntries) {
- successCallback([]);
- return;
- }
- var reader = this;
- var win = typeof successCallback !== 'function' ? null : function (result) {
- var retVal = [];
- for (var i = 0; i < result.length; i++) {
- var entry = null;
- if (result[i].isDirectory) {
- entry = new (require('./DirectoryEntry'))();
- } else if (result[i].isFile) {
- entry = new (require('./FileEntry'))();
- }
- entry.isDirectory = result[i].isDirectory;
- entry.isFile = result[i].isFile;
- entry.name = result[i].name;
- entry.fullPath = result[i].fullPath;
- entry.filesystem = new (require('./FileSystem'))(result[i].filesystemName);
- entry.nativeURL = result[i].nativeURL;
- retVal.push(entry);
- }
- reader.hasReadEntries = true;
- successCallback(retVal);
- };
- var fail = typeof errorCallback !== 'function' ? null : function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'readEntries', [this.localURL]);
-};
-
-module.exports = DirectoryReader;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Entry.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Entry.js
deleted file mode 100644
index b296d999e..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Entry.js
+++ /dev/null
@@ -1,263 +0,0 @@
-cordova.define("cordova-plugin-file.Entry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck');
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-var Metadata = require('./Metadata');
-
-/**
- * Represents a file or directory on the local file system.
- *
- * @param isFile
- * {boolean} true if Entry is a file (readonly)
- * @param isDirectory
- * {boolean} true if Entry is a directory (readonly)
- * @param name
- * {DOMString} name of the file or directory, excluding the path
- * leading to it (readonly)
- * @param fullPath
- * {DOMString} the absolute full path to the file or directory
- * (readonly)
- * @param fileSystem
- * {FileSystem} the filesystem on which this entry resides
- * (readonly)
- * @param nativeURL
- * {DOMString} an alternate URL which can be used by native
- * webview controls, for example media players.
- * (optional, readonly)
- */
-function Entry (isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
- this.isFile = !!isFile;
- this.isDirectory = !!isDirectory;
- this.name = name || '';
- this.fullPath = fullPath || '';
- this.filesystem = fileSystem || null;
- this.nativeURL = nativeURL || null;
-}
-
-/**
- * Look up the metadata of the entry.
- *
- * @param successCallback
- * {Function} is called with a Metadata object
- * @param errorCallback
- * {Function} is called with a FileError
- */
-Entry.prototype.getMetadata = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
- var success = successCallback && function (entryMetadata) {
- var metadata = new Metadata({
- size: entryMetadata.size,
- modificationTime: entryMetadata.lastModifiedDate
- });
- successCallback(metadata);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(success, fail, 'File', 'getFileMetadata', [this.toInternalURL()]);
-};
-
-/**
- * Set the metadata of the entry.
- *
- * @param successCallback
- * {Function} is called with a Metadata object
- * @param errorCallback
- * {Function} is called with a FileError
- * @param metadataObject
- * {Object} keys and values to set
- */
-Entry.prototype.setMetadata = function (successCallback, errorCallback, metadataObject) {
- argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
- exec(successCallback, errorCallback, 'File', 'setMetadata', [this.toInternalURL(), metadataObject]);
-};
-
-/**
- * Move a file or directory to a new location.
- *
- * @param parent
- * {DirectoryEntry} the directory to which to move this entry
- * @param newName
- * {DOMString} new name of the entry, defaults to the current name
- * @param successCallback
- * {Function} called with the new DirectoryEntry object
- * @param errorCallback
- * {Function} called with a FileError
- */
-Entry.prototype.moveTo = function (parent, newName, successCallback, errorCallback) {
- argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- var srcURL = this.toInternalURL();
- // entry name
- var name = newName || this.name;
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
- var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
- var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- }
- } else {
- // no Entry object returned
- if (fail) {
- fail(FileError.NOT_FOUND_ERR);
- }
- }
- };
-
- // copy
- exec(success, fail, 'File', 'moveTo', [srcURL, parent.toInternalURL(), name]);
-};
-
-/**
- * Copy a directory to a different location.
- *
- * @param parent
- * {DirectoryEntry} the directory to which to copy the entry
- * @param newName
- * {DOMString} new name of the entry, defaults to the current name
- * @param successCallback
- * {Function} called with the new Entry object
- * @param errorCallback
- * {Function} called with a FileError
- */
-Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallback) {
- argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- var srcURL = this.toInternalURL();
- // entry name
- var name = newName || this.name;
- // success callback
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
- var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
- var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- }
- } else {
- // no Entry object returned
- if (fail) {
- fail(FileError.NOT_FOUND_ERR);
- }
- }
- };
-
- // copy
- exec(success, fail, 'File', 'copyTo', [srcURL, parent.toInternalURL(), name]);
-};
-
-/**
- * Return a URL that can be passed across the bridge to identify this entry.
- */
-Entry.prototype.toInternalURL = function () {
- if (this.filesystem && this.filesystem.__format__) {
- return this.filesystem.__format__(this.fullPath, this.nativeURL);
- }
-};
-
-/**
- * Return a URL that can be used to identify this entry.
- * Use a URL that can be used to as the src attribute of a <video> or
- * <audio> tag. If that is not possible, construct a cdvfile:// URL.
- */
-Entry.prototype.toURL = function () {
- if (this.nativeURL) {
- return this.nativeURL;
- }
- // fullPath attribute may contain the full URL in the case that
- // toInternalURL fails.
- return this.toInternalURL() || 'file://localhost' + this.fullPath;
-};
-
-/**
- * Backwards-compatibility: In v1.0.0 - 1.0.2, .toURL would only return a
- * cdvfile:// URL, and this method was necessary to obtain URLs usable by the
- * webview.
- * See CB-6051, CB-6106, CB-6117, CB-6152, CB-6199, CB-6201, CB-6243, CB-6249,
- * and CB-6300.
- */
-Entry.prototype.toNativeURL = function () {
- console.log("DEPRECATED: Update your code to use 'toURL'");
- return this.toURL();
-};
-
-/**
- * Returns a URI that can be used to identify this entry.
- *
- * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.
- * @return uri
- */
-Entry.prototype.toURI = function (mimeType) {
- console.log("DEPRECATED: Update your code to use 'toURL'");
- return this.toURL();
-};
-
-/**
- * Remove a file or directory. It is an error to attempt to delete a
- * directory that is not empty. It is an error to attempt to delete a
- * root directory of a file system.
- *
- * @param successCallback {Function} called with no parameters
- * @param errorCallback {Function} called with a FileError
- */
-Entry.prototype.remove = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.remove', arguments);
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(successCallback, fail, 'File', 'remove', [this.toInternalURL()]);
-};
-
-/**
- * Look up the parent DirectoryEntry of this entry.
- *
- * @param successCallback {Function} called with the parent DirectoryEntry object
- * @param errorCallback {Function} called with a FileError
- */
-Entry.prototype.getParent = function (successCallback, errorCallback) {
- argscheck.checkArgs('FF', 'Entry.getParent', arguments);
- var fs = this.filesystem;
- var win = successCallback && function (result) {
- var DirectoryEntry = require('./DirectoryEntry');
- var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
- successCallback(entry);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getParent', [this.toInternalURL()]);
-};
-
-module.exports = Entry;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/File.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/File.js
deleted file mode 100644
index c77178653..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/File.js
+++ /dev/null
@@ -1,81 +0,0 @@
-cordova.define("cordova-plugin-file.File", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Constructor.
- * name {DOMString} name of the file, without path information
- * fullPath {DOMString} the full path of the file, including the name
- * type {DOMString} mime type
- * lastModifiedDate {Date} last modified date
- * size {Number} size of the file in bytes
- */
-
-var File = function (name, localURL, type, lastModifiedDate, size) {
- this.name = name || '';
- this.localURL = localURL || null;
- this.type = type || null;
- this.lastModified = lastModifiedDate || null;
- // For backwards compatibility, store the timestamp in lastModifiedDate as well
- this.lastModifiedDate = lastModifiedDate || null;
- this.size = size || 0;
-
- // These store the absolute start and end for slicing the file.
- this.start = 0;
- this.end = this.size;
-};
-
-/**
- * Returns a "slice" of the file. Since Cordova Files don't contain the actual
- * content, this really returns a File with adjusted start and end.
- * Slices of slices are supported.
- * start {Number} The index at which to start the slice (inclusive).
- * end {Number} The index at which to end the slice (exclusive).
- */
-File.prototype.slice = function (start, end) {
- var size = this.end - this.start;
- var newStart = 0;
- var newEnd = size;
- if (arguments.length) {
- if (start < 0) {
- newStart = Math.max(size + start, 0);
- } else {
- newStart = Math.min(size, start);
- }
- }
-
- if (arguments.length >= 2) {
- if (end < 0) {
- newEnd = Math.max(size + end, 0);
- } else {
- newEnd = Math.min(end, size);
- }
- }
-
- var newFile = new File(this.name, this.localURL, this.type, this.lastModified, this.size);
- newFile.start = this.start + newStart;
- newFile.end = this.start + newEnd;
- return newFile;
-};
-
-module.exports = File;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileEntry.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileEntry.js
deleted file mode 100644
index 6651b5542..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileEntry.js
+++ /dev/null
@@ -1,95 +0,0 @@
-cordova.define("cordova-plugin-file.FileEntry", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var utils = require('cordova/utils');
-var exec = require('cordova/exec');
-var Entry = require('./Entry');
-var FileWriter = require('./FileWriter');
-var File = require('./File');
-var FileError = require('./FileError');
-
-/**
- * An interface representing a file on the file system.
- *
- * {boolean} isFile always true (readonly)
- * {boolean} isDirectory always false (readonly)
- * {DOMString} name of the file, excluding the path leading to it (readonly)
- * {DOMString} fullPath the absolute full path to the file (readonly)
- * {FileSystem} filesystem on which the file resides (readonly)
- */
-var FileEntry = function (name, fullPath, fileSystem, nativeURL) {
- // remove trailing slash if it is present
- if (fullPath && /\/$/.test(fullPath)) {
- fullPath = fullPath.substring(0, fullPath.length - 1);
- }
- if (nativeURL && /\/$/.test(nativeURL)) {
- nativeURL = nativeURL.substring(0, nativeURL.length - 1);
- }
-
- FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem, nativeURL]);
-};
-
-utils.extend(FileEntry, Entry);
-
-/**
- * Creates a new FileWriter associated with the file that this FileEntry represents.
- *
- * @param {Function} successCallback is called with the new FileWriter
- * @param {Function} errorCallback is called with a FileError
- */
-FileEntry.prototype.createWriter = function (successCallback, errorCallback) {
- this.file(function (filePointer) {
- var writer = new FileWriter(filePointer);
-
- if (writer.localURL === null || writer.localURL === '') {
- if (errorCallback) {
- errorCallback(new FileError(FileError.INVALID_STATE_ERR));
- }
- } else {
- if (successCallback) {
- successCallback(writer);
- }
- }
- }, errorCallback);
-};
-
-/**
- * Returns a File that represents the current state of the file that this FileEntry represents.
- *
- * @param {Function} successCallback is called with the new File object
- * @param {Function} errorCallback is called with a FileError
- */
-FileEntry.prototype.file = function (successCallback, errorCallback) {
- var localURL = this.toInternalURL();
- var win = successCallback && function (f) {
- var file = new File(f.name, localURL, f.type, f.lastModifiedDate, f.size);
- successCallback(file);
- };
- var fail = errorCallback && function (code) {
- errorCallback(new FileError(code));
- };
- exec(win, fail, 'File', 'getFileMetadata', [localURL]);
-};
-
-module.exports = FileEntry;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileError.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileError.js
deleted file mode 100644
index f378c3874..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileError.js
+++ /dev/null
@@ -1,49 +0,0 @@
-cordova.define("cordova-plugin-file.FileError", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * FileError
- */
-function FileError (error) {
- this.code = error || null;
-}
-
-// File error codes
-// Found in DOMException
-FileError.NOT_FOUND_ERR = 1;
-FileError.SECURITY_ERR = 2;
-FileError.ABORT_ERR = 3;
-
-// Added by File API specification
-FileError.NOT_READABLE_ERR = 4;
-FileError.ENCODING_ERR = 5;
-FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
-FileError.INVALID_STATE_ERR = 7;
-FileError.SYNTAX_ERR = 8;
-FileError.INVALID_MODIFICATION_ERR = 9;
-FileError.QUOTA_EXCEEDED_ERR = 10;
-FileError.TYPE_MISMATCH_ERR = 11;
-FileError.PATH_EXISTS_ERR = 12;
-
-module.exports = FileError;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileReader.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileReader.js
deleted file mode 100644
index 5c030913b..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileReader.js
+++ /dev/null
@@ -1,301 +0,0 @@
-cordova.define("cordova-plugin-file.FileReader", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var modulemapper = require('cordova/modulemapper');
-var utils = require('cordova/utils');
-var FileError = require('./FileError');
-var ProgressEvent = require('./ProgressEvent');
-var origFileReader = modulemapper.getOriginalSymbol(window, 'FileReader');
-
-/**
- * This class reads the mobile device file system.
- *
- * For Android:
- * The root directory is the root of the file system.
- * To read from the SD card, the file name is "sdcard/my_file.txt"
- * @constructor
- */
-var FileReader = function () {
- this._readyState = 0;
- this._error = null;
- this._result = null;
- this._progress = null;
- this._localURL = '';
- this._realReader = origFileReader ? new origFileReader() : {}; // eslint-disable-line new-cap
-};
-
-/**
- * Defines the maximum size to read at a time via the native API. The default value is a compromise between
- * minimizing the overhead of many exec() calls while still reporting progress frequently enough for large files.
- * (Note attempts to allocate more than a few MB of contiguous memory on the native side are likely to cause
- * OOM exceptions, while the JS engine seems to have fewer problems managing large strings or ArrayBuffers.)
- */
-FileReader.READ_CHUNK_SIZE = 256 * 1024;
-
-// States
-FileReader.EMPTY = 0;
-FileReader.LOADING = 1;
-FileReader.DONE = 2;
-
-utils.defineGetter(FileReader.prototype, 'readyState', function () {
- return this._localURL ? this._readyState : this._realReader.readyState;
-});
-
-utils.defineGetter(FileReader.prototype, 'error', function () {
- return this._localURL ? this._error : this._realReader.error;
-});
-
-utils.defineGetter(FileReader.prototype, 'result', function () {
- return this._localURL ? this._result : this._realReader.result;
-});
-
-function defineEvent (eventName) {
- utils.defineGetterSetter(FileReader.prototype, eventName, function () {
- return this._realReader[eventName] || null;
- }, function (value) {
- this._realReader[eventName] = value;
- });
-}
-defineEvent('onloadstart'); // When the read starts.
-defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
-defineEvent('onload'); // When the read has successfully completed.
-defineEvent('onerror'); // When the read has failed (see errors).
-defineEvent('onloadend'); // When the request has completed (either in success or failure).
-defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method.
-
-function initRead (reader, file) {
- // Already loading something
- if (reader.readyState === FileReader.LOADING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- reader._result = null;
- reader._error = null;
- reader._progress = 0;
- reader._readyState = FileReader.LOADING;
-
- if (typeof file.localURL === 'string') {
- reader._localURL = file.localURL;
- } else {
- reader._localURL = '';
- return true;
- }
-
- if (reader.onloadstart) {
- reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
- }
-}
-
-/**
- * Callback used by the following read* functions to handle incremental or final success.
- * Must be bound to the FileReader's this along with all but the last parameter,
- * e.g. readSuccessCallback.bind(this, "readAsText", "UTF-8", offset, totalSize, accumulate)
- * @param readType The name of the read function to call.
- * @param encoding Text encoding, or null if this is not a text type read.
- * @param offset Starting offset of the read.
- * @param totalSize Total number of bytes or chars to read.
- * @param accumulate A function that takes the callback result and accumulates it in this._result.
- * @param r Callback result returned by the last read exec() call, or null to begin reading.
- */
-function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, r) {
- if (this._readyState === FileReader.DONE) {
- return;
- }
-
- var CHUNK_SIZE = FileReader.READ_CHUNK_SIZE;
- if (readType === 'readAsDataURL') {
- // Windows proxy does not support reading file slices as Data URLs
- // so read the whole file at once.
- CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
- // Calculate new chunk size for data URLs to be multiply of 3
- // Otherwise concatenated base64 chunks won't be valid base64 data
- FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
- }
-
- if (typeof r !== 'undefined') {
- accumulate(r);
- this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
-
- if (typeof this.onprogress === 'function') {
- this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
- }
- }
-
- if (typeof r === 'undefined' || this._progress < totalSize) {
- var execArgs = [
- this._localURL,
- offset + this._progress,
- offset + this._progress + Math.min(totalSize - this._progress, CHUNK_SIZE)];
- if (encoding) {
- execArgs.splice(1, 0, encoding);
- }
- exec(
- readSuccessCallback.bind(this, readType, encoding, offset, totalSize, accumulate),
- readFailureCallback.bind(this),
- 'File', readType, execArgs);
- } else {
- this._readyState = FileReader.DONE;
-
- if (typeof this.onload === 'function') {
- this.onload(new ProgressEvent('load', {target: this}));
- }
-
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
- }
-}
-
-/**
- * Callback used by the following read* functions to handle errors.
- * Must be bound to the FileReader's this, e.g. readFailureCallback.bind(this)
- */
-function readFailureCallback (e) {
- if (this._readyState === FileReader.DONE) {
- return;
- }
-
- this._readyState = FileReader.DONE;
- this._result = null;
- this._error = new FileError(e);
-
- if (typeof this.onerror === 'function') {
- this.onerror(new ProgressEvent('error', {target: this}));
- }
-
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
-}
-
-/**
- * Abort reading file.
- */
-FileReader.prototype.abort = function () {
- if (origFileReader && !this._localURL) {
- return this._realReader.abort();
- }
- this._result = null;
-
- if (this._readyState === FileReader.DONE || this._readyState === FileReader.EMPTY) {
- return;
- }
-
- this._readyState = FileReader.DONE;
-
- // If abort callback
- if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', {target: this}));
- }
- // If load end callback
- if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', {target: this}));
- }
-};
-
-/**
- * Read text file.
- *
- * @param file {File} File object containing file properties
- * @param encoding [Optional] (see http://www.iana.org/assignments/character-sets)
- */
-FileReader.prototype.readAsText = function (file, encoding) {
- if (initRead(this, file)) {
- return this._realReader.readAsText(file, encoding);
- }
-
- // Default encoding is UTF-8
- var enc = encoding || 'UTF-8';
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsText', enc, file.start, totalSize, function (r) {
- if (this._progress === 0) {
- this._result = '';
- }
- this._result += r;
- }.bind(this));
-};
-
-/**
- * Read file and return data as a base64 encoded data url.
- * A data url is of the form:
- * data:[<mediatype>][;base64],<data>
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsDataURL = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsDataURL(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsDataURL', null, file.start, totalSize, function (r) {
- var commaIndex = r.indexOf(',');
- if (this._progress === 0) {
- this._result = r;
- } else {
- this._result += r.substring(commaIndex + 1);
- }
- }.bind(this));
-};
-
-/**
- * Read file and return data as a binary data.
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsBinaryString = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsBinaryString(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsBinaryString', null, file.start, totalSize, function (r) {
- if (this._progress === 0) {
- this._result = '';
- }
- this._result += r;
- }.bind(this));
-};
-
-/**
- * Read file and return data as a binary data.
- *
- * @param file {File} File object containing file properties
- */
-FileReader.prototype.readAsArrayBuffer = function (file) {
- if (initRead(this, file)) {
- return this._realReader.readAsArrayBuffer(file);
- }
-
- var totalSize = file.end - file.start;
- readSuccessCallback.bind(this)('readAsArrayBuffer', null, file.start, totalSize, function (r) {
- var resultArray = (this._progress === 0 ? new Uint8Array(totalSize) : new Uint8Array(this._result));
- resultArray.set(new Uint8Array(r), this._progress);
- this._result = resultArray.buffer;
- }.bind(this));
-};
-
-module.exports = FileReader;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileSystem.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileSystem.js
deleted file mode 100644
index ad9ea7859..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileSystem.js
+++ /dev/null
@@ -1,58 +0,0 @@
-cordova.define("cordova-plugin-file.FileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var DirectoryEntry = require('./DirectoryEntry');
-
-/**
- * An interface representing a file system
- *
- * @constructor
- * {DOMString} name the unique name of the file system (readonly)
- * {DirectoryEntry} root directory of the file system (readonly)
- */
-var FileSystem = function (name, root) {
- this.name = name;
- if (root) {
- this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
- } else {
- this.root = new DirectoryEntry(this.name, '/', this);
- }
-};
-
-FileSystem.prototype.__format__ = function (fullPath, nativeUrl) {
- return fullPath;
-};
-
-FileSystem.prototype.toJSON = function () {
- return '<FileSystem: ' + this.name + '>';
-};
-
-// Use instead of encodeURI() when encoding just the path part of a URI rather than an entire URI.
-FileSystem.encodeURIPath = function (path) {
- // Because # is a valid filename character, it must be encoded to prevent part of the
- // path from being parsed as a URI fragment.
- return encodeURI(path).replace(/#/g, '%23');
-};
-
-module.exports = FileSystem;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileUploadOptions.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileUploadOptions.js
deleted file mode 100644
index 6acd09334..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileUploadOptions.js
+++ /dev/null
@@ -1,44 +0,0 @@
-cordova.define("cordova-plugin-file.FileUploadOptions", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Options to customize the HTTP request used to upload files.
- * @constructor
- * @param fileKey {String} Name of file request parameter.
- * @param fileName {String} Filename to be used by the server. Defaults to image.jpg.
- * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg.
- * @param params {Object} Object with key: value params to send to the server.
- * @param headers {Object} Keys are header names, values are header values. Multiple
- * headers of the same name are not supported.
- */
-var FileUploadOptions = function (fileKey, fileName, mimeType, params, headers, httpMethod) {
- this.fileKey = fileKey || null;
- this.fileName = fileName || null;
- this.mimeType = mimeType || null;
- this.params = params || null;
- this.headers = headers || null;
- this.httpMethod = httpMethod || null;
-};
-
-module.exports = FileUploadOptions;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileUploadResult.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileUploadResult.js
deleted file mode 100644
index e3c3a7431..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileUploadResult.js
+++ /dev/null
@@ -1,33 +0,0 @@
-cordova.define("cordova-plugin-file.FileUploadResult", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * FileUploadResult
- * @constructor
- */
-module.exports = function FileUploadResult (size, code, content) {
- this.bytesSent = size;
- this.responseCode = code;
- this.response = content;
-};
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileWriter.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileWriter.js
deleted file mode 100644
index c3e856219..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileWriter.js
+++ /dev/null
@@ -1,328 +0,0 @@
-cordova.define("cordova-plugin-file.FileWriter", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var FileError = require('./FileError');
-var FileReader = require('./FileReader');
-var ProgressEvent = require('./ProgressEvent');
-
-/**
- * This class writes to the mobile device file system.
- *
- * For Android:
- * The root directory is the root of the file system.
- * To write to the SD card, the file name is "sdcard/my_file.txt"
- *
- * @constructor
- * @param file {File} File object containing file properties
- * @param append if true write to the end of the file, otherwise overwrite the file
- */
-var FileWriter = function (file) {
- this.fileName = '';
- this.length = 0;
- if (file) {
- this.localURL = file.localURL || file;
- this.length = file.size || 0;
- }
- // default is to write at the beginning of the file
- this.position = 0;
-
- this.readyState = 0; // EMPTY
-
- this.result = null;
-
- // Error
- this.error = null;
-
- // Event handlers
- this.onwritestart = null; // When writing starts
- this.onprogress = null; // While writing the file, and reporting partial file data
- this.onwrite = null; // When the write has successfully completed.
- this.onwriteend = null; // When the request has completed (either in success or failure).
- this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method.
- this.onerror = null; // When the write has failed (see errors).
-};
-
-// States
-FileWriter.INIT = 0;
-FileWriter.WRITING = 1;
-FileWriter.DONE = 2;
-
-/**
- * Abort writing file.
- */
-FileWriter.prototype.abort = function () {
- // check for invalid state
- if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // set error
- this.error = new FileError(FileError.ABORT_ERR);
-
- this.readyState = FileWriter.DONE;
-
- // If abort callback
- if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', {'target': this}));
- }
-
- // If write end callback
- if (typeof this.onwriteend === 'function') {
- this.onwriteend(new ProgressEvent('writeend', {'target': this}));
- }
-};
-
-/**
- * Writes data to the file
- *
- * @param data text or blob to be written
- * @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
- */
-FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
-
- var that = this;
- var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
- /* eslint-disable no-undef */
- var isProxySupportBlobNatively = (cordova.platformId === 'windows8' || cordova.platformId === 'windows');
- var isBinary;
-
- // Check to see if the incoming data is a blob
- if (data instanceof File || (!isProxySupportBlobNatively && supportsBinary && data instanceof Blob)) {
- var fileReader = new FileReader();
- /* eslint-enable no-undef */
- fileReader.onload = function () {
- // Call this method again, with the arraybuffer as argument
- FileWriter.prototype.write.call(that, this.result, true /* isPendingBlobReadResult */);
- };
- fileReader.onerror = function () {
- // DONE state
- that.readyState = FileWriter.DONE;
-
- // Save error
- that.error = this.error;
-
- // If onerror callback
- if (typeof that.onerror === 'function') {
- that.onerror(new ProgressEvent('error', {'target': that}));
- }
-
- // If onwriteend callback
- if (typeof that.onwriteend === 'function') {
- that.onwriteend(new ProgressEvent('writeend', {'target': that}));
- }
- };
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- if (supportsBinary) {
- fileReader.readAsArrayBuffer(data);
- } else {
- fileReader.readAsText(data);
- }
- return;
- }
-
- // Mark data type for safer transport over the binary bridge
- isBinary = supportsBinary && (data instanceof ArrayBuffer);
- if (isBinary && cordova.platformId === 'windowsphone') { // eslint-disable-line no-undef
- // create a plain array, using the keys from the Uint8Array view so that we can serialize it
- data = Array.apply(null, new Uint8Array(data));
- }
-
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING && !isPendingBlobReadResult) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- var me = this;
-
- // If onwritestart callback
- if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', {'target': me}));
- }
-
- // Write file
- exec(
- // Success callback
- function (r) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // position always increases by bytes written because file would be extended
- me.position += r;
- // The length of the file is now where we are done writing.
-
- me.length = me.position;
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // If onwrite callback
- if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- },
- // Error callback
- function (e) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Save error
- me.error = new FileError(e);
-
- // If onerror callback
- if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- }, 'File', 'write', [this.localURL, data, this.position, isBinary]);
-};
-
-/**
- * Moves the file pointer to the location specified.
- *
- * If the offset is a negative number the position of the file
- * pointer is rewound. If the offset is greater than the file
- * size the position is set to the end of the file.
- *
- * @param offset is the location to move the file pointer to.
- */
-FileWriter.prototype.seek = function (offset) {
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- if (!offset && offset !== 0) {
- return;
- }
-
- // See back from end of file.
- if (offset < 0) {
- this.position = Math.max(offset + this.length, 0);
- // Offset is bigger than file size so set position
- // to the end of the file.
- } else if (offset > this.length) {
- this.position = this.length;
- // Offset is between 0 and file size so set the position
- // to start writing.
- } else {
- this.position = offset;
- }
-};
-
-/**
- * Truncates the file to the size specified.
- *
- * @param size to chop the file at.
- */
-FileWriter.prototype.truncate = function (size) {
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- var me = this;
-
- // If onwritestart callback
- if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', {'target': this}));
- }
-
- // Write file
- exec(
- // Success callback
- function (r) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Update the length of the file
- me.length = r;
- me.position = Math.min(me.position, r);
-
- // If onwrite callback
- if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- },
- // Error callback
- function (e) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Save error
- me.error = new FileError(e);
-
- // If onerror callback
- if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', {'target': me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', {'target': me}));
- }
- }, 'File', 'truncate', [this.localURL, size]);
-};
-
-module.exports = FileWriter;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Flags.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Flags.js
deleted file mode 100644
index cdb12bb73..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Flags.js
+++ /dev/null
@@ -1,39 +0,0 @@
-cordova.define("cordova-plugin-file.Flags", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Supplies arguments to methods that lookup or create files and directories.
- *
- * @param create
- * {boolean} file or directory if it doesn't exist
- * @param exclusive
- * {boolean} used with create; if true the command will fail if
- * target path exists
- */
-function Flags (create, exclusive) {
- this.create = create || false;
- this.exclusive = exclusive || false;
-}
-
-module.exports = Flags;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/LocalFileSystem.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/LocalFileSystem.js
deleted file mode 100644
index 4ce684812..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/LocalFileSystem.js
+++ /dev/null
@@ -1,26 +0,0 @@
-cordova.define("cordova-plugin-file.LocalFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-exports.TEMPORARY = 0;
-exports.PERSISTENT = 1;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Metadata.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Metadata.js
deleted file mode 100644
index 22366e167..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Metadata.js
+++ /dev/null
@@ -1,43 +0,0 @@
-cordova.define("cordova-plugin-file.Metadata", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Information about the state of the file or directory
- *
- * {Date} modificationTime (readonly)
- */
-var Metadata = function (metadata) {
- if (typeof metadata === 'object') {
- this.modificationTime = new Date(metadata.modificationTime);
- this.size = metadata.size || 0;
- } else if (typeof metadata === 'undefined') {
- this.modificationTime = null;
- this.size = 0;
- } else {
- /* Backwards compatiblity with platforms that only return a timestamp */
- this.modificationTime = new Date(metadata);
- }
-};
-
-module.exports = Metadata;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/ProgressEvent.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/ProgressEvent.js
deleted file mode 100644
index cbecdb12b..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/ProgressEvent.js
+++ /dev/null
@@ -1,70 +0,0 @@
-cordova.define("cordova-plugin-file.ProgressEvent", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
-// Feature test: See if we can instantiate a native ProgressEvent;
-// if so, use that approach,
-// otherwise fill-in with our own implementation.
-//
-// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview.
-var ProgressEvent = (function () {
- /*
- var createEvent = function(data) {
- var event = document.createEvent('Events');
- event.initEvent('ProgressEvent', false, false);
- if (data) {
- for (var i in data) {
- if (data.hasOwnProperty(i)) {
- event[i] = data[i];
- }
- }
- if (data.target) {
- // TODO: cannot call <some_custom_object>.dispatchEvent
- // need to first figure out how to implement EventTarget
- }
- }
- return event;
- };
- try {
- var ev = createEvent({type:"abort",target:document});
- return function ProgressEvent(type, data) {
- data.type = type;
- return createEvent(data);
- };
- } catch(e){
- */
- return function ProgressEvent (type, dict) {
- this.type = type;
- this.bubbles = false;
- this.cancelBubble = false;
- this.cancelable = false;
- this.lengthComputable = false;
- this.loaded = dict && dict.loaded ? dict.loaded : 0;
- this.total = dict && dict.total ? dict.total : 0;
- this.target = dict && dict.target ? dict.target : null;
- };
- // }
-})();
-
-module.exports = ProgressEvent;
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/browser/isChrome.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/browser/isChrome.js
deleted file mode 100644
index 90450d862..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/browser/isChrome.js
+++ /dev/null
@@ -1,29 +0,0 @@
-cordova.define("cordova-plugin-file.isChrome", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-module.exports = function () {
- // window.webkitRequestFileSystem and window.webkitResolveLocalFileSystemURL are available only in Chrome and
- // possibly a good flag to indicate that we're running in Chrome
- return window.webkitRequestFileSystem && window.webkitResolveLocalFileSystemURL;
-};
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystemPaths.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystemPaths.js
deleted file mode 100644
index 4bfc0f629..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystemPaths.js
+++ /dev/null
@@ -1,65 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystemPaths", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var channel = require('cordova/channel');
-
-exports.file = {
- // Read-only directory where the application is installed.
- applicationDirectory: null,
- // Root of app's private writable storage
- applicationStorageDirectory: null,
- // Where to put app-specific data files.
- dataDirectory: null,
- // Cached files that should survive app restarts.
- // Apps should not rely on the OS to delete files in here.
- cacheDirectory: null,
- // Android: the application space on external storage.
- externalApplicationStorageDirectory: null,
- // Android: Where to put app-specific data files on external storage.
- externalDataDirectory: null,
- // Android: the application cache on external storage.
- externalCacheDirectory: null,
- // Android: the external storage (SD card) root.
- externalRootDirectory: null,
- // iOS: Temp directory that the OS can clear at will.
- tempDirectory: null,
- // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
- syncedDataDirectory: null,
- // iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
- documentsDirectory: null,
- // BlackBerry10: Files globally available to all apps
- sharedDirectory: null
-};
-
-channel.waitForInitialization('onFileSystemPathsReady');
-channel.onCordovaReady.subscribe(function () {
- function after (paths) {
- for (var k in paths) {
- exports.file[k] = paths[k];
- }
- channel.initializationComplete('onFileSystemPathsReady');
- }
- exec(after, null, 'File', 'requestAllPaths', []);
-});
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystems-roots.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystems-roots.js
deleted file mode 100644
index 6e02953e8..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystems-roots.js
+++ /dev/null
@@ -1,49 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystems-roots", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Map of fsName -> FileSystem.
-var fsMap = null;
-var FileSystem = require('./FileSystem');
-var exec = require('cordova/exec');
-
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-require('./fileSystems').getFs = function (name, callback) {
- function success (response) {
- fsMap = {};
- for (var i = 0; i < response.length; ++i) {
- var fsRoot = response[i];
- if (fsRoot) {
- var fs = new FileSystem(fsRoot.filesystemName, fsRoot);
- fsMap[fs.name] = fs;
- }
- }
- callback(fsMap[name]);
- }
-
- if (fsMap) {
- callback(fsMap[name]);
- } else {
- exec(success, null, 'File', 'requestAllFileSystems', []);
- }
-};
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystems.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystems.js
deleted file mode 100644
index e61ceafc8..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/fileSystems.js
+++ /dev/null
@@ -1,28 +0,0 @@
-cordova.define("cordova-plugin-file.fileSystems", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-module.exports.getFs = function (name, callback) {
- callback(null);
-};
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/ios/FileSystem.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/ios/FileSystem.js
deleted file mode 100644
index 551b51545..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/ios/FileSystem.js
+++ /dev/null
@@ -1,32 +0,0 @@
-cordova.define("cordova-plugin-file.iosFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-/* eslint no-undef : 0 */
-FILESYSTEM_PROTOCOL = 'cdvfile';
-
-module.exports = {
- __format__: function (fullPath) {
- var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
- return FILESYSTEM_PROTOCOL + '://localhost' + path;
- }
-};
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/requestFileSystem.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/requestFileSystem.js
deleted file mode 100644
index 7f652193c..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/requestFileSystem.js
+++ /dev/null
@@ -1,84 +0,0 @@
-cordova.define("cordova-plugin-file.requestFileSystem", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-(function () {
- // For browser platform: not all browsers use this file.
- function checkBrowser () {
- if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
- module.exports = window.requestFileSystem || window.webkitRequestFileSystem;
- return true;
- }
- return false;
- }
- if (checkBrowser()) {
- return;
- }
-
- var argscheck = require('cordova/argscheck');
- var FileError = require('./FileError');
- var FileSystem = require('./FileSystem');
- var exec = require('cordova/exec');
- var fileSystems = require('./fileSystems');
-
- /**
- * Request a file system in which to store application data.
- * @param type local file system type
- * @param size indicates how much storage space, in bytes, the application expects to need
- * @param successCallback invoked with a FileSystem object
- * @param errorCallback invoked if error occurs retrieving file system
- */
- var requestFileSystem = function (type, size, successCallback, errorCallback) {
- argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
- var fail = function (code) {
- if (errorCallback) {
- errorCallback(new FileError(code));
- }
- };
-
- if (type < 0) {
- fail(FileError.SYNTAX_ERR);
- } else {
- // if successful, return a FileSystem object
- var success = function (file_system) {
- if (file_system) {
- if (successCallback) {
- fileSystems.getFs(file_system.name, function (fs) {
- // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
- if (!fs) {
- fs = new FileSystem(file_system.name, file_system.root);
- }
- successCallback(fs);
- });
- }
- } else {
- // no FileSystem object returned
- fail(FileError.NOT_FOUND_ERR);
- }
- };
- exec(success, fail, 'File', 'requestFileSystem', [type, size]);
- }
- };
-
- module.exports = requestFileSystem;
-})();
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
deleted file mode 100644
index 73715bc0e..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
+++ /dev/null
@@ -1,94 +0,0 @@
-cordova.define("cordova-plugin-file.resolveLocalFileSystemURI", function(require, exports, module) {
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-(function () {
- // For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`.
- function checkBrowser () {
- if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
- module.exports.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
- return true;
- }
- return false;
- }
- if (checkBrowser()) {
- return;
- }
-
- var argscheck = require('cordova/argscheck');
- var DirectoryEntry = require('./DirectoryEntry');
- var FileEntry = require('./FileEntry');
- var FileError = require('./FileError');
- var exec = require('cordova/exec');
- var fileSystems = require('./fileSystems');
-
- /**
- * Look up file system Entry referred to by local URI.
- * @param {DOMString} uri URI referring to a local file or directory
- * @param successCallback invoked with Entry object corresponding to URI
- * @param errorCallback invoked if error occurs retrieving file system entry
- */
- module.exports.resolveLocalFileSystemURL = module.exports.resolveLocalFileSystemURL || function (uri, successCallback, errorCallback) {
- argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments);
- // error callback
- var fail = function (error) {
- if (errorCallback) {
- errorCallback(new FileError(error));
- }
- };
- // sanity check for 'not:valid:filename' or '/not:valid:filename'
- // file.spec.12 window.resolveLocalFileSystemURI should error (ENCODING_ERR) when resolving invalid URI with leading /.
- if (!uri || uri.split(':').length > 2) {
- setTimeout(function () {
- fail(FileError.ENCODING_ERR);
- }, 0);
- return;
- }
- // if successful, return either a file or directory entry
- var success = function (entry) {
- if (entry) {
- if (successCallback) {
- // create appropriate Entry object
- var fsName = entry.filesystemName || (entry.filesystem && entry.filesystem.name) || (entry.filesystem === window.PERSISTENT ? 'persistent' : 'temporary'); // eslint-disable-line no-undef
- fileSystems.getFs(fsName, function (fs) {
- // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
- if (!fs) {
- fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
- }
- var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
- successCallback(result);
- });
- }
- } else {
- // no Entry object returned
- fail(FileError.NOT_FOUND_ERR);
- }
- };
-
- exec(success, fail, 'File', 'resolveLocalFileSystemURI', [uri]);
- };
-
- module.exports.resolveLocalFileSystemURI = function () {
- console.log('resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.');
- module.exports.resolveLocalFileSystemURL.apply(this, arguments);
- };
-})();
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/cordova/platforms/ios/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
deleted file mode 100644
index d16bfdc1c..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
+++ /dev/null
@@ -1,160 +0,0 @@
-cordova.define("cordova-plugin-x-socialsharing.SocialSharing", function(require, exports, module) {
-function SocialSharing() {
-}
-
-// Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear.
-// If not overridden with different values, the popup is not used. Example:
-//
-// window.plugins.socialsharing.iPadPopupCoordinates = function() {
-// return "100,100,200,300";
-// };
-SocialSharing.prototype.iPadPopupCoordinates = function () {
- // left,top,width,height
- return "-1,-1,-1,-1";
-};
-
-SocialSharing.prototype.setIPadPopupCoordinates = function (coords) {
- console.log("Deprecated - setIPadPopupCoordinates no longer works since plugin version 5.5.0. See https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/1052");
- // left,top,width,height
- cordova.exec(function() {}, this._getErrorCallback(function() {}, "setIPadPopupCoordinates"), "SocialSharing", "setIPadPopupCoordinates", [coords]);
-};
-
-SocialSharing.prototype.available = function (callback) {
- cordova.exec(function (avail) {
- callback(avail ? true : false);
- }, null, "SocialSharing", "available", []);
-};
-
-// this is the recommended way to share as it is the most feature-rich with respect to what you pass in and get back
-SocialSharing.prototype.shareWithOptions = function (options, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareWithOptions"), "SocialSharing", "shareWithOptions", [options]);
-};
-
-SocialSharing.prototype.shareW3C = function (sharedata) {
- return new Promise(function(resolve, reject) {
- var options = {
- subject: sharedata.title,
- message: sharedata.text,
- url: sharedata.url,
- iPadCoordinates: sharedata.iPadCoordinates || undefined
- };
- if(sharedata.hasOwnProperty('title') ||
- sharedata.hasOwnProperty('text') ||
- sharedata.hasOwnProperty('url')) {
- cordova.exec(resolve, reject, "SocialSharing", "shareWithOptions", [options]);
- } else {
- reject();
- }
- });
-};
-
-SocialSharing.prototype.share = function (message, subject, fileOrFileArray, url, iPadCoordinates, successCallback, errorCallback) {
- if (typeof iPadCoordinates === 'function') {
- errorCallback = successCallback;
- successCallback = iPadCoordinates;
- iPadCoordinates = "";
- }
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "share"), "SocialSharing", "share", [message, subject, this._asArray(fileOrFileArray), url, iPadCoordinates]);
-};
-
-SocialSharing.prototype.shareViaTwitter = function (message, file /* multiple not allowed by twitter */, url, successCallback, errorCallback) {
- var fileArray = this._asArray(file);
- var ecb = this._getErrorCallback(errorCallback, "shareViaTwitter");
- if (fileArray.length > 1) {
- ecb("shareViaTwitter supports max one file");
- } else {
- cordova.exec(successCallback, ecb, "SocialSharing", "shareViaTwitter", [message, null, fileArray, url]);
- }
-};
-
-SocialSharing.prototype.shareViaFacebook = function (message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebook"), "SocialSharing", "shareViaFacebook", [message, null, this._asArray(fileOrFileArray), url]);
-};
-
-SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message, fileOrFileArray, url, pasteMessageHint, successCallback, errorCallback) {
- pasteMessageHint = pasteMessageHint || "If you like you can paste a message from your clipboard";
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebookWithPasteMessageHint"), "SocialSharing", "shareViaFacebookWithPasteMessageHint", [message, null, this._asArray(fileOrFileArray), url, pasteMessageHint]);
-};
-
-SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, null]);
-};
-
-SocialSharing.prototype.shareViaWhatsAppToReceiver = function (receiver, message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToReceiver"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, receiver, null]);
-};
-
-SocialSharing.prototype.shareViaWhatsAppToPhone = function (phone, message, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToPhone"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, phone]);
-};
-
-SocialSharing.prototype.shareViaSMS = function (options, phonenumbers, successCallback, errorCallback) {
- var opts = options;
- if (typeof options === "string") {
- opts = {"message":options}; // for backward compatibility as the options param used to be the message
- }
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaSMS"), "SocialSharing", "shareViaSMS", [opts, phonenumbers]);
-};
-
-SocialSharing.prototype.shareViaEmail = function (message, subject, toArray, ccArray, bccArray, fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaEmail"), "SocialSharing", "shareViaEmail", [message, subject, this._asArray(toArray), this._asArray(ccArray), this._asArray(bccArray), this._asArray(fileOrFileArray)]);
-};
-
-SocialSharing.prototype.canShareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareVia"), "SocialSharing", "canShareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
-};
-
-SocialSharing.prototype.canShareViaEmail = function (successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareViaEmail"), "SocialSharing", "canShareViaEmail", []);
-};
-
-SocialSharing.prototype.shareViaInstagram = function (message, fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaInstagram"), "SocialSharing", "shareViaInstagram", [message, null, this._asArray(fileOrFileArray), null]);
-};
-
-SocialSharing.prototype.shareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareVia"), "SocialSharing", "shareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
-};
-
-SocialSharing.prototype.saveToPhotoAlbum = function (fileOrFileArray, successCallback, errorCallback) {
- cordova.exec(successCallback, this._getErrorCallback(errorCallback, "saveToPhotoAlbum"), "SocialSharing", "saveToPhotoAlbum", [this._asArray(fileOrFileArray)]);
-};
-
-SocialSharing.prototype._asArray = function (param) {
- if (param == null) {
- param = [];
- } else if (typeof param === 'string') {
- param = new Array(param);
- }
- return param;
-};
-
-SocialSharing.prototype._getErrorCallback = function (ecb, functionName) {
- if (typeof ecb === 'function') {
- return ecb;
- } else {
- return function (result) {
- console.log("The injected error callback of '" + functionName + "' received: " + JSON.stringify(result));
- }
- }
-};
-
-SocialSharing.install = function () {
- if (!window.plugins) {
- window.plugins = {};
- }
-
- window.plugins.socialsharing = new SocialSharing();
-
- // Note only polyfill navigator.share if it is not defined, since shareW3C implements L1 of the spec,
- // and an existing navigator.share method could implement L2.
- if (!navigator.share) {
- navigator.share = window.plugins.socialsharing.shareW3C;
- }
-
- return window.plugins.socialsharing;
-};
-
-cordova.addConstructor(SocialSharing.install);
-
-});
diff --git a/cordova/platforms/ios/www/plugins/es6-promise-plugin/www/promise.js b/cordova/platforms/ios/www/plugins/es6-promise-plugin/www/promise.js
deleted file mode 100644
index 6cce47ae8..000000000
--- a/cordova/platforms/ios/www/plugins/es6-promise-plugin/www/promise.js
+++ /dev/null
@@ -1,13 +0,0 @@
-cordova.define("es6-promise-plugin.Promise", function(require, exports, module) {
-/*!
- * @overview es6-promise - a tiny implementation of Promises/A+.
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
- * @license Licensed under MIT license
- * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
- * @version v4.2.2+97478eb6
- */
-
-!function t(e,n,r){function o(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(t){var n=e[u][1][t];return o(n?n:t)},a,a.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t){void 0===window.Promise&&t("es6-promise").polyfill()},{"es6-promise":2}],2:[function(t,e,n){(function(r,o){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.ES6Promise=r()}(this,function(){"use strict";function e(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function n(t){return"function"==typeof t}function i(t){J=t}function u(t){Q=t}function s(){return function(){return r.nextTick(h)}}function c(){return"undefined"!=typeof I?function(){I(h)}:l()}function f(){var t=0,e=new X(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function a(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function l(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;H>t;t+=2){var e=te[t],n=te[t+1];e(n),te[t]=void 0,te[t+1]=void 0}H=0}function p(){try{var e=t,n=e("vertx");return I=n.runOnLoop||n.runOnContext,c()}catch(r){return l()}}function d(t,e){var n=this,r=new this.constructor(y);void 0===r[ne]&&D(r);var o=n._state;if(o){var i=arguments[o-1];Q(function(){return L(o,r,i,n._result)})}else O(n,r,t,e);return r}function v(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(y);return E(n,t),n}function y(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ue.error=e,ue}}function g(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function b(t,e,n){Q(function(t){var r=!1,o=g(n,e,function(n){r||(r=!0,e!==n?E(t,n):j(t,n))},function(e){r||(r=!0,x(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,x(t,o))},t)}function T(t,e){e._state===oe?j(t,e._result):e._state===ie?x(t,e._result):O(e,void 0,function(e){return E(t,e)},function(e){return x(t,e)})}function A(t,e,r){e.constructor===t.constructor&&r===d&&e.constructor.resolve===v?T(t,e):r===ue?(x(t,ue.error),ue.error=null):void 0===r?j(t,e):n(r)?b(t,e,r):j(t,e)}function E(t,n){t===n?x(t,m()):e(n)?A(t,n,w(n)):j(t,n)}function S(t){t._onerror&&t._onerror(t._result),M(t)}function j(t,e){t._state===re&&(t._result=e,t._state=oe,0!==t._subscribers.length&&Q(M,t))}function x(t,e){t._state===re&&(t._state=ie,t._result=e,Q(S,t))}function O(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+oe]=n,o[i+ie]=r,0===i&&t._state&&Q(M,t)}function M(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)r=e[u],o=e[u+n],r?L(n,r,o,i):o(i);t._subscribers.length=0}}function P(){this.error=null}function C(t,e){try{return t(e)}catch(n){return se.error=n,se}}function L(t,e,r,o){var i=n(r),u=void 0,s=void 0,c=void 0,f=void 0;if(i){if(u=C(r,o),u===se?(f=!0,s=u.error,u.error=null):c=!0,e===u)return x(e,_()),void 0}else u=o,c=!0;e._state!==re||(i&&c?E(e,u):f?x(e,s):t===oe?j(e,u):t===ie&&x(e,u))}function k(t,e){try{e(function(e){E(t,e)},function(e){x(t,e)})}catch(n){x(t,n)}}function q(){return ce++}function D(t){t[ne]=ce++,t._state=void 0,t._result=void 0,t._subscribers=[]}function F(){return new Error("Array Methods must be provided an Array")}function F(){return new Error("Array Methods must be provided an Array")}function N(t){return new fe(this,t).promise}function U(t){var e=this;return G(t)?new e(function(n,r){for(var o=t.length,i=0;o>i;i++)e.resolve(t[i]).then(n,r)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})}function Y(t){var e=this,n=new e(y);return x(n,t),n}function K(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function z(){var t=void 0;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=ae}var B=void 0;B=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=B,H=0,I=void 0,J=void 0,Q=function(t,e){te[H]=t,te[H+1]=e,H+=2,2===H&&(J?J(h):ee())},R="undefined"!=typeof window?window:void 0,V=R||{},X=V.MutationObserver||V.WebKitMutationObserver,Z="undefined"==typeof self&&"undefined"!=typeof r&&"[object process]"==={}.toString.call(r),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3),ee=void 0;ee=Z?s():X?f():$?a():void 0===R&&"function"==typeof t?p():l();var ne=Math.random().toString(36).substring(16),re=void 0,oe=1,ie=2,ue=new P,se=new P,ce=0,fe=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(y),this.promise[ne]||D(this.promise),G(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&j(this.promise,this._result))):x(this.promise,F())}return t.prototype._enumerate=function(t){for(var e=0;this._state===re&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===v){var o=w(t);if(o===d&&t._state!==re)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===ae){var i=new n(y);A(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===re&&(this._remaining--,t===ie?x(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){return n._settledAt(oe,e,t)},function(t){return n._settledAt(ie,e,t)})},t}(),ae=function(){function t(e){this[ne]=q(),this._result=this._state=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&K(),this instanceof t?k(this,e):W())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this,n=e.constructor;return e.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})},t}();return ae.prototype.then=d,ae.all=N,ae.race=U,ae.resolve=v,ae.reject=Y,ae._setScheduler=i,ae._setAsap=u,ae._asap=Q,ae.polyfill=z,ae.Promise=ae,ae})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],3:[function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(a===setTimeout)return setTimeout(t,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(t,0);try{return a(t,0)}catch(e){try{return a.call(null,t,0)}catch(e){return a.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!v){var t=o(u);v=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var a,l,h=e.exports={};!function(){try{a="function"==typeof setTimeout?setTimeout:n}catch(t){a=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,d=[],v=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(){return[]},h.binding=function(){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}]},{},[1]);
-
-
-});
diff --git a/cordova/res/README.md b/cordova/res/README.md
deleted file mode 100644
index bffb33b65..000000000
--- a/cordova/res/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
--->
-
-Note that these image resources are not copied into a project when a project
-is created with the CLI. Although there are default image resources in a
-newly-created project, those come from the platform-specific project template,
-which can generally be found in the platform's `template` directory. Until
-icon and splashscreen support is added to the CLI, these image resources
-aren't used directly.
-
-See https://issues.apache.org/jira/browse/CB-5145
diff --git a/cordova/res/android/mnk_file_path.xml b/cordova/res/android/mnk_file_path.xml
deleted file mode 100644
index 24212697f..000000000
--- a/cordova/res/android/mnk_file_path.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<paths xmlns:android="http://schemas.android.com/apk/res/android">
- <root-path
- name="root"
- path="." />
-</paths>
diff --git a/cordova/res/icon/android/mipmap-anydpi-v26/ic_launcher.xml b/cordova/res/icon/android/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index 1451b6a0a..000000000
--- a/cordova/res/icon/android/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
- <background android:drawable="@color/ic_launcher_background" />
- <foreground android:drawable="@mipmap/ic_launcher_foreground" />
- <monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
-</adaptive-icon>
diff --git a/cordova/res/icon/android/mipmap-anydpi-v26/ic_launcher_round.xml b/cordova/res/icon/android/mipmap-anydpi-v26/ic_launcher_round.xml
deleted file mode 100644
index 1451b6a0a..000000000
--- a/cordova/res/icon/android/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
- <background android:drawable="@color/ic_launcher_background" />
- <foreground android:drawable="@mipmap/ic_launcher_foreground" />
- <monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
-</adaptive-icon>
diff --git a/cordova/res/icon/android/mipmap-hdpi/ic_launcher.png b/cordova/res/icon/android/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index 2b0b628c9..000000000
Binary files a/cordova/res/icon/android/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-hdpi/ic_launcher_foreground.png b/cordova/res/icon/android/mipmap-hdpi/ic_launcher_foreground.png
deleted file mode 100644
index 716ceeee9..000000000
Binary files a/cordova/res/icon/android/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-hdpi/ic_launcher_monochrome.png b/cordova/res/icon/android/mipmap-hdpi/ic_launcher_monochrome.png
deleted file mode 100644
index f9b06b491..000000000
Binary files a/cordova/res/icon/android/mipmap-hdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-hdpi/ic_launcher_round.png b/cordova/res/icon/android/mipmap-hdpi/ic_launcher_round.png
deleted file mode 100644
index d1f6b9559..000000000
Binary files a/cordova/res/icon/android/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-mdpi/ic_launcher.png b/cordova/res/icon/android/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index ac504efd0..000000000
Binary files a/cordova/res/icon/android/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-mdpi/ic_launcher_foreground.png b/cordova/res/icon/android/mipmap-mdpi/ic_launcher_foreground.png
deleted file mode 100644
index 091073bfb..000000000
Binary files a/cordova/res/icon/android/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-mdpi/ic_launcher_monochrome.png b/cordova/res/icon/android/mipmap-mdpi/ic_launcher_monochrome.png
deleted file mode 100644
index 26354e258..000000000
Binary files a/cordova/res/icon/android/mipmap-mdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-mdpi/ic_launcher_round.png b/cordova/res/icon/android/mipmap-mdpi/ic_launcher_round.png
deleted file mode 100644
index fa34e1fc6..000000000
Binary files a/cordova/res/icon/android/mipmap-mdpi/ic_launcher_round.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher.png b/cordova/res/icon/android/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 9df3f6427..000000000
Binary files a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_foreground.png b/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_foreground.png
deleted file mode 100644
index b37d031b9..000000000
Binary files a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_monochrome.png b/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_monochrome.png
deleted file mode 100644
index 5ca0bc049..000000000
Binary files a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_round.png b/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_round.png
deleted file mode 100644
index 50336bd60..000000000
Binary files a/cordova/res/icon/android/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher.png b/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 5052e2b94..000000000
Binary files a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_foreground.png b/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index d008e5262..000000000
Binary files a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_monochrome.png b/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_monochrome.png
deleted file mode 100644
index 827d2c9b1..000000000
Binary files a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_round.png b/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_round.png
deleted file mode 100644
index 22192ac72..000000000
Binary files a/cordova/res/icon/android/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher.png b/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index dde248656..000000000
Binary files a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 86709fd1c..000000000
Binary files a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_monochrome.png b/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_monochrome.png
deleted file mode 100644
index a9cabb322..000000000
Binary files a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_round.png b/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_round.png
deleted file mode 100644
index b28183c7a..000000000
Binary files a/cordova/res/icon/android/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/cordova/res/icon/android/values/ic_launcher_background.xml b/cordova/res/icon/android/values/ic_launcher_background.xml
deleted file mode 100644
index 5b3095927..000000000
--- a/cordova/res/icon/android/values/ic_launcher_background.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <color name="ic_launcher_background">#ffffff</color>
-</resources>
diff --git a/cordova/res/icon/ios/icon-57-2x.png b/cordova/res/icon/ios/icon-57-2x.png
deleted file mode 100644
index 8bc2ce395..000000000
Binary files a/cordova/res/icon/ios/icon-57-2x.png and /dev/null differ
diff --git a/cordova/res/icon/ios/icon-57.png b/cordova/res/icon/ios/icon-57.png
deleted file mode 100644
index 743492e40..000000000
Binary files a/cordova/res/icon/ios/icon-57.png and /dev/null differ
diff --git a/cordova/res/icon/ios/icon-72-2x.png b/cordova/res/icon/ios/icon-72-2x.png
deleted file mode 100644
index 6b3262752..000000000
Binary files a/cordova/res/icon/ios/icon-72-2x.png and /dev/null differ
diff --git a/cordova/res/icon/ios/icon-72.png b/cordova/res/icon/ios/icon-72.png
deleted file mode 100644
index 644b82c65..000000000
Binary files a/cordova/res/icon/ios/icon-72.png and /dev/null differ
diff --git a/cordova/www/index.html b/cordova/www/index.html
deleted file mode 100644
index ad5da122c..000000000
--- a/cordova/www/index.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>TagSpaces Mobile</title>
- <meta
- http-equiv="Content-Security-Policy"
- content="connect-src files: *; default-src 'self' data: gap: cdvfile: ; script-src 'self' 'unsafe-inline' ; style-src 'self' 'unsafe-inline' data: blob: ; media-src * blob: ; img-src * blob: data: content:;"
- >
-
-
- <meta charset="utf-8">
- <meta name="format-detection" content="telephone=yes">
- <meta name="msapplication-tap-highlight" content="no">
- <meta
- name="viewport"
- content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"
-/>
- <meta name="theme-color" content="#1DD19F">
- <meta name="description" content="TagSpaces Mobile">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta name="mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="apple-mobile-web-app-title" content="TagSpaces">
- <link rel="stylesheet" type="text/css" href="dist/style.css">
- <script type="text/javascript" src="extconfig.js"></script>
-</head>
-
-<body style="overflow: hidden; margin: 0; padding: 0;">
- <noscript>This app requires JavaScript</noscript>
- <div id="root" style="height: 100%">
- <div
- style="text-align: center; width: 100%; height: 100%; font-size: 1.4em; position:absolute; z-index: 999999; background-color: #F5F5F5; user-select: none; -webkit-user-select: none; -moz-user-select: none; -webkit-app-region: drag"
- class="appBackgroundTile"
- >
- <div
- style="top:45%; width: 100%; text-align: center; position:absolute;"
- >
- <svg
- style="vertical-align: middle"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100"
- height="100"
- >
- <g
- id="layer1"
- transform="matrix(0.33346217,0,0,0.33346217,-0.01300084,-250.91)"
- >
- <rect
- style="fill:none;fill-opacity:1;stroke:none"
- id="rect3052-8-1"
- width="299.42227"
- height="299.42227"
- x="-0.019505024"
- y="752.95935"
- />
- <path
- style="fill:#ffffff;fill-opacity:1;stroke:none"
- d="m 181.90177,787.75394 70.88695,43.53834 C 180.29225,977.67059 187.41436,950.59754 124.58989,989.154 L 65.05006,905.90077 Z"
- id="rect3052-8-2-2"
- />
- <ellipse
- style="fill:#616577;fill-opacity:1;stroke:none"
- id="path4875-4-7-5-6-2"
- cx="192.4187"
- cy="851.11481"
- rx="15.970615"
- ry="15.782593"
- />
- <path
- style="fill:none;stroke:#a466aa;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 159.73623,964.91671 134.54529,941.61879"
- id="path3108-5-39-8"
- />
- <path
- style="fill:none;stroke:#ffffff;stroke-width:34.19813538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 162.16161,795.17204 90.03628,0.34544 0,86.1724 -115.50748,117.79375 -88.457192,-81.6665 z"
- id="path3923-1-1-4-9-8"
- />
- <path
- style="fill:#f7901e;fill-opacity:1;stroke:#33b5be;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 204.81469,910.87834 -50.38182,-45.3016"
- id="path3108-9-1-76-7"
- />
- <path
- style="fill:#616577;fill-opacity:1;stroke:#f7901e;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 182.93838,938.7066 144.48907,904.40668"
- id="path3108-0-7-9-8"
- />
- <path
- style="fill:none;stroke:#616577;stroke-width:31.96374702;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 164.34385,800.70161 83.03644,0 0,79.10209 -110.49206,113.42316 -82.031957,-75.83333 z"
- id="path3923-1-1-4-9"
- />
- </g>
- </svg>
- </div>
- </div>
- </div>
- <script type="text/javascript" src="cordova.js"></script>
- <script type="text/javascript" src="dist/bundle.js"></script>
-</body>
-</html>