Skip to content

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

update cordova platforms (#1335)

Stanimir721df7c82d99
diff --git a/app/services/cordova-io.ts b/app/services/cordova-io.ts
index 0ef799524..251fc08e3 100644
--- a/app/services/cordova-io.ts
+++ b/app/services/cordova-io.ts
@@ -1263,7 +1263,7 @@ export default class CordovaIO {
// ["file:///storage/emulated/0/360/security", "file:///storage/emulated/0/360/security"]
// fix https://trello.com/c/vV7D0kGf/500-tsn500-fix-folder-selector-in-create-edit-location-on-android-or-use-native-dialog
data[0] = data[0].replace(
- 'file:///storage/emulated/0',
+ 'content://org.tagspaces.mobile.provider/root/storage/emulated/0', //'file:///storage/emulated/0',
'file:///sdcard'
);
resolve(data);
diff --git a/cordova/config.xml b/cordova/config.xml
index 5ee7e2b02..ec3c1c7a4 100644
--- a/cordova/config.xml
+++ b/cordova/config.xml
@@ -1,7 +1,8 @@
<?xml version='1.0' encoding='utf-8'?>
-<widget id="org.tagspaces.mobile" 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>
+<widget id="org.tagspaces.mobile" 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">
@@ -55,7 +56,17 @@
<data android:host="*" android:mimeType="*/*" android:pathPattern="..ogv" android:scheme="file" />
</intent-filter>
</config-file>
- </platform>
+ <config-file parent="/manifest/application" target="AndroidManifest.xml">
+ <provider android:name="android.support.v4.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" />-->
diff --git a/cordova/package-lock.json b/cordova/package-lock.json
index 9f7db1fc6..f4f9e24e9 100644
--- a/cordova/package-lock.json
+++ b/cordova/package-lock.json
@@ -16,35 +16,35 @@
"integrity": "sha512-b+MGNyP9/LXkapreJzNUzcvuzZslj/RGgdVVJ16P2wSlYatfLycPObImqVJSmNAdyeShvNeM/pl3sVZsObFueg==",
"dev": true,
"requires": {
- "assert-plus": "^1.0.0",
- "extsprintf": "^1.4.0",
- "lodash": "^4.17.15"
+ "assert-plus": "1.0.0",
+ "extsprintf": "1.4.0",
+ "lodash": "4.17.21"
}
},
"@nodelib/fs.scandir": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
- "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==",
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz",
+ "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==",
"dev": true,
"requires": {
- "@nodelib/fs.stat": "2.0.3",
- "run-parallel": "^1.1.9"
+ "@nodelib/fs.stat": "2.0.4",
+ "run-parallel": "1.2.0"
}
},
"@nodelib/fs.stat": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz",
- "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz",
+ "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==",
"dev": true
},
"@nodelib/fs.walk": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz",
- "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==",
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz",
+ "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==",
"dev": true,
"requires": {
- "@nodelib/fs.scandir": "2.1.3",
- "fastq": "^1.6.0"
+ "@nodelib/fs.scandir": "2.1.4",
+ "fastq": "1.11.0"
}
},
"abbrev": {
@@ -59,7 +59,7 @@
"integrity": "sha512-ojC2Ig7b/KJ6iNtR8e4bacmOsJyEkoERk3CKMIsnH7kJz5z6551NMbrVaRb7KXYavu1d74Uhml/bfcmqT3nAcg==",
"dev": true,
"requires": {
- "semver": "^5.7.1"
+ "semver": "5.7.1"
}
},
"ansi": {
@@ -85,6 +85,10 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
+ "bamboo.cordova.plugin.downloader": {
+ "version": "git+https://github.com/sytolk/cordova-plugin-downloader.git#9ab2c3ad6c0faf9aefcc32a7870593daab5c69db",
+ "dev": true
+ },
"base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -100,7 +104,7 @@
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz",
"integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==",
"requires": {
- "stream-buffers": "~2.2.0"
+ "stream-buffers": "2.2.0"
}
},
"bplist-parser": {
@@ -108,7 +112,7 @@
"resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz",
"integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==",
"requires": {
- "big-integer": "^1.6.44"
+ "big-integer": "1.6.48"
}
},
"brace-expansion": {
@@ -116,7 +120,7 @@
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
- "balanced-match": "^1.0.0",
+ "balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
@@ -126,7 +130,7 @@
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
- "fill-range": "^7.0.1"
+ "fill-range": "7.0.1"
}
},
"com-darryncampbell-cordova-plugin-intent": {
@@ -146,13 +150,13 @@
"integrity": "sha512-2ZEgApK4LPMYW0zh/mLAH3CabzCaKE0yxQTzA2wTf0Eo2HHTJnRtDCf9spGf3nPOkubyXS6+pvzz5QzNHpVTqQ==",
"dev": true,
"requires": {
- "android-versions": "^1.5.0",
- "cordova-common": "^4.0.1",
- "execa": "^4.0.2",
- "fs-extra": "^9.0.1",
- "nopt": "^4.0.3",
- "properties-parser": "^0.3.1",
- "which": "^2.0.2"
+ "android-versions": "1.6.0",
+ "cordova-common": "4.0.2",
+ "execa": "4.1.0",
+ "fs-extra": "9.1.0",
+ "nopt": "4.0.3",
+ "properties-parser": "0.3.1",
+ "which": "2.0.2"
}
},
"cordova-common": {
@@ -161,59 +165,72 @@
"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"
+ "@netflix/nerror": "1.1.3",
+ "ansi": "0.3.1",
+ "bplist-parser": "0.2.0",
+ "cross-spawn": "7.0.3",
+ "elementtree": "0.1.7",
+ "endent": "1.4.1",
+ "fast-glob": "3.2.5",
+ "fs-extra": "9.1.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.12.0"
}
},
"cordova-ios": {
- "version": "6.1.1",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-6.1.1.tgz",
- "integrity": "sha512-WHNvjVhkuwRpq95rISVXtcRyd6UGZapbmU+hO/CAn1c0AIT5WnO8mg2mOjv0WDNa0mt/V5P+N2Vig1UWwfxa5Q==",
- "dev": true,
- "requires": {
- "cordova-common": "^4.0.2",
- "fs-extra": "^9.0.0",
- "ios-sim": "^8.0.2",
- "nopt": "^4.0.3",
- "plist": "^3.0.1",
- "semver": "^7.3.2",
- "unorm": "^1.6.0",
- "which": "^2.0.2",
- "xcode": "^3.0.1",
- "xml-escape": "^1.1.0"
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-6.2.0.tgz",
+ "integrity": "sha512-sLjZg2QBI1SpQVwfe0MSn89YNVkBGLW9Q1vcFJBsqKBrhvoEOJ5Ytq0gwqdhgTOGzlwJUfxC6OHM3jcsRjtYrw==",
+ "dev": true,
+ "requires": {
+ "cordova-common": "4.0.2",
+ "fs-extra": "9.1.0",
+ "ios-sim": "8.0.2",
+ "nopt": "5.0.0",
+ "plist": "3.0.1",
+ "semver": "7.3.4",
+ "unorm": "1.6.0",
+ "which": "2.0.2",
+ "xcode": "3.0.1",
+ "xml-escape": "1.1.0"
},
"dependencies": {
+ "nopt": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
+ "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
+ "dev": true,
+ "requires": {
+ "abbrev": "1.1.1"
+ }
+ },
"semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"dev": true,
"requires": {
- "lru-cache": "^6.0.0"
+ "lru-cache": "6.0.0"
}
}
}
},
+ "cordova-ourcodeworld-filebrowser": {
+ "version": "git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git#07b8d2298a53691913101da5f704cb11159aed70",
+ "dev": true
+ },
"cordova-plugin-add-swift-support": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/cordova-plugin-add-swift-support/-/cordova-plugin-add-swift-support-2.0.2.tgz",
"integrity": "sha512-K03WDnsD3GT+n7Od3BnS17D8rYnAFZbZjjQJa2r7qW8QLq8+h7hGbFaiF+w5+nUtyAqUNq+HT/d/MdqBGLNzxA==",
"requires": {
- "glob": "^7.1.3",
- "semver": "^6.0.0",
- "xcode": "^2.0.0"
+ "glob": "7.1.6",
+ "semver": "6.3.0",
+ "xcode": "2.1.0"
},
"dependencies": {
"semver": {
@@ -231,20 +248,26 @@
"resolved": "https://registry.npmjs.org/xcode/-/xcode-2.1.0.tgz",
"integrity": "sha512-uCrmPITrqTEzhn0TtT57fJaNaw8YJs1aCzs+P/QqxsDbvPZSv7XMPPwXrKvHtD6pLjBM/NaVwraWJm8q83Y4iQ==",
"requires": {
- "simple-plist": "^1.0.0",
- "uuid": "^3.3.2"
+ "simple-plist": "1.1.1",
+ "uuid": "3.4.0"
}
}
}
},
+ "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"
+ "q": "1.5.1",
+ "recursive-readdir": "2.2.2"
}
},
"cordova-plugin-background-mode": {
@@ -252,6 +275,12 @@
"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.1",
+ "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-5.0.1.tgz",
+ "integrity": "sha512-9gXyZvI8u9KzsZuqmB8Yw+uheF+7f+usMAwvOMw7L7pqbykg+bm9US5zjhJbwit3A1cSblgZkpBafe5cFiMcTA==",
+ "dev": true
+ },
"cordova-plugin-device": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz",
@@ -272,15 +301,21 @@
"resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz",
"integrity": "sha512-EYC5eQFVkoYXq39l7tYKE6lEjHJ04mvTmKXxGL7quHLdFPfJMNzru/UYpn92AOfpl3PQaZmou78C7EgmFOwFQQ=="
},
+ "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.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
+ "path-key": "3.1.1",
+ "shebang-command": "2.0.0",
+ "which": "2.0.2"
}
},
"dedent": {
@@ -304,7 +339,7 @@
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"requires": {
- "once": "^1.4.0"
+ "once": "1.4.0"
}
},
"endent": {
@@ -313,9 +348,9 @@
"integrity": "sha512-buHTb5c8AC9NshtP6dgmNLYkiT+olskbq1z6cEGvfGCF3Qphbu/1zz5Xu+yjTDln8RbxNhPoUyJ5H8MSrp1olQ==",
"dev": true,
"requires": {
- "dedent": "^0.7.0",
- "fast-json-parse": "^1.0.3",
- "objectorarray": "^1.0.4"
+ "dedent": "0.7.0",
+ "fast-json-parse": "1.0.3",
+ "objectorarray": "1.0.4"
}
},
"es6-promise-plugin": {
@@ -329,15 +364,15 @@
"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"
+ "cross-spawn": "7.0.3",
+ "get-stream": "5.2.0",
+ "human-signals": "1.1.1",
+ "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"
}
},
"extsprintf": {
@@ -347,17 +382,17 @@
"dev": true
},
"fast-glob": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz",
- "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==",
+ "version": "3.2.5",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
+ "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==",
"dev": true,
"requires": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.0",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.2",
- "picomatch": "^2.2.1"
+ "@nodelib/fs.stat": "2.0.4",
+ "@nodelib/fs.walk": "1.2.6",
+ "glob-parent": "5.1.2",
+ "merge2": "1.4.1",
+ "micromatch": "4.0.2",
+ "picomatch": "2.2.2"
}
},
"fast-json-parse": {
@@ -367,12 +402,12 @@
"dev": true
},
"fastq": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz",
- "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==",
+ "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"
+ "reusify": "1.0.4"
}
},
"fill-range": {
@@ -381,19 +416,19 @@
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
- "to-regex-range": "^5.0.1"
+ "to-regex-range": "5.0.1"
}
},
"fs-extra": {
- "version": "9.0.1",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz",
- "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==",
+ "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": "^1.0.0"
+ "at-least-node": "1.0.0",
+ "graceful-fs": "4.2.6",
+ "jsonfile": "6.1.0",
+ "universalify": "2.0.0"
}
},
"fs.realpath": {
@@ -407,7 +442,7 @@
"integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
"dev": true,
"requires": {
- "pump": "^3.0.0"
+ "pump": "3.0.0"
}
},
"glob": {
@@ -415,27 +450,27 @@
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"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"
+ "fs.realpath": "1.0.0",
+ "inflight": "1.0.6",
+ "inherits": "2.0.4",
+ "minimatch": "3.0.4",
+ "once": "1.4.0",
+ "path-is-absolute": "1.0.1"
}
},
"glob-parent": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
- "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
+ "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"
+ "is-glob": "4.0.1"
}
},
"graceful-fs": {
- "version": "4.2.4",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
- "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
+ "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": {
@@ -449,8 +484,8 @@
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
- "once": "^1.3.0",
- "wrappy": "1"
+ "once": "1.4.0",
+ "wrappy": "1.0.2"
}
},
"inherits": {
@@ -464,10 +499,10 @@
"integrity": "sha512-P7nEG771bfd+JoMRjnis1gpZOkjTUUxu+4Ek1Z+eoaEEoT9byllU9pxfQ8Df7hL3gSkIQxNwTSLhos2I8tWUQA==",
"dev": true,
"requires": {
- "bplist-parser": "^0.0.6",
+ "bplist-parser": "0.0.6",
"nopt": "1.0.9",
- "plist": "^3.0.1",
- "simctl": "^2"
+ "plist": "3.0.1",
+ "simctl": "2.0.0"
},
"dependencies": {
"bplist-parser": {
@@ -482,7 +517,7 @@
"integrity": "sha1-O8DXy6e/sNWmdtvtfA6+SKT9RU4=",
"dev": true,
"requires": {
- "abbrev": "1"
+ "abbrev": "1.1.1"
}
}
}
@@ -499,7 +534,7 @@
"integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
"dev": true,
"requires": {
- "is-extglob": "^2.1.1"
+ "is-extglob": "2.1.1"
}
},
"is-number": {
@@ -526,22 +561,14 @@
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"requires": {
- "graceful-fs": "^4.1.6",
- "universalify": "^2.0.0"
- },
- "dependencies": {
- "universalify": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
- "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
- "dev": true
- }
+ "graceful-fs": "4.2.6",
+ "universalify": "2.0.0"
}
},
"lodash": {
- "version": "4.17.20",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
- "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"lru-cache": {
@@ -550,7 +577,7 @@
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
- "yallist": "^4.0.0"
+ "yallist": "4.0.0"
}
},
"merge-stream": {
@@ -571,8 +598,8 @@
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"requires": {
- "braces": "^3.0.1",
- "picomatch": "^2.0.5"
+ "braces": "3.0.2",
+ "picomatch": "2.2.2"
}
},
"mimic-fn": {
@@ -586,7 +613,7 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
- "brace-expansion": "^1.1.7"
+ "brace-expansion": "1.1.11"
}
},
"nopt": {
@@ -595,8 +622,8 @@
"integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
"dev": true,
"requires": {
- "abbrev": "1",
- "osenv": "^0.1.4"
+ "abbrev": "1.1.1",
+ "osenv": "0.1.5"
}
},
"npm-run-path": {
@@ -605,7 +632,7 @@
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"requires": {
- "path-key": "^3.0.0"
+ "path-key": "3.1.1"
}
},
"objectorarray": {
@@ -619,7 +646,7 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
- "wrappy": "1"
+ "wrappy": "1.0.2"
}
},
"onetime": {
@@ -628,7 +655,7 @@
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
"dev": true,
"requires": {
- "mimic-fn": "^2.1.0"
+ "mimic-fn": "2.1.0"
}
},
"os-homedir": {
@@ -649,8 +676,8 @@
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"dev": true,
"requires": {
- "os-homedir": "^1.0.0",
- "os-tmpdir": "^1.0.0"
+ "os-homedir": "1.0.2",
+ "os-tmpdir": "1.0.2"
}
},
"p-finally": {
@@ -693,9 +720,9 @@
"resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz",
"integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==",
"requires": {
- "base64-js": "^1.2.3",
- "xmlbuilder": "^9.0.7",
- "xmldom": "0.1.x"
+ "base64-js": "1.5.1",
+ "xmlbuilder": "9.0.7",
+ "xmldom": "0.1.31"
}
},
"properties-parser": {
@@ -704,7 +731,7 @@
"integrity": "sha1-ExbpU5/7/ZOEXjabIRAiq9R4dxo=",
"dev": true,
"requires": {
- "string.prototype.codepointat": "^0.2.0"
+ "string.prototype.codepointat": "0.2.1"
}
},
"pump": {
@@ -713,8 +740,8 @@
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"requires": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
+ "end-of-stream": "1.4.4",
+ "once": "1.4.0"
}
},
"q": {
@@ -723,14 +750,20 @@
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
"dev": true
},
+ "queue-microtask": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz",
+ "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==",
+ "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"
+ "pify": "4.0.1",
+ "with-open-file": "0.1.7"
}
},
"recursive-readdir": {
@@ -749,10 +782,13 @@
"dev": true
},
"run-parallel": {
- "version": "1.1.10",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz",
- "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==",
- "dev": true
+ "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",
@@ -772,7 +808,7 @@
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
- "shebang-regex": "^3.0.0"
+ "shebang-regex": "3.0.0"
}
},
"shebang-regex": {
@@ -799,8 +835,8 @@
"integrity": "sha512-5rB7rN4N3b0z0nFdy9eczVssXqrv2aAgdVRksPVqVoiDtvXmfzNvebp3EMdId2sAUzXIflarQlx4P0hjVQEzKQ==",
"dev": true,
"requires": {
- "shelljs": "^0.2.6",
- "tail": "^0.4.0"
+ "shelljs": "0.2.6",
+ "tail": "0.4.0"
}
},
"simple-plist": {
@@ -810,7 +846,7 @@
"requires": {
"bplist-creator": "0.0.8",
"bplist-parser": "0.2.0",
- "plist": "^3.0.1"
+ "plist": "3.0.1"
}
},
"stream-buffers": {
@@ -848,7 +884,7 @@
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
- "is-number": "^7.0.0"
+ "is-number": "7.0.0"
}
},
"underscore": {
@@ -858,9 +894,9 @@
"dev": true
},
"universalify": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
- "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true
},
"unorm": {
@@ -881,7 +917,7 @@
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
- "isexe": "^2.0.0"
+ "isexe": "2.0.0"
}
},
"with-open-file": {
@@ -890,9 +926,9 @@
"integrity": "sha512-ecJS2/oHtESJ1t3ZfMI3B7KIDKyfN0O16miWxdn30zdh66Yd3LsRFebXZXq6GU4xfxLf6nVxp9kIqElb5fqczA==",
"dev": true,
"requires": {
- "p-finally": "^1.0.0",
- "p-try": "^2.1.0",
- "pify": "^4.0.1"
+ "p-finally": "1.0.0",
+ "p-try": "2.2.0",
+ "pify": "4.0.1"
}
},
"wrappy": {
@@ -906,8 +942,8 @@
"integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==",
"dev": true,
"requires": {
- "simple-plist": "^1.1.0",
- "uuid": "^7.0.3"
+ "simple-plist": "1.1.1",
+ "uuid": "7.0.3"
}
},
"xml-escape": {
diff --git a/cordova/package.json b/cordova/package.json
index 3146d5f83..1c9b4f7f9 100644
--- a/cordova/package.json
+++ b/cordova/package.json
@@ -27,7 +27,7 @@
"cordova-plugin-file-opener2": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
- "com.whebcraft.cordova.plugin.downloader": {},
+ "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.",
@@ -37,9 +37,9 @@
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-androidx-adapter": {},
- "com.ourcodeworld.plugins.Filebrowser": {},
"cordova-plugin-add-swift-support": {},
- "com-darryncampbell-cordova-plugin-intent": {}
+ "com-darryncampbell-cordova-plugin-intent": {},
+ "cordova-plugin-androidx": {}
},
"platforms": [
"android",
@@ -51,8 +51,11 @@
"bamboo.cordova.plugin.downloader": "git+https://github.com/sytolk/cordova-plugin-downloader.git",
"com-darryncampbell-cordova-plugin-intent": "^2.0.0",
"cordova-android": "^9.0.0",
- "cordova-ios": "^6.1.1",
- "cordova-ourcodeworld-filebrowser": "git+https://github.com/ourcodeworld/cordova-ourcodeworld-filebrowser.git",
- "cordova-plugin-androidx-adapter": "^1.1.3"
+ "cordova-ios": "^6.2.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.1",
+ "cordova-plugin-x-socialsharing": "^6.0.3"
}
-}
\ No newline at end of file
+}
diff --git a/cordova/platforms/android/android.json b/cordova/platforms/android/android.json
index 88e437950..26d670b13 100644
--- a/cordova/platforms/android/android.json
+++ b/cordova/platforms/android/android.json
@@ -5,148 +5,162 @@
},
"config_munge": {
"files": {
- "res/xml/config.xml": {
+ "AndroidManifest.xml": {
"parents": {
- "/*": [
+ "/manifest/application/activity": [
{
- "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
- "count": 1
+ "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": 5
},
{
- "xml": "<feature name=\"BackgroundMode\"><param name=\"android-package\" value=\"de.appplant.cordova.plugin.background.BackgroundMode\" /></feature>",
- "count": 1
+ "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": 5
},
{
- "xml": "<feature name=\"BackgroundModeExt\"><param name=\"android-package\" value=\"de.appplant.cordova.plugin.background.BackgroundModeExt\" /></feature>",
+ "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": 5
},
{
- "xml": "<preference name=\"KeepRunning\" value=\"true\" />",
+ "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": "<feature name=\"Camera\"><param name=\"android-package\" value=\"org.apache.cordova.camera.CameraLauncher\" /></feature>",
+ "xml": "<activity android:label=\"Filepicker\" android:name=\"com.nononsenseapps.filepicker.FilePickerActivity\" android:theme=\"@style/FilePickerTheme\"><intent-filter><action android:name=\"android.intent.action.GET_CONTENT\" /><category android:name=\"android.intent.category.DEFAULT\" /></intent-filter></activity>",
"count": 1
},
{
- "xml": "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>",
+ "xml": "<service android:name=\"de.appplant.cordova.plugin.background.ForegroundService\" />",
"count": 1
},
{
- "xml": "<allow-navigation href=\"cdvfile:*\" />",
+ "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": "<feature name=\"FileOpener2\"><param name=\"android-package\" value=\"io.github.pwlin.cordova.plugins.fileopener2.FileOpener2\" /></feature>",
+ "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
+ }
+ ],
+ "/manifest": [
+ {
+ "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
+ "count": 2
},
{
- "xml": "<feature name=\"Whitelist\"><param name=\"android-package\" value=\"org.apache.cordova.whitelist.WhitelistPlugin\" /><param name=\"onload\" value=\"true\" /></feature>",
+ "xml": "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />",
+ "count": 3
+ },
+ {
+ "xml": "<uses-permission android:name=\"android.permission.WAKE_LOCK\" />",
"count": 1
},
{
- "xml": "<feature name=\"SocialSharing\"><param name=\"android-package\" value=\"nl.xservices.plugins.SocialSharing\" /></feature>",
+ "xml": "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />",
"count": 1
+ }
+ ],
+ "/*": [
+ {
+ "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
+ "count": 3
},
{
- "xml": "<feature name=\"Downloader\"><param name=\"android-package\" value=\"com.whebcraft.android.plugin.Downloader\" /></feature>",
+ "xml": "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />",
"count": 1
},
{
- "xml": "<feature name=\"Filebrowser\"><param name=\"android-package\" value=\"com.ourcodeworld.plugins.filebrowser.Filebrowser\" /></feature>",
+ "xml": "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />",
+ "count": 1
+ }
+ ],
+ "application": [
+ {
+ "xml": "<provider android:authorities=\"${applicationId}.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": "<feature name=\"IntentShim\"><param name=\"android-package\" value=\"com.darryncampbell.cordova.plugin.intent.IntentShim\" /><param name=\"onload\" value=\"true\" /></feature>",
+ "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
}
]
}
},
- "AndroidManifest.xml": {
+ "res/xml/config.xml": {
"parents": {
- "/manifest/application": [
+ "/*": [
{
- "xml": "<service android:name=\"de.appplant.cordova.plugin.background.ForegroundService\" />",
+ "xml": "<feature name=\"Filebrowser\"><param name=\"android-package\" value=\"com.ourcodeworld.plugins.filebrowser.Filebrowser\" /></feature>",
"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>",
+ "xml": "<feature name=\"Downloader\"><param name=\"android-package\" value=\"com.whebcraft.android.plugin.Downloader\" /></feature>",
"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>",
+ "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
"count": 1
},
{
- "xml": "<activity android:label=\"Filepicker\" android:name=\"com.nononsenseapps.filepicker.FilePickerActivity\" android:theme=\"@style/FilePickerTheme\"><intent-filter><action android:name=\"android.intent.action.GET_CONTENT\" /><category android:name=\"android.intent.category.DEFAULT\" /></intent-filter></activity>",
+ "xml": "<feature name=\"BackgroundMode\"><param name=\"android-package\" value=\"de.appplant.cordova.plugin.background.BackgroundMode\" /></feature>",
"count": 1
},
{
- "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
- }
- ],
- "/manifest": [
- {
- "xml": "<uses-permission android:name=\"android.permission.WAKE_LOCK\" />",
+ "xml": "<feature name=\"BackgroundModeExt\"><param name=\"android-package\" value=\"de.appplant.cordova.plugin.background.BackgroundModeExt\" /></feature>",
"count": 1
},
{
- "xml": "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />",
- "count": 3
+ "xml": "<preference name=\"KeepRunning\" value=\"true\" />",
+ "count": 1
},
{
- "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
- "count": 2
+ "xml": "<feature name=\"Camera\"><param name=\"android-package\" value=\"org.apache.cordova.camera.CameraLauncher\" /></feature>",
+ "count": 1
},
{
- "xml": "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />",
+ "xml": "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>",
"count": 1
- }
- ],
- "/*": [
- {
- "xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
- "count": 3
},
{
- "xml": "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />",
+ "xml": "<allow-navigation href=\"cdvfile:*\" />",
"count": 1
},
{
- "xml": "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />",
+ "xml": "<feature name=\"FileOpener2\"><param name=\"android-package\" value=\"io.github.pwlin.cordova.plugins.fileopener2.FileOpener2\" /></feature>",
"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>",
+ "xml": "<feature name=\"Whitelist\"><param name=\"android-package\" value=\"org.apache.cordova.whitelist.WhitelistPlugin\" /><param name=\"onload\" value=\"true\" /></feature>",
"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>",
+ "xml": "<feature name=\"SocialSharing\"><param name=\"android-package\" value=\"nl.xservices.plugins.SocialSharing\" /></feature>",
"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>",
+ "xml": "<feature name=\"IntentShim\"><param name=\"android-package\" value=\"com.darryncampbell.cordova.plugin.intent.IntentShim\" /><param name=\"onload\" value=\"true\" /></feature>",
"count": 1
}
- ],
- "/manifest/application/activity": [
+ ]
+ }
+ },
+ "config.xml": {
+ "parents": {
+ "/*": [
{
- "xml": "<intent-filter><action android:name=\"com.darryncampbell.cordova.plugin.intent.ACTION\" /><category android:name=\"android.intent.category.DEFAULT\" /></intent-filter>",
+ "xml": "<feature name=\"Chooser\"><param name=\"android-package\" value=\"com.cyph.cordova.Chooser\" /></feature>",
"count": 1
- },
- {
- "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": 3
- },
- {
- "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": 3
}
]
}
@@ -154,6 +168,18 @@
}
},
"installed_plugins": {
+ "com.ourcodeworld.plugins.Filebrowser": {
+ "PACKAGE_NAME": "org.tagspaces.mobile"
+ },
+ "com.whebcraft.cordova.plugin.downloader": {
+ "PACKAGE_NAME": "org.tagspaces.mobile"
+ },
+ "cordova-plugin-add-swift-support": {
+ "PACKAGE_NAME": "org.tagspaces.mobile"
+ },
+ "cordova-plugin-androidx-adapter": {
+ "PACKAGE_NAME": "org.tagspaces.mobile"
+ },
"cordova-plugin-device": {
"PACKAGE_NAME": "org.tagspaces.mobile"
},
@@ -164,6 +190,9 @@
"ANDROID_SUPPORT_V4_VERSION": "27.+",
"PACKAGE_NAME": "org.tagspaces.mobile"
},
+ "cordova-plugin-chooser": {
+ "PACKAGE_NAME": "org.tagspaces.mobile"
+ },
"cordova-plugin-file": {
"PACKAGE_NAME": "org.tagspaces.mobile"
},
@@ -178,18 +207,7 @@
"PACKAGE_NAME": "org.tagspaces.mobile"
},
"cordova-plugin-x-socialsharing": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-androidx-adapter": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "com.whebcraft.cordova.plugin.downloader": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "com.ourcodeworld.plugins.Filebrowser": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-add-swift-support": {
+ "ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
"PACKAGE_NAME": "org.tagspaces.mobile"
},
"com-darryncampbell-cordova-plugin-intent": {
@@ -198,6 +216,22 @@
},
"dependent_plugins": {},
"modules": [
+ {
+ "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",
@@ -247,6 +281,14 @@
"CameraPopoverHandle"
]
},
+ {
+ "id": "cordova-plugin-chooser.Chooser",
+ "file": "plugins/cordova-plugin-chooser/www/chooser.js",
+ "pluginId": "cordova-plugin-chooser",
+ "clobbers": [
+ "chooser"
+ ]
+ },
{
"id": "cordova-plugin-file.DirectoryEntry",
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
@@ -442,22 +484,6 @@
"window.plugins.socialsharing"
]
},
- {
- "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": "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-darryncampbell-cordova-plugin-intent.IntentShim",
"file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
@@ -468,18 +494,19 @@
}
],
"plugin_metadata": {
+ "com.ourcodeworld.plugins.Filebrowser": "1.0.0",
+ "com.whebcraft.cordova.plugin.downloader": "0.1.0",
+ "cordova-plugin-add-swift-support": "2.0.2",
+ "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-camera": "4.1.0",
+ "cordova-plugin-chooser": "1.3.1",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.4",
"cordova-plugin-whitelist": "1.3.4",
"es6-promise-plugin": "4.2.2",
- "cordova-plugin-x-socialsharing": "6.0.2",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "com.ourcodeworld.plugins.Filebrowser": "1.0.0",
- "cordova-plugin-add-swift-support": "2.0.2",
+ "cordova-plugin-x-socialsharing": "5.6.8",
"com-darryncampbell-cordova-plugin-intent": "2.0.0"
}
}
diff --git a/cordova/platforms/android/app/build.gradle b/cordova/platforms/android/app/build.gradle
index c1a7c58b7..b40db3a8e 100644
--- a/cordova/platforms/android/app/build.gradle
+++ b/cordova/platforms/android/app/build.gradle
@@ -353,6 +353,7 @@ dependencies {
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: ":CordovaLib"))
implementation "androidx.legacy:legacy-support-v4:1.0.0"
+ implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.core:core:1.1.0"
// SUB-PROJECT DEPENDENCIES END
}
diff --git a/cordova/platforms/android/app/gradle/wrapper/gradle-wrapper.jar b/cordova/platforms/android/app/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..f3d88b1c2
Binary files /dev/null and b/cordova/platforms/android/app/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/cordova/platforms/android/app/gradle/wrapper/gradle-wrapper.properties b/cordova/platforms/android/app/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..622ab64a3
--- /dev/null
+++ b/cordova/platforms/android/app/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/cordova/platforms/android/app/gradlew b/cordova/platforms/android/app/gradlew
new file mode 100755
index 000000000..2fe81a7d9
--- /dev/null
+++ b/cordova/platforms/android/app/gradlew
@@ -0,0 +1,183 @@
+#!/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
+ ;;
+ 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/app/gradlew.bat b/cordova/platforms/android/app/gradlew.bat
new file mode 100644
index 000000000..9618d8d96
--- /dev/null
+++ b/cordova/platforms/android/app/gradlew.bat
@@ -0,0 +1,100 @@
+@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 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 init
+
+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 init
+
+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
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+: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 %CMD_LINE_ARGS%
+
+: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/app/src/main/AndroidManifest.xml b/cordova/platforms/android/app/src/main/AndroidManifest.xml
index f7def5ce4..b9d869111 100644
--- a/cordova/platforms/android/app/src/main/AndroidManifest.xml
+++ b/cordova/platforms/android/app/src/main/AndroidManifest.xml
@@ -8,10 +8,6 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
- <intent-filter>
- <action android:name="com.darryncampbell.cordova.plugin.intent.ACTION" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
@@ -40,21 +36,13 @@
<data android:host="*" android:mimeType="*/*" android:pathPattern="..markdown" android:scheme="file" />
<data android:host="*" android:mimeType="*/*" android:pathPattern="..ogv" android:scheme="file" />
</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" />
+ <action android:name="com.darryncampbell.cordova.plugin.intent.ACTION" />
+ <category android:name="android.intent.category.DEFAULT" />
</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" />
+ </activity>
+ <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>
<activity android:label="Our Code World filepicker" android:name="com.ourcodeworld.plugins.filebrowser.DialogShowPicker">
<intent-filter>
@@ -68,12 +56,33 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
+ <service android:name="de.appplant.cordova.plugin.background.ForegroundService" />
+ <provider android:authorities="${applicationId}.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}.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>
+ <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.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
</manifest>
diff --git a/cordova/platforms/android/app/src/main/java/com/cyph/cordova/Chooser.java b/cordova/platforms/android/app/src/main/java/com/cyph/cordova/Chooser.java
new file mode 100755
index 000000000..04978bff8
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/java/com/cyph/cordova/Chooser.java
@@ -0,0 +1,156 @@
+package com.cyph.cordova;
+
+import android.app.Activity;
+import android.content.ContentResolver;
+import android.content.Intent;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.MediaStore;
+import android.util.Base64;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.lang.Exception;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.PluginResult;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+
+public class Chooser extends CordovaPlugin {
+ private static final String ACTION_OPEN = "getFile";
+ private static final int PICK_FILE_REQUEST = 1;
+ private static final String TAG = "Chooser";
+
+ /** @see https://stackoverflow.com/a/17861016/459881 */
+ public static byte[] getBytesFromInputStream (InputStream is) throws IOException {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ byte[] buffer = new byte[0xFFFF];
+
+ for (int len = is.read(buffer); len != -1; len = is.read(buffer)) {
+ os.write(buffer, 0, len);
+ }
+
+ return os.toByteArray();
+ }
+
+ /** @see https://stackoverflow.com/a/23270545/459881 */
+ public static String getDisplayName (ContentResolver contentResolver, Uri uri) {
+ String[] projection = {MediaStore.MediaColumns.DISPLAY_NAME};
+ Cursor metaCursor = contentResolver.query(uri, projection, null, null, null);
+
+ if (metaCursor != null) {
+ try {
+ if (metaCursor.moveToFirst()) {
+ return metaCursor.getString(0);
+ }
+ } finally {
+ metaCursor.close();
+ }
+ }
+
+ return "File";
+ }
+
+
+ private CallbackContext callback;
+ private Boolean includeData;
+
+ public void chooseFile (CallbackContext callbackContext, String accept, Boolean includeData) {
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.setType("*/*");
+ if (!accept.equals("*/*")) {
+ intent.putExtra(Intent.EXTRA_MIME_TYPES, accept.split(","));
+ }
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
+ intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
+ intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+ this.includeData = includeData;
+
+ Intent chooser = Intent.createChooser(intent, "Select File");
+ cordova.startActivityForResult(this, chooser, Chooser.PICK_FILE_REQUEST);
+
+ PluginResult pluginResult = new PluginResult(PluginResult.Status.NO_RESULT);
+ pluginResult.setKeepCallback(true);
+ this.callback = callbackContext;
+ callbackContext.sendPluginResult(pluginResult);
+ }
+
+ @Override
+ public boolean execute (
+ String action,
+ JSONArray args,
+ CallbackContext callbackContext
+ ) {
+ try {
+ if (action.equals(Chooser.ACTION_OPEN)) {
+ this.chooseFile(callbackContext, args.getString(0), args.getBoolean(1));
+ return true;
+ }
+ }
+ catch (JSONException err) {
+ this.callback.error("Execute failed: " + err.toString());
+ }
+
+ return false;
+ }
+
+ @Override
+ public void onActivityResult (int requestCode, int resultCode, Intent data) {
+ try {
+ if (requestCode == Chooser.PICK_FILE_REQUEST && this.callback != null) {
+ if (resultCode == Activity.RESULT_OK) {
+ Uri uri = data.getData();
+
+ if (uri != null) {
+ ContentResolver contentResolver =
+ this.cordova.getActivity().getContentResolver()
+ ;
+
+ String name = Chooser.getDisplayName(contentResolver, uri);
+
+ String mediaType = contentResolver.getType(uri);
+ if (mediaType == null || mediaType.isEmpty()) {
+ mediaType = "application/octet-stream";
+ }
+
+ String base64 = "";
+
+ if (this.includeData) {
+ byte[] bytes = Chooser.getBytesFromInputStream(
+ contentResolver.openInputStream(uri)
+ );
+
+ base64 = Base64.encodeToString(bytes, Base64.DEFAULT);
+ }
+
+ JSONObject result = new JSONObject();
+
+ result.put("data", base64);
+ result.put("mediaType", mediaType);
+ result.put("name", name);
+ result.put("uri", uri.toString());
+
+ this.callback.success(result.toString());
+ }
+ else {
+ this.callback.error("File URI was null.");
+ }
+ }
+ else if (resultCode == Activity.RESULT_CANCELED) {
+ this.callback.success("RESULT_CANCELED");
+ }
+ else {
+ this.callback.error(resultCode);
+ }
+ }
+ }
+ catch (Exception err) {
+ this.callback.error("Failed to read file: " + err.toString());
+ }
+ }
+}
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
index 93dabc460..2dedd9c91 100644
--- 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
@@ -1,4 +1,4 @@
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/SocialSharing.java b/cordova/platforms/android/app/src/main/java/nl/xservices/plugins/SocialSharing.java
index 825a28ba7..e72446f42 100644
--- 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
@@ -87,10 +87,10 @@ public class SocialSharing extends CordovaPlugin {
} 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");
+ return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.isNull(3) ? args.getJSONArray(2) : null, 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");
+ return doSendIntent(callbackContext, args.getString(0), args.getString(1), args.isNull(3) ? args.getJSONArray(2) : null, 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));
@@ -440,9 +440,6 @@ public class SocialSharing extends CordovaPlugin {
}
}
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);
}
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
old mode 100755
new mode 100644
index 614935d19..c0a03904b
--- 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
@@ -21,7 +21,6 @@ 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;
@@ -35,7 +34,6 @@ 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;
@@ -53,6 +51,7 @@ import org.json.JSONException;
import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -70,6 +69,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
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 NATIVE_URI = 2; // On Android, this is the same as FILE_URI
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
@@ -109,8 +109,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
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 CordovaUri imageUri; // Uri of captured image
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)
@@ -128,7 +127,6 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
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;
@@ -222,7 +220,17 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
//--------------------------------------------------------------------------
private String getTempDirectoryPath() {
- File cache = cordova.getActivity().getCacheDir();
+ File cache = null;
+
+ // SD Card Mounted
+ if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+ cache = cordova.getActivity().getExternalCacheDir();
+ }
+ // Use internal storage
+ else {
+ cache = cordova.getActivity().getCacheDir();
+ }
+
// Create the cache directory if it doesn't exist
cache.mkdirs();
return cache.getAbsolutePath();
@@ -292,11 +300,10 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
// 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);
+ this.imageUri = new CordovaUri(FileProvider.getUriForFile(cordova.getActivity(),
+ applicationId + ".provider",
+ photo));
+ intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri.getCorrectUri());
//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);
@@ -363,7 +370,6 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
Intent intent = new Intent();
String title = GET_PICTURE;
croppedUri = null;
- croppedFilePath = null;
if (this.mediaType == PICTURE) {
intent.setType("image/*");
if (this.allowEdit) {
@@ -379,9 +385,8 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
}
- File croppedFile = createCaptureFile(JPEG);
- croppedFilePath = croppedFile.getAbsolutePath();
- croppedUri = Uri.fromFile(croppedFile);
+ File photo = createCaptureFile(JPEG);
+ croppedUri = Uri.fromFile(photo);
intent.putExtra(MediaStore.EXTRA_OUTPUT, croppedUri);
} else {
intent.setAction(Intent.ACTION_GET_CONTENT);
@@ -406,57 +411,57 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
}
}
- /**
- * 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");
+ /**
+ * 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);
+ // 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
+ croppedUri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
+ 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");
- }
+ // 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.
@@ -471,8 +476,8 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
ExifHelper exif = new ExifHelper();
String sourcePath = (this.allowEdit && this.croppedUri != null) ?
- this.croppedFilePath :
- this.imageFilePath;
+ FileHelper.stripFileProtocol(this.croppedUri.toString()) :
+ this.imageUri.getFilePath();
if (this.encodingType == JPEG) {
@@ -494,18 +499,16 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
// 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()));
+ galleryUri = Uri.fromFile(new File(getPicturesPath()));
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);
- }
+ Uri imageUri = this.imageUri.getFileUri();
+ writeUncompressedImage(imageUri, galleryUri);
}
+
+ refreshGallery(galleryUri);
}
// If sending base64 image back
@@ -533,7 +536,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
}
// If sending filename back
- else if (destType == FILE_URI) {
+ else if (destType == FILE_URI || destType == NATIVE_URI) {
// If all this is true we shouldn't compress the image.
if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
!this.correctOrientation) {
@@ -546,10 +549,10 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
Uri uri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
if (this.allowEdit && this.croppedUri != null) {
- Uri croppedUri = Uri.parse(croppedFilePath);
+ Uri croppedUri = Uri.fromFile(new File(getFileNameFromUri(this.croppedUri)));
writeUncompressedImage(croppedUri, uri);
} else {
- Uri imageUri = this.imageUri;
+ Uri imageUri = this.imageUri.getFileUri();
writeUncompressedImage(imageUri, uri);
}
@@ -569,7 +572,9 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
// Add compressed version of captured image to returned media store Uri
OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri);
- CompressFormat compressFormat = getCompressFormatForEncodingType(encodingType);
+ CompressFormat compressFormat = encodingType == JPEG ?
+ CompressFormat.JPEG :
+ CompressFormat.PNG;
bitmap.compress(compressFormat, this.mQuality, os);
os.close();
@@ -593,45 +598,22 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
throw new IllegalStateException();
}
- this.cleanup(FILE_URI, this.imageUri, galleryUri, bitmap);
+ this.cleanup(FILE_URI, this.imageUri.getFileUri(), 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() {
+ private String 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);
+ String galleryPath = storageDir.getAbsolutePath() + "/" + imageFileName;
+ return galleryPath;
}
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);
}
@@ -663,7 +645,9 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
String modifiedPath = getTempDirectoryPath() + "/" + fileName;
OutputStream os = new FileOutputStream(modifiedPath);
- CompressFormat compressFormat = getCompressFormatForEncodingType(this.encodingType);
+ CompressFormat compressFormat = this.encodingType == JPEG ?
+ CompressFormat.JPEG :
+ CompressFormat.PNG;
bitmap.compress(compressFormat, this.mQuality, os);
os.close();
@@ -700,80 +684,74 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
return;
}
}
+ int rotate = 0;
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 {
+ // 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(fileLocation);
+ }
+ 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;
- }
+ // 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 || destType == NATIVE_URI) && !this.correctOrientation &&
+ mimeType != null && mimeType.equalsIgnoreCase(getMimetypeForFormat(encodingType)))
+ {
+ this.callbackContext.success(uriString);
+ } 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 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 sending filename back
+ else if (destType == FILE_URI || destType == NATIVE_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(fileLocation);
}
- if (bitmap != null) {
- bitmap.recycle();
- bitmap = null;
- }
- System.gc();
}
+ if (bitmap != null) {
+ bitmap.recycle();
+ bitmap = null;
+ }
+ System.gc();
}
}
-
}
/**
@@ -821,7 +799,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
try {
if (this.allowEdit) {
Uri tmpFile = FileProvider.getUriForFile(cordova.getActivity(),
- applicationId + ".cordova.plugin.camera.provider",
+ applicationId + ".provider",
createCaptureFile(this.encodingType));
performCrop(tmpFile, destType, intent);
} else {
@@ -920,11 +898,34 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
private void writeUncompressedImage(Uri src, Uri dest) throws FileNotFoundException,
IOException {
- InputStream fis = FileHelper.getInputStreamFromUriString(src.toString(), cordova);
+ FileInputStream fis = new FileInputStream(FileHelper.stripFileProtocol(src.toString()));
writeUncompressedImage(fis, dest);
}
+ /**
+ * Create entry in media store for image
+ *
+ * @return uri
+ */
+ private Uri getUriFromMediaStore() {
+ ContentValues values = new ContentValues();
+ values.put(MediaStore.Images.Media.MIME_TYPE, JPEG_MIME_TYPE);
+ Uri uri;
+ try {
+ uri = this.cordova.getActivity().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
+ } catch (RuntimeException e) {
+ LOG.d(LOG_TAG, "Can't write to external media storage.");
+ try {
+ uri = this.cordova.getActivity().getContentResolver().insert(MediaStore.Images.Media.INTERNAL_CONTENT_URI, values);
+ } catch (RuntimeException ex) {
+ LOG.d(LOG_TAG, "Can't write to internal media storage.");
+ return null;
+ }
+ }
+ return uri;
+ }
+
/**
* Return a scaled and rotated bitmap based on the target width and height
*
@@ -1255,7 +1256,9 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
*/
public void processPicture(Bitmap bitmap, int encodingType) {
ByteArrayOutputStream jpeg_data = new ByteArrayOutputStream();
- CompressFormat compressFormat = getCompressFormatForEncodingType(encodingType);
+ CompressFormat compressFormat = encodingType == JPEG ?
+ CompressFormat.JPEG :
+ CompressFormat.PNG;
try {
if (bitmap.compress(compressFormat, mQuality, jpeg_data)) {
@@ -1343,11 +1346,11 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
state.putBoolean("saveToPhotoAlbum", this.saveToPhotoAlbum);
if (this.croppedUri != null) {
- state.putString(CROPPED_URI_KEY, this.croppedFilePath);
+ state.putString(CROPPED_URI_KEY, this.croppedUri.toString());
}
if (this.imageUri != null) {
- state.putString(IMAGE_URI_KEY, this.imageFilePath);
+ state.putString(IMAGE_URI_KEY, this.imageUri.getFileUri().toString());
}
return state;
@@ -1372,9 +1375,28 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
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.imageUri = new CordovaUri(Uri.parse(state.getString(IMAGE_URI_KEY)));
}
this.callbackContext = callbackContext;
}
+
+ /*
+ * This is dirty, but it does the job.
+ *
+ * Since the FilesProvider doesn't really provide you a way of getting a URL from the file,
+ * and since we actually need the Camera to create the file for us most of the time, we don't
+ * actually write the file, just generate the location based on a timestamp, we need to get it
+ * back from the Intent.
+ *
+ * However, the FilesProvider preserves the path, so we can at least write to it from here, since
+ * we own the context in this case.
+ */
+ private String getFileNameFromUri(Uri uri) {
+ String fullUri = uri.toString();
+ String partial_path = fullUri.split("external_files")[1];
+ File external_storage = Environment.getExternalStorageDirectory();
+ String path = external_storage.getAbsolutePath() + partial_path;
+ return path;
+ }
}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/CordovaUri.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/CordovaUri.java
new file mode 100644
index 000000000..56e388667
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/CordovaUri.java
@@ -0,0 +1,104 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT 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.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import androidx.core.content.FileProvider;
+
+import java.io.File;
+
+/*
+ * This class exists because Andorid FilesProvider doesn't work on Android 4.4.4 and below and throws
+ * weird errors. I'm not sure why writing to shared cache directories is somehow verboten, but it is
+ * and this error is irritating for a Compatibility library to have.
+ *
+ */
+
+public class CordovaUri {
+
+ private Uri androidUri;
+ private String fileName;
+ private Uri fileUri;
+
+ /*
+ * We always expect a FileProvider string to be passed in for the file that we create
+ *
+ */
+ CordovaUri (Uri inputUri)
+ {
+ //Determine whether the file is a content or file URI
+ if(inputUri.getScheme().equals("content"))
+ {
+ androidUri = inputUri;
+ fileName = getFileNameFromUri(androidUri);
+ fileUri = Uri.parse("file://" + fileName);
+ }
+ else
+ {
+ fileUri = inputUri;
+ fileName = FileHelper.stripFileProtocol(inputUri.toString());
+ }
+ }
+
+ public Uri getFileUri()
+ {
+ return fileUri;
+ }
+
+ public String getFilePath()
+ {
+ return fileName;
+ }
+
+ /*
+ * This only gets called by takePicture
+ */
+
+ public Uri getCorrectUri()
+ {
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
+ return androidUri;
+ else
+ return fileUri;
+ }
+
+ /*
+ * This is dirty, but it does the job.
+ *
+ * Since the FilesProvider doesn't really provide you a way of getting a URL from the file,
+ * and since we actually need the Camera to create the file for us most of the time, we don't
+ * actually write the file, just generate the location based on a timestamp, we need to get it
+ * back from the Intent.
+ *
+ * However, the FilesProvider preserves the path, so we can at least write to it from here, since
+ * we own the context in this case.
+ */
+
+ private String getFileNameFromUri(Uri uri) {
+ String fullUri = uri.toString();
+ String partial_path = fullUri.split("external_files")[1];
+ File external_storage = Environment.getExternalStorageDirectory();
+ String path = external_storage.getAbsolutePath() + partial_path;
+ return path;
+
+ }
+}
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
index a6e5574bf..edf165787
--- 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
@@ -50,7 +50,16 @@ public class FileHelper {
*/
@SuppressWarnings("deprecation")
public static String getRealPath(Uri uri, CordovaInterface cordova) {
- return FileHelper.getRealPathFromURI(cordova.getActivity(), uri);
+ String realPath = null;
+
+ if (Build.VERSION.SDK_INT < 11)
+ realPath = FileHelper.getRealPathFromURI_BelowAPI11(cordova.getActivity(), uri);
+
+ // SDK >= 11
+ else
+ realPath = FileHelper.getRealPathFromURI_API11_And_Above(cordova.getActivity(), uri);
+
+ return realPath;
}
/**
@@ -66,9 +75,11 @@ public class FileHelper {
}
@SuppressLint("NewApi")
- public static String getRealPathFromURI(final Context context, final Uri uri) {
+ public static String getRealPathFromURI_API11_And_Above(final Context context, final Uri uri) {
+
+ final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
- if (DocumentsContract.isDocumentUri(context, uri)) {
+ if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
@@ -225,7 +236,7 @@ public class FileHelper {
}
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
}
-
+
/**
* Returns the mime type of the data specified by the given URI string.
*
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
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
old mode 100755
new mode 100644
index 85546509f..2db87bdbd
--- 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
@@ -17,5 +17,5 @@
-->
<paths xmlns:android="http://schemas.android.com/apk/res/android">
- <cache-path name="cache_files" path="." />
-</paths>
+ <external-path name="external_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
index f0b5f7b97..2931a097d 100644
--- a/cordova/platforms/android/app/src/main/res/xml/config.xml
+++ b/cordova/platforms/android/app/src/main/res/xml/config.xml
@@ -1,5 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.tagspaces.mobile" 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="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>
@@ -27,16 +33,13 @@
<feature name="SocialSharing">
<param name="android-package" value="nl.xservices.plugins.SocialSharing" />
</feature>
- <feature name="Downloader">
- <param name="android-package" value="com.whebcraft.android.plugin.Downloader" />
- </feature>
- <feature name="Filebrowser">
- <param name="android-package" value="com.ourcodeworld.plugins.filebrowser.Filebrowser" />
- </feature>
<feature name="IntentShim">
<param name="android-package" value="com.darryncampbell.cordova.plugin.intent.IntentShim" />
<param name="onload" value="true" />
</feature>
+ <feature name="Chooser">
+ <param name="android-package" value="com.cyph.cordova.Chooser" />
+ </feature>
<name>TagSpaces</name>
<description>
Offline file organizer and browser with tagging support.
@@ -83,6 +86,12 @@
<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" />
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
new file mode 100644
index 000000000..24212697f
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/xml/mnk_file_path.xml
@@ -0,0 +1,6 @@
+<?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/gradle.properties b/cordova/platforms/android/gradle.properties
index f969c4500..904dd213f 100644
--- a/cordova/platforms/android/gradle.properties
+++ b/cordova/platforms/android/gradle.properties
@@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx2048m
android.useAndroidX=true
android.enableJetifier=true
cdvMinSdkVersion=22
-cdvTargetSdkVersion=29
+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
index 62d4c0535..f3d88b1c2 100644
Binary files a/cordova/platforms/android/gradle/wrapper/gradle-wrapper.jar and b/cordova/platforms/android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties b/cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties
index 4154807e5..1b16c34a7 100644
--- a/cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties
+++ b/cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/cordova/platforms/android/gradlew b/cordova/platforms/android/gradlew
index 4f906e0c8..2fe81a7d9 100755
--- a/cordova/platforms/android/gradlew
+++ b/cordova/platforms/android/gradlew
@@ -82,7 +82,6 @@ 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
@@ -130,7 +129,6 @@ fi
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
diff --git a/cordova/platforms/android/gradlew.bat b/cordova/platforms/android/gradlew.bat
index 5093609d5..9618d8d96 100644
--- a/cordova/platforms/android/gradlew.bat
+++ b/cordova/platforms/android/gradlew.bat
@@ -29,9 +29,6 @@ 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"
@@ -84,7 +81,6 @@ set CMD_LINE_ARGS=%*
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 %CMD_LINE_ARGS%
diff --git a/cordova/platforms/android/platform_www/cordova_plugins.js b/cordova/platforms/android/platform_www/cordova_plugins.js
index 1f6aa0de1..5bfda3c57 100644
--- a/cordova/platforms/android/platform_www/cordova_plugins.js
+++ b/cordova/platforms/android/platform_www/cordova_plugins.js
@@ -1,5 +1,21 @@
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
+ {
+ "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",
@@ -49,6 +65,14 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"CameraPopoverHandle"
]
},
+ {
+ "id": "cordova-plugin-chooser.Chooser",
+ "file": "plugins/cordova-plugin-chooser/www/chooser.js",
+ "pluginId": "cordova-plugin-chooser",
+ "clobbers": [
+ "chooser"
+ ]
+ },
{
"id": "cordova-plugin-file.DirectoryEntry",
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
@@ -244,22 +268,6 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"window.plugins.socialsharing"
]
},
- {
- "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": "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-darryncampbell-cordova-plugin-intent.IntentShim",
"file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
@@ -270,18 +278,19 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
}
];
module.exports.metadata = {
+ "com.ourcodeworld.plugins.Filebrowser": "1.0.0",
+ "com.whebcraft.cordova.plugin.downloader": "0.1.0",
+ "cordova-plugin-add-swift-support": "2.0.2",
+ "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-camera": "4.1.0",
+ "cordova-plugin-chooser": "1.3.1",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.4",
"cordova-plugin-whitelist": "1.3.4",
"es6-promise-plugin": "4.2.2",
- "cordova-plugin-x-socialsharing": "6.0.2",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "com.ourcodeworld.plugins.Filebrowser": "1.0.0",
- "cordova-plugin-add-swift-support": "2.0.2",
+ "cordova-plugin-x-socialsharing": "5.6.8",
"com-darryncampbell-cordova-plugin-intent": "2.0.0"
};
});
\ No newline at end of file
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
index 0fe4c6d03..4f4b046f1 100644
--- 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
@@ -27,14 +27,20 @@ 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 if possible */
+ /** 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
+ FILE_URI: 1,
+ /** Return native uri (eg. asset-library://... for iOS) */
+ NATIVE_URI: 2
},
/**
* @enum {number}
@@ -59,6 +65,9 @@ module.exports = {
/**
* @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}
*/
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-chooser/www/chooser.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-chooser/www/chooser.js
new file mode 100644
index 000000000..74a433887
--- /dev/null
+++ b/cordova/platforms/android/platform_www/plugins/cordova-plugin-chooser/www/chooser.js
@@ -0,0 +1,120 @@
+cordova.define("cordova-plugin-chooser.Chooser", function(require, exports, module) {
+/** @see sodiumutil */
+function from_base64 (sBase64, nBlocksSize) {
+ function _b64ToUint6 (nChr) {
+ return nChr > 64 && nChr < 91 ?
+ nChr - 65 :
+ nChr > 96 && nChr < 123 ?
+ nChr - 71 :
+ nChr > 47 && nChr < 58 ?
+ nChr + 4 :
+ nChr === 43 ?
+ 62 :
+ nChr === 47 ?
+ 63 :
+ 0;
+ }
+
+ var nInLen = sBase64.length;
+ var nOutLen = nBlocksSize ?
+ Math.ceil(((nInLen * 3 + 1) >> 2) / nBlocksSize) * nBlocksSize :
+ (nInLen * 3 + 1) >> 2;
+ var taBytes = new Uint8Array(nOutLen);
+
+ for (
+ var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0;
+ nInIdx < nInLen;
+ nInIdx++
+ ) {
+ nMod4 = nInIdx & 3;
+ nUint24 |= _b64ToUint6(sBase64.charCodeAt(nInIdx)) << (18 - 6 * nMod4);
+ if (nMod4 === 3 || nInLen - nInIdx === 1) {
+ for (
+ nMod3 = 0;
+ nMod3 < 3 && nOutIdx < nOutLen;
+ nMod3++, nOutIdx++
+ ) {
+ taBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255;
+ }
+ nUint24 = 0;
+ }
+ }
+
+ return taBytes;
+}
+
+function getFileInternal (
+ accept,
+ includeData,
+ successCallback,
+ failureCallback
+) {
+ if (typeof accept === 'function') {
+ failureCallback = successCallback;
+ successCallback = accept;
+ accept = undefined;
+ }
+
+ var result = new Promise(function (resolve, reject) {
+ cordova.exec(
+ function (json) {
+ if (json === 'RESULT_CANCELED') {
+ resolve();
+ return;
+ }
+
+ try {
+ var o = JSON.parse(json);
+
+ if (includeData) {
+ var base64Data = o.data.replace(
+ /[^A-Za-z0-9\+\/]/g,
+ ''
+ );
+
+ o.data = from_base64(base64Data);
+ o.dataURI =
+ 'data:' + o.mediaType + ';base64,' + base64Data;
+ }
+ else {
+ delete o.data;
+ }
+
+ resolve(o);
+ }
+ catch (err) {
+ reject(err);
+ }
+ },
+ reject,
+ 'Chooser',
+ 'getFile',
+ [
+ (typeof accept === 'string' ?
+ accept.toLowerCase().replace(/\s/g, '') :
+ undefined) || '*/*',
+ includeData
+ ]
+ );
+ });
+
+ if (typeof successCallback === 'function') {
+ result.then(successCallback);
+ }
+ if (typeof failureCallback === 'function') {
+ result.catch(failureCallback);
+ }
+
+ return result;
+}
+
+module.exports = {
+ getFile: function (accept, successCallback, failureCallback) {
+ return getFileInternal(accept, true, successCallback, failureCallback);
+ },
+ getFileMetadata: function (accept, successCallback, failureCallback) {
+ return getFileInternal(accept, false, successCallback, failureCallback);
+ }
+};
+
+});
diff --git a/cordova/platforms/android/project.properties b/cordova/platforms/android/project.properties
index 442493b34..ef5f114f1 100644
--- a/cordova/platforms/android/project.properties
+++ b/cordova/platforms/android/project.properties
@@ -11,8 +11,8 @@
target=android-29
android.library.reference.1=CordovaLib
android.library.reference.2=app
+cordova.gradle.include.1=com.ourcodeworld.plugins.Filebrowser/mobile-plugin.gradle
cordova.system.library.1=androidx.legacy:legacy-support-v4:1.0.0
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.gradle.include.1=com.ourcodeworld.plugins.Filebrowser/mobile-plugin.gradle
cordova.system.library.4=androidx.core:core:1.1.0
\ No newline at end of file
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
index a098be2b9..3021f8f57 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
+++ b/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
@@ -108,9 +108,11 @@
+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
{
+ BOOL isMainNavigation = [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]];
+
return (
navigationType == CDVWebViewNavigationTypeLinkClicked ||
- navigationType == CDVWebViewNavigationTypeLinkOther
+ (navigationType == CDVWebViewNavigationTypeLinkOther && isMainNavigation)
);
}
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
index 3324ed310..8b1ab479b 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
+++ b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
@@ -77,7 +77,7 @@
#define __CORDOVA_5_1_1 50101
#define __CORDOVA_6_0_0 60000
#define __CORDOVA_6_1_0 60100
-#define __CORDOVA_6_1_1 60101
+#define __CORDOVA_6_2_0 60200
/* coho:next-version,insert-before */
#define __CORDOVA_NA 99999 /* not available */
@@ -90,7 +90,7 @@
*/
#ifndef CORDOVA_VERSION_MIN_REQUIRED
/* coho:next-version-min-required,replace-after */
- #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_6_1_1
+ #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_6_2_0
#endif
/*
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
index 1cd84d09d..c074fa61c 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
+++ b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
@@ -26,6 +26,8 @@
@property (nonatomic, strong) CDVViewController* viewController;
+@property (nonatomic) CDVPlugin* schemePlugin;
+
- (instancetype)initWithVC:(CDVViewController *)controller;
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
index 6c88ceb69..333124c2a 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
+++ b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
@@ -21,6 +21,8 @@
#import "CDVURLSchemeHandler.h"
#import <MobileCoreServices/MobileCoreServices.h>
+#import <objc/message.h>
+
@implementation CDVURLSchemeHandler
@@ -39,50 +41,77 @@
NSURL * url = urlSchemeTask.request.URL;
NSString * stringToLoad = url.path;
NSString * scheme = url.scheme;
-
- if ([scheme isEqualToString:self.viewController.appScheme]) {
- if ([stringToLoad hasPrefix:@"/_app_file_"]) {
- startPath = [stringToLoad stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
- } else {
- if ([stringToLoad isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
- startPath = [startPath stringByAppendingPathComponent:self.viewController.startPage];
- } else {
- startPath = [startPath stringByAppendingPathComponent:stringToLoad];
+
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ /*
+ * Give plugins the chance to handle the url
+ */
+ BOOL anyPluginsResponded = NO;
+ BOOL handledRequest = NO;
+
+ NSDictionary *pluginObjects = [[vc pluginObjects] copy];
+ for (NSString* pluginName in pluginObjects) {
+ self.schemePlugin = [vc.pluginObjects objectForKey:pluginName];
+ SEL selector = NSSelectorFromString(@"overrideSchemeTask:");
+ if ([self.schemePlugin respondsToSelector:selector]) {
+ handledRequest = (((BOOL (*)(id, SEL, id <WKURLSchemeTask>))objc_msgSend)(self.schemePlugin, selector, urlSchemeTask));
+ if (handledRequest) {
+ anyPluginsResponded = YES;
+ break;
}
}
}
- NSError * fileError = nil;
- NSData * data = nil;
- if ([self isMediaExtension:url.pathExtension]) {
- data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
- }
- if (!data || fileError) {
- data = [[NSData alloc] initWithContentsOfFile:startPath];
- }
- NSInteger statusCode = 200;
- if (!data) {
- statusCode = 404;
- }
- NSURL * localUrl = [NSURL URLWithString:url.absoluteString];
- NSString * mimeType = [self getMimeType:url.pathExtension];
- id response = nil;
- if (data && [self isMediaExtension:url.pathExtension]) {
- response = [[NSURLResponse alloc] initWithURL:localUrl MIMEType:mimeType expectedContentLength:data.length textEncodingName:nil];
- } else {
- NSDictionary * headers = @{ @"Content-Type" : mimeType, @"Cache-Control": @"no-cache"};
- response = [[NSHTTPURLResponse alloc] initWithURL:localUrl statusCode:statusCode HTTPVersion:nil headerFields:headers];
- }
+ if (!anyPluginsResponded) {
+ if ([scheme isEqualToString:self.viewController.appScheme]) {
+ if ([stringToLoad hasPrefix:@"/_app_file_"]) {
+ startPath = [stringToLoad stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
+ } else {
+ if ([stringToLoad isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
+ startPath = [startPath stringByAppendingPathComponent:self.viewController.startPage];
+ } else {
+ startPath = [startPath stringByAppendingPathComponent:stringToLoad];
+ }
+ }
+ }
- [urlSchemeTask didReceiveResponse:response];
- [urlSchemeTask didReceiveData:data];
- [urlSchemeTask didFinish];
+ NSError * fileError = nil;
+ NSData * data = nil;
+ if ([self isMediaExtension:url.pathExtension]) {
+ data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
+ }
+ if (!data || fileError) {
+ data = [[NSData alloc] initWithContentsOfFile:startPath];
+ }
+ NSInteger statusCode = 200;
+ if (!data) {
+ statusCode = 404;
+ }
+ NSURL * localUrl = [NSURL URLWithString:url.absoluteString];
+ NSString * mimeType = [self getMimeType:url.pathExtension];
+ id response = nil;
+ if (data && [self isMediaExtension:url.pathExtension]) {
+ response = [[NSURLResponse alloc] initWithURL:localUrl MIMEType:mimeType expectedContentLength:data.length textEncodingName:nil];
+ } else {
+ NSDictionary * headers = @{ @"Content-Type" : mimeType, @"Cache-Control": @"no-cache"};
+ response = [[NSHTTPURLResponse alloc] initWithURL:localUrl statusCode:statusCode HTTPVersion:nil headerFields:headers];
+ }
+ [urlSchemeTask didReceiveResponse:response];
+ if (data) {
+ [urlSchemeTask didReceiveData:data];
+ }
+ [urlSchemeTask didFinish];
+ }
}
- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask
{
-
+ SEL selector = NSSelectorFromString(@"stopSchemeTask:");
+ if (self.schemePlugin != nil && [self.schemePlugin respondsToSelector:selector]) {
+ (((void (*)(id, SEL, id <WKURLSchemeTask>))objc_msgSend)(self.schemePlugin, selector, urlSchemeTask));
+ }
}
-(NSString *) getMimeType:(NSString *)fileExtension {
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
index 4b5e423a4..81c7128f1 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
+++ b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
@@ -37,6 +37,7 @@
}
@property (nonatomic, readonly, weak) IBOutlet UIView* webView;
+@property (nonatomic, readonly, strong) UIView* launchView;
@property (nonatomic, readonly, strong) NSMutableDictionary* pluginObjects;
@property (nonatomic, readonly, strong) NSDictionary* pluginsMap;
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
index 0d7eb8b7b..dcec9589e 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
+++ b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
@@ -521,6 +521,7 @@
webViewBounds.origin = self.view.bounds.origin;
UIView* view = [[UIView alloc] initWithFrame:webViewBounds];
+ [view setAlpha:0];
NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
if (launchStoryboardName != nil) {
@@ -767,7 +768,18 @@
self.webView.hidden = NO;
if ([self.settings cordovaBoolSettingForKey:@"AutoHideSplashScreen" defaultValue:YES]) {
- [self showLaunchScreen:NO];
+ CGFloat splashScreenDelaySetting = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
+
+ if (splashScreenDelaySetting == 0) {
+ [self showLaunchScreen: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 showLaunchScreen:NO];
+ }];
+ }
}
}
@@ -776,22 +788,16 @@
*/
- (void)showLaunchScreen:(BOOL)visible
{
- CGFloat splashScreenDelay = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
-
- // AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
CGFloat fadeSplashScreenDuration = [self.settings cordovaFloatSettingForKey:@"FadeSplashScreenDuration" defaultValue:250];
// Setting minimum value for fade to 0.25 seconds
fadeSplashScreenDuration = fadeSplashScreenDuration < 250 ? 250 : fadeSplashScreenDuration;
- // Divide by 1000 because config returns milliseconds and NSTimer takes seconds
- CGFloat delayToFade = (MAX(splashScreenDelay, fadeSplashScreenDuration) - fadeSplashScreenDuration)/1000;
+ // AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
CGFloat fadeDuration = fadeSplashScreenDuration/1000;
- [NSTimer scheduledTimerWithTimeInterval:delayToFade repeats:NO block:^(NSTimer * _Nonnull timer) {
- [UIView animateWithDuration:fadeDuration animations:^{
- [self.launchView setAlpha:(visible ? 1 : 0)];
- }];
+ [UIView animateWithDuration:fadeDuration animations:^{
+ [self.launchView setAlpha:(visible ? 1 : 0)];
}];
}
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.h
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h
rename to cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.h
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m
rename to cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
diff --git a/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 2ae1b42c8..f0958e478 100644
--- a/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -19,11 +19,17 @@
4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
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 */; };
+ 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 */; settings = {ATTRIBUTES = (Public, ); }; };
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 */; };
+ 4F56D83C254A2F2F0063F1D6 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */; };
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 */; };
@@ -233,8 +239,6 @@
children = (
4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */,
4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */,
- 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */,
- 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */,
4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */,
);
@@ -313,6 +317,8 @@
7ED95D241AB9029B008C4574 /* CDVTimer.h */,
7ED95D251AB9029B008C4574 /* CDVTimer.m */,
7ED95D2A1AB9029B008C4574 /* CDVViewController.h */,
+ 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */,
+ 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
7ED95D2B1AB9029B008C4574 /* CDVViewController.m */,
7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */,
7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */,
@@ -360,6 +366,7 @@
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 */,
@@ -367,6 +374,7 @@
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 */,
@@ -531,8 +539,12 @@
9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */,
9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */,
9052DE782150D040008E83D4 /* CDVPluginResult.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 */,
+ 4F56D83C254A2F2F0063F1D6 /* CDVURLSchemeHandler.m in Sources */,
9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */,
9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */,
9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */,
diff --git a/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist b/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 000000000..e3071f032
--- /dev/null
+++ b/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,19 @@
+<?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>SchemeUserState</key>
+ <dict>
+ <key>Cordova.xcscheme_^#shared#^_</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>1</integer>
+ </dict>
+ <key>CordovaLib.xcscheme_^#shared#^_</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>2</integer>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/cordova/platforms/ios/CordovaLib/VERSION b/cordova/platforms/ios/CordovaLib/VERSION
index f3b5af39e..6abaeb2f9 100644
--- a/cordova/platforms/ios/CordovaLib/VERSION
+++ b/cordova/platforms/ios/CordovaLib/VERSION
@@ -1 +1 @@
-6.1.1
+6.2.0
diff --git a/cordova/platforms/ios/CordovaLib/cordova.js b/cordova/platforms/ios/CordovaLib/cordova.js
index a837c75fc..37f329f54 100644
--- a/cordova/platforms/ios/CordovaLib/cordova.js
+++ b/cordova/platforms/ios/CordovaLib/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// 538a985db128858c0a0eb4dd40fb9c8e5433fc94
+// 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
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.1.1';
+var PLATFORM_VERSION_BUILD_LABEL = '6.2.0';
// file: src/scripts/require.js
var require;
var define;
diff --git a/cordova/platforms/ios/TagSpaces.xcodeproj/project.pbxproj b/cordova/platforms/ios/TagSpaces.xcodeproj/project.pbxproj
index 05e347650..d284621e6 100755
--- a/cordova/platforms/ios/TagSpaces.xcodeproj/project.pbxproj
+++ b/cordova/platforms/ios/TagSpaces.xcodeproj/project.pbxproj
@@ -14,25 +14,7 @@
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; };
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; };
6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; };
- FEEE928A4AD8491486721D6F /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBF0D06E7524DD2B755B392 /* Downloader.swift */; };
- E440D348BDA3438F975418AE /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FC47C5C190044ADAC8D3E9D /* CDVDevice.m */; };
- D986298F42AA477C8D8D9393 /* APPBackgroundMode.m in Sources */ = {isa = PBXBuildFile; fileRef = D09E5CBC43E245CC84794445 /* APPBackgroundMode.m */; };
- FA9D552FEF984337A83F9911 /* APPMethodMagic.m in Sources */ = {isa = PBXBuildFile; fileRef = C77734BC85074373AD93C0C0 /* APPMethodMagic.m */; };
- CA6DDDE6296644368F3E4856 /* appbeep.wav in Resources */ = {isa = PBXBuildFile; fileRef = C0B41EC0FBFD44DCA7972CC0 /* appbeep.wav */; };
- ADC52B768D704F5EB6367B7D /* UIImage+CropScaleOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 019019571F2C4210A9FC2DD8 /* UIImage+CropScaleOrientation.m */; };
- 2F394F41FB574ADF8DCE477F /* CDVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = 2618078CEAB34ECD9740FD7C /* CDVCamera.m */; };
- 43D378AD0BFE428AB9BCEDA5 /* CDVJpegHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 98572CF1A8F743E58EBAB213 /* CDVJpegHeaderWriter.m */; };
- CEDF9DA591994E5AA33897F1 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4FB6EA94C1640319E4505F6 /* ImageIO.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 9DC61920D4474E6AAA1B26CB /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EBC0DEF0CF484FEBA27B35CF /* CoreLocation.framework */; };
- 3625A4A520824A46B3A30A0E /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06C7177D461542E59A765874 /* AVFoundation.framework */; };
- 0889929684F04C01815B97C3 /* CDVFile.m in Sources */ = {isa = PBXBuildFile; fileRef = E6ACB2524D61425D94C9E7D8 /* CDVFile.m */; };
- 8B7A0639ED744B5597E95C75 /* CDVLocalFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = B024C0F6A76E4DD38F591A58 /* CDVLocalFilesystem.m */; };
- 2E0D51E94BAA42E3AE96DD69 /* CDVAssetLibraryFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6CB788D09840369BE3A9D9 /* CDVAssetLibraryFilesystem.m */; };
- DE02828B37C8472AB0064B73 /* FileOpener2.m in Sources */ = {isa = PBXBuildFile; fileRef = 7414BF1107AA4B99B2EB1896 /* FileOpener2.m */; };
- AE31B08700C04213BE757C8A /* NSString+SSURLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 85935FE0FA55478CB6632D9B /* NSString+SSURLEncoding.m */; };
- 64ACFF098DE5427D8BDA2928 /* SocialSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B106B5D2A6C4C49B3D7D3D7 /* SocialSharing.m */; };
- 44CE9D1DBFC145D88637C785 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AF14CDC14E54417B5FD10DE /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 409A640BA55545D3AC925C86 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5EC120F671184A47A55DF154 /* MessageUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ F833DAD9664D4D998385F691 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 092C2B0C2C7844CB9D043A41 /* Downloader.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -80,38 +62,7 @@
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "TagSpaces/config.xml"; sourceTree = "<group>"; };
- 9FBF0D06E7524DD2B755B392 /* Downloader.swift */ = {isa = PBXFileReference; name = "Downloader.swift"; path = "com.whebcraft.cordova.plugin.downloader/Downloader.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };
- 3FC47C5C190044ADAC8D3E9D /* CDVDevice.m */ = {isa = PBXFileReference; name = "CDVDevice.m"; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- E9CC37A961D842A0BBFBCAB6 /* CDVDevice.h */ = {isa = PBXFileReference; name = "CDVDevice.h"; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- D09E5CBC43E245CC84794445 /* APPBackgroundMode.m */ = {isa = PBXFileReference; name = "APPBackgroundMode.m"; path = "cordova-plugin-background-mode/APPBackgroundMode.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- C77734BC85074373AD93C0C0 /* APPMethodMagic.m */ = {isa = PBXFileReference; name = "APPMethodMagic.m"; path = "cordova-plugin-background-mode/APPMethodMagic.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 24D7A22ED2D44DDB94834E25 /* APPBackgroundMode.h */ = {isa = PBXFileReference; name = "APPBackgroundMode.h"; path = "cordova-plugin-background-mode/APPBackgroundMode.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- DCE6C8BE67FB49DB98D52FD4 /* APPMethodMagic.h */ = {isa = PBXFileReference; name = "APPMethodMagic.h"; path = "cordova-plugin-background-mode/APPMethodMagic.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- C0B41EC0FBFD44DCA7972CC0 /* appbeep.wav */ = {isa = PBXFileReference; name = "appbeep.wav"; path = "appbeep.wav"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
- 019019571F2C4210A9FC2DD8 /* UIImage+CropScaleOrientation.m */ = {isa = PBXFileReference; name = "UIImage+CropScaleOrientation.m"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 2618078CEAB34ECD9740FD7C /* CDVCamera.m */ = {isa = PBXFileReference; name = "CDVCamera.m"; path = "cordova-plugin-camera/CDVCamera.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 98572CF1A8F743E58EBAB213 /* CDVJpegHeaderWriter.m */ = {isa = PBXFileReference; name = "CDVJpegHeaderWriter.m"; path = "cordova-plugin-camera/CDVJpegHeaderWriter.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- DA443F9FC37B42B49A7055E0 /* UIImage+CropScaleOrientation.h */ = {isa = PBXFileReference; name = "UIImage+CropScaleOrientation.h"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 21B4C3B21ECD4CEEBFBA6480 /* CDVCamera.h */ = {isa = PBXFileReference; name = "CDVCamera.h"; path = "cordova-plugin-camera/CDVCamera.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 34745935869043DFB14130D9 /* CDVJpegHeaderWriter.h */ = {isa = PBXFileReference; name = "CDVJpegHeaderWriter.h"; path = "cordova-plugin-camera/CDVJpegHeaderWriter.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 1ABA0153297844929C5356CC /* CDVExif.h */ = {isa = PBXFileReference; name = "CDVExif.h"; path = "cordova-plugin-camera/CDVExif.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- F4FB6EA94C1640319E4505F6 /* ImageIO.framework */ = {isa = PBXFileReference; name = "ImageIO.framework"; path = "System/Library/Frameworks/ImageIO.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- EBC0DEF0CF484FEBA27B35CF /* CoreLocation.framework */ = {isa = PBXFileReference; name = "CoreLocation.framework"; path = "System/Library/Frameworks/CoreLocation.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- 06C7177D461542E59A765874 /* AVFoundation.framework */ = {isa = PBXFileReference; name = "AVFoundation.framework"; path = "System/Library/Frameworks/AVFoundation.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- E6ACB2524D61425D94C9E7D8 /* CDVFile.m */ = {isa = PBXFileReference; name = "CDVFile.m"; path = "cordova-plugin-file/CDVFile.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- B024C0F6A76E4DD38F591A58 /* CDVLocalFilesystem.m */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.m"; path = "cordova-plugin-file/CDVLocalFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- AC6CB788D09840369BE3A9D9 /* CDVAssetLibraryFilesystem.m */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.m"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 2F61736C7D3F445087B5437B /* CDVFile.h */ = {isa = PBXFileReference; name = "CDVFile.h"; path = "cordova-plugin-file/CDVFile.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 9DFA2C895A6A4872AC85D103 /* CDVLocalFilesystem.h */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.h"; path = "cordova-plugin-file/CDVLocalFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 15640AF0B0534C36B16E6BF5 /* CDVAssetLibraryFilesystem.h */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.h"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 7414BF1107AA4B99B2EB1896 /* FileOpener2.m */ = {isa = PBXFileReference; name = "FileOpener2.m"; path = "cordova-plugin-file-opener2/FileOpener2.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- CD4FFBCEA8CD4D13971CB6D2 /* FileOpener2.h */ = {isa = PBXFileReference; name = "FileOpener2.h"; path = "cordova-plugin-file-opener2/FileOpener2.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 85935FE0FA55478CB6632D9B /* 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; explicitFileType = undefined; includeInIndex = 0; };
- 5B106B5D2A6C4C49B3D7D3D7 /* SocialSharing.m */ = {isa = PBXFileReference; name = "SocialSharing.m"; path = "cordova-plugin-x-socialsharing/SocialSharing.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 185BCA5B0FC74FB5910AA368 /* 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; explicitFileType = undefined; includeInIndex = 0; };
- C8D59C392C574DBABF4899BD /* SocialSharing.h */ = {isa = PBXFileReference; name = "SocialSharing.h"; path = "cordova-plugin-x-socialsharing/SocialSharing.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 7AF14CDC14E54417B5FD10DE /* Social.framework */ = {isa = PBXFileReference; name = "Social.framework"; path = "System/Library/Frameworks/Social.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- 5EC120F671184A47A55DF154 /* MessageUI.framework */ = {isa = PBXFileReference; name = "MessageUI.framework"; path = "System/Library/Frameworks/MessageUI.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
+ 092C2B0C2C7844CB9D043A41 /* Downloader.swift */ = {isa = PBXFileReference; name = "Downloader.swift"; path = "com.whebcraft.cordova.plugin.downloader/Downloader.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -120,11 +71,6 @@
buildActionMask = 2147483647;
files = (
301BF552109A68D80062928A /* libCordova.a in Frameworks */,
- CEDF9DA591994E5AA33897F1 /* ImageIO.framework in Frameworks */,
- 9DC61920D4474E6AAA1B26CB /* CoreLocation.framework in Frameworks */,
- 3625A4A520824A46B3A30A0E /* AVFoundation.framework in Frameworks */,
- 44CE9D1DBFC145D88637C785 /* Social.framework in Frameworks */,
- 409A640BA55545D3AC925C86 /* MessageUI.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -187,7 +133,6 @@
3047A50E1AB8057F00498E2A /* config */,
8D1107310486CEB800E47090 /* TagSpaces-Info.plist */,
6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */,
- C0B41EC0FBFD44DCA7972CC0 /* appbeep.wav */,
);
name = Resources;
path = "TagSpaces/Resources";
@@ -196,11 +141,6 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
- F4FB6EA94C1640319E4505F6 /* ImageIO.framework */,
- EBC0DEF0CF484FEBA27B35CF /* CoreLocation.framework */,
- 06C7177D461542E59A765874 /* AVFoundation.framework */,
- 7AF14CDC14E54417B5FD10DE /* Social.framework */,
- 5EC120F671184A47A55DF154 /* MessageUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -227,32 +167,7 @@
307C750510C5A3420062BCA9 /* Plugins */ = {
isa = PBXGroup;
children = (
- 9FBF0D06E7524DD2B755B392 /* Downloader.swift */,
- 3FC47C5C190044ADAC8D3E9D /* CDVDevice.m */,
- E9CC37A961D842A0BBFBCAB6 /* CDVDevice.h */,
- D09E5CBC43E245CC84794445 /* APPBackgroundMode.m */,
- C77734BC85074373AD93C0C0 /* APPMethodMagic.m */,
- 24D7A22ED2D44DDB94834E25 /* APPBackgroundMode.h */,
- DCE6C8BE67FB49DB98D52FD4 /* APPMethodMagic.h */,
- 019019571F2C4210A9FC2DD8 /* UIImage+CropScaleOrientation.m */,
- 2618078CEAB34ECD9740FD7C /* CDVCamera.m */,
- 98572CF1A8F743E58EBAB213 /* CDVJpegHeaderWriter.m */,
- DA443F9FC37B42B49A7055E0 /* UIImage+CropScaleOrientation.h */,
- 21B4C3B21ECD4CEEBFBA6480 /* CDVCamera.h */,
- 34745935869043DFB14130D9 /* CDVJpegHeaderWriter.h */,
- 1ABA0153297844929C5356CC /* CDVExif.h */,
- E6ACB2524D61425D94C9E7D8 /* CDVFile.m */,
- B024C0F6A76E4DD38F591A58 /* CDVLocalFilesystem.m */,
- AC6CB788D09840369BE3A9D9 /* CDVAssetLibraryFilesystem.m */,
- 2F61736C7D3F445087B5437B /* CDVFile.h */,
- 9DFA2C895A6A4872AC85D103 /* CDVLocalFilesystem.h */,
- 15640AF0B0534C36B16E6BF5 /* CDVAssetLibraryFilesystem.h */,
- 7414BF1107AA4B99B2EB1896 /* FileOpener2.m */,
- CD4FFBCEA8CD4D13971CB6D2 /* FileOpener2.h */,
- 85935FE0FA55478CB6632D9B /* NSString+SSURLEncoding.m */,
- 5B106B5D2A6C4C49B3D7D3D7 /* SocialSharing.m */,
- 185BCA5B0FC74FB5910AA368 /* NSString+SSURLEncoding.h */,
- C8D59C392C574DBABF4899BD /* SocialSharing.h */,
+ 092C2B0C2C7844CB9D043A41 /* Downloader.swift */,
);
name = Plugins;
path = "TagSpaces/Plugins";
@@ -350,7 +265,6 @@
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */,
0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */,
6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */,
- CA6DDDE6296644368F3E4856 /* appbeep.wav in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -382,19 +296,7 @@
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
- FEEE928A4AD8491486721D6F /* Downloader.swift in Sources */,
- E440D348BDA3438F975418AE /* CDVDevice.m in Sources */,
- D986298F42AA477C8D8D9393 /* APPBackgroundMode.m in Sources */,
- FA9D552FEF984337A83F9911 /* APPMethodMagic.m in Sources */,
- ADC52B768D704F5EB6367B7D /* UIImage+CropScaleOrientation.m in Sources */,
- 2F394F41FB574ADF8DCE477F /* CDVCamera.m in Sources */,
- 43D378AD0BFE428AB9BCEDA5 /* CDVJpegHeaderWriter.m in Sources */,
- 0889929684F04C01815B97C3 /* CDVFile.m in Sources */,
- 8B7A0639ED744B5597E95C75 /* CDVLocalFilesystem.m in Sources */,
- 2E0D51E94BAA42E3AE96DD69 /* CDVAssetLibraryFilesystem.m in Sources */,
- DE02828B37C8472AB0064B73 /* FileOpener2.m in Sources */,
- AE31B08700C04213BE757C8A /* NSString+SSURLEncoding.m in Sources */,
- 64ACFF098DE5427D8BDA2928 /* SocialSharing.m in Sources */,
+ F833DAD9664D4D998385F691 /* Downloader.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -430,10 +332,7 @@
PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobile;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ VALIDATE_WORKSPACE = NO;
};
name = Debug;
};
@@ -456,9 +355,7 @@
PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobile;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
+ VALIDATE_WORKSPACE = NO;
};
name = Release;
};
@@ -502,10 +399,6 @@
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
WK_WEB_VIEW_ONLY = 1;
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
@@ -547,9 +440,6 @@
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
WK_WEB_VIEW_ONLY = 1;
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
};
name = Release;
};
diff --git a/cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 000000000..18d981003
--- /dev/null
+++ b/cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+<?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/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate b/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 000000000..a29bed694
Binary files /dev/null and b/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist b/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 000000000..3a4ef209b
--- /dev/null
+++ b/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,14 @@
+<?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>SchemeUserState</key>
+ <dict>
+ <key>TagSpaces.xcscheme_^#shared#^_</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.m b/cordova/platforms/ios/TagSpaces/Classes/MainViewController.m
index 24baca664..312a297cd 100644
--- a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.m
+++ b/cordova/platforms/ios/TagSpaces/Classes/MainViewController.m
@@ -74,7 +74,7 @@
- (void)viewDidLoad
{
[super viewDidLoad];
- // Do any additional setup after loading the view from its nib.
+ [self.launchView setAlpha:1];
}
@end
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h
deleted file mode 100644
index e7ed1e5a3..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m
deleted file mode 100644
index e0792cccc..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-background-mode/APPMethodMagic.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-background-mode/APPMethodMagic.h
deleted file mode 100644
index 84de79111..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-background-mode/APPMethodMagic.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-background-mode/APPMethodMagic.m
deleted file mode 100644
index cb9cc35f5..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-camera/CDVCamera.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-camera/CDVCamera.h
deleted file mode 100644
index f64f66c27..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-camera/CDVCamera.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-camera/CDVCamera.m
deleted file mode 100644
index bf02ca2e6..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-camera/CDVExif.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-camera/CDVExif.h
deleted file mode 100644
index 3e8adbd02..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h
deleted file mode 100644
index 3b43ef0b7..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m
deleted file mode 100644
index 4d3ea2443..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h
deleted file mode 100644
index 31bc42ff0..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m
deleted file mode 100644
index a66a5d88d..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-device/CDVDevice.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-device/CDVDevice.h
deleted file mode 100644
index a146d8829..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-device/CDVDevice.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-device/CDVDevice.m
deleted file mode 100644
index de535332f..000000000
--- a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-device/CDVDevice.m
+++ /dev/null
@@ -1,115 +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
-{
-#if TARGET_IPHONE_SIMULATOR
- NSString* platform = NSProcessInfo.processInfo.environment[@"SIMULATOR_MODEL_IDENTIFIER"];
-#else
- 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);
-#endif
- 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/TagSpaces/Plugins/cordova-plugin-file-opener2/FileOpener2.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file-opener2/FileOpener2.h
deleted file mode 100644
index f3014d07c..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-file-opener2/FileOpener2.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file-opener2/FileOpener2.m
deleted file mode 100644
index 716170543..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h
deleted file mode 100644
index e09e2250e..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m
deleted file mode 100644
index 8486b7be1..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-file/CDVFile.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVFile.h
deleted file mode 100644
index 987c66b5c..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-file/CDVFile.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVFile.m
deleted file mode 100644
index 59e7d6407..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.h
deleted file mode 100644
index a0186c853..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
deleted file mode 100644
index c340ce0cc..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h
deleted file mode 100644
index 696bac338..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m
deleted file mode 100644
index d72effa08..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h
deleted file mode 100644
index 0c7314505..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m b/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m
deleted file mode 100644
index 75c8b41bb..000000000
--- a/cordova/platforms/ios/TagSpaces/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/TagSpaces/Resources/appbeep.wav b/cordova/platforms/ios/TagSpaces/Resources/appbeep.wav
deleted file mode 100644
index 24a13d40e..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Resources/appbeep.wav and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/TagSpaces-Info.plist b/cordova/platforms/ios/TagSpaces/TagSpaces-Info.plist
index d79ba28fd..1616947ce 100644
--- a/cordova/platforms/ios/TagSpaces/TagSpaces-Info.plist
+++ b/cordova/platforms/ios/TagSpaces/TagSpaces-Info.plist
@@ -50,13 +50,5 @@
<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/TagSpaces/config.xml b/cordova/platforms/ios/TagSpaces/config.xml
index 2a1d44f6f..58650aa63 100644
--- a/cordova/platforms/ios/TagSpaces/config.xml
+++ b/cordova/platforms/ios/TagSpaces/config.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<widget id="org.tagspaces.mobile" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="org.tagspaces.mobile" 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>
@@ -28,27 +28,6 @@
<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="Camera">
- <param name="ios-package" value="CDVCamera" />
- </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>
<name>TagSpaces</name>
<description>
Offline file organizer and browser with tagging support.
@@ -79,7 +58,6 @@
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" />
<preference name="PaginationMode" value="unpaginated" />
- <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" />
diff --git a/cordova/platforms/ios/cordova/Api.js b/cordova/platforms/ios/cordova/Api.js
index a7b62b687..5532c19c8 100644
--- a/cordova/platforms/ios/cordova/Api.js
+++ b/cordova/platforms/ios/cordova/Api.js
@@ -26,7 +26,7 @@
* This workflow would not have the `package.json` file.
*/
// Coho updates this line
-const VERSION = '6.1.1';
+const VERSION = '6.2.0';
const fs = require('fs-extra');
const path = require('path');
@@ -354,52 +354,60 @@ Api.prototype.addPodSpecs = function (plugin, podSpecs, frameworkPods, installOp
events.emit('verbose', 'Adding pods since the plugin contained <podspecs>');
podSpecs.forEach(obj => {
// declarations
- Object.keys(obj.declarations).forEach(key => {
- if (obj.declarations[key] === 'true') {
- const declaration = Podfile.proofDeclaration(key);
+ if (obj.declarations) {
+ Object.keys(obj.declarations).forEach(key => {
+ if (obj.declarations[key] === 'true') {
+ const declaration = Podfile.proofDeclaration(key);
+ const podJson = {
+ declaration
+ };
+ const val = podsjsonFile.getDeclaration(declaration);
+ if (val) {
+ podsjsonFile.incrementDeclaration(declaration);
+ } else {
+ podJson.count = 1;
+ podsjsonFile.setJsonDeclaration(declaration, podJson);
+ podfileFile.addDeclaration(podJson.declaration);
+ }
+ }
+ });
+ }
+
+ // sources
+ if (obj.sources) {
+ Object.keys(obj.sources).forEach(key => {
const podJson = {
- declaration
+ source: obj.sources[key].source
};
- const val = podsjsonFile.getDeclaration(declaration);
+ const val = podsjsonFile.getSource(key);
if (val) {
- podsjsonFile.incrementDeclaration(declaration);
+ podsjsonFile.incrementSource(key);
} else {
podJson.count = 1;
- podsjsonFile.setJsonDeclaration(declaration, podJson);
- podfileFile.addDeclaration(podJson.declaration);
+ podsjsonFile.setJsonSource(key, podJson);
+ podfileFile.addSource(podJson.source);
}
- }
- });
- // sources
- Object.keys(obj.sources).forEach(key => {
- const podJson = {
- source: obj.sources[key].source
- };
- const val = podsjsonFile.getSource(key);
- if (val) {
- podsjsonFile.incrementSource(key);
- } else {
- podJson.count = 1;
- podsjsonFile.setJsonSource(key, podJson);
- podfileFile.addSource(podJson.source);
- }
- });
+ });
+ }
+
// libraries
- Object.keys(obj.libraries).forEach(key => {
- const podJson = Object.assign({}, obj.libraries[key]);
- if (podJson.spec) {
- podJson.spec = getVariableSpec(podJson.spec, installOptions);
- }
- const val = podsjsonFile.getLibrary(key);
- if (val) {
- events.emit('warn', `${plugin.id} depends on ${podJson.name}, which may conflict with another plugin. ${podJson.name}@${val.spec} is already installed and was not overwritten.`);
- podsjsonFile.incrementLibrary(key);
- } else {
- podJson.count = 1;
- podsjsonFile.setJsonLibrary(key, podJson);
- podfileFile.addSpec(podJson.name, podJson);
- }
- });
+ if (obj.libraries) {
+ Object.keys(obj.libraries).forEach(key => {
+ const podJson = Object.assign({}, obj.libraries[key]);
+ if (podJson.spec) {
+ podJson.spec = getVariableSpec(podJson.spec, installOptions);
+ }
+ const val = podsjsonFile.getLibrary(key);
+ if (val) {
+ events.emit('warn', `${plugin.id} depends on ${podJson.name}, which may conflict with another plugin. ${podJson.name}@${val.spec} is already installed and was not overwritten.`);
+ podsjsonFile.incrementLibrary(key);
+ } else {
+ podJson.count = 1;
+ podsjsonFile.setJsonLibrary(key, podJson);
+ podfileFile.addSpec(podJson.name, podJson);
+ }
+ });
+ }
});
}
diff --git a/cordova/platforms/ios/cordova/apple_ios_version b/cordova/platforms/ios/cordova/apple_ios_version
deleted file mode 100755
index 5fee9e852..000000000
--- a/cordova/platforms/ios/cordova/apple_ios_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 versions = require('./lib/versions.js');
-
-versions.get_apple_ios_version().catch(err => {
- console.log(err);
- process.exit(2);
-});
diff --git a/cordova/platforms/ios/cordova/apple_osx_version b/cordova/platforms/ios/cordova/apple_osx_version
deleted file mode 100755
index 062d8b7fb..000000000
--- a/cordova/platforms/ios/cordova/apple_osx_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 versions = require('./lib/versions.js');
-
-versions.get_apple_osx_version().catch(err => {
- console.log(err);
- process.exit(2);
-});
diff --git a/cordova/platforms/ios/cordova/apple_xcode_version b/cordova/platforms/ios/cordova/apple_xcode_version
deleted file mode 100755
index 4656e3851..000000000
--- a/cordova/platforms/ios/cordova/apple_xcode_version
+++ /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 versions = require('./lib/versions.js');
-
-versions.get_apple_xcode_version().then(
- version => {
- console.log(version);
- },
- err => {
- console.error(err);
- process.exit(2);
- }
-);
diff --git a/cordova/platforms/ios/cordova/check_reqs b/cordova/platforms/ios/cordova/check_reqs
deleted file mode 100755
index e46db6c82..000000000
--- a/cordova/platforms/ios/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 for help flag
-if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) > -1) {
- console.log('Usage: check_reqs or node check_reqs');
-} else {
- check_reqs.run().catch(err => {
- console.error('Failed to check requirements due to ' + err);
- process.exit(2);
- });
-}
diff --git a/cordova/platforms/ios/cordova/check_reqs.bat b/cordova/platforms/ios/cordova/check_reqs.bat
deleted file mode 100755
index 683914b88..000000000
--- a/cordova/platforms/ios/cordova/check_reqs.bat
+++ /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
-@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
-)
\ No newline at end of file
diff --git a/cordova/platforms/ios/cordova/lib/build.js b/cordova/platforms/ios/cordova/lib/build.js
index a72038756..ddcc4b6d0 100644
--- a/cordova/platforms/ios/cordova/lib/build.js
+++ b/cordova/platforms/ios/cordova/lib/build.js
@@ -71,6 +71,7 @@ function createProjectObject (projectPath, projectName) {
* @return {Promise}
*/
function getDefaultSimulatorTarget () {
+ events.emit('log', 'Select last emulator from list as default.');
return require('./listEmulatorBuildTargets').run()
.then(emulators => {
let targetEmulator;
diff --git a/cordova/platforms/ios/cordova/lib/check_reqs.js b/cordova/platforms/ios/cordova/lib/check_reqs.js
index 33dc684fc..83f5f6fa6 100644
--- a/cordova/platforms/ios/cordova/lib/check_reqs.js
+++ b/cordova/platforms/ios/cordova/lib/check_reqs.js
@@ -68,7 +68,14 @@ function os_platform_is_supported () {
* @return {Promise} Returns a promise either resolved or rejected
*/
module.exports.check_cocoapods = toolChecker => {
- return checkTool('pod', COCOAPODS_MIN_VERSION, COCOAPODS_NOT_FOUND_MESSAGE, 'CocoaPods');
+ if (os_platform_is_supported()) {
+ return checkTool('pod', COCOAPODS_MIN_VERSION, COCOAPODS_NOT_FOUND_MESSAGE, 'CocoaPods');
+ }
+
+ return Promise.resolve({
+ ignore: true,
+ ignoreMessage: `CocoaPods check and installation ignored on ${process.platform}`
+ });
};
/**
diff --git a/cordova/platforms/ios/cordova/lib/listEmulatorBuildTargets.js b/cordova/platforms/ios/cordova/lib/listEmulatorBuildTargets.js
index 73e35c05a..5b1bc2a78 100644
--- a/cordova/platforms/ios/cordova/lib/listEmulatorBuildTargets.js
+++ b/cordova/platforms/ios/cordova/lib/listEmulatorBuildTargets.js
@@ -17,7 +17,7 @@
under the License.
*/
-const { superspawn: { spawn } } = require('cordova-common');
+const { superspawn: { spawn }, events } = require('cordova-common');
/**
* Returns a list of available simulator build targets of the form
@@ -31,7 +31,8 @@ const { superspawn: { spawn } } = require('cordova-common');
*
*/
function listEmulatorBuildTargets () {
- return spawn('xcrun', ['simctl', 'list', '--json'])
+ events.emit('log', 'List simulator targets');
+ return spawn('xcrun', ['simctl', 'list', '--json'], { printCommand: true })
.then(output => JSON.parse(output))
.then(function (simInfo) {
var devices = simInfo.devices;
diff --git a/cordova/platforms/ios/cordova/lib/prepare.js b/cordova/platforms/ios/cordova/lib/prepare.js
index c98cb8f48..7badf9fa1 100644
--- a/cordova/platforms/ios/cordova/lib/prepare.js
+++ b/cordova/platforms/ios/cordova/lib/prepare.js
@@ -416,7 +416,7 @@ function getBackgroundColorDir (projectRoot, platformProjDir) {
}
function colorPreferenceToComponents (pref) {
- if (!pref || !pref.match(/^(#[0-9A-F]{3}|(0x|#)([0-9A-F]{2})?[0-9A-F]{6})$/)) {
+ if (!pref || !pref.match(/^(#[0-9A-Fa-f]{3}|(0x|#)([0-9A-Fa-f]{2})?[0-9A-Fa-f]{6})$/)) {
return {
platform: 'ios',
reference: 'systemBackgroundColor'
@@ -450,9 +450,9 @@ function colorPreferenceToComponents (pref) {
return {
'color-space': 'srgb',
components: {
- red: '0x' + red,
- green: '0x' + green,
- blue: '0x' + blue,
+ red: '0x' + red.toUpperCase(),
+ green: '0x' + green.toUpperCase(),
+ blue: '0x' + blue.toUpperCase(),
alpha: alpha.toFixed(3)
}
};
diff --git a/cordova/platforms/ios/frameworks.json b/cordova/platforms/ios/frameworks.json
deleted file mode 100644
index e430f8008..000000000
--- a/cordova/platforms/ios/frameworks.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "ImageIO.framework": 1,
- "CoreLocation.framework": 1,
- "AVFoundation.framework": 1,
- "Social.framework": 1,
- "MessageUI.framework": 1
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/ios.json b/cordova/platforms/ios/ios.json
index faf4fafe9..fbdd0b1a3 100644
--- a/cordova/platforms/ios/ios.json
+++ b/cordova/platforms/ios/ios.json
@@ -11,56 +11,6 @@
{
"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=\"Camera\"><param name=\"ios-package\" value=\"CDVCamera\" /></feature>",
- "count": 1
- },
- {
- "xml": "<preference name=\"CameraUsesGeolocation\" value=\"false\" />",
- "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
- }
- ]
- }
- },
- "*-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
}
]
}
@@ -68,58 +18,12 @@
}
},
"installed_plugins": {
- "com.ourcodeworld.plugins.Filebrowser": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
"com.whebcraft.cordova.plugin.downloader": {
"PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-add-swift-support": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-androidx-adapter": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-device": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-background-mode": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-camera": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-file": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-file-opener2": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "cordova-plugin-whitelist": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "es6-promise-plugin": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
- },
- "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.mobile"
- },
- "com-darryncampbell-cordova-plugin-intent": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
}
},
"dependent_plugins": {},
"modules": [
- {
- "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",
@@ -127,273 +31,9 @@
"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/ios/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.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": "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"
- ]
- },
- {
- "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.ourcodeworld.plugins.Filebrowser": "1.0.0",
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-add-swift-support": "2.0.2",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "cordova-plugin-device": "2.0.3",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-camera": "4.1.0",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.4",
- "cordova-plugin-whitelist": "1.3.4",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-x-socialsharing": "5.6.8",
- "com-darryncampbell-cordova-plugin-intent": "2.0.0"
+ "com.whebcraft.cordova.plugin.downloader": "0.1.0"
}
}
diff --git a/cordova/platforms/ios/platform_www/cordova.js b/cordova/platforms/ios/platform_www/cordova.js
index a837c75fc..37f329f54 100644
--- a/cordova/platforms/ios/platform_www/cordova.js
+++ b/cordova/platforms/ios/platform_www/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// 538a985db128858c0a0eb4dd40fb9c8e5433fc94
+// 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
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.1.1';
+var PLATFORM_VERSION_BUILD_LABEL = '6.2.0';
// file: src/scripts/require.js
var require;
var define;
diff --git a/cordova/platforms/ios/platform_www/cordova_plugins.js b/cordova/platforms/ios/platform_www/cordova_plugins.js
index 87ca27141..a5a788214 100644
--- a/cordova/platforms/ios/platform_www/cordova_plugins.js
+++ b/cordova/platforms/ios/platform_www/cordova_plugins.js
@@ -1,13 +1,5 @@
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
- {
- "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",
@@ -15,273 +7,9 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"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/ios/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.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": "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"
- ]
- },
- {
- "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.ourcodeworld.plugins.Filebrowser": "1.0.0",
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-add-swift-support": "2.0.2",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "cordova-plugin-device": "2.0.3",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-camera": "4.1.0",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.4",
- "cordova-plugin-whitelist": "1.3.4",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-x-socialsharing": "5.6.8",
- "com-darryncampbell-cordova-plugin-intent": "2.0.0"
+ "com.whebcraft.cordova.plugin.downloader": "0.1.0"
};
});
\ No newline at end of file
diff --git a/cordova/platforms/ios/platform_www/js/filebrowser.js b/cordova/platforms/ios/platform_www/js/filebrowser.js
deleted file mode 100644
index e809a8f84..000000000
--- a/cordova/platforms/ios/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/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.ourcodeworld.plugins.Filebrowser/www/filebrowser.js b/cordova/platforms/ios/platform_www/plugins/com.ourcodeworld.plugins.Filebrowser/www/filebrowser.js
deleted file mode 100644
index 2224917a4..000000000
--- a/cordova/platforms/ios/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/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/www/cordova.js b/cordova/platforms/ios/www/cordova.js
index a837c75fc..37f329f54 100644
--- a/cordova/platforms/ios/www/cordova.js
+++ b/cordova/platforms/ios/www/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// 538a985db128858c0a0eb4dd40fb9c8e5433fc94
+// 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
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.1.1';
+var PLATFORM_VERSION_BUILD_LABEL = '6.2.0';
// file: src/scripts/require.js
var require;
var define;
diff --git a/cordova/platforms/ios/www/cordova_plugins.js b/cordova/platforms/ios/www/cordova_plugins.js
index 87ca27141..a5a788214 100644
--- a/cordova/platforms/ios/www/cordova_plugins.js
+++ b/cordova/platforms/ios/www/cordova_plugins.js
@@ -1,13 +1,5 @@
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
- {
- "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",
@@ -15,273 +7,9 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"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/ios/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.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": "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"
- ]
- },
- {
- "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.ourcodeworld.plugins.Filebrowser": "1.0.0",
- "com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-add-swift-support": "2.0.2",
- "cordova-plugin-androidx-adapter": "1.1.3",
- "cordova-plugin-device": "2.0.3",
- "cordova-plugin-background-mode": "0.7.3",
- "cordova-plugin-camera": "4.1.0",
- "cordova-plugin-file": "6.0.2",
- "cordova-plugin-file-opener2": "3.0.4",
- "cordova-plugin-whitelist": "1.3.4",
- "es6-promise-plugin": "4.2.2",
- "cordova-plugin-x-socialsharing": "5.6.8",
- "com-darryncampbell-cordova-plugin-intent": "2.0.0"
+ "com.whebcraft.cordova.plugin.downloader": "0.1.0"
};
});
\ No newline at end of file
diff --git a/cordova/platforms/ios/www/js/filebrowser.js b/cordova/platforms/ios/www/js/filebrowser.js
deleted file mode 100644
index e809a8f84..000000000
--- a/cordova/platforms/ios/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/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.ourcodeworld.plugins.Filebrowser/www/filebrowser.js b/cordova/platforms/ios/www/plugins/com.ourcodeworld.plugins.Filebrowser/www/filebrowser.js
deleted file mode 100644
index 2224917a4..000000000
--- a/cordova/platforms/ios/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/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/android/mnk_file_path.xml b/cordova/res/android/mnk_file_path.xml
new file mode 100644
index 000000000..24212697f
--- /dev/null
+++ b/cordova/res/android/mnk_file_path.xml
@@ -0,0 +1,6 @@
+<?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/yarn.lock b/cordova/yarn.lock
index 16047825e..4de210e41 100644
--- a/cordova/yarn.lock
+++ b/cordova/yarn.lock
@@ -117,6 +117,11 @@ braces@^3.0.1:
dependencies:
fill-range "^7.0.1"
+com-darryncampbell-cordova-plugin-intent@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/com-darryncampbell-cordova-plugin-intent/-/com-darryncampbell-cordova-plugin-intent-2.0.0.tgz#1c0447656416294aeed21321cd7c60e09c9e3c06"
+ integrity sha512-4f5BAyhpiGVsuouj2cokZCb99RA8V4O5YZnwGMliceFCu35BQcQvC0VLW55jl+xVDLhVymomnaBiHSktKKnK4w==
+
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -155,7 +160,7 @@ cordova-common@^4.0.1, cordova-common@^4.0.2:
strip-bom "^4.0.0"
underscore "^1.9.2"
-cordova-ios@^6.1.1:
+cordova-ios@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/cordova-ios/-/cordova-ios-6.2.0.tgz#3aaec7376b9a202cdcaf28faab6a79823b04c519"
integrity sha512-sLjZg2QBI1SpQVwfe0MSn89YNVkBGLW9Q1vcFJBsqKBrhvoEOJ5Ytq0gwqdhgTOGzlwJUfxC6OHM3jcsRjtYrw==
@@ -171,9 +176,9 @@ cordova-ios@^6.1.1:
xcode "^3.0.1"
xml-escape "^1.1.0"
-"cordova-ourcodeworld-filebrowser@git+https://github.com/ourcodeworld/cordova-ourcodeworld-filebrowser.git":
+"cordova-ourcodeworld-filebrowser@git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git":
version "1.0.0"
- resolved "git+https://github.com/ourcodeworld/cordova-ourcodeworld-filebrowser.git#b4824ea23d9e359708207158420b43cd5e816790"
+ resolved "git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git#07b8d2298a53691913101da5f704cb11159aed70"
version "2.0.2"
@@ -192,11 +197,21 @@ cordova-plugin-androidx-adapter@^1.1.3:
q "^1.5.1"
recursive-readdir "^2.2.2"
+cordova-plugin-androidx@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/cordova-plugin-androidx/-/cordova-plugin-androidx-3.0.0.tgz#03785d95d1c0e3ab42a45dd36fd4132e44e162f7"
+ integrity sha512-niMnhcxKsu4/oKTUbL0jRAnh6/cdoIVxRxJqj3uEyv8CVOlAj1sWhX+9b1XiAo9+bejAM9BbA21YK0mChfbVTA==
+
cordova-plugin-background-mode@^0.7.3:
version "0.7.3"
resolved "https://registry.yarnpkg.com/cordova-plugin-background-mode/-/cordova-plugin-background-mode-0.7.3.tgz#066f92c99f403b3ed3d6fb91f281a0a7ccbc84ba"
integrity sha512-LsU1v7EgTUROaks+tcQ8TnMzVUcU/TwjDVwj2O/4e4aI2q2ldLGsiZorqKqfqvwh2HoIssmY73OwJk91hQi62w==
+cordova-plugin-camera@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/cordova-plugin-camera/-/cordova-plugin-camera-5.0.1.tgz#9e0e94a7d29b15e6708f186bf9e59a28fcc0ee53"
+ integrity sha512-9gXyZvI8u9KzsZuqmB8Yw+uheF+7f+usMAwvOMw7L7pqbykg+bm9US5zjhJbwit3A1cSblgZkpBafe5cFiMcTA==
+
cordova-plugin-device@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz#c2b41b7efd0455dd097f89356d85bfdd5dadeb0f"
@@ -217,6 +232,11 @@ cordova-plugin-whitelist@^1.3.4:
resolved "https://registry.yarnpkg.com/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz#31938545c7c3e7de35c20ab08c2c3afa06e8a3f9"
integrity sha512-EYC5eQFVkoYXq39l7tYKE6lEjHJ04mvTmKXxGL7quHLdFPfJMNzru/UYpn92AOfpl3PQaZmou78C7EgmFOwFQQ==
+cordova-plugin-x-socialsharing@^6.0.3:
+ version "6.0.3"
+ resolved "https://registry.yarnpkg.com/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-6.0.3.tgz#5ae9276a73f4201b7af8727219a6372ccc8ba2cd"
+ integrity sha512-pnrE2CXsz4G0n0WoFDAasLS1VT3nIsNpddvXgfpiqX3wyOlSjO2NdF+sjYaTvs1B+f7z8EWbYCHpCrgBQiMLIg==
+
cross-spawn@^7.0.0, cross-spawn@^7.0.1:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
diff --git a/package.json b/package.json
index 27f2558cd..46c0e0bcc 100644
--- a/package.json
+++ b/package.json
@@ -73,6 +73,9 @@
"run-ios-dev": "yarn prepare-cordova && yarn build-cordova-dev && cd cordova && cordova run ios && cd ..",
"cordova-list-emulators": "cd cordova && cordova run --list --emulator && cd ..",
"cordova-add-android": "cd cordova && cordova platform add android && cd ..",
+ "cordova-remove-android": "cd cordova && cordova platform remove android && cd ..",
+ "cordova-add-ios": "cd cordova && cordova platform add ios && cd ..",
+ "cordova-remove-ios": "cd cordova && cordova platform remove ios && cd ..",
"cordova-create-app": "cordova create ./cordova org.tagspaces.iosn TagSpaces",
"update-changelog": "git log v3.7.6..HEAD --no-merges --format=%B > CHANGELOG.TXT",
"update-changelog-pro": "cd extensions/pro && git log v3.7.6..HEAD --no-merges --format=%B > ../../CHANGELOG-PRO.TXT",
diff --git a/tests/e2e/hook.js b/tests/e2e/hook.js
index 46adbdc16..0baa62f3e 100644
--- a/tests/e2e/hook.js
+++ b/tests/e2e/hook.js
@@ -74,7 +74,7 @@ export async function startSpectronApp() {
'goog:chromeOptions': {
w3c: true,
args: chromeDriverArgs
- },
+ }
// pageLoadStrategy: 'normal'
},
// Warns when a deprecated command is used
diff --git a/tests/e2e/tag.e2e.js b/tests/e2e/tag.e2e.js
index d4de3ae07..10d7dd29d 100644
--- a/tests/e2e/tag.e2e.js
+++ b/tests/e2e/tag.e2e.js
@@ -205,7 +205,7 @@ describe('TST04 - Testing the tag library:', () => {
let colorStyle = await colorElem.getAttribute('style');
// const color = await colorElem.getCSSProperty('background');
const rgb2hex = require('rgb2hex');
- const hex = rgb2hex(colorStyle);// color.value);
+ const hex = rgb2hex(colorStyle); // color.value);
expect(hex.hex).toBe('#000000'); //'rgb(0,0,0)');
await clickOn('[data-tid=createTagGroupCancelButton]');