Skip to content

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

update cordova-android plugin && add take picture from camera

Stanimir Marinov711b269f75e3
diff --git a/app/components/menus/DirectoryMenu.js b/app/components/menus/DirectoryMenu.js
index b542d6654..7612ee644 100644
--- a/app/components/menus/DirectoryMenu.js
+++ b/app/components/menus/DirectoryMenu.js
@@ -37,8 +37,9 @@ import CreateDirectoryDialog from '../dialogs/CreateDirectoryDialog';
import RenameDirectoryDialog from '../dialogs/RenameDirectoryDialog';
import AppConfig from '../../config';
import i18n from '../../services/i18n';
-import { extractFileName, extractParentDirectoryPath } from '../../utils/paths'; // extractFileExtension
+import { extractFileName, extractParentDirectoryPath, normalizePath } from '../../utils/paths'; // extractFileExtension
import PlatformIO from '../../services/platform-io';
+import { formatDateTime4Tag } from '../../utils/misc';
type Props = {
open?: boolean,
@@ -139,16 +140,105 @@ class DirectoryMenu extends React.Component<Props, State> {
addExistingFile = () => {
this.props.onClose();
- if (this.fileInput) {
- this.fileInput.click();
- }
+ this.fileInput.click();
+ };
+
+ onFail = (message) => {
+ console.log('Camera Failed: ' + message);
+ };
+
+ onCameraSuccess = (imageURL) => {
+ window.resolveLocalFileSystemURL(imageURL, (fp) => {
+ this.moveFile(fp.nativeURL);
+ }, () => { console.log('Failed to get filesystem url'); });
+ // this.saveFile(imageURL); // 'data:image/jpeg;base64,' + imageData);
+ };
+
+ moveFile = (filePath) => {
+ const fileName = 'IMG_TS' + AppConfig.beginTagContainer + formatDateTime4Tag(new Date(), true) + AppConfig.endTagContainer + '.jpg';
+ const newFilePath =
+ normalizePath(this.props.directoryPath) +
+ AppConfig.dirSeparator +
+ fileName;
+
+ PlatformIO.renameFilePromise(filePath, newFilePath)
+ .then(() => {
+ this.props.showNotification(
+ 'File ' + newFilePath + ' successfully imported.',
+ 'default',
+ true
+ );
+ this.props.reflectCreateEntry(newFilePath, true);
+ return true;
+ })
+ .catch(error => {
+ // TODO showAlertDialog("Saving " + filePath + " failed.");
+ console.error('Save to file ' + newFilePath + ' failed ' + error);
+ this.props.showNotification(
+ 'Importing file ' + newFilePath + ' failed.',
+ 'error',
+ true
+ );
+ return true;
+ });
+ };
+
+ /* saveFile = (data) => {
+ const fileName = 'IMG' + AppConfig.beginTagContainer + formatDateTime4Tag(new Date(), true) + AppConfig.endTagContainer + '.jpg';
+ const filePath =
+ normalizePath(this.props.directoryPath) +
+ AppConfig.dirSeparator +
+ fileName;
+
+ PlatformIO.saveBinaryFilePromise(
+ filePath,
+ data,
+ true
+ )
+ .then(() => {
+ this.props.showNotification(
+ 'File ' + filePath + ' successfully imported.',
+ 'default',
+ true
+ );
+ this.props.reflectCreateEntry(filePath, true);
+ return true;
+ })
+ .catch(error => {
+ // TODO showAlertDialog("Saving " + filePath + " failed.");
+ console.error('Save to file ' + filePath + ' failed ' + error);
+ this.props.showNotification(
+ 'Importing file ' + filePath + ' failed.',
+ 'error',
+ true
+ );
+ return true;
+ });
+ }; */
+
+ loadImageLocal = () => {
+ this.props.onClose();
+ navigator.camera.getPicture(this.onCameraSuccess, this.onFail, {
+ destinationType: Camera.DestinationType.FILE_URI,
+ sourceType: Camera.PictureSourceType.PHOTOLIBRARY
+ });
+ };
+
+ cameraTakePicture = () => {
+ this.props.onClose();
+ navigator.camera.getPicture(this.onCameraSuccess, this.onFail, {
+ // quality: 50,
+ destinationType: Camera.DestinationType.FILE_URI, // DATA_URL, // Return base64 encoded string
+ // encodingType: Camera.EncodingType.JPEG,
+ mediaType: Camera.MediaType.PICTURE // ALLMEDIA
+ });
};
handleFileInputChange = (selection: Object) => {
// console.log("Selected File: "+JSON.stringify(selection.currentTarget.files[0]));
const file = selection.currentTarget.files[0];
const filePath =
- this.props.directoryPath +
+ normalizePath(this.props.directoryPath) +
AppConfig.dirSeparator +
decodeURIComponent(file.name);
@@ -325,6 +415,14 @@ class DirectoryMenu extends React.Component<Props, State> {
<ListItemText inset primary={i18n.t('core:showAddFileDialog')} />
</MenuItem>
)}
+ {AppConfig.isCordova && (
+ <MenuItem data-tid="takePicture" onClick={this.cameraTakePicture}>
+ <ListItemIcon>
+ <AddExistingFileIcon />
+ </ListItemIcon>
+ <ListItemText inset primary={i18n.t('core:cameraTakePicture')} />
+ </MenuItem>
+ )}
{!this.props.perspectiveMode && (
<Divider />
)}
diff --git a/app/config.js b/app/config.js
index a17b7ac6b..886276403 100644
--- a/app/config.js
+++ b/app/config.js
@@ -16,6 +16,8 @@
*
* @flow
*/
+const isCordovaiOS = /^file:\/{3}[^\/]/i.test(window.location.href) && /ios|iphone|ipod|ipad/i.test(navigator.userAgent);
+const isCordovaAndroid = document.URL.indexOf('file:///android_asset') === 0;
export default {
checkNewVersionURL: 'https://www.tagspaces.org/releases/tagspaces.json',
@@ -43,7 +45,8 @@ export default {
isWin: navigator.appVersion.includes('Win'),
isMacLike: navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i),
isWeb: (document.URL.startsWith('http') && !document.URL.startsWith('http://localhost:1212/')),
- isCordovaiOS: /^file:\/{3}[^\/]/i.test(window.location.href) && /ios|iphone|ipod|ipad/i.test(navigator.userAgent),
- isCordovaAndroid: (document.URL.indexOf('file:///android_asset') === 0),
+ isCordovaiOS,
+ isCordovaAndroid,
+ isCordova: isCordovaiOS || isCordovaAndroid,
dirSeparator: (navigator.appVersion.includes('Win') && !document.URL.startsWith('http')) ? '\\' : '/',
};
diff --git a/app/locales/en/core.json b/app/locales/en/core.json
index df8e42c4b..70c45e995 100644
--- a/app/locales/en/core.json
+++ b/app/locales/en/core.json
@@ -254,6 +254,7 @@
"fileName": "File Name",
"createTXTFile": "New Plain Text File",
"showAddFileDialog": "Add Existing File",
+ "cameraTakePicture": "Take Picture",
"deleteConfirmationTitle": "Confirm Delete",
"deleteConfirmationContent": "The selected entries will be permanently deleted. Are you sure?",
"changeBackgroundColor": "Change Background Color",
diff --git a/app/services/cordova-io.js b/app/services/cordova-io.js
index 551d4cde5..502a15383 100644
--- a/app/services/cordova-io.js
+++ b/app/services/cordova-io.js
@@ -714,10 +714,11 @@ export default class CordovaIO {
overWrite: boolean,
isRaw?: boolean
): Promise<*> => {
+ // eslint-disable-next-line no-param-reassign
+ filePath = this.normalizePath(filePath);
console.log('Saving file: ' + filePath);
return new Promise((resolve, reject) => {
let isFileNew = true;
- filePath = this.normalizePath(filePath);
// Checks if the file already exists
this.fsRoot.getFile(
filePath,
@@ -748,7 +749,7 @@ export default class CordovaIO {
};
if (isRaw) {
writer.write(content);
- } else if (content.indexOf(';base64,') > 0) {
+ } else if (typeof content === 'string' && content.indexOf(';base64,') > 0) {
const contentArray = content.split(';base64,');
const type =
contentArray.length > 1
@@ -845,7 +846,8 @@ export default class CordovaIO {
*/
copyFilePromise = (filePath: string, newFilePath: string): Promise<*> =>
new Promise((resolve, reject) => {
- const filePath = this.normalizePath(filePath);
+ // eslint-disable-next-line no-param-reassign
+ filePath = this.normalizePath(filePath);
const newFileName = newFilePath.substring(
newFilePath.lastIndexOf('/') + 1
);
@@ -905,6 +907,7 @@ export default class CordovaIO {
*/
renameFilePromise = (filePath: string, newFilePath: string): Promise<*> =>
new Promise((resolve, reject) => {
+ // eslint-disable-next-line no-param-reassign
filePath = this.normalizePath(filePath);
const newFileName = newFilePath.substring(newFilePath.lastIndexOf('/') + 1);
const newFileParentPath = this.normalizePath(
@@ -973,7 +976,7 @@ export default class CordovaIO {
extractParentDirectoryPath(dirPath) +
AppConfig.dirSeparator +
newDirName;
-
+ // eslint-disable-next-line no-param-reassign
dirPath = this.normalizePath(dirPath);
const newDirParentPath = this.normalizePath(
newDirPath.substring(0, newDirPath.lastIndexOf('/'))
diff --git a/cordova/config.xml b/cordova/config.xml
index a6e19d5ca..cd4cd7e73 100644
--- a/cordova/config.xml
+++ b/cordova/config.xml
@@ -28,5 +28,6 @@
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
- <engine name="android" spec="^7.1.4" />
+ <plugin name="cordova-plugin-camera" spec="~4.0.3" />
+ <engine name="android" spec="git+https://github.com/apache/cordova-android.git" />
</widget>
diff --git a/cordova/package.json b/cordova/package.json
index 45b92870d..ecbd00836 100644
--- a/cordova/package.json
+++ b/cordova/package.json
@@ -10,7 +10,8 @@
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"dependencies": {
- "cordova-android": "^7.1.4",
+ "cordova-android": "git+https://github.com/apache/cordova-android.git",
+ "cordova-plugin-camera": "^4.0.3",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-whitelist": "^1.3.3"
@@ -19,7 +20,8 @@
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-file": {},
- "cordova-plugin-device": {}
+ "cordova-plugin-device": {},
+ "cordova-plugin-camera": {}
},
"platforms": [
"android"
diff --git a/cordova/platforms/android/CordovaLib/build.gradle b/cordova/platforms/android/CordovaLib/build.gradle
index 28c5e5946..834617a93 100644
--- a/cordova/platforms/android/CordovaLib/build.gradle
+++ b/cordova/platforms/android/CordovaLib/build.gradle
@@ -24,15 +24,15 @@ ext {
buildscript {
repositories {
- maven {
- url "https://maven.google.com"
- }
+ google()
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ // The gradle plugin and the maven plugin have to be updated after each version of Android
+ // studio comes out
+ classpath 'com.android.tools.build:gradle:3.2.0'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
@@ -42,12 +42,11 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = 'org.apache.cordova'
-version = '7.1.2'
+version = '8.0.0-dev'
android {
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
- publishNonDefault true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@@ -94,9 +93,9 @@ install {
}
}
scm {
- connection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
- developerConnection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
- url 'https://git-wip-us.apache.org/repos/asf?p=cordova-android'
+ connection 'scm:git:https://github.com/apache/cordova-android.git'
+ developerConnection 'scm:git:[email protected]:apache/cordova-android.git'
+ url 'https://github.com/apache/cordova-android'
}
}
@@ -122,16 +121,16 @@ bintray {
name = 'cordova-android'
userOrg = 'cordova'
licenses = ['Apache-2.0']
- vcsUrl = 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
+ vcsUrl = 'https://github.com/apache/cordova-android'
websiteUrl = 'https://cordova.apache.org'
- issueTrackerUrl = 'https://issues.apache.org/jira/browse/CB'
+ issueTrackerUrl = 'https://github.com/apache/cordova-android/issues'
publicDownloadNumbers = true
licenses = ['Apache-2.0']
labels = ['android', 'cordova', 'phonegap']
version {
- name = '7.1.2'
+ name = '8.0.0-dev'
released = new Date()
- vcsTag = '7.1.2'
+ vcsTag = '8.0.0-dev'
}
}
}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
index 64d410ea2..306339837 100644
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
+++ b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
@@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
* are not expected to implement it.
*/
public interface CordovaWebView {
- public static final String CORDOVA_VERSION = "7.1.2";
+ public static final String CORDOVA_VERSION = "8.0.0-dev";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java
index fb99c3443..1db2e9554 100644
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java
+++ b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java
@@ -216,8 +216,10 @@ public class CordovaWebViewImpl implements CordovaWebView {
// TODO: What about params?
// Load new URL
loadUrlIntoView(url, true);
+ return;
} else {
LOG.w(TAG, "showWebPage: Refusing to load URL into webview since it is not in the <allow-navigation> whitelist. URL=" + url);
+ return;
}
}
if (!pluginManager.shouldOpenExternalUrl(url)) {
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java
index e384f8d74..3945cdd62 100755
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java
+++ b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java
@@ -43,6 +43,7 @@ public class CoreAndroid extends CordovaPlugin {
private BroadcastReceiver telephonyReceiver;
private CallbackContext messageChannel;
private PluginResult pendingResume;
+ private PluginResult pendingPause;
private final Object messageChannelLock = new Object();
/**
@@ -113,6 +114,10 @@ public class CoreAndroid extends CordovaPlugin {
else if (action.equals("messageChannel")) {
synchronized(messageChannelLock) {
messageChannel = callbackContext;
+ if (pendingPause != null) {
+ sendEventMessage(pendingPause);
+ pendingPause = null;
+ }
if (pendingResume != null) {
sendEventMessage(pendingResume);
pendingResume = null;
@@ -139,7 +144,7 @@ public class CoreAndroid extends CordovaPlugin {
public void clearCache() {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
- webView.clearCache(true);
+ webView.clearCache();
}
});
}
@@ -321,7 +326,19 @@ public class CoreAndroid extends CordovaPlugin {
} catch (JSONException e) {
LOG.e(TAG, "Failed to create event message", e);
}
- sendEventMessage(new PluginResult(PluginResult.Status.OK, obj));
+ PluginResult result = new PluginResult(PluginResult.Status.OK, obj);
+
+ if (messageChannel == null) {
+ LOG.i(TAG, "Request to send event before messageChannel initialised: " + action);
+ if ("pause".equals(action)) {
+ pendingPause = result;
+ } else if ("resume".equals(action)) {
+ // When starting normally onPause then onResume is called
+ pendingPause = null;
+ }
+ } else {
+ sendEventMessage(result);
+ }
}
private void sendEventMessage(PluginResult payload) {
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
index acf795fa6..3e5df513b 100644
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
+++ b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
@@ -58,7 +58,11 @@ class SystemCookieManager implements ICordovaCookieManager {
}
public void clearCookies() {
- cookieManager.removeAllCookie();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ cookieManager.removeAllCookies(null);
+ } else {
+ cookieManager.removeAllCookie();
+ }
}
public void flush() {
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java
index a27fc6af4..72846f0fc 100755
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java
+++ b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java
@@ -142,6 +142,7 @@ public class SystemWebChromeClient extends WebChromeClient {
* Handle database quota exceeded notification.
*/
@Override
+ @SuppressWarnings("deprecation")
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{
@@ -180,11 +181,13 @@ public class SystemWebChromeClient extends WebChromeClient {
// API level 7 is required for this, see if we could lower this using something else
@Override
+ @SuppressWarnings("deprecation")
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
parentEngine.getCordovaWebView().showCustomView(view, callback);
}
@Override
+ @SuppressWarnings("deprecation")
public void onHideCustomView() {
parentEngine.getCordovaWebView().hideCustomView();
}
diff --git a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java
index 0b6a577ea..616cef1ed 100755
--- a/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java
+++ b/cordova/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java
@@ -74,7 +74,8 @@ public class SystemWebViewClient extends WebViewClient {
* @param url The url to be loaded.
* @return true to override, false for default behavior
*/
- @Override
+ @Override
+ @SuppressWarnings("deprecation")
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return parentEngine.client.onNavigationAttempt(url);
}
@@ -186,6 +187,7 @@ public class SystemWebViewClient extends WebViewClient {
* @param failingUrl The url that failed to load.
*/
@Override
+ @SuppressWarnings("deprecation")
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
// Ignore error due to stopLoading().
if (!isCurrentlyLoading) {
@@ -316,6 +318,7 @@ public class SystemWebViewClient extends WebViewClient {
}
@Override
+ @SuppressWarnings("deprecation")
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
try {
// Check the against the whitelist and lock out access to the WebView directory
diff --git a/cordova/platforms/android/android.json b/cordova/platforms/android/android.json
index 1c729d224..c0fbf7475 100644
--- a/cordova/platforms/android/android.json
+++ b/cordova/platforms/android/android.json
@@ -9,15 +9,19 @@
"parents": {
"/*": [
{
- "xml": "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>",
+ "xml": "<feature name=\"Camera\"><param name=\"android-package\" value=\"org.apache.cordova.camera.CameraLauncher\" /></feature>",
"count": 1
},
{
- "xml": "<allow-navigation href=\"cdvfile:*\" />",
+ "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
"count": 1
},
{
- "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
+ "xml": "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>",
+ "count": 1
+ },
+ {
+ "xml": "<allow-navigation href=\"cdvfile:*\" />",
"count": 1
},
{
@@ -32,6 +36,12 @@
"/*": [
{
"xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
+ "count": 2
+ }
+ ],
+ "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
}
]
@@ -40,18 +50,61 @@
}
},
"installed_plugins": {
- "cordova-plugin-file": {
+ "cordova-plugin-camera": {
"PACKAGE_NAME": "org.tagspaces.mobile"
},
"cordova-plugin-device": {
"PACKAGE_NAME": "org.tagspaces.mobile"
},
+ "cordova-plugin-file": {
+ "PACKAGE_NAME": "org.tagspaces.mobile"
+ },
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "org.tagspaces.mobile"
}
},
"dependent_plugins": {},
"modules": [
+ {
+ "id": "cordova-plugin-camera.Camera",
+ "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "Camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverOptions",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.camera",
+ "file": "plugins/cordova-plugin-camera/www/Camera.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "navigator.camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverHandle",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverHandle.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverHandle"
+ ]
+ },
+ {
+ "id": "cordova-plugin-device.device",
+ "file": "plugins/cordova-plugin-device/www/device.js",
+ "pluginId": "cordova-plugin-device",
+ "clobbers": [
+ "device"
+ ]
+ },
{
"id": "cordova-plugin-file.DirectoryEntry",
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
@@ -224,19 +277,12 @@
"cordova"
],
"runs": true
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
}
],
"plugin_metadata": {
- "cordova-plugin-file": "6.0.1",
+ "cordova-plugin-camera": "4.0.3",
"cordova-plugin-device": "2.0.2",
+ "cordova-plugin-file": "6.0.1",
"cordova-plugin-whitelist": "1.3.3"
}
}
\ No newline at end of file
diff --git a/cordova/platforms/android/app/build.gradle b/cordova/platforms/android/app/build.gradle
index a1ea273bf..802d9bfdc 100644
--- a/cordova/platforms/android/app/build.gradle
+++ b/cordova/platforms/android/app/build.gradle
@@ -22,33 +22,32 @@ apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
- maven {
- url "https://maven.google.com"
- }
+ google()
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.android.tools.build:gradle:3.2.0'
}
}
// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
repositories {
- mavenCentral();
+ mavenCentral()
jcenter()
}
}
task wrapper(type: Wrapper) {
- gradleVersion = '4.1.0'
+ gradleVersion = '4.6.0'
}
// Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties.
// Refer to: http://www.gradle.org/docs/current/userguide/tutorial_this_and_that.html
ext {
apply from: '../CordovaLib/cordova.gradle'
+
// The value for android.compileSdkVersion.
if (!project.hasProperty('cdvCompileSdkVersion')) {
cdvCompileSdkVersion = null;
@@ -69,7 +68,7 @@ ext {
if (!project.hasProperty('cdvBuildMultipleApks')) {
cdvBuildMultipleApks = null
}
- // Whether to append a 0 "abi digit" to versionCode when only a single APK is build
+ // Whether to append a 0 "abi digit" to versionCode when only a single APK is build
if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) {
cdvVersionCodeForceAbiDigit = null
}
@@ -93,11 +92,16 @@ ext {
// PLUGIN GRADLE EXTENSIONS START
// PLUGIN GRADLE EXTENSIONS END
-def hasBuildExtras = file('build-extras.gradle').exists()
-if (hasBuildExtras) {
+def hasBuildExtras1 = file('build-extras.gradle').exists()
+if (hasBuildExtras1) {
apply from: 'build-extras.gradle'
}
+def hasBuildExtras2 = file('../build-extras.gradle').exists()
+if (hasBuildExtras2) {
+ apply from: '../build-extras.gradle'
+}
+
// Set property defaults after extension .gradle files.
if (ext.cdvCompileSdkVersion == null) {
ext.cdvCompileSdkVersion = privateHelpers.getProjectTarget()
@@ -117,7 +121,7 @@ if (ext.cdvReleaseSigningPropertiesFile == null && file('../release-signing.prop
// Cast to appropriate types.
ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean();
ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean();
-ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : defaultMinSdkVersion
+ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? defaultMinSdkVersion : Integer.parseInt('' + cdvMinSdkVersion)
ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode)
def computeBuildTargetName(debugBuild) {
@@ -140,24 +144,25 @@ cdvBuildRelease.dependsOn {
return computeBuildTargetName(false)
}
-task cdvPrintProps << {
- println('cdvCompileSdkVersion=' + cdvCompileSdkVersion)
- println('cdvBuildToolsVersion=' + cdvBuildToolsVersion)
- println('cdvVersionCode=' + cdvVersionCode)
- println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit)
- println('cdvMinSdkVersion=' + cdvMinSdkVersion)
- println('cdvBuildMultipleApks=' + cdvBuildMultipleApks)
- println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile)
- println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile)
- println('cdvBuildArch=' + cdvBuildArch)
- println('computedVersionCode=' + android.defaultConfig.versionCode)
- android.productFlavors.each { flavor ->
- println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode)
+task cdvPrintProps {
+ doLast {
+ println('cdvCompileSdkVersion=' + cdvCompileSdkVersion)
+ println('cdvBuildToolsVersion=' + cdvBuildToolsVersion)
+ println('cdvVersionCode=' + cdvVersionCode)
+ println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit)
+ println('cdvMinSdkVersion=' + cdvMinSdkVersion)
+ println('cdvBuildMultipleApks=' + cdvBuildMultipleApks)
+ println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile)
+ println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile)
+ println('cdvBuildArch=' + cdvBuildArch)
+ println('computedVersionCode=' + android.defaultConfig.versionCode)
+ android.productFlavors.each { flavor ->
+ println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode)
+ }
}
}
android {
-
defaultConfig {
versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package")
@@ -174,10 +179,11 @@ android {
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
- //This code exists for Crosswalk and other Native APIs.
- //By default, we multiply the existing version code in the Android Manifest by 10 and
- //add a number for each architecture. If you are not using Crosswalk or SQLite, you can
- //ignore this chunk of code, and your version codes will be respected.
+ // This code exists for Crosswalk and other Native APIs.
+ // By default, we multiply the existing version code in the
+ // Android Manifest by 10 and add a number for each architecture.
+ // If you are not using Crosswalk or SQLite, you can
+ // ignore this chunk of code, and your version codes will be respected.
if (Boolean.valueOf(cdvBuildMultipleApks)) {
flavorDimensions "default"
@@ -243,6 +249,7 @@ android {
}
addSigningProps(cdvReleaseSigningPropertiesFile, signingConfigs.release)
}
+
if (cdvDebugSigningPropertiesFile) {
addSigningProps(cdvDebugSigningPropertiesFile, signingConfigs.debug)
}
@@ -259,6 +266,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: ":CordovaLib"))
+ implementation "com.android.support:support-v4:24.1.1+"
// SUB-PROJECT DEPENDENCIES END
}
diff --git a/cordova/platforms/android/app/src/main/AndroidManifest.xml b/cordova/platforms/android/app/src/main/AndroidManifest.xml
index ff707efe6..1540cdf99 100644
--- a/cordova/platforms/android/app/src/main/AndroidManifest.xml
+++ b/cordova/platforms/android/app/src/main/AndroidManifest.xml
@@ -2,13 +2,16 @@
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="org.tagspaces.mobile" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
- <application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
- <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:resizeableActivity="true" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
+ <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
+ <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+ <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>
</application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
diff --git a/cordova/platforms/android/app/src/main/assets/www/cordova-js-src/exec.js b/cordova/platforms/android/app/src/main/assets/www/cordova-js-src/exec.js
index f73d87a12..39e8c97ee 100644
--- a/cordova/platforms/android/app/src/main/assets/www/cordova-js-src/exec.js
+++ b/cordova/platforms/android/app/src/main/assets/www/cordova-js-src/exec.js
@@ -109,17 +109,6 @@ function androidExec(success, fail, service, action, args) {
}
androidExec.init = function() {
- //CB-11828
- //This failsafe checks the version of Android and if it's Jellybean, it switches it to
- //using the Online Event bridge for communicating from Native to JS
- //
- //It's ugly, but it's necessary.
- var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
- var version_code = check && check[0].match(/4.[0-3].*/);
- if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
- nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
- }
-
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
channel.onNativeReady.fire();
};
diff --git a/cordova/platforms/android/app/src/main/assets/www/cordova.js b/cordova/platforms/android/app/src/main/assets/www/cordova.js
index a9f8bb0dd..4cdb1e3e5 100644
--- a/cordova/platforms/android/app/src/main/assets/www/cordova.js
+++ b/cordova/platforms/android/app/src/main/assets/www/cordova.js
@@ -1,5 +1,5 @@
// Platform: android
-// 9e8e1b716252c4a08abcd31a13013b868d6f4141
+// e040d9e9343d5f27dd4f67616660b33b92a82ff7
/*
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 = '7.1.2';
+var PLATFORM_VERSION_BUILD_LABEL = '8.0.0-dev';
// file: src/scripts/require.js
/* jshint -W079 */
@@ -975,17 +975,6 @@ function androidExec(success, fail, service, action, args) {
}
androidExec.init = function() {
- //CB-11828
- //This failsafe checks the version of Android and if it's Jellybean, it switches it to
- //using the Online Event bridge for communicating from Native to JS
- //
- //It's ugly, but it's necessary.
- var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
- var version_code = check && check[0].match(/4.[0-3].*/);
- if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
- nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
- }
-
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
channel.onNativeReady.fire();
};
@@ -2186,4 +2175,4 @@ window.cordova = require('cordova');
require('cordova/init');
-})();
+})();
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/assets/www/cordova_plugins.js b/cordova/platforms/android/app/src/main/assets/www/cordova_plugins.js
index 387eea4c7..12711ac06 100644
--- a/cordova/platforms/android/app/src/main/assets/www/cordova_plugins.js
+++ b/cordova/platforms/android/app/src/main/assets/www/cordova_plugins.js
@@ -1,193 +1,223 @@
cordova.define('cordova/plugin_list', function(require, exports, module) {
-module.exports = [
- {
- "id": "cordova-plugin-file.DirectoryEntry",
- "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryReader",
- "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryReader"
- ]
- },
- {
- "id": "cordova-plugin-file.Entry",
- "file": "plugins/cordova-plugin-file/www/Entry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Entry"
- ]
- },
- {
- "id": "cordova-plugin-file.File",
- "file": "plugins/cordova-plugin-file/www/File.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.File"
- ]
- },
- {
- "id": "cordova-plugin-file.FileEntry",
- "file": "plugins/cordova-plugin-file/www/FileEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.FileError",
- "file": "plugins/cordova-plugin-file/www/FileError.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileError"
- ]
- },
- {
- "id": "cordova-plugin-file.FileReader",
- "file": "plugins/cordova-plugin-file/www/FileReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileReader"
- ]
- },
- {
- "id": "cordova-plugin-file.FileSystem",
- "file": "plugins/cordova-plugin-file/www/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadOptions",
- "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadOptions"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadResult",
- "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadResult"
- ]
- },
- {
- "id": "cordova-plugin-file.FileWriter",
- "file": "plugins/cordova-plugin-file/www/FileWriter.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileWriter"
- ]
- },
- {
- "id": "cordova-plugin-file.Flags",
- "file": "plugins/cordova-plugin-file/www/Flags.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Flags"
- ]
- },
- {
- "id": "cordova-plugin-file.LocalFileSystem",
- "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.LocalFileSystem"
- ],
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.Metadata",
- "file": "plugins/cordova-plugin-file/www/Metadata.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Metadata"
- ]
- },
- {
- "id": "cordova-plugin-file.ProgressEvent",
- "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.ProgressEvent"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems",
- "file": "plugins/cordova-plugin-file/www/fileSystems.js",
- "pluginId": "cordova-plugin-file"
- },
- {
- "id": "cordova-plugin-file.requestFileSystem",
- "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.requestFileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.resolveLocalFileSystemURI",
- "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.isChrome",
- "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.androidFileSystem",
- "file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems-roots",
- "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.fileSystemPaths",
- "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "cordova"
- ],
- "runs": true
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
- }
-];
-module.exports.metadata =
-// TOP OF METADATA
-{
- "cordova-plugin-file": "6.0.1",
- "cordova-plugin-device": "2.0.2",
- "cordova-plugin-whitelist": "1.3.3"
-};
-// BOTTOM OF METADATA
+ module.exports = [
+ {
+ "id": "cordova-plugin-camera.Camera",
+ "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "Camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverOptions",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.camera",
+ "file": "plugins/cordova-plugin-camera/www/Camera.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "navigator.camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverHandle",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverHandle.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverHandle"
+ ]
+ },
+ {
+ "id": "cordova-plugin-device.device",
+ "file": "plugins/cordova-plugin-device/www/device.js",
+ "pluginId": "cordova-plugin-device",
+ "clobbers": [
+ "device"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.DirectoryEntry",
+ "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.DirectoryEntry"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.DirectoryReader",
+ "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.DirectoryReader"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.Entry",
+ "file": "plugins/cordova-plugin-file/www/Entry.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Entry"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.File",
+ "file": "plugins/cordova-plugin-file/www/File.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.File"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileEntry",
+ "file": "plugins/cordova-plugin-file/www/FileEntry.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileEntry"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileError",
+ "file": "plugins/cordova-plugin-file/www/FileError.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileError"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileReader",
+ "file": "plugins/cordova-plugin-file/www/FileReader.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileReader"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileSystem",
+ "file": "plugins/cordova-plugin-file/www/FileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileSystem"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileUploadOptions",
+ "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileUploadOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileUploadResult",
+ "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileUploadResult"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileWriter",
+ "file": "plugins/cordova-plugin-file/www/FileWriter.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileWriter"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.Flags",
+ "file": "plugins/cordova-plugin-file/www/Flags.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Flags"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.LocalFileSystem",
+ "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.LocalFileSystem"
+ ],
+ "merges": [
+ "window"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.Metadata",
+ "file": "plugins/cordova-plugin-file/www/Metadata.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Metadata"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.ProgressEvent",
+ "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.ProgressEvent"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.fileSystems",
+ "file": "plugins/cordova-plugin-file/www/fileSystems.js",
+ "pluginId": "cordova-plugin-file"
+ },
+ {
+ "id": "cordova-plugin-file.requestFileSystem",
+ "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.requestFileSystem"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.resolveLocalFileSystemURI",
+ "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "window"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.isChrome",
+ "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
+ "pluginId": "cordova-plugin-file",
+ "runs": true
+ },
+ {
+ "id": "cordova-plugin-file.androidFileSystem",
+ "file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "FileSystem"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.fileSystems-roots",
+ "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
+ "pluginId": "cordova-plugin-file",
+ "runs": true
+ },
+ {
+ "id": "cordova-plugin-file.fileSystemPaths",
+ "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "cordova"
+ ],
+ "runs": true
+ }
+ ];
+ module.exports.metadata = {
+ "cordova-plugin-camera": "4.0.3",
+ "cordova-plugin-device": "2.0.2",
+ "cordova-plugin-file": "6.0.1",
+ "cordova-plugin-whitelist": "1.3.3"
+ };
});
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/Camera.js b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/Camera.js
new file mode 100644
index 000000000..3f614ec80
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/Camera.js
@@ -0,0 +1,188 @@
+cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck');
+var exec = require('cordova/exec');
+var Camera = require('./Camera');
+// XXX: commented out
+// CameraPopoverHandle = require('./CameraPopoverHandle');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * @exports camera
+ */
+var cameraExport = {};
+
+// Tack on the Camera Constants to the base camera plugin.
+for (var key in Camera) {
+ cameraExport[key] = Camera[key];
+}
+
+/**
+ * Callback function that provides an error message.
+ * @callback module:camera.onError
+ * @param {string} message - The message is provided by the device's native code.
+ */
+
+/**
+ * Callback function that provides the image data.
+ * @callback module:camera.onSuccess
+ * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
+ * @example
+ * // Show image
+ * //
+ * function cameraCallback(imageData) {
+ * var image = document.getElementById('myImage');
+ * image.src = "data:image/jpeg;base64," + imageData;
+ * }
+ */
+
+/**
+ * Optional parameters to customize the camera settings.
+ * * [Quirks](#CameraOptions-quirks)
+ * @typedef module:camera.CameraOptions
+ * @type {Object}
+ * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
+ * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
+ * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
+ * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
+ * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
+ * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
+ * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
+ * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
+ * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
+ * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
+ * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
+ * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
+ */
+
+/**
+ * @description Takes a photo using the camera, or retrieves a photo from the device's
+ * image gallery. The image is passed to the success callback as a
+ * Base64-encoded `String`, or as the URI for the image file.
+ *
+ * The `camera.getPicture` function opens the device's default camera
+ * application that allows users to snap pictures by default - this behavior occurs,
+ * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
+ * Once the user snaps the photo, the camera application closes and the application is restored.
+ *
+ * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
+ * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
+ * that allows users to select an existing image.
+ *
+ * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
+ * one of the following formats, depending on the specified
+ * `cameraOptions`:
+ *
+ * - A `String` containing the Base64-encoded photo image.
+ * - A `String` representing the image file location on local storage (default).
+ *
+ * You can do whatever you want with the encoded image or URI, for
+ * example:
+ *
+ * - Render the image in an `<img>` tag, as in the example below
+ * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
+ * - Post the data to a remote server
+ *
+ * __NOTE__: Photo resolution on newer devices is quite good. Photos
+ * selected from the device's gallery are not downscaled to a lower
+ * quality, even if a `quality` parameter is specified. To avoid common
+ * memory problems, set `Camera.destinationType` to `FILE_URI` rather
+ * than `DATA_URL`.
+ *
+ * __Supported Platforms__
+ *
+ * - Android
+ * - BlackBerry
+ * - Browser
+ * - Firefox
+ * - FireOS
+ * - iOS
+ * - Windows
+ * - WP8
+ * - Ubuntu
+ *
+ * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
+ *
+ * @example
+ * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
+ * @param {module:camera.onSuccess} successCallback
+ * @param {module:camera.onError} errorCallback
+ * @param {module:camera.CameraOptions} options CameraOptions
+ */
+cameraExport.getPicture = function (successCallback, errorCallback, options) {
+ argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
+ options = options || {};
+ var getValue = argscheck.getValue;
+
+ var quality = getValue(options.quality, 50);
+ var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
+ var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
+ var targetWidth = getValue(options.targetWidth, -1);
+ var targetHeight = getValue(options.targetHeight, -1);
+ var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
+ var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
+ var allowEdit = !!options.allowEdit;
+ var correctOrientation = !!options.correctOrientation;
+ var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
+ var popoverOptions = getValue(options.popoverOptions, null);
+ var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
+
+ var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
+ mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
+
+ exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
+ // XXX: commented out
+ // return new CameraPopoverHandle();
+};
+
+/**
+ * Removes intermediate image files that are kept in temporary storage
+ * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
+ * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
+ * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
+ *
+ * __Supported Platforms__
+ *
+ * - iOS
+ *
+ * @example
+ * navigator.camera.cleanup(onSuccess, onFail);
+ *
+ * function onSuccess() {
+ * console.log("Camera cleanup success.")
+ * }
+ *
+ * function onFail(message) {
+ * alert('Failed because: ' + message);
+ * }
+ */
+cameraExport.cleanup = function (successCallback, errorCallback) {
+ exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
+};
+
+module.exports = cameraExport;
+
+});
diff --git a/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraConstants.js b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraConstants.js
new file mode 100644
index 000000000..4f4b046f1
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraConstants.js
@@ -0,0 +1,104 @@
+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/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
new file mode 100644
index 000000000..c970f55a3
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
@@ -0,0 +1,35 @@
+cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * @ignore in favour of iOS' one
+ * A handle to an image picker popover.
+ */
+var CameraPopoverHandle = function () {
+ this.setPosition = function (popoverOptions) {
+ console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
+ };
+};
+
+module.exports = CameraPopoverHandle;
+
+});
diff --git a/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
new file mode 100644
index 000000000..81d7d20ec
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
@@ -0,0 +1,55 @@
+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.
+ */
+var CameraPopoverOptions = function (x, y, width, height, arrowDir) {
+ // 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;
+};
+
+module.exports = CameraPopoverOptions;
+
+});
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
new file mode 100644
index 000000000..fbe8470e4
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/CameraLauncher.java
@@ -0,0 +1,1407 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+package org.apache.cordova.camera;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.cordova.BuildHelper;
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CordovaResourceApi;
+import org.apache.cordova.LOG;
+import org.apache.cordova.PermissionHelper;
+import org.apache.cordova.PluginResult;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import android.Manifest;
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.content.ActivityNotFoundException;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.CompressFormat;
+import android.graphics.BitmapFactory;
+import android.graphics.Matrix;
+import android.media.ExifInterface;
+import android.media.MediaScannerConnection;
+import android.media.MediaScannerConnection.MediaScannerConnectionClient;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Environment;
+import android.provider.DocumentsContract;
+import android.provider.MediaStore;
+import android.provider.OpenableColumns;
+import android.support.v4.content.FileProvider;
+import android.util.Base64;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+
+/**
+ * This class launches the camera view, allows the user to take a picture, closes the camera view,
+ * and returns the captured image. When the camera view is closed, the screen displayed before
+ * the camera view was shown is redisplayed.
+ */
+public class CameraLauncher extends CordovaPlugin implements MediaScannerConnectionClient {
+
+ private static final int DATA_URL = 0; // Return base64 encoded string
+ private static final int FILE_URI = 1; // Return file uri (content://media/external/images/media/2 for Android)
+ private static final int 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
+ private static final int SAVEDPHOTOALBUM = 2; // Choose image from picture library (same as PHOTOLIBRARY for Android)
+
+ private static final int PICTURE = 0; // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
+ private static final int VIDEO = 1; // allow selection of video only, ONLY RETURNS URL
+ private static final int ALLMEDIA = 2; // allow selection from all media types
+
+ private static final int JPEG = 0; // Take a picture of type JPEG
+ private static final int PNG = 1; // Take a picture of type PNG
+ private static final String GET_PICTURE = "Get Picture";
+ private static final String GET_VIDEO = "Get Video";
+ private static final String GET_All = "Get All";
+
+ public static final int PERMISSION_DENIED_ERROR = 20;
+ public static final int TAKE_PIC_SEC = 0;
+ public static final int SAVE_TO_ALBUM_SEC = 1;
+
+ private static final String LOG_TAG = "CameraLauncher";
+
+ //Where did this come from?
+ private static final int CROP_CAMERA = 100;
+
+ private 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 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)
+ private int srcType; // Destination type (needs to be saved for permission handling)
+ private boolean saveToPhotoAlbum; // Should the picture be saved to the device's photo album
+ private boolean correctOrientation; // Should the pictures orientation be corrected
+ private boolean orientationCorrected; // Has the picture's orientation been corrected
+ private boolean allowEdit; // Should we allow the user to crop the image.
+
+ protected final static String[] permissions = { Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE };
+
+ public CallbackContext callbackContext;
+ private int numPics;
+
+ private MediaScannerConnection conn; // Used to update gallery app with newly-written files
+ private Uri scanMe; // Uri of image to be added to content store
+ private Uri croppedUri;
+ private ExifHelper exifData; // Exif data from source
+ private String applicationId;
+
+
+ /**
+ * Executes the request and returns PluginResult.
+ *
+ * @param action The action to execute.
+ * @param args JSONArry of arguments for the plugin.
+ * @param callbackContext The callback id used when calling back into JavaScript.
+ * @return A PluginResult object with a status and message.
+ */
+ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+ this.callbackContext = callbackContext;
+ //Adding an API to CoreAndroid to get the BuildConfigValue
+ //This allows us to not make this a breaking change to embedding
+ this.applicationId = (String) BuildHelper.getBuildConfigValue(cordova.getActivity(), "APPLICATION_ID");
+ this.applicationId = preferences.getString("applicationId", this.applicationId);
+
+
+ if (action.equals("takePicture")) {
+ this.srcType = CAMERA;
+ this.destType = FILE_URI;
+ this.saveToPhotoAlbum = false;
+ this.targetHeight = 0;
+ this.targetWidth = 0;
+ this.encodingType = JPEG;
+ this.mediaType = PICTURE;
+ this.mQuality = 50;
+
+ //Take the values from the arguments if they're not already defined (this is tricky)
+ this.destType = args.getInt(1);
+ this.srcType = args.getInt(2);
+ this.mQuality = args.getInt(0);
+ this.targetWidth = args.getInt(3);
+ this.targetHeight = args.getInt(4);
+ this.encodingType = args.getInt(5);
+ this.mediaType = args.getInt(6);
+ this.allowEdit = args.getBoolean(7);
+ this.correctOrientation = args.getBoolean(8);
+ this.saveToPhotoAlbum = args.getBoolean(9);
+
+ // If the user specifies a 0 or smaller width/height
+ // make it -1 so later comparisons succeed
+ if (this.targetWidth < 1) {
+ this.targetWidth = -1;
+ }
+ if (this.targetHeight < 1) {
+ this.targetHeight = -1;
+ }
+
+ // We don't return full-quality PNG files. The camera outputs a JPEG
+ // so requesting it as a PNG provides no actual benefit
+ if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
+ !this.correctOrientation && this.encodingType == PNG && this.srcType == CAMERA) {
+ this.encodingType = JPEG;
+ }
+
+ try {
+ if (this.srcType == CAMERA) {
+ this.callTakePicture(destType, encodingType);
+ }
+ else if ((this.srcType == PHOTOLIBRARY) || (this.srcType == SAVEDPHOTOALBUM)) {
+ // FIXME: Stop always requesting the permission
+ if(!PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)) {
+ PermissionHelper.requestPermission(this, SAVE_TO_ALBUM_SEC, Manifest.permission.READ_EXTERNAL_STORAGE);
+ } else {
+ this.getImage(this.srcType, destType, encodingType);
+ }
+ }
+ }
+ catch (IllegalArgumentException e)
+ {
+ callbackContext.error("Illegal Argument Exception");
+ PluginResult r = new PluginResult(PluginResult.Status.ERROR);
+ callbackContext.sendPluginResult(r);
+ return true;
+ }
+
+ PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
+ r.setKeepCallback(true);
+ callbackContext.sendPluginResult(r);
+
+ return true;
+ }
+ return false;
+ }
+
+ //--------------------------------------------------------------------------
+ // LOCAL METHODS
+ //--------------------------------------------------------------------------
+
+ private String getTempDirectoryPath() {
+ File cache = 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();
+ }
+
+ /**
+ * Take a picture with the camera.
+ * When an image is captured or the camera view is cancelled, the result is returned
+ * in CordovaActivity.onActivityResult, which forwards the result to this.onActivityResult.
+ *
+ * The image can either be returned as a base64 string or a URI that points to the file.
+ * To display base64 string in an img tag, set the source to:
+ * img.src="data:image/jpeg;base64,"+result;
+ * or to display URI in an img tag
+ * img.src=result;
+ *
+ * @param returnType Set the type of image to return.
+ * @param encodingType Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
+ */
+ public void callTakePicture(int returnType, int encodingType) {
+ boolean saveAlbumPermission = PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
+ && PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ boolean takePicturePermission = PermissionHelper.hasPermission(this, Manifest.permission.CAMERA);
+
+ // CB-10120: The CAMERA permission does not need to be requested unless it is declared
+ // in AndroidManifest.xml. This plugin does not declare it, but others may and so we must
+ // check the package info to determine if the permission is present.
+
+ if (!takePicturePermission) {
+ takePicturePermission = true;
+ try {
+ PackageManager packageManager = this.cordova.getActivity().getPackageManager();
+ String[] permissionsInPackage = packageManager.getPackageInfo(this.cordova.getActivity().getPackageName(), PackageManager.GET_PERMISSIONS).requestedPermissions;
+ if (permissionsInPackage != null) {
+ for (String permission : permissionsInPackage) {
+ if (permission.equals(Manifest.permission.CAMERA)) {
+ takePicturePermission = false;
+ break;
+ }
+ }
+ }
+ } catch (NameNotFoundException e) {
+ // We are requesting the info for our package, so this should
+ // never be caught
+ }
+ }
+
+ if (takePicturePermission && saveAlbumPermission) {
+ takePicture(returnType, encodingType);
+ } else if (saveAlbumPermission && !takePicturePermission) {
+ PermissionHelper.requestPermission(this, TAKE_PIC_SEC, Manifest.permission.CAMERA);
+ } else if (!saveAlbumPermission && takePicturePermission) {
+ PermissionHelper.requestPermissions(this, TAKE_PIC_SEC,
+ new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE});
+ } else {
+ PermissionHelper.requestPermissions(this, TAKE_PIC_SEC, permissions);
+ }
+ }
+
+ public void takePicture(int returnType, int encodingType)
+ {
+ // Save the number of images currently on disk for later
+ this.numPics = queryImgDB(whichContentStore()).getCount();
+
+ // Let's use the intent and see what happens
+ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
+
+ // Specify file so that large image is captured and returned
+ File photo = createCaptureFile(encodingType);
+ this.imageUri = new CordovaUri(FileProvider.getUriForFile(cordova.getActivity(),
+ applicationId + ".provider",
+ photo));
+ intent.putExtra(android.provider.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);
+
+ if (this.cordova != null) {
+ // Let's check to make sure the camera is actually installed. (Legacy Nexus 7 code)
+ PackageManager mPm = this.cordova.getActivity().getPackageManager();
+ if(intent.resolveActivity(mPm) != null)
+ {
+
+ this.cordova.startActivityForResult((CordovaPlugin) this, intent, (CAMERA + 1) * 16 + returnType + 1);
+ }
+ else
+ {
+ LOG.d(LOG_TAG, "Error: You don't have a default camera. Your device may not be CTS complaint.");
+ }
+ }
+// else
+// LOG.d(LOG_TAG, "ERROR: You must use the CordovaInterface for this to work correctly. Please implement it in your activity");
+ }
+
+ /**
+ * Create a file in the applications temporary directory based upon the supplied encoding.
+ *
+ * @param encodingType of the image to be taken
+ * @return a File object pointing to the temporary picture
+ */
+ private File createCaptureFile(int encodingType) {
+ return createCaptureFile(encodingType, "");
+ }
+
+ /**
+ * Create a file in the applications temporary directory based upon the supplied encoding.
+ *
+ * @param encodingType of the image to be taken
+ * @param fileName or resultant File object.
+ * @return a File object pointing to the temporary picture
+ */
+ private File createCaptureFile(int encodingType, String fileName) {
+ if (fileName.isEmpty()) {
+ fileName = ".Pic";
+ }
+
+ if (encodingType == JPEG) {
+ fileName = fileName + ".jpg";
+ } else if (encodingType == PNG) {
+ fileName = fileName + ".png";
+ } else {
+ throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType);
+ }
+
+ return new File(getTempDirectoryPath(), fileName);
+ }
+
+
+
+ /**
+ * Get image from photo library.
+ *
+ * @param srcType The album to get image from.
+ * @param returnType Set the type of image to return.
+ * @param encodingType
+ */
+ // TODO: Images selected from SDCARD don't display correctly, but from CAMERA ALBUM do!
+ // TODO: Images from kitkat filechooser not going into crop function
+ public void getImage(int srcType, int returnType, int encodingType) {
+ Intent intent = new Intent();
+ String title = GET_PICTURE;
+ croppedUri = null;
+ if (this.mediaType == PICTURE) {
+ intent.setType("image/*");
+ if (this.allowEdit) {
+ intent.setAction(Intent.ACTION_PICK);
+ intent.putExtra("crop", "true");
+ if (targetWidth > 0) {
+ intent.putExtra("outputX", targetWidth);
+ }
+ if (targetHeight > 0) {
+ intent.putExtra("outputY", targetHeight);
+ }
+ if (targetHeight > 0 && targetWidth > 0 && targetWidth == targetHeight) {
+ intent.putExtra("aspectX", 1);
+ intent.putExtra("aspectY", 1);
+ }
+ File photo = createCaptureFile(JPEG);
+ croppedUri = Uri.fromFile(photo);
+ intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, croppedUri);
+ } else {
+ intent.setAction(Intent.ACTION_GET_CONTENT);
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
+ }
+ } else if (this.mediaType == VIDEO) {
+ intent.setType("video/*");
+ title = GET_VIDEO;
+ intent.setAction(Intent.ACTION_GET_CONTENT);
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
+ } else if (this.mediaType == ALLMEDIA) {
+ // I wanted to make the type 'image/*, video/*' but this does not work on all versions
+ // of android so I had to go with the wildcard search.
+ intent.setType("*/*");
+ title = GET_All;
+ intent.setAction(Intent.ACTION_GET_CONTENT);
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
+ }
+ if (this.cordova != null) {
+ this.cordova.startActivityForResult((CordovaPlugin) this, Intent.createChooser(intent,
+ new String(title)), (srcType + 1) * 16 + returnType + 1);
+ }
+ }
+
+
+ /**
+ * Brings up the UI to perform crop on passed image URI
+ *
+ * @param picUri
+ */
+ private void performCrop(Uri picUri, int destType, Intent cameraIntent) {
+ try {
+ Intent cropIntent = new Intent("com.android.camera.action.CROP");
+ // indicate image type and Uri
+ cropIntent.setDataAndType(picUri, "image/*");
+ // set crop properties
+ cropIntent.putExtra("crop", "true");
+
+
+ // indicate output X and Y
+ if (targetWidth > 0) {
+ cropIntent.putExtra("outputX", targetWidth);
+ }
+ if (targetHeight > 0) {
+ cropIntent.putExtra("outputY", targetHeight);
+ }
+ if (targetHeight > 0 && targetWidth > 0 && targetWidth == targetHeight) {
+ cropIntent.putExtra("aspectX", 1);
+ cropIntent.putExtra("aspectY", 1);
+ }
+ // create new file handle to get full resolution crop
+ 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");
+ }
+ }
+ }
+
+ /**
+ * Applies all needed transformation to the image received from the camera.
+ *
+ * @param destType In which form should we return the image
+ * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
+ */
+ private void processResultFromCamera(int destType, Intent intent) throws IOException {
+ int rotate = 0;
+
+ // Create an ExifHelper to save the exif data that is lost during compression
+ ExifHelper exif = new ExifHelper();
+
+ String sourcePath = (this.allowEdit && this.croppedUri != null) ?
+ FileHelper.stripFileProtocol(this.croppedUri.toString()) :
+ this.imageUri.getFilePath();
+
+
+ if (this.encodingType == JPEG) {
+ try {
+ //We don't support PNG, so let's not pretend we do
+ exif.createInFile(sourcePath);
+ exif.readExifData();
+ rotate = exif.getOrientation();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ Bitmap bitmap = null;
+ Uri galleryUri = null;
+
+ // CB-5479 When this option is given the unchanged image should be saved
+ // in the gallery and the modified image is saved in the temporary
+ // directory
+ if (this.saveToPhotoAlbum) {
+ galleryUri = Uri.fromFile(new File(getPicturesPath()));
+
+ if (this.allowEdit && this.croppedUri != null) {
+ writeUncompressedImage(croppedUri, galleryUri);
+ } else {
+ Uri imageUri = this.imageUri.getFileUri();
+ writeUncompressedImage(imageUri, galleryUri);
+ }
+
+ refreshGallery(galleryUri);
+ }
+
+ // If sending base64 image back
+ if (destType == DATA_URL) {
+ bitmap = getScaledAndRotatedBitmap(sourcePath);
+
+ if (bitmap == null) {
+ // Try to get the bitmap from intent.
+ bitmap = (Bitmap) intent.getExtras().get("data");
+ }
+
+ // Double-check the bitmap.
+ if (bitmap == null) {
+ LOG.d(LOG_TAG, "I either have a null image path or bitmap");
+ this.failPicture("Unable to create bitmap!");
+ return;
+ }
+
+
+ this.processPicture(bitmap, this.encodingType);
+
+ if (!this.saveToPhotoAlbum) {
+ checkForDuplicateImage(DATA_URL);
+ }
+ }
+
+ // If sending filename back
+ else if (destType == FILE_URI || 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) {
+
+ // If we saved the uncompressed photo to the album, we can just
+ // return the URI we already created
+ if (this.saveToPhotoAlbum) {
+ this.callbackContext.success(galleryUri.toString());
+ } else {
+ Uri uri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
+
+ if (this.allowEdit && this.croppedUri != null) {
+ Uri croppedUri = Uri.fromFile(new File(getFileNameFromUri(this.croppedUri)));
+ writeUncompressedImage(croppedUri, uri);
+ } else {
+ Uri imageUri = this.imageUri.getFileUri();
+ writeUncompressedImage(imageUri, uri);
+ }
+
+ this.callbackContext.success(uri.toString());
+ }
+ } else {
+ Uri uri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
+ bitmap = getScaledAndRotatedBitmap(sourcePath);
+
+ // Double-check the bitmap.
+ if (bitmap == null) {
+ LOG.d(LOG_TAG, "I either have a null image path or bitmap");
+ this.failPicture("Unable to create bitmap!");
+ return;
+ }
+
+
+ // Add compressed version of captured image to returned media store Uri
+ OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri);
+ CompressFormat compressFormat = encodingType == JPEG ?
+ CompressFormat.JPEG :
+ CompressFormat.PNG;
+
+ bitmap.compress(compressFormat, this.mQuality, os);
+ os.close();
+
+ // Restore exif data to file
+ if (this.encodingType == JPEG) {
+ String exifPath;
+ exifPath = uri.getPath();
+ //We just finished rotating it by an arbitrary orientation, just make sure it's normal
+ if(rotate != ExifInterface.ORIENTATION_NORMAL)
+ exif.resetOrientation();
+ exif.createOutFile(exifPath);
+ exif.writeExifData();
+ }
+
+ // Send Uri back to JavaScript for viewing image
+ this.callbackContext.success(uri.toString());
+
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+
+ this.cleanup(FILE_URI, this.imageUri.getFileUri(), galleryUri, bitmap);
+ bitmap = null;
+ }
+
+ private String getPicturesPath() {
+ String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+ String imageFileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? ".jpg" : ".png");
+ File storageDir = Environment.getExternalStoragePublicDirectory(
+ Environment.DIRECTORY_PICTURES);
+ storageDir.mkdirs();
+ String galleryPath = storageDir.getAbsolutePath() + "/" + imageFileName;
+ return galleryPath;
+ }
+
+ private void refreshGallery(Uri contentUri) {
+ Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+ mediaScanIntent.setData(contentUri);
+ this.cordova.getActivity().sendBroadcast(mediaScanIntent);
+ }
+
+ /**
+ * Converts output image format int value to string value of mime type.
+ * @param outputFormat int Output format of camera API.
+ * Must be value of either JPEG or PNG constant
+ * @return String String value of mime type or empty string if mime type is not supported
+ */
+ private String getMimetypeForFormat(int outputFormat) {
+ if (outputFormat == PNG) return "image/png";
+ if (outputFormat == JPEG) return "image/jpeg";
+ return "";
+ }
+
+
+ private String outputModifiedBitmap(Bitmap bitmap, Uri uri) throws IOException {
+ // Some content: URIs do not map to file paths (e.g. picasa).
+ String realPath = FileHelper.getRealPath(uri, this.cordova);
+
+ // Get filename from uri
+ String fileName = realPath != null ?
+ realPath.substring(realPath.lastIndexOf('/') + 1) :
+ "modified." + (this.encodingType == JPEG ? "jpg" : "png");
+
+ String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+ //String fileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? ".jpg" : ".png");
+ String modifiedPath = getTempDirectoryPath() + "/" + fileName;
+
+ OutputStream os = new FileOutputStream(modifiedPath);
+ CompressFormat compressFormat = this.encodingType == JPEG ?
+ CompressFormat.JPEG :
+ CompressFormat.PNG;
+
+ bitmap.compress(compressFormat, this.mQuality, os);
+ os.close();
+
+ if (exifData != null && this.encodingType == JPEG) {
+ try {
+ if (this.correctOrientation && this.orientationCorrected) {
+ exifData.resetOrientation();
+ }
+ exifData.createOutFile(modifiedPath);
+ exifData.writeExifData();
+ exifData = null;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return modifiedPath;
+ }
+
+
+ /**
+ * Applies all needed transformation to the image received from the gallery.
+ *
+ * @param destType In which form should we return the image
+ * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
+ */
+ private void processResultFromGallery(int destType, Intent intent) {
+ Uri uri = intent.getData();
+ if (uri == null) {
+ if (croppedUri != null) {
+ uri = croppedUri;
+ } else {
+ this.failPicture("null data from photo library");
+ return;
+ }
+ }
+ int rotate = 0;
+
+ String fileLocation = FileHelper.getRealPath(uri, this.cordova);
+ LOG.d(LOG_TAG, "File locaton is: " + fileLocation);
+
+ // If you ask for video or all media type you will automatically get back a file URI
+ // and there will be no attempt to resize any returned data
+ if (this.mediaType != PICTURE) {
+ this.callbackContext.success(fileLocation);
+ }
+ else {
+ String uriString = uri.toString();
+ // Get the path to the image. Makes loading so much easier.
+ String mimeType = FileHelper.getMimeType(uriString, this.cordova);
+
+ // 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.equalsIgnoreCase(getMimetypeForFormat(encodingType)))
+ {
+ this.callbackContext.success(uriString);
+ } else {
+ // If we don't have a valid image so quit.
+ if (!("image/jpeg".equalsIgnoreCase(mimeType) || "image/png".equalsIgnoreCase(mimeType))) {
+ LOG.d(LOG_TAG, "I either have a null image path or bitmap");
+ this.failPicture("Unable to retrieve path to picture!");
+ return;
+ }
+ Bitmap bitmap = null;
+ try {
+ bitmap = getScaledAndRotatedBitmap(uriString);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (bitmap == null) {
+ LOG.d(LOG_TAG, "I either have a null image path or bitmap");
+ this.failPicture("Unable to create bitmap!");
+ return;
+ }
+
+ // If sending base64 image back
+ if (destType == DATA_URL) {
+ this.processPicture(bitmap, this.encodingType);
+ }
+
+ // If sending filename back
+ else if (destType == FILE_URI || 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();
+ }
+ }
+ }
+
+ /**
+ * Called when the camera view exits.
+ *
+ * @param requestCode The request code originally supplied to startActivityForResult(),
+ * allowing you to identify who this result came from.
+ * @param resultCode The integer result code returned by the child activity through its setResult().
+ * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
+ */
+ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
+
+ // Get src and dest types from request code for a Camera Activity
+ int srcType = (requestCode / 16) - 1;
+ int destType = (requestCode % 16) - 1;
+
+ // If Camera Crop
+ if (requestCode >= CROP_CAMERA) {
+ if (resultCode == Activity.RESULT_OK) {
+
+ // Because of the inability to pass through multiple intents, this hack will allow us
+ // to pass arcane codes back.
+ destType = requestCode - CROP_CAMERA;
+ try {
+ processResultFromCamera(destType, intent);
+ } catch (IOException e) {
+ e.printStackTrace();
+ LOG.e(LOG_TAG, "Unable to write to file");
+ }
+
+ }// If cancelled
+ else if (resultCode == Activity.RESULT_CANCELED) {
+ this.failPicture("No Image Selected");
+ }
+
+ // If something else
+ else {
+ this.failPicture("Did not complete!");
+ }
+ }
+ // If CAMERA
+ else if (srcType == CAMERA) {
+ // If image available
+ if (resultCode == Activity.RESULT_OK) {
+ try {
+ if (this.allowEdit) {
+ Uri tmpFile = FileProvider.getUriForFile(cordova.getActivity(),
+ applicationId + ".provider",
+ createCaptureFile(this.encodingType));
+ performCrop(tmpFile, destType, intent);
+ } else {
+ this.processResultFromCamera(destType, intent);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ this.failPicture("Error capturing image.");
+ }
+ }
+
+ // If cancelled
+ else if (resultCode == Activity.RESULT_CANCELED) {
+ this.failPicture("No Image Selected");
+ }
+
+ // If something else
+ else {
+ this.failPicture("Did not complete!");
+ }
+ }
+ // If retrieving photo from library
+ else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
+ if (resultCode == Activity.RESULT_OK && intent != null) {
+ final Intent i = intent;
+ final int finalDestType = destType;
+ cordova.getThreadPool().execute(new Runnable() {
+ public void run() {
+ processResultFromGallery(finalDestType, i);
+ }
+ });
+ } else if (resultCode == Activity.RESULT_CANCELED) {
+ this.failPicture("No Image Selected");
+ } else {
+ this.failPicture("Selection did not complete!");
+ }
+ }
+ }
+
+ private int exifToDegrees(int exifOrientation) {
+ if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
+ return 90;
+ } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {
+ return 180;
+ } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {
+ return 270;
+ } else {
+ return 0;
+ }
+ }
+
+ /**
+ * Write an inputstream to local disk
+ *
+ * @param fis - The InputStream to write
+ * @param dest - Destination on disk to write to
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ private void writeUncompressedImage(InputStream fis, Uri dest) throws FileNotFoundException,
+ IOException {
+ OutputStream os = null;
+ try {
+ os = this.cordova.getActivity().getContentResolver().openOutputStream(dest);
+ byte[] buffer = new byte[4096];
+ int len;
+ while ((len = fis.read(buffer)) != -1) {
+ os.write(buffer, 0, len);
+ }
+ os.flush();
+ } finally {
+ if (os != null) {
+ try {
+ os.close();
+ } catch (IOException e) {
+ LOG.d(LOG_TAG, "Exception while closing output stream.");
+ }
+ }
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ LOG.d(LOG_TAG, "Exception while closing file input stream.");
+ }
+ }
+ }
+ }
+ /**
+ * In the special case where the default width, height and quality are unchanged
+ * we just write the file out to disk saving the expensive Bitmap.compress function.
+ *
+ * @param src
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ private void writeUncompressedImage(Uri src, Uri dest) throws FileNotFoundException,
+ IOException {
+
+ 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(android.provider.MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
+ Uri uri;
+ try {
+ uri = this.cordova.getActivity().getContentResolver().insert(android.provider.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(android.provider.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
+ *
+ * @param imageUrl
+ * @return
+ * @throws IOException
+ */
+ private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
+ // If no new width or height were specified, and orientation is not needed return the original bitmap
+ if (this.targetWidth <= 0 && this.targetHeight <= 0 && !(this.correctOrientation)) {
+ InputStream fileStream = null;
+ Bitmap image = null;
+ try {
+ fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
+ image = BitmapFactory.decodeStream(fileStream);
+ } catch (OutOfMemoryError e) {
+ callbackContext.error(e.getLocalizedMessage());
+ } catch (Exception e){
+ callbackContext.error(e.getLocalizedMessage());
+ }
+ finally {
+ if (fileStream != null) {
+ try {
+ fileStream.close();
+ } catch (IOException e) {
+ LOG.d(LOG_TAG, "Exception while closing file input stream.");
+ }
+ }
+ }
+ return image;
+ }
+
+
+ /* Copy the inputstream to a temporary file on the device.
+ We then use this temporary file to determine the width/height/orientation.
+ This is the only way to determine the orientation of the photo coming from 3rd party providers (Google Drive, Dropbox,etc)
+ This also ensures we create a scaled bitmap with the correct orientation
+
+ We delete the temporary file once we are done
+ */
+ File localFile = null;
+ Uri galleryUri = null;
+ int rotate = 0;
+ try {
+ InputStream fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
+ if (fileStream != null) {
+ // Generate a temporary file
+ String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+ String fileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? ".jpg" : ".png");
+ localFile = new File(getTempDirectoryPath() + fileName);
+ galleryUri = Uri.fromFile(localFile);
+ writeUncompressedImage(fileStream, galleryUri);
+ try {
+ String mimeType = FileHelper.getMimeType(imageUrl.toString(), cordova);
+ if ("image/jpeg".equalsIgnoreCase(mimeType)) {
+ // ExifInterface doesn't like the file:// prefix
+ String filePath = galleryUri.toString().replace("file://", "");
+ // read exifData of source
+ exifData = new ExifHelper();
+ exifData.createInFile(filePath);
+ // Use ExifInterface to pull rotation information
+ if (this.correctOrientation) {
+ ExifInterface exif = new ExifInterface(filePath);
+ rotate = exifToDegrees(exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED));
+ }
+ }
+ } catch (Exception oe) {
+ LOG.w(LOG_TAG,"Unable to read Exif data: "+ oe.toString());
+ rotate = 0;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ LOG.e(LOG_TAG,"Exception while getting input stream: "+ e.toString());
+ return null;
+ }
+
+
+
+ try {
+ // figure out the original width and height of the image
+ BitmapFactory.Options options = new BitmapFactory.Options();
+ options.inJustDecodeBounds = true;
+ InputStream fileStream = null;
+ try {
+ fileStream = FileHelper.getInputStreamFromUriString(galleryUri.toString(), cordova);
+ BitmapFactory.decodeStream(fileStream, null, options);
+ } finally {
+ if (fileStream != null) {
+ try {
+ fileStream.close();
+ } catch (IOException e) {
+ LOG.d(LOG_TAG, "Exception while closing file input stream.");
+ }
+ }
+ }
+
+
+ //CB-2292: WTF? Why is the width null?
+ if (options.outWidth == 0 || options.outHeight == 0) {
+ return null;
+ }
+
+ // User didn't specify output dimensions, but they need orientation
+ if (this.targetWidth <= 0 && this.targetHeight <= 0) {
+ this.targetWidth = options.outWidth;
+ this.targetHeight = options.outHeight;
+ }
+
+ // Setup target width/height based on orientation
+ int rotatedWidth, rotatedHeight;
+ boolean rotated= false;
+ if (rotate == 90 || rotate == 270) {
+ rotatedWidth = options.outHeight;
+ rotatedHeight = options.outWidth;
+ rotated = true;
+ } else {
+ rotatedWidth = options.outWidth;
+ rotatedHeight = options.outHeight;
+ }
+
+ // determine the correct aspect ratio
+ int[] widthHeight = calculateAspectRatio(rotatedWidth, rotatedHeight);
+
+
+ // Load in the smallest bitmap possible that is closest to the size we want
+ options.inJustDecodeBounds = false;
+ options.inSampleSize = calculateSampleSize(rotatedWidth, rotatedHeight, widthHeight[0], widthHeight[1]);
+ Bitmap unscaledBitmap = null;
+ try {
+ fileStream = FileHelper.getInputStreamFromUriString(galleryUri.toString(), cordova);
+ unscaledBitmap = BitmapFactory.decodeStream(fileStream, null, options);
+ } finally {
+ if (fileStream != null) {
+ try {
+ fileStream.close();
+ } catch (IOException e) {
+ LOG.d(LOG_TAG, "Exception while closing file input stream.");
+ }
+ }
+ }
+ if (unscaledBitmap == null) {
+ return null;
+ }
+
+ int scaledWidth = (!rotated) ? widthHeight[0] : widthHeight[1];
+ int scaledHeight = (!rotated) ? widthHeight[1] : widthHeight[0];
+
+ Bitmap scaledBitmap = Bitmap.createScaledBitmap(unscaledBitmap, scaledWidth, scaledHeight, true);
+ if (scaledBitmap != unscaledBitmap) {
+ unscaledBitmap.recycle();
+ unscaledBitmap = null;
+ }
+ if (this.correctOrientation && (rotate != 0)) {
+ Matrix matrix = new Matrix();
+ matrix.setRotate(rotate);
+ try {
+ scaledBitmap = Bitmap.createBitmap(scaledBitmap, 0, 0, scaledBitmap.getWidth(), scaledBitmap.getHeight(), matrix, true);
+ this.orientationCorrected = true;
+ } catch (OutOfMemoryError oom) {
+ this.orientationCorrected = false;
+ }
+ }
+ return scaledBitmap;
+ }
+ finally {
+ // delete the temporary copy
+ if (localFile != null) {
+ localFile.delete();
+ }
+ }
+
+ }
+
+ /**
+ * Maintain the aspect ratio so the resulting image does not look smooshed
+ *
+ * @param origWidth
+ * @param origHeight
+ * @return
+ */
+ public int[] calculateAspectRatio(int origWidth, int origHeight) {
+ int newWidth = this.targetWidth;
+ int newHeight = this.targetHeight;
+
+ // If no new width or height were specified return the original bitmap
+ if (newWidth <= 0 && newHeight <= 0) {
+ newWidth = origWidth;
+ newHeight = origHeight;
+ }
+ // Only the width was specified
+ else if (newWidth > 0 && newHeight <= 0) {
+ newHeight = (int)((double)(newWidth / (double)origWidth) * origHeight);
+ }
+ // only the height was specified
+ else if (newWidth <= 0 && newHeight > 0) {
+ newWidth = (int)((double)(newHeight / (double)origHeight) * origWidth);
+ }
+ // If the user specified both a positive width and height
+ // (potentially different aspect ratio) then the width or height is
+ // scaled so that the image fits while maintaining aspect ratio.
+ // Alternatively, the specified width and height could have been
+ // kept and Bitmap.SCALE_TO_FIT specified when scaling, but this
+ // would result in whitespace in the new image.
+ else {
+ double newRatio = newWidth / (double) newHeight;
+ double origRatio = origWidth / (double) origHeight;
+
+ if (origRatio > newRatio) {
+ newHeight = (newWidth * origHeight) / origWidth;
+ } else if (origRatio < newRatio) {
+ newWidth = (newHeight * origWidth) / origHeight;
+ }
+ }
+
+ int[] retval = new int[2];
+ retval[0] = newWidth;
+ retval[1] = newHeight;
+ return retval;
+ }
+
+ /**
+ * Figure out what ratio we can load our image into memory at while still being bigger than
+ * our desired width and height
+ *
+ * @param srcWidth
+ * @param srcHeight
+ * @param dstWidth
+ * @param dstHeight
+ * @return
+ */
+ public static int calculateSampleSize(int srcWidth, int srcHeight, int dstWidth, int dstHeight) {
+ final float srcAspect = (float) srcWidth / (float) srcHeight;
+ final float dstAspect = (float) dstWidth / (float) dstHeight;
+
+ if (srcAspect > dstAspect) {
+ return srcWidth / dstWidth;
+ } else {
+ return srcHeight / dstHeight;
+ }
+ }
+
+ /**
+ * Creates a cursor that can be used to determine how many images we have.
+ *
+ * @return a cursor
+ */
+ private Cursor queryImgDB(Uri contentStore) {
+ return this.cordova.getActivity().getContentResolver().query(
+ contentStore,
+ new String[]{MediaStore.Images.Media._ID},
+ null,
+ null,
+ null);
+ }
+
+ /**
+ * Cleans up after picture taking. Checking for duplicates and that kind of stuff.
+ *
+ * @param newImage
+ */
+ private void cleanup(int imageType, Uri oldImage, Uri newImage, Bitmap bitmap) {
+ if (bitmap != null) {
+ bitmap.recycle();
+ }
+
+ // Clean up initial camera-written image file.
+ (new File(FileHelper.stripFileProtocol(oldImage.toString()))).delete();
+
+ checkForDuplicateImage(imageType);
+ // Scan for the gallery to update pic refs in gallery
+ if (this.saveToPhotoAlbum && newImage != null) {
+ this.scanForGallery(newImage);
+ }
+
+ System.gc();
+ }
+
+ /**
+ * Used to find out if we are in a situation where the Camera Intent adds to images
+ * to the content store. If we are using a FILE_URI and the number of images in the DB
+ * increases by 2 we have a duplicate, when using a DATA_URL the number is 1.
+ *
+ * @param type FILE_URI or DATA_URL
+ */
+ private void checkForDuplicateImage(int type) {
+ int diff = 1;
+ Uri contentStore = whichContentStore();
+ Cursor cursor = queryImgDB(contentStore);
+ int currentNumOfImages = cursor.getCount();
+
+ if (type == FILE_URI && this.saveToPhotoAlbum) {
+ diff = 2;
+ }
+
+ // delete the duplicate file if the difference is 2 for file URI or 1 for Data URL
+ if ((currentNumOfImages - numPics) == diff) {
+ cursor.moveToLast();
+ int id = Integer.valueOf(cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media._ID)));
+ if (diff == 2) {
+ id--;
+ }
+ Uri uri = Uri.parse(contentStore + "/" + id);
+ this.cordova.getActivity().getContentResolver().delete(uri, null, null);
+ cursor.close();
+ }
+ }
+
+ /**
+ * Determine if we are storing the images in internal or external storage
+ *
+ * @return Uri
+ */
+ private Uri whichContentStore() {
+ if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+ return android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
+ } else {
+ return android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI;
+ }
+ }
+
+ /**
+ * Compress bitmap using jpeg, convert to Base64 encoded string, and return to JavaScript.
+ *
+ * @param bitmap
+ */
+ public void processPicture(Bitmap bitmap, int encodingType) {
+ ByteArrayOutputStream jpeg_data = new ByteArrayOutputStream();
+ CompressFormat compressFormat = encodingType == JPEG ?
+ CompressFormat.JPEG :
+ CompressFormat.PNG;
+
+ try {
+ if (bitmap.compress(compressFormat, mQuality, jpeg_data)) {
+ byte[] code = jpeg_data.toByteArray();
+ byte[] output = Base64.encode(code, Base64.NO_WRAP);
+ String js_out = new String(output);
+ this.callbackContext.success(js_out);
+ js_out = null;
+ output = null;
+ code = null;
+ }
+ } catch (Exception e) {
+ this.failPicture("Error compressing image.");
+ }
+ jpeg_data = null;
+ }
+
+ /**
+ * Send error message to JavaScript.
+ *
+ * @param err
+ */
+ public void failPicture(String err) {
+ this.callbackContext.error(err);
+ }
+
+ private void scanForGallery(Uri newImage) {
+ this.scanMe = newImage;
+ if (this.conn != null) {
+ this.conn.disconnect();
+ }
+ this.conn = new MediaScannerConnection(this.cordova.getActivity().getApplicationContext(), this);
+ conn.connect();
+ }
+
+ public void onMediaScannerConnected() {
+ try {
+ this.conn.scanFile(this.scanMe.toString(), "image/*");
+ } catch (java.lang.IllegalStateException e) {
+ LOG.e(LOG_TAG, "Can't scan file in MediaScanner after taking picture");
+ }
+
+ }
+
+ public void onScanCompleted(String path, Uri uri) {
+ this.conn.disconnect();
+ }
+
+
+ public void onRequestPermissionResult(int requestCode, String[] permissions,
+ int[] grantResults) throws JSONException {
+ for (int r : grantResults) {
+ if (r == PackageManager.PERMISSION_DENIED) {
+ this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, PERMISSION_DENIED_ERROR));
+ return;
+ }
+ }
+ switch (requestCode) {
+ case TAKE_PIC_SEC:
+ takePicture(this.destType, this.encodingType);
+ break;
+ case SAVE_TO_ALBUM_SEC:
+ this.getImage(this.srcType, this.destType, this.encodingType);
+ break;
+ }
+ }
+
+ /**
+ * Taking or choosing a picture launches another Activity, so we need to implement the
+ * save/restore APIs to handle the case where the CordovaActivity is killed by the OS
+ * before we get the launched Activity's result.
+ */
+ public Bundle onSaveInstanceState() {
+ Bundle state = new Bundle();
+ state.putInt("destType", this.destType);
+ state.putInt("srcType", this.srcType);
+ state.putInt("mQuality", this.mQuality);
+ state.putInt("targetWidth", this.targetWidth);
+ state.putInt("targetHeight", this.targetHeight);
+ state.putInt("encodingType", this.encodingType);
+ state.putInt("mediaType", this.mediaType);
+ state.putInt("numPics", this.numPics);
+ state.putBoolean("allowEdit", this.allowEdit);
+ state.putBoolean("correctOrientation", this.correctOrientation);
+ state.putBoolean("saveToPhotoAlbum", this.saveToPhotoAlbum);
+
+ if (this.croppedUri != null) {
+ state.putString("croppedUri", this.croppedUri.toString());
+ }
+
+ if (this.imageUri != null) {
+ state.putString("imageUri", this.imageUri.getFileUri().toString());
+ }
+
+ return state;
+ }
+
+ public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {
+ this.destType = state.getInt("destType");
+ this.srcType = state.getInt("srcType");
+ this.mQuality = state.getInt("mQuality");
+ this.targetWidth = state.getInt("targetWidth");
+ this.targetHeight = state.getInt("targetHeight");
+ this.encodingType = state.getInt("encodingType");
+ this.mediaType = state.getInt("mediaType");
+ this.numPics = state.getInt("numPics");
+ this.allowEdit = state.getBoolean("allowEdit");
+ this.correctOrientation = state.getBoolean("correctOrientation");
+ this.saveToPhotoAlbum = state.getBoolean("saveToPhotoAlbum");
+
+ if (state.containsKey("croppedUri")) {
+ this.croppedUri = Uri.parse(state.getString("croppedUri"));
+ }
+
+ if (state.containsKey("imageUri")) {
+ //I have no idea what type of URI is being passed in
+ this.imageUri = new CordovaUri(Uri.parse(state.getString("imageUri")));
+ }
+
+ 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..5c2224d42
--- /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 android.support.v4.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
new file mode 100644
index 000000000..5160a2f6a
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/ExifHelper.java
@@ -0,0 +1,185 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+package org.apache.cordova.camera;
+
+import java.io.IOException;
+
+import android.media.ExifInterface;
+
+public class ExifHelper {
+ private String aperture = null;
+ private String datetime = null;
+ private String exposureTime = null;
+ private String flash = null;
+ private String focalLength = null;
+ private String gpsAltitude = null;
+ private String gpsAltitudeRef = null;
+ private String gpsDateStamp = null;
+ private String gpsLatitude = null;
+ private String gpsLatitudeRef = null;
+ private String gpsLongitude = null;
+ private String gpsLongitudeRef = null;
+ private String gpsProcessingMethod = null;
+ private String gpsTimestamp = null;
+ private String iso = null;
+ private String make = null;
+ private String model = null;
+ private String orientation = null;
+ private String whiteBalance = null;
+
+ private ExifInterface inFile = null;
+ private ExifInterface outFile = null;
+
+ /**
+ * The file before it is compressed
+ *
+ * @param filePath
+ * @throws IOException
+ */
+ public void createInFile(String filePath) throws IOException {
+ this.inFile = new ExifInterface(filePath);
+ }
+
+ /**
+ * The file after it has been compressed
+ *
+ * @param filePath
+ * @throws IOException
+ */
+ public void createOutFile(String filePath) throws IOException {
+ this.outFile = new ExifInterface(filePath);
+ }
+
+ /**
+ * Reads all the EXIF data from the input file.
+ */
+ public void readExifData() {
+ this.aperture = inFile.getAttribute(ExifInterface.TAG_APERTURE);
+ this.datetime = inFile.getAttribute(ExifInterface.TAG_DATETIME);
+ this.exposureTime = inFile.getAttribute(ExifInterface.TAG_EXPOSURE_TIME);
+ this.flash = inFile.getAttribute(ExifInterface.TAG_FLASH);
+ this.focalLength = inFile.getAttribute(ExifInterface.TAG_FOCAL_LENGTH);
+ this.gpsAltitude = inFile.getAttribute(ExifInterface.TAG_GPS_ALTITUDE);
+ this.gpsAltitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF);
+ this.gpsDateStamp = inFile.getAttribute(ExifInterface.TAG_GPS_DATESTAMP);
+ this.gpsLatitude = inFile.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
+ this.gpsLatitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
+ this.gpsLongitude = inFile.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
+ this.gpsLongitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);
+ this.gpsProcessingMethod = inFile.getAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD);
+ this.gpsTimestamp = inFile.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP);
+ this.iso = inFile.getAttribute(ExifInterface.TAG_ISO);
+ this.make = inFile.getAttribute(ExifInterface.TAG_MAKE);
+ this.model = inFile.getAttribute(ExifInterface.TAG_MODEL);
+ this.orientation = inFile.getAttribute(ExifInterface.TAG_ORIENTATION);
+ this.whiteBalance = inFile.getAttribute(ExifInterface.TAG_WHITE_BALANCE);
+ }
+
+ /**
+ * Writes the previously stored EXIF data to the output file.
+ *
+ * @throws IOException
+ */
+ public void writeExifData() throws IOException {
+ // Don't try to write to a null file
+ if (this.outFile == null) {
+ return;
+ }
+
+ if (this.aperture != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_APERTURE, this.aperture);
+ }
+ if (this.datetime != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_DATETIME, this.datetime);
+ }
+ if (this.exposureTime != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_EXPOSURE_TIME, this.exposureTime);
+ }
+ if (this.flash != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_FLASH, this.flash);
+ }
+ if (this.focalLength != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_FOCAL_LENGTH, this.focalLength);
+ }
+ if (this.gpsAltitude != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_ALTITUDE, this.gpsAltitude);
+ }
+ if (this.gpsAltitudeRef != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF, this.gpsAltitudeRef);
+ }
+ if (this.gpsDateStamp != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_DATESTAMP, this.gpsDateStamp);
+ }
+ if (this.gpsLatitude != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_LATITUDE, this.gpsLatitude);
+ }
+ if (this.gpsLatitudeRef != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, this.gpsLatitudeRef);
+ }
+ if (this.gpsLongitude != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, this.gpsLongitude);
+ }
+ if (this.gpsLongitudeRef != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, this.gpsLongitudeRef);
+ }
+ if (this.gpsProcessingMethod != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD, this.gpsProcessingMethod);
+ }
+ if (this.gpsTimestamp != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_GPS_TIMESTAMP, this.gpsTimestamp);
+ }
+ if (this.iso != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_ISO, this.iso);
+ }
+ if (this.make != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_MAKE, this.make);
+ }
+ if (this.model != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_MODEL, this.model);
+ }
+ if (this.orientation != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_ORIENTATION, this.orientation);
+ }
+ if (this.whiteBalance != null) {
+ this.outFile.setAttribute(ExifInterface.TAG_WHITE_BALANCE, this.whiteBalance);
+ }
+
+ this.outFile.saveAttributes();
+ }
+
+ public int getOrientation() {
+ int o = Integer.parseInt(this.orientation);
+
+ if (o == ExifInterface.ORIENTATION_NORMAL) {
+ return 0;
+ } else if (o == ExifInterface.ORIENTATION_ROTATE_90) {
+ return 90;
+ } else if (o == ExifInterface.ORIENTATION_ROTATE_180) {
+ return 180;
+ } else if (o == ExifInterface.ORIENTATION_ROTATE_270) {
+ return 270;
+ } else {
+ return 0;
+ }
+ }
+
+ public void resetOrientation() {
+ this.orientation = "" + ExifInterface.ORIENTATION_NORMAL;
+ }
+}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileHelper.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileHelper.java
new file mode 100644
index 000000000..ccc5e3e75
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileHelper.java
@@ -0,0 +1,319 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+package org.apache.cordova.camera;
+
+import android.annotation.SuppressLint;
+import android.content.ContentUris;
+import android.content.Context;
+import android.content.CursorLoader;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import android.provider.DocumentsContract;
+import android.provider.MediaStore;
+import android.webkit.MimeTypeMap;
+
+import org.apache.cordova.CordovaInterface;
+import org.apache.cordova.LOG;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Locale;
+
+public class FileHelper {
+ private static final String LOG_TAG = "FileUtils";
+ private static final String _DATA = "_data";
+
+ /**
+ * Returns the real path of the given URI string.
+ * If the given URI string represents a content:// URI, the real path is retrieved from the media store.
+ *
+ * @param uriString the URI string of the audio/image/video
+ * @param cordova the current application context
+ * @return the full path to the file
+ */
+ @SuppressWarnings("deprecation")
+ public static String getRealPath(Uri uri, CordovaInterface cordova) {
+ 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;
+ }
+
+ /**
+ * Returns the real path of the given URI.
+ * If the given URI is a content:// URI, the real path is retrieved from the media store.
+ *
+ * @param uri the URI of the audio/image/video
+ * @param cordova the current application context
+ * @return the full path to the file
+ */
+ public static String getRealPath(String uriString, CordovaInterface cordova) {
+ return FileHelper.getRealPath(Uri.parse(uriString), cordova);
+ }
+
+ @SuppressLint("NewApi")
+ public static String getRealPathFromURI_API11_And_Above(final Context context, final Uri uri) {
+
+ final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
+ // DocumentProvider
+ if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
+
+ // ExternalStorageProvider
+ if (isExternalStorageDocument(uri)) {
+ final String docId = DocumentsContract.getDocumentId(uri);
+ final String[] split = docId.split(":");
+ final String type = split[0];
+
+ if ("primary".equalsIgnoreCase(type)) {
+ return Environment.getExternalStorageDirectory() + "/" + split[1];
+ }
+
+ // TODO handle non-primary volumes
+ }
+ // DownloadsProvider
+ else if (isDownloadsDocument(uri)) {
+
+ final String id = DocumentsContract.getDocumentId(uri);
+ final Uri contentUri = ContentUris.withAppendedId(
+ Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
+
+ return getDataColumn(context, contentUri, null, null);
+ }
+ // MediaProvider
+ else if (isMediaDocument(uri)) {
+ final String docId = DocumentsContract.getDocumentId(uri);
+ final String[] split = docId.split(":");
+ final String type = split[0];
+
+ Uri contentUri = null;
+ if ("image".equals(type)) {
+ contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
+ } else if ("video".equals(type)) {
+ contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
+ } else if ("audio".equals(type)) {
+ contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
+ }
+
+ final String selection = "_id=?";
+ final String[] selectionArgs = new String[] {
+ split[1]
+ };
+
+ return getDataColumn(context, contentUri, selection, selectionArgs);
+ }
+ }
+ // MediaStore (and general)
+ else if ("content".equalsIgnoreCase(uri.getScheme())) {
+
+ // Return the remote address
+ if (isGooglePhotosUri(uri))
+ return uri.getLastPathSegment();
+
+ return getDataColumn(context, uri, null, null);
+ }
+ // File
+ else if ("file".equalsIgnoreCase(uri.getScheme())) {
+ return uri.getPath();
+ }
+
+ return null;
+ }
+
+ public static String getRealPathFromURI_BelowAPI11(Context context, Uri contentUri) {
+ String[] proj = { MediaStore.Images.Media.DATA };
+ String result = null;
+
+ try {
+ Cursor cursor = context.getContentResolver().query(contentUri, proj, null, null, null);
+ int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
+ cursor.moveToFirst();
+ result = cursor.getString(column_index);
+
+ } catch (Exception e) {
+ result = null;
+ }
+ return result;
+ }
+
+ /**
+ * Returns an input stream based on given URI string.
+ *
+ * @param uriString the URI string from which to obtain the input stream
+ * @param cordova the current application context
+ * @return an input stream into the data at the given URI or null if given an invalid URI string
+ * @throws IOException
+ */
+ public static InputStream getInputStreamFromUriString(String uriString, CordovaInterface cordova)
+ throws IOException {
+ InputStream returnValue = null;
+ if (uriString.startsWith("content")) {
+ Uri uri = Uri.parse(uriString);
+ returnValue = cordova.getActivity().getContentResolver().openInputStream(uri);
+ } else if (uriString.startsWith("file://")) {
+ int question = uriString.indexOf("?");
+ if (question > -1) {
+ uriString = uriString.substring(0, question);
+ }
+ if (uriString.startsWith("file:///android_asset/")) {
+ Uri uri = Uri.parse(uriString);
+ String relativePath = uri.getPath().substring(15);
+ returnValue = cordova.getActivity().getAssets().open(relativePath);
+ } else {
+ // might still be content so try that first
+ try {
+ returnValue = cordova.getActivity().getContentResolver().openInputStream(Uri.parse(uriString));
+ } catch (Exception e) {
+ returnValue = null;
+ }
+ if (returnValue == null) {
+ returnValue = new FileInputStream(getRealPath(uriString, cordova));
+ }
+ }
+ } else {
+ returnValue = new FileInputStream(uriString);
+ }
+ return returnValue;
+ }
+
+ /**
+ * Removes the "file://" prefix from the given URI string, if applicable.
+ * If the given URI string doesn't have a "file://" prefix, it is returned unchanged.
+ *
+ * @param uriString the URI string to operate on
+ * @return a path without the "file://" prefix
+ */
+ public static String stripFileProtocol(String uriString) {
+ if (uriString.startsWith("file://")) {
+ uriString = uriString.substring(7);
+ }
+ return uriString;
+ }
+
+ public static String getMimeTypeForExtension(String path) {
+ String extension = path;
+ int lastDot = extension.lastIndexOf('.');
+ if (lastDot != -1) {
+ extension = extension.substring(lastDot + 1);
+ }
+ // Convert the URI string to lower case to ensure compatibility with MimeTypeMap (see CB-2185).
+ extension = extension.toLowerCase(Locale.getDefault());
+ if (extension.equals("3ga")) {
+ return "audio/3gpp";
+ }
+ return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
+ }
+
+ /**
+ * Returns the mime type of the data specified by the given URI string.
+ *
+ * @param uriString the URI string of the data
+ * @return the mime type of the specified data
+ */
+ public static String getMimeType(String uriString, CordovaInterface cordova) {
+ String mimeType = null;
+
+ Uri uri = Uri.parse(uriString);
+ if (uriString.startsWith("content://")) {
+ mimeType = cordova.getActivity().getContentResolver().getType(uri);
+ } else {
+ mimeType = getMimeTypeForExtension(uri.getPath());
+ }
+
+ return mimeType;
+ }
+
+ /**
+ * Get the value of the data column for this Uri. This is useful for
+ * MediaStore Uris, and other file-based ContentProviders.
+ *
+ * @param context The context.
+ * @param uri The Uri to query.
+ * @param selection (Optional) Filter used in the query.
+ * @param selectionArgs (Optional) Selection arguments used in the query.
+ * @return The value of the _data column, which is typically a file path.
+ * @author paulburke
+ */
+ public static String getDataColumn(Context context, Uri uri, String selection,
+ String[] selectionArgs) {
+
+ Cursor cursor = null;
+ final String column = "_data";
+ final String[] projection = {
+ column
+ };
+
+ try {
+ cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
+ null);
+ if (cursor != null && cursor.moveToFirst()) {
+
+ final int column_index = cursor.getColumnIndexOrThrow(column);
+ return cursor.getString(column_index);
+ }
+ } catch (Exception e) {
+ return null;
+ } finally {
+ if (cursor != null)
+ cursor.close();
+ }
+ return null;
+ }
+
+ /**
+ * @param uri The Uri to check.
+ * @return Whether the Uri authority is ExternalStorageProvider.
+ * @author paulburke
+ */
+ public static boolean isExternalStorageDocument(Uri uri) {
+ return "com.android.externalstorage.documents".equals(uri.getAuthority());
+ }
+
+ /**
+ * @param uri The Uri to check.
+ * @return Whether the Uri authority is DownloadsProvider.
+ * @author paulburke
+ */
+ public static boolean isDownloadsDocument(Uri uri) {
+ return "com.android.providers.downloads.documents".equals(uri.getAuthority());
+ }
+
+ /**
+ * @param uri The Uri to check.
+ * @return Whether the Uri authority is MediaProvider.
+ * @author paulburke
+ */
+ public static boolean isMediaDocument(Uri uri) {
+ return "com.android.providers.media.documents".equals(uri.getAuthority());
+ }
+
+ /**
+ * @param uri The Uri to check.
+ * @return Whether the Uri authority is Google Photos.
+ */
+ public static boolean isGooglePhotosUri(Uri uri) {
+ return "com.google.android.apps.photos.content".equals(uri.getAuthority());
+ }
+}
diff --git a/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileProvider.java b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileProvider.java
new file mode 100644
index 000000000..336f93cef
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/java/org/apache/cordova/camera/FileProvider.java
@@ -0,0 +1,21 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+package org.apache.cordova.camera;
+
+public class FileProvider extends android.support.v4.content.FileProvider {}
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher.xml b/cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..be316184e
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background" />
+ <foreground android:drawable="@mipmap/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_background.png b/cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_background.png
new file mode 100644
index 000000000..021da864f
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_background.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-hdpi/icon.png b/cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png
similarity index 100%
rename from cordova/platforms/android/app/src/main/res/mipmap-hdpi/icon.png
rename to cordova/platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/cordova/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 000000000..538426124
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher.xml b/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..be316184e
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background" />
+ <foreground android:drawable="@mipmap/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_background.png b/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_background.png
new file mode 100644
index 000000000..da47a979e
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_background.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png b/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png
new file mode 100644
index 000000000..203223aff
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher_foreground.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-ldpi/icon.png b/cordova/platforms/android/app/src/main/res/mipmap-ldpi/ic_launcher.png
similarity index 100%
rename from cordova/platforms/android/app/src/main/res/mipmap-ldpi/icon.png
rename to cordova/platforms/android/app/src/main/res/mipmap-ldpi/ic_launcher.png
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher.xml b/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..be316184e
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background" />
+ <foreground android:drawable="@mipmap/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_background.png b/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_background.png
new file mode 100644
index 000000000..74e56e5b0
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_background.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png b/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 000000000..8ca658e72
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-mdpi/icon.png b/cordova/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from cordova/platforms/android/app/src/main/res/mipmap-mdpi/icon.png
rename to cordova/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..be316184e
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background" />
+ <foreground android:drawable="@mipmap/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_background.png b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_background.png
new file mode 100644
index 000000000..d0cb62dde
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_background.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 000000000..ae324f2d3
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xhdpi/icon.png b/cordova/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from cordova/platforms/android/app/src/main/res/mipmap-xhdpi/icon.png
rename to cordova/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..be316184e
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background" />
+ <foreground android:drawable="@mipmap/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_background.png b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_background.png
new file mode 100644
index 000000000..ec38d4032
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_background.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 000000000..7983ef454
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi/icon.png b/cordova/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from cordova/platforms/android/app/src/main/res/mipmap-xxhdpi/icon.png
rename to cordova/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..be316184e
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background" />
+ <foreground android:drawable="@mipmap/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_background.png b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_background.png
new file mode 100644
index 000000000..d652c0840
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_background.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png
new file mode 100644
index 000000000..6857bef7b
Binary files /dev/null and b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png differ
diff --git a/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi/icon.png b/cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi/icon.png
rename to cordova/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
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
new file mode 100644
index 000000000..2db87bdbd
--- /dev/null
+++ b/cordova/platforms/android/app/src/main/res/xml/camera_provider_paths.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<paths xmlns:android="http://schemas.android.com/apk/res/android">
+ <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 174443bae..d3c111cfe 100644
--- a/cordova/platforms/android/app/src/main/res/xml/config.xml
+++ b/cordova/platforms/android/app/src/main/res/xml/config.xml
@@ -1,13 +1,16 @@
<?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">
+ <feature name="Camera">
+ <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
+ </feature>
+ <feature name="Device">
+ <param name="android-package" value="org.apache.cordova.device.Device" />
+ </feature>
<feature name="File">
<param name="android-package" value="org.apache.cordova.file.FileUtils" />
<param name="onload" value="true" />
</feature>
<allow-navigation href="cdvfile:*" />
- <feature name="Device">
- <param name="android-package" value="org.apache.cordova.device.Device" />
- </feature>
<feature name="Whitelist">
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
<param name="onload" value="true" />
diff --git a/cordova/platforms/android/build.gradle b/cordova/platforms/android/build.gradle
index 47f79119a..fb40bb660 100644
--- a/cordova/platforms/android/build.gradle
+++ b/cordova/platforms/android/build.gradle
@@ -20,32 +20,30 @@
buildscript {
repositories {
- maven {
- url "https://maven.google.com"
- }
+ google()
jcenter()
}
- dependencies {
+ dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
- classpath 'com.android.tools.build:gradle:3.1.3'
+
+ classpath 'com.android.tools.build:gradle:3.2.0'
}
}
allprojects {
repositories {
- maven {
- url "https://maven.google.com"
- }
+ google()
jcenter()
}
+
//This replaces project.properties w.r.t. build settings
project.ext {
- defaultBuildToolsVersion="27.0.1" //String
+ defaultBuildToolsVersion="28.0.3" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
- defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
- defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
+ defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
+ defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
}
}
diff --git a/cordova/platforms/android/cordova/Api.js b/cordova/platforms/android/cordova/Api.js
index ae4d17bdd..be6b76b99 100644
--- a/cordova/platforms/android/cordova/Api.js
+++ b/cordova/platforms/android/cordova/Api.js
@@ -21,7 +21,6 @@ var path = require('path');
var Q = require('q');
var AndroidProject = require('./lib/AndroidProject');
-var AndroidStudio = require('./lib/AndroidStudio');
var PluginManager = require('cordova-common').PluginManager;
var CordovaLogger = require('cordova-common').CordovaLogger;
@@ -56,41 +55,27 @@ function setupEvents (externalEventEmitter) {
function Api (platform, platformRootDir, events) {
this.platform = PLATFORM;
this.root = path.resolve(__dirname, '..');
- this.builder = 'gradle';
setupEvents(events);
- var self = this;
+ const appMain = path.join(this.root, 'app', 'src', 'main');
+ const appRes = path.join(appMain, 'res');
this.locations = {
- root: self.root,
- www: path.join(self.root, 'assets/www'),
- res: path.join(self.root, 'res'),
- platformWww: path.join(self.root, 'platform_www'),
- configXml: path.join(self.root, 'res/xml/config.xml'),
- defaultConfigXml: path.join(self.root, 'cordova/defaults.xml'),
- strings: path.join(self.root, 'res/values/strings.xml'),
- manifest: path.join(self.root, 'AndroidManifest.xml'),
- build: path.join(self.root, 'build'),
- javaSrc: path.join(self.root, 'src'),
+ root: this.root,
+ www: path.join(appMain, 'assets', 'www'),
+ res: appRes,
+ platformWww: path.join(this.root, 'platform_www'),
+ configXml: path.join(appRes, 'xml', 'config.xml'),
+ defaultConfigXml: path.join(this.root, 'cordova', 'defaults.xml'),
+ strings: path.join(appRes, 'values', 'strings.xml'),
+ manifest: path.join(appMain, 'AndroidManifest.xml'),
+ build: path.join(this.root, 'build'),
+ javaSrc: path.join(appMain, 'java'),
// NOTE: Due to platformApi spec we need to return relative paths here
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
cordovaJsSrc: 'cordova-js-src'
};
-
- // XXX Override some locations for Android Studio projects
- if (AndroidStudio.isAndroidStudioProject(self.root) === true) {
- selfEvents.emit('log', 'Android Studio project detected');
- this.builder = 'studio';
- this.android_studio = true;
- this.locations.configXml = path.join(self.root, 'app/src/main/res/xml/config.xml');
- this.locations.strings = path.join(self.root, 'app/src/main/res/values/strings.xml');
- this.locations.manifest = path.join(self.root, 'app/src/main/AndroidManifest.xml');
- // We could have Java Source, we could have other languages
- this.locations.javaSrc = path.join(self.root, 'app/src/main/java/');
- this.locations.www = path.join(self.root, 'app/src/main/assets/www');
- this.locations.res = path.join(self.root, 'app/src/main/res');
- }
}
/**
@@ -223,33 +208,13 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
installOptions.variables.PACKAGE_NAME = project.getPackageName();
}
- if (this.android_studio === true) {
- installOptions.android_studio = true;
- }
-
return Q().then(function () {
- // CB-11964: Do a clean when installing the plugin code to get around
- // the Gradle bug introduced by the Android Gradle Plugin Version 2.2
- // TODO: Delete when the next version of Android Gradle plugin comes out
- // Since clean doesn't just clean the build, it also wipes out www, we need
- // to pass additional options.
-
- // Do some basic argument parsing
- var opts = {};
-
- // Skip cleaning prepared files when not invoking via cordova CLI.
- opts.noPrepare = true;
-
- if (!AndroidStudio.isAndroidStudioProject(self.root) && !project.isClean()) {
- return self.clean(opts);
- }
- }).then(function () {
return PluginManager.get(self.platform, self.locations, project).addPlugin(plugin, installOptions);
}).then(function () {
if (plugin.getFrameworks(this.platform).length === 0) return;
selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
// This should pick the correct builder, not just get gradle
- require('./lib/builders/builders').getBuilder(this.builder).prepBuildFiles();
+ require('./lib/builders/builders').getBuilder().prepBuildFiles();
}.bind(this))
// CB-11022 Return truthy value to prevent running prepare after
.thenResolve(true);
@@ -271,9 +236,8 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
var project = AndroidProject.getProjectFile(this.root);
- if (uninstallOptions && uninstallOptions.usePlatformWww === true && this.android_studio === true) {
+ if (uninstallOptions && uninstallOptions.usePlatformWww === true) {
uninstallOptions.usePlatformWww = false;
- uninstallOptions.android_studio = true;
}
return PluginManager.get(this.platform, this.locations, project)
@@ -282,7 +246,7 @@ Api.prototype.removePlugin = function (plugin, uninstallOptions) {
if (plugin.getFrameworks(this.platform).length === 0) return;
selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
- require('./lib/builders/builders').getBuilder(this.builder).prepBuildFiles();
+ require('./lib/builders/builders').getBuilder().prepBuildFiles();
}.bind(this))
// CB-11022 Return truthy value to prevent running prepare after
.thenResolve(true);
@@ -335,9 +299,7 @@ Api.prototype.removePlugin = function (plugin, uninstallOptions) {
*/
Api.prototype.build = function (buildOptions) {
var self = this;
- if (this.android_studio) {
- buildOptions.studio = true;
- }
+
return require('./lib/check_reqs').run().then(function () {
return require('./lib/build').run.call(self, buildOptions);
}).then(function (buildResults) {
@@ -381,12 +343,9 @@ Api.prototype.run = function (runOptions) {
*/
Api.prototype.clean = function (cleanOptions) {
var self = this;
- if (this.android_studio) {
- // This will lint, checking for null won't
- if (typeof cleanOptions === 'undefined') {
- cleanOptions = {};
- }
- cleanOptions.studio = true;
+ // This will lint, checking for null won't
+ if (typeof cleanOptions === 'undefined') {
+ cleanOptions = {};
}
return require('./lib/check_reqs').run().then(function () {
diff --git a/cordova/platforms/android/cordova/android_sdk_version b/cordova/platforms/android/cordova/android_sdk_version
index 34ed28fea..c4082f1f9 100755
--- a/cordova/platforms/android/cordova/android_sdk_version
+++ b/cordova/platforms/android/cordova/android_sdk_version
@@ -21,9 +21,7 @@
var android_sdk = require('./lib/android_sdk');
-android_sdk.print_newest_available_sdk_target().done(null, function(err) {
+android_sdk.print_newest_available_sdk_target().done(null, function (err) {
console.error(err);
process.exit(2);
});
-
-
diff --git a/cordova/platforms/android/cordova/build b/cordova/platforms/android/cordova/build
index 222e84a06..69f7b3ae0 100755
--- a/cordova/platforms/android/cordova/build
+++ b/cordova/platforms/android/cordova/build
@@ -19,24 +19,25 @@
under the License.
*/
-var args = process.argv;
+var args = process.argv;
var Api = require('./Api');
var nopt = require('nopt');
var path = require('path');
// Support basic help commands
-if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0)
+if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) >= 0) {
require('./lib/build').help();
+}
// Do some basic argument parsing
var buildOpts = nopt({
- 'verbose' : Boolean,
- 'silent' : Boolean,
- 'debug' : Boolean,
- 'release' : Boolean,
+ 'verbose': Boolean,
+ 'silent': Boolean,
+ 'debug': Boolean,
+ 'release': Boolean,
'nobuild': Boolean,
- 'buildConfig' : path
-}, { 'd' : '--verbose' });
+ 'buildConfig': path
+}, { 'd': '--verbose' });
// Make buildOptions compatible with PlatformApi build method spec
buildOpts.argv = buildOpts.argv.original;
@@ -44,7 +45,7 @@ buildOpts.argv = buildOpts.argv.original;
require('./loggingHelper').adjustLoggerLevel(buildOpts);
new Api().build(buildOpts)
-.catch(function(err) {
+.catch(function (err) {
console.error(err.stack);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/check_reqs b/cordova/platforms/android/cordova/check_reqs
index 372a3830a..e0c1c444f 100755
--- a/cordova/platforms/android/cordova/check_reqs
+++ b/cordova/platforms/android/cordova/check_reqs
@@ -22,9 +22,10 @@
var check_reqs = require('./lib/check_reqs');
check_reqs.run().done(
- function success() {
+ function success () {
console.log('Looks like your environment fully supports cordova-android development!');
- }, function fail(err) {
+ },
+ function fail (err) {
console.log(err);
process.exit(2);
}
diff --git a/cordova/platforms/android/cordova/clean b/cordova/platforms/android/cordova/clean
index 22065cc54..d3e6da1e3 100755
--- a/cordova/platforms/android/cordova/clean
+++ b/cordova/platforms/android/cordova/clean
@@ -20,11 +20,11 @@
*/
var Api = require('./Api');
-var path = require('path');
+var path = require('path');
var nopt = require('nopt');
// Support basic help commands
-if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
+if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]));
console.log('Cleans the project directory.');
process.exit(0);
@@ -32,9 +32,9 @@ if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >=
// Do some basic argument parsing
var opts = nopt({
- 'verbose' : Boolean,
- 'silent' : Boolean
-}, { 'd' : '--verbose' });
+ 'verbose': Boolean,
+ 'silent': Boolean
+}, { 'd': '--verbose' });
// Make buildOptions compatible with PlatformApi clean method spec
opts.argv = opts.argv.original;
@@ -45,7 +45,7 @@ opts.noPrepare = true;
require('./loggingHelper').adjustLoggerLevel(opts);
new Api().clean(opts)
-.catch(function(err) {
+.catch(function (err) {
console.error(err.stack);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/lib/AndroidManifest.js b/cordova/platforms/android/cordova/lib/AndroidManifest.js
index 5b7077ae5..98f820266 100644
--- a/cordova/platforms/android/cordova/lib/AndroidManifest.js
+++ b/cordova/platforms/android/cordova/lib/AndroidManifest.js
@@ -51,15 +51,11 @@ AndroidManifest.prototype.setVersionCode = function (versionCode) {
};
AndroidManifest.prototype.getPackageId = function () {
- /* jshint -W069 */
return this.doc.getroot().attrib['package'];
- /* jshint +W069 */
};
AndroidManifest.prototype.setPackageId = function (pkgId) {
- /* jshint -W069 */
this.doc.getroot().attrib['package'] = pkgId;
- /* jshint +W069 */
return this;
};
diff --git a/cordova/platforms/android/cordova/lib/AndroidProject.js b/cordova/platforms/android/cordova/lib/AndroidProject.js
index bf55cad1c..3c2586a32 100644
--- a/cordova/platforms/android/cordova/lib/AndroidProject.js
+++ b/cordova/platforms/android/cordova/lib/AndroidProject.js
@@ -21,7 +21,6 @@ var fs = require('fs');
var path = require('path');
var properties_parser = require('properties-parser');
var AndroidManifest = require('./AndroidManifest');
-var AndroidStudio = require('./AndroidStudio');
var pluginHandlers = require('./pluginHandlers');
var projectFileCache = {};
@@ -62,10 +61,7 @@ function AndroidProject (projectDir) {
this._dirty = false;
this.projectDir = projectDir;
this.platformWww = path.join(this.projectDir, 'platform_www');
- this.www = path.join(this.projectDir, 'assets/www');
- if (AndroidStudio.isAndroidStudioProject(projectDir) === true) {
- this.www = path.join(this.projectDir, 'app/src/main/assets/www');
- }
+ this.www = path.join(this.projectDir, 'app/src/main/assets/www');
}
AndroidProject.getProjectFile = function (projectDir) {
@@ -92,10 +88,7 @@ AndroidProject.purgeCache = function (projectDir) {
* @return {String} The name of the package
*/
AndroidProject.prototype.getPackageName = function () {
- var manifestPath = path.join(this.projectDir, 'AndroidManifest.xml');
- if (AndroidStudio.isAndroidStudioProject(this.projectDir) === true) {
- manifestPath = path.join(this.projectDir, 'app/src/main/AndroidManifest.xml');
- }
+ var manifestPath = path.join(this.projectDir, 'app/src/main/AndroidManifest.xml');
return new AndroidManifest(manifestPath).getPackageId();
};
diff --git a/cordova/platforms/android/cordova/lib/AndroidStudio.js b/cordova/platforms/android/cordova/lib/AndroidStudio.js
deleted file mode 100644
index 68d4d8f6c..000000000
--- a/cordova/platforms/android/cordova/lib/AndroidStudio.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * This is a simple routine that checks if project is an Android Studio Project
- *
- * @param {String} root Root folder of the project
- */
-
-/* jshint esnext: false */
-
-module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) {
- return true;
-};
diff --git a/cordova/platforms/android/cordova/lib/android_sdk.js b/cordova/platforms/android/cordova/lib/android_sdk.js
index 148f9f3db..1c0ab204c 100755
--- a/cordova/platforms/android/cordova/lib/android_sdk.js
+++ b/cordova/platforms/android/cordova/lib/android_sdk.js
@@ -17,7 +17,6 @@
under the License.
*/
-var Q = require('q');
var superspawn = require('cordova-common').superspawn;
var suffix_number_regex = /(\d+)$/;
@@ -95,7 +94,7 @@ module.exports.list_targets = function () {
} else throw err;
}).then(function (targets) {
if (targets.length === 0) {
- return Q.reject(new Error('No android targets (SDKs) installed!'));
+ return Promise.reject(new Error('No android targets (SDKs) installed!'));
}
return targets;
});
diff --git a/cordova/platforms/android/cordova/lib/build.js b/cordova/platforms/android/cordova/lib/build.js
index e33cfae08..2f0ba690e 100644
--- a/cordova/platforms/android/cordova/lib/build.js
+++ b/cordova/platforms/android/cordova/lib/build.js
@@ -31,11 +31,10 @@ var events = require('cordova-common').events;
var spawn = require('cordova-common').superspawn.spawn;
var CordovaError = require('cordova-common').CordovaError;
+module.exports.parseBuildOptions = parseOpts;
function parseOpts (options, resolvedTarget, projectRoot) {
options = options || {};
options.argv = nopt({
- gradle: Boolean,
- studio: Boolean,
prepenv: Boolean,
versionCode: String,
minSdkVersion: String,
@@ -50,26 +49,13 @@ function parseOpts (options, resolvedTarget, projectRoot) {
// Android Studio Build method is the default
var ret = {
buildType: options.release ? 'release' : 'debug',
- buildMethod: process.env.ANDROID_BUILD || 'studio',
prepEnv: options.argv.prepenv,
arch: resolvedTarget && resolvedTarget.arch,
extraArgs: []
};
- if (options.argv.gradle || options.argv.studio) {
- ret.buildMethod = options.argv.studio ? 'studio' : 'gradle';
- }
-
- // This comes from cordova/run
- if (options.studio) ret.buildMethod = 'studio';
- if (options.gradle) ret.buildMethod = 'gradle';
-
- if (options.nobuild) ret.buildMethod = 'none';
-
if (options.argv.versionCode) { ret.extraArgs.push('-PcdvVersionCode=' + options.argv.versionCode); }
-
if (options.argv.minSdkVersion) { ret.extraArgs.push('-PcdvMinSdkVersion=' + options.argv.minSdkVersion); }
-
if (options.argv.gradleArg) {
ret.extraArgs = ret.extraArgs.concat(options.argv.gradleArg);
}
@@ -129,7 +115,8 @@ function parseOpts (options, resolvedTarget, projectRoot) {
*/
module.exports.runClean = function (options) {
var opts = parseOpts(options, null, this.root);
- var builder = builders.getBuilder(opts.buildMethod);
+ var builder = builders.getBuilder();
+
return builder.prepEnv(opts).then(function () {
return builder.clean(opts);
});
@@ -149,8 +136,8 @@ module.exports.runClean = function (options) {
*/
module.exports.run = function (options, optResolvedTarget) {
var opts = parseOpts(options, optResolvedTarget, this.root);
- console.log(opts.buildMethod);
- var builder = builders.getBuilder(opts.buildMethod);
+ var builder = builders.getBuilder();
+
return builder.prepEnv(opts).then(function () {
if (opts.prepEnv) {
events.emit('verbose', 'Build file successfully prepared.');
@@ -161,8 +148,7 @@ module.exports.run = function (options, optResolvedTarget) {
events.emit('log', 'Built the following apk(s): \n\t' + apkPaths.join('\n\t'));
return {
apkPaths: apkPaths,
- buildType: opts.buildType,
- buildMethod: opts.buildMethod
+ buildType: opts.buildType
};
});
});
@@ -276,12 +262,10 @@ module.exports.help = function () {
console.log('Flags:');
console.log(' \'--debug\': will build project in debug mode (default)');
console.log(' \'--release\': will build project for release');
- console.log(' \'--ant\': will build project with ant');
- console.log(' \'--gradle\': will build project with gradle (default)');
console.log(' \'--nobuild\': will skip build process (useful when using run command)');
console.log(' \'--prepenv\': don\'t build, but copy in build scripts where necessary');
- console.log(' \'--versionCode=#\': Override versionCode for this build. Useful for uploading multiple APKs. Requires --gradle.');
- console.log(' \'--minSdkVersion=#\': Override minSdkVersion for this build. Useful for uploading multiple APKs. Requires --gradle.');
+ console.log(' \'--versionCode=#\': Override versionCode for this build. Useful for uploading multiple APKs.');
+ console.log(' \'--minSdkVersion=#\': Override minSdkVersion for this build. Useful for uploading multiple APKs.');
console.log(' \'--gradleArg=<gradle command line arg>\': Extra args to pass to the gradle command. Use one flag per arg. Ex. --gradleArg=-PcdvBuildMultipleApks=true');
console.log('');
console.log('Signed APK flags (overwrites debug/release-signing.proprties) :');
diff --git a/cordova/platforms/android/cordova/lib/builders/GenericBuilder.js b/cordova/platforms/android/cordova/lib/builders/GenericBuilder.js
deleted file mode 100644
index 892aa38f4..000000000
--- a/cordova/platforms/android/cordova/lib/builders/GenericBuilder.js
+++ /dev/null
@@ -1,124 +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.
-*/
-/* eslint no-self-assign: 0 */
-/* eslint no-unused-vars: 0 */
-
-var Q = require('q');
-var fs = require('fs');
-var path = require('path');
-var shell = require('shelljs');
-var events = require('cordova-common').events;
-
-function GenericBuilder (projectDir) {
- this.root = projectDir || path.resolve(__dirname, '../../..');
- this.binDirs = {
- studio: path.join(this.root, 'app', 'build', 'outputs', 'apk'),
- gradle: path.join(this.root, 'build', 'outputs', 'apk')
- };
-}
-
-GenericBuilder.prototype.prepEnv = function () {
- return Q();
-};
-
-GenericBuilder.prototype.build = function () {
- events.emit('log', 'Skipping build...');
- return Q(null);
-};
-
-GenericBuilder.prototype.clean = function () {
- return Q();
-};
-
-GenericBuilder.prototype.findOutputApks = function (build_type, arch) {
- var self = this;
- return Object.keys(this.binDirs).reduce(function (result, builderName) {
- var binDir = self.binDirs[builderName];
- return result.concat(findOutputApksHelper(binDir, build_type, builderName === 'ant' ? null : arch));
- }, []).sort(apkSorter);
-};
-
-module.exports = GenericBuilder;
-
-function apkSorter (fileA, fileB) {
- // De-prioritize arch specific builds
- var archSpecificRE = /-x86|-arm/;
- if (archSpecificRE.exec(fileA)) {
- return 1;
- } else if (archSpecificRE.exec(fileB)) {
- return -1;
- }
-
- // De-prioritize unsigned builds
- var unsignedRE = /-unsigned/;
- if (unsignedRE.exec(fileA)) {
- return 1;
- } else if (unsignedRE.exec(fileB)) {
- return -1;
- }
-
- var timeDiff = fs.statSync(fileB).mtime - fs.statSync(fileA).mtime;
- return timeDiff === 0 ? fileA.length - fileB.length : timeDiff;
-}
-
-function findOutputApksHelper (dir, build_type, arch) {
- var shellSilent = shell.config.silent;
- shell.config.silent = true;
-
- // list directory recursively
- var ret = shell.ls('-R', dir).map(function (file) {
- // ls does not include base directory
- return path.join(dir, file);
- }).filter(function (file) {
- // find all APKs
- return file.match(/\.apk?$/i);
- }).filter(function (candidate) {
- var apkName = path.basename(candidate);
- // Need to choose between release and debug .apk.
- if (build_type === 'debug') {
- return /-debug/.exec(apkName) && !/-unaligned|-unsigned/.exec(apkName);
- }
- if (build_type === 'release') {
- return /-release/.exec(apkName) && !/-unaligned/.exec(apkName);
- }
- return true;
- }).sort(apkSorter);
-
- shellSilent = shellSilent;
-
- if (ret.length === 0) {
- return ret;
- }
- // Assume arch-specific build if newest apk has -x86 or -arm.
- var archSpecific = !!/-x86|-arm/.exec(path.basename(ret[0]));
- // And show only arch-specific ones (or non-arch-specific)
- ret = ret.filter(function (p) {
- /* jshint -W018 */
- return !!/-x86|-arm/.exec(path.basename(p)) === archSpecific;
- /* jshint +W018 */
- });
-
- if (archSpecific && ret.length > 1 && arch) {
- ret = ret.filter(function (p) {
- return path.basename(p).indexOf('-' + arch) !== -1;
- });
- }
-
- return ret;
-}
diff --git a/cordova/platforms/android/cordova/lib/builders/GradleBuilder.js b/cordova/platforms/android/cordova/lib/builders/GradleBuilder.js
deleted file mode 100644
index b955db18b..000000000
--- a/cordova/platforms/android/cordova/lib/builders/GradleBuilder.js
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var Q = require('q');
-var fs = require('fs');
-var util = require('util');
-var path = require('path');
-var shell = require('shelljs');
-var superspawn = require('cordova-common').superspawn;
-var CordovaError = require('cordova-common').CordovaError;
-var events = require('cordova-common').events;
-var check_reqs = require('../check_reqs');
-
-var GenericBuilder = require('./GenericBuilder');
-
-var MARKER = 'YOUR CHANGES WILL BE ERASED!';
-var SIGNING_PROPERTIES = '-signing.properties';
-var TEMPLATE =
- '# This file is automatically generated.\n' +
- '# Do not modify this file -- ' + MARKER + '\n';
-
-function GradleBuilder (projectRoot) {
- GenericBuilder.call(this, projectRoot);
-
- this.binDirs = { gradle: this.binDirs.gradle };
-}
-
-util.inherits(GradleBuilder, GenericBuilder);
-
-GradleBuilder.prototype.getArgs = function (cmd, opts) {
- if (cmd === 'release') {
- cmd = 'cdvBuildRelease';
- } else if (cmd === 'debug') {
- cmd = 'cdvBuildDebug';
- }
- var args = [cmd, '-b', path.join(this.root, 'build.gradle')];
- if (opts.arch) {
- args.push('-PcdvBuildArch=' + opts.arch);
- }
-
- // 10 seconds -> 6 seconds
- args.push('-Dorg.gradle.daemon=true');
- // to allow dex in process
- args.push('-Dorg.gradle.jvmargs=-Xmx2048m');
- // allow NDK to be used - required by Gradle 1.5 plugin
- args.push('-Pandroid.useDeprecatedNdk=true');
- args.push.apply(args, opts.extraArgs);
- // Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
- // args.push('-Dorg.gradle.parallel=true');
- return args;
-};
-
-/*
- * This returns a promise
- */
-
-GradleBuilder.prototype.runGradleWrapper = function (gradle_cmd, gradle_file) {
- var gradlePath = path.join(this.root, 'gradlew');
- gradle_file = path.join(this.root, (gradle_file || 'wrapper.gradle'));
- if (fs.existsSync(gradlePath)) {
- // Literally do nothing, for some reason this works, while !fs.existsSync didn't on Windows
- } else {
- return superspawn.spawn(gradle_cmd, ['-p', this.root, 'wrapper', '-b', gradle_file], { stdio: 'pipe' })
- .progress(function (stdio) {
- suppressJavaOptionsInfo(stdio);
- });
- }
-};
-
-/*
- * We need to kill this in a fire.
- */
-
-GradleBuilder.prototype.readProjectProperties = function () {
- function findAllUniq (data, r) {
- var s = {};
- var m;
- while ((m = r.exec(data))) {
- s[m[1]] = 1;
- }
- return Object.keys(s);
- }
-
- var data = fs.readFileSync(path.join(this.root, 'project.properties'), 'utf8');
- return {
- libs: findAllUniq(data, /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg),
- gradleIncludes: findAllUniq(data, /^\s*cordova\.gradle\.include\.\d+=(.*)(?:\s|$)/mg),
- systemLibs: findAllUniq(data, /^\s*cordova\.system\.library\.\d+=(.*)(?:\s|$)/mg)
- };
-};
-
-GradleBuilder.prototype.extractRealProjectNameFromManifest = function () {
- var manifestPath = path.join(this.root, 'AndroidManifest.xml');
- var manifestData = fs.readFileSync(manifestPath, 'utf8');
- var m = /<manifest[\s\S]*?package\s*=\s*"(.*?)"/i.exec(manifestData);
- if (!m) {
- throw new CordovaError('Could not find package name in ' + manifestPath);
- }
-
- var packageName = m[1];
- var lastDotIndex = packageName.lastIndexOf('.');
- return packageName.substring(lastDotIndex + 1);
-};
-
-// Makes the project buildable, minus the gradle wrapper.
-GradleBuilder.prototype.prepBuildFiles = function () {
- // Update the version of build.gradle in each dependent library.
- var pluginBuildGradle = path.join(this.root, 'cordova', 'lib', 'plugin-build.gradle');
- var propertiesObj = this.readProjectProperties();
- var subProjects = propertiesObj.libs;
-
- // Check and copy the gradle file into the subproject.
- // Called by the loop below this function def.
- var checkAndCopy = function (subProject, root) {
- var subProjectGradle = path.join(root, subProject, 'build.gradle');
- // This is the future-proof way of checking if a file exists
- // This must be synchronous to satisfy a Travis test
- try {
- fs.accessSync(subProjectGradle, fs.F_OK);
- } catch (e) {
- shell.cp('-f', pluginBuildGradle, subProjectGradle);
- }
- };
-
- // Some dependencies on Android don't use gradle, or don't have default
- // gradle files. This copies a dummy gradle file into them
- for (var i = 0; i < subProjects.length; ++i) {
- if (subProjects[i] !== 'CordovaLib' && subProjects[i] !== 'app') {
- checkAndCopy(subProjects[i], this.root);
- }
- }
-
- var name = this.extractRealProjectNameFromManifest();
- // Remove the proj.id/name- prefix from projects: https://issues.apache.org/jira/browse/CB-9149
- var settingsGradlePaths = subProjects.map(function (p) {
- var realDir = p.replace(/[/\\]/g, ':');
- var libName = realDir.replace(name + '-', '');
- var str = 'include ":' + libName + '"\n';
- if (realDir.indexOf(name + '-') !== -1) { str += 'project(":' + libName + '").projectDir = new File("' + p + '")\n'; }
- return str;
- });
-
- // Write the settings.gradle file.
- fs.writeFileSync(path.join(this.root, 'settings.gradle'),
- '// GENERATED FILE - DO NOT EDIT\n' +
- 'include ":"\n' + settingsGradlePaths.join(''));
- // Update dependencies within build.gradle.
- var buildGradle = fs.readFileSync(path.join(this.root, 'build.gradle'), 'utf8');
- var depsList = '';
- var root = this.root;
-
- // Cordova Plugins can be written as library modules that would use Cordova as a
- // dependency. Because we need to make sure that Cordova is compiled only once for
- // dexing, we make sure to exclude CordovaLib from these modules
- var insertExclude = function (p) {
- var gradlePath = path.join(root, p, 'build.gradle');
- var projectGradleFile = fs.readFileSync(gradlePath, 'utf-8');
- if (projectGradleFile.indexOf('CordovaLib') !== -1) {
- depsList += '{\n exclude module:("CordovaLib")\n }\n';
- } else {
- depsList += '\n';
- }
- };
-
- subProjects.forEach(function (p) {
- events.emit('log', 'Subproject Path: ' + p);
- var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
- depsList += ' implementation(project(path: "' + libName + '"))';
- insertExclude(p);
- });
-
- // For why we do this mapping: https://issues.apache.org/jira/browse/CB-8390
- var SYSTEM_LIBRARY_MAPPINGS = [
- [/^\/?extras\/android\/support\/(.*)$/, 'com.android.support:support-$1:+'],
- [/^\/?google\/google_play_services\/libproject\/google-play-services_lib\/?$/, 'com.google.android.gms:play-services:+']
- ];
- propertiesObj.systemLibs.forEach(function (p) {
- var mavenRef;
- // It's already in gradle form if it has two ':'s
- if (/:.*:/.exec(p)) {
- mavenRef = p;
- } else {
- for (var i = 0; i < SYSTEM_LIBRARY_MAPPINGS.length; ++i) {
- var pair = SYSTEM_LIBRARY_MAPPINGS[i];
- if (pair[0].exec(p)) {
- mavenRef = p.replace(pair[0], pair[1]);
- break;
- }
- }
- if (!mavenRef) {
- throw new CordovaError('Unsupported system library (does not work with gradle): ' + p);
- }
- }
- depsList += ' compile "' + mavenRef + '"\n';
- });
-
- // This code is dangerous and actually writes gradle declarations directly into the build.gradle
- // Try not to mess with this if possible
- buildGradle = buildGradle.replace(/(SUB-PROJECT DEPENDENCIES START)[\s\S]*(\/\/ SUB-PROJECT DEPENDENCIES END)/, '$1\n' + depsList + ' $2');
- var includeList = '';
- propertiesObj.gradleIncludes.forEach(function (includePath) {
- includeList += 'apply from: "' + includePath + '"\n';
- });
- buildGradle = buildGradle.replace(/(PLUGIN GRADLE EXTENSIONS START)[\s\S]*(\/\/ PLUGIN GRADLE EXTENSIONS END)/, '$1\n' + includeList + '$2');
- fs.writeFileSync(path.join(this.root, 'build.gradle'), buildGradle);
-};
-
-GradleBuilder.prototype.prepEnv = function (opts) {
- var self = this;
- return check_reqs.check_gradle().then(function (gradlePath) {
- return self.runGradleWrapper(gradlePath);
- }).then(function () {
- return self.prepBuildFiles();
- }).then(function () {
- // We now copy the gradle out of the framework
- // This is a dirty patch to get the build working
- /*
- var wrapperDir = path.join(self.root, 'CordovaLib');
- if (process.platform == 'win32') {
- shell.rm('-f', path.join(self.root, 'gradlew.bat'));
- shell.cp(path.join(wrapperDir, 'gradlew.bat'), self.root);
- } else {
- shell.rm('-f', path.join(self.root, 'gradlew'));
- shell.cp(path.join(wrapperDir, 'gradlew'), self.root);
- }
- shell.rm('-rf', path.join(self.root, 'gradle', 'wrapper'));
- shell.mkdir('-p', path.join(self.root, 'gradle'));
- shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(self.root, 'gradle'));
-*/
- // If the gradle distribution URL is set, make sure it points to version we want.
- // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
- // For some reason, using ^ and $ don't work. This does the job, though.
- var distributionUrlRegex = /distributionUrl.*zip/;
- /* jshint -W069 */
- var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
- /* jshint +W069 */
- var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
- shell.chmod('u+w', gradleWrapperPropertiesPath);
- shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
-
- var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
- var propertiesFilePath = path.join(self.root, propertiesFile);
- if (opts.packageInfo) {
- fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
- } else if (isAutoGenerated(propertiesFilePath)) {
- shell.rm('-f', propertiesFilePath);
- }
- });
-};
-
-/*
- * Builds the project with gradle.
- * Returns a promise.
- */
-GradleBuilder.prototype.build = function (opts) {
- var wrapper = path.join(this.root, 'gradlew');
- var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts);
-
- return superspawn.spawn(wrapper, args, { stdio: 'pipe' })
- .progress(function (stdio) {
- suppressJavaOptionsInfo(stdio);
- }).catch(function (error) {
- if (error.toString().indexOf('failed to find target with hash string') >= 0) {
- return check_reqs.check_android_target(error).then(function () {
- // If due to some odd reason - check_android_target succeeds
- // we should still fail here.
- return Q.reject(error);
- });
- }
- return Q.reject(error);
- });
-};
-
-GradleBuilder.prototype.clean = function (opts) {
- var builder = this;
- var wrapper = path.join(this.root, 'gradlew');
- var args = builder.getArgs('clean', opts);
- return Q().then(function () {
- return superspawn.spawn(wrapper, args, { stdio: 'inherit' });
- }).then(function () {
- shell.rm('-rf', path.join(builder.root, 'out'));
-
- ['debug', 'release'].forEach(function (config) {
- var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
- if (isAutoGenerated(propertiesFilePath)) {
- shell.rm('-f', propertiesFilePath);
- }
- });
- });
-};
-
-module.exports = GradleBuilder;
-
-function suppressJavaOptionsInfo (stdio) {
- if (stdio.stderr) {
- /*
- * Workaround for the issue with Java printing some unwanted information to
- * stderr instead of stdout.
- * This function suppresses 'Picked up _JAVA_OPTIONS' message from being
- * printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
- * explanation.
- */
- var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
- if (suppressThisLine) {
- return;
- }
- process.stderr.write(stdio.stderr);
- } else {
- process.stdout.write(stdio.stdout);
- }
-}
-
-function isAutoGenerated (file) {
- return fs.existsSync(file) && fs.readFileSync(file, 'utf8').indexOf(MARKER) > 0;
-}
diff --git a/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js b/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js
new file mode 100644
index 000000000..c5ad00d34
--- /dev/null
+++ b/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js
@@ -0,0 +1,370 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT 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-self-assign: 0 */
+/* eslint no-unused-vars: 0 */
+
+var Q = require('q');
+var fs = require('fs');
+var path = require('path');
+var shell = require('shelljs');
+var spawn = require('cordova-common').superspawn.spawn;
+var events = require('cordova-common').events;
+var CordovaError = require('cordova-common').CordovaError;
+var check_reqs = require('../check_reqs');
+
+const MARKER = 'YOUR CHANGES WILL BE ERASED!';
+const SIGNING_PROPERTIES = '-signing.properties';
+const TEMPLATE =
+ '# This file is automatically generated.\n' +
+ '# Do not modify this file -- ' + MARKER + '\n';
+
+class ProjectBuilder {
+ constructor (rootDirectory) {
+ this.root = rootDirectory || path.resolve(__dirname, '../../..');
+ this.binDir = path.join(this.root, 'app', 'build', 'outputs', 'apk');
+ }
+
+ getArgs (cmd, opts) {
+ if (cmd === 'release') {
+ cmd = 'cdvBuildRelease';
+ } else if (cmd === 'debug') {
+ cmd = 'cdvBuildDebug';
+ }
+
+ let args = [cmd, '-b', path.join(this.root, 'build.gradle')];
+
+ if (opts.arch) {
+ args.push('-PcdvBuildArch=' + opts.arch);
+ }
+
+ args.push.apply(args, opts.extraArgs);
+
+ return args;
+ }
+
+ /*
+ * This returns a promise
+ */
+ runGradleWrapper (gradle_cmd) {
+ var gradlePath = path.join(this.root, 'gradlew');
+ var wrapperGradle = path.join(this.root, 'wrapper.gradle');
+ if (fs.existsSync(gradlePath)) {
+ // Literally do nothing, for some reason this works, while !fs.existsSync didn't on Windows
+ } else {
+ return spawn(gradle_cmd, ['-p', this.root, 'wrapper', '-b', wrapperGradle], { stdio: 'inherit' });
+ }
+ }
+
+ readProjectProperties () {
+ function findAllUniq (data, r) {
+ var s = {};
+ var m;
+ while ((m = r.exec(data))) {
+ s[m[1]] = 1;
+ }
+ return Object.keys(s);
+ }
+
+ var data = fs.readFileSync(path.join(this.root, 'project.properties'), 'utf8');
+ return {
+ libs: findAllUniq(data, /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg),
+ gradleIncludes: findAllUniq(data, /^\s*cordova\.gradle\.include\.\d+=(.*)(?:\s|$)/mg),
+ systemLibs: findAllUniq(data, /^\s*cordova\.system\.library\.\d+=(.*)(?:\s|$)/mg)
+ };
+ }
+
+ extractRealProjectNameFromManifest () {
+ var manifestPath = path.join(this.root, 'app', 'src', 'main', 'AndroidManifest.xml');
+ var manifestData = fs.readFileSync(manifestPath, 'utf8');
+ var m = /<manifest[\s\S]*?package\s*=\s*"(.*?)"/i.exec(manifestData);
+ if (!m) {
+ throw new CordovaError('Could not find package name in ' + manifestPath);
+ }
+
+ var packageName = m[1];
+ var lastDotIndex = packageName.lastIndexOf('.');
+ return packageName.substring(lastDotIndex + 1);
+ }
+
+ // Makes the project buildable, minus the gradle wrapper.
+ prepBuildFiles () {
+ // Update the version of build.gradle in each dependent library.
+ var pluginBuildGradle = path.join(this.root, 'cordova', 'lib', 'plugin-build.gradle');
+ var propertiesObj = this.readProjectProperties();
+ var subProjects = propertiesObj.libs;
+
+ // Check and copy the gradle file into the subproject
+ // Called by the loop before this function def
+
+ var checkAndCopy = function (subProject, root) {
+ var subProjectGradle = path.join(root, subProject, 'build.gradle');
+ // This is the future-proof way of checking if a file exists
+ // This must be synchronous to satisfy a Travis test
+ try {
+ fs.accessSync(subProjectGradle, fs.F_OK);
+ } catch (e) {
+ shell.cp('-f', pluginBuildGradle, subProjectGradle);
+ }
+ };
+
+ for (var i = 0; i < subProjects.length; ++i) {
+ if (subProjects[i] !== 'CordovaLib') {
+ checkAndCopy(subProjects[i], this.root);
+ }
+ }
+ var name = this.extractRealProjectNameFromManifest();
+ // Remove the proj.id/name- prefix from projects: https://issues.apache.org/jira/browse/CB-9149
+ var settingsGradlePaths = subProjects.map(function (p) {
+ var realDir = p.replace(/[/\\]/g, ':');
+ var libName = realDir.replace(name + '-', '');
+ var str = 'include ":' + libName + '"\n';
+ if (realDir.indexOf(name + '-') !== -1) {
+ str += 'project(":' + libName + '").projectDir = new File("' + p + '")\n';
+ }
+ return str;
+ });
+
+ fs.writeFileSync(path.join(this.root, 'settings.gradle'),
+ '// GENERATED FILE - DO NOT EDIT\n' +
+ 'include ":"\n' + settingsGradlePaths.join(''));
+
+ // Update dependencies within build.gradle.
+ var buildGradle = fs.readFileSync(path.join(this.root, 'app', 'build.gradle'), 'utf8');
+ var depsList = '';
+ var root = this.root;
+ var insertExclude = function (p) {
+ var gradlePath = path.join(root, p, 'build.gradle');
+ var projectGradleFile = fs.readFileSync(gradlePath, 'utf-8');
+ if (projectGradleFile.indexOf('CordovaLib') !== -1) {
+ depsList += '{\n exclude module:("CordovaLib")\n }\n';
+ } else {
+ depsList += '\n';
+ }
+ };
+ subProjects.forEach(function (p) {
+ events.emit('log', 'Subproject Path: ' + p);
+ var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
+ if (libName !== 'app') {
+ depsList += ' implementation(project(path: ":' + libName + '"))';
+ insertExclude(p);
+ }
+ });
+ // For why we do this mapping: https://issues.apache.org/jira/browse/CB-8390
+ var SYSTEM_LIBRARY_MAPPINGS = [
+ [/^\/?extras\/android\/support\/(.*)$/, 'com.android.support:support-$1:+'],
+ [/^\/?google\/google_play_services\/libproject\/google-play-services_lib\/?$/, 'com.google.android.gms:play-services:+']
+ ];
+
+ propertiesObj.systemLibs.forEach(function (p) {
+ var mavenRef;
+ // It's already in gradle form if it has two ':'s
+ if (/:.*:/.exec(p)) {
+ mavenRef = p;
+ } else {
+ for (var i = 0; i < SYSTEM_LIBRARY_MAPPINGS.length; ++i) {
+ var pair = SYSTEM_LIBRARY_MAPPINGS[i];
+ if (pair[0].exec(p)) {
+ mavenRef = p.replace(pair[0], pair[1]);
+ break;
+ }
+ }
+ if (!mavenRef) {
+ throw new CordovaError('Unsupported system library (does not work with gradle): ' + p);
+ }
+ }
+ depsList += ' implementation "' + mavenRef + '"\n';
+ });
+
+ buildGradle = buildGradle.replace(/(SUB-PROJECT DEPENDENCIES START)[\s\S]*(\/\/ SUB-PROJECT DEPENDENCIES END)/, '$1\n' + depsList + ' $2');
+ var includeList = '';
+
+ propertiesObj.gradleIncludes.forEach(function (includePath) {
+ includeList += 'apply from: "../' + includePath + '"\n';
+ });
+ buildGradle = buildGradle.replace(/(PLUGIN GRADLE EXTENSIONS START)[\s\S]*(\/\/ PLUGIN GRADLE EXTENSIONS END)/, '$1\n' + includeList + '$2');
+ // This needs to be stored in the app gradle, not the root grade
+ fs.writeFileSync(path.join(this.root, 'app', 'build.gradle'), buildGradle);
+ }
+
+ prepEnv (opts) {
+ var self = this;
+ return check_reqs.check_gradle()
+ .then(function (gradlePath) {
+ return self.runGradleWrapper(gradlePath);
+ }).then(function () {
+ return self.prepBuildFiles();
+ }).then(function () {
+ // If the gradle distribution URL is set, make sure it points to version we want.
+ // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
+ // For some reason, using ^ and $ don't work. This does the job, though.
+ var distributionUrlRegex = /distributionUrl.*zip/;
+ var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.6-all.zip';
+ var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
+ shell.chmod('u+w', gradleWrapperPropertiesPath);
+ shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
+
+ var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
+ var propertiesFilePath = path.join(self.root, propertiesFile);
+ if (opts.packageInfo) {
+ fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
+ } else if (isAutoGenerated(propertiesFilePath)) {
+ shell.rm('-f', propertiesFilePath);
+ }
+ });
+ }
+
+ /*
+ * Builds the project with gradle.
+ * Returns a promise.
+ */
+ build (opts) {
+ var wrapper = path.join(this.root, 'gradlew');
+ var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts);
+
+ return spawn(wrapper, args, { stdio: 'pipe' })
+ .progress(function (stdio) {
+ if (stdio.stderr) {
+ /*
+ * Workaround for the issue with Java printing some unwanted information to
+ * stderr instead of stdout.
+ * This function suppresses 'Picked up _JAVA_OPTIONS' message from being
+ * printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
+ * explanation.
+ */
+ var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
+ if (suppressThisLine) {
+ return;
+ }
+ process.stderr.write(stdio.stderr);
+ } else {
+ process.stdout.write(stdio.stdout);
+ }
+ }).catch(function (error) {
+ if (error.toString().indexOf('failed to find target with hash string') >= 0) {
+ return check_reqs.check_android_target(error).then(function () {
+ // If due to some odd reason - check_android_target succeeds
+ // we should still fail here.
+ return Q.reject(error);
+ });
+ }
+ return Q.reject(error);
+ });
+ }
+
+ clean (opts) {
+ var builder = this;
+ var wrapper = path.join(this.root, 'gradlew');
+ var args = builder.getArgs('clean', opts);
+ return Q().then(function () {
+ return spawn(wrapper, args, { stdio: 'inherit' });
+ })
+ .then(function () {
+ shell.rm('-rf', path.join(builder.root, 'out'));
+
+ ['debug', 'release'].forEach(function (config) {
+ var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
+ if (isAutoGenerated(propertiesFilePath)) {
+ shell.rm('-f', propertiesFilePath);
+ }
+ });
+ });
+ }
+
+ findOutputApks (build_type, arch) {
+ return findOutputApksHelper(this.binDir, build_type, arch).sort(apkSorter);
+ }
+
+ fetchBuildResults (build_type, arch) {
+ return {
+ apkPaths: this.findOutputApks(build_type, arch),
+ buildType: build_type
+ };
+ }
+}
+
+module.exports = ProjectBuilder;
+
+function apkSorter (fileA, fileB) {
+ // De-prioritize arch specific builds
+ var archSpecificRE = /-x86|-arm/;
+ if (archSpecificRE.exec(fileA)) {
+ return 1;
+ } else if (archSpecificRE.exec(fileB)) {
+ return -1;
+ }
+
+ // De-prioritize unsigned builds
+ var unsignedRE = /-unsigned/;
+ if (unsignedRE.exec(fileA)) {
+ return 1;
+ } else if (unsignedRE.exec(fileB)) {
+ return -1;
+ }
+
+ var timeDiff = fs.statSync(fileB).mtime - fs.statSync(fileA).mtime;
+ return timeDiff === 0 ? fileA.length - fileB.length : timeDiff;
+}
+
+function findOutputApksHelper (dir, build_type, arch) {
+ var shellSilent = shell.config.silent;
+ shell.config.silent = true;
+
+ // list directory recursively
+ var ret = shell.ls('-R', dir).map(function (file) {
+ // ls does not include base directory
+ return path.join(dir, file);
+ }).filter(function (file) {
+ // find all APKs
+ return file.match(/\.apk?$/i);
+ }).filter(function (candidate) {
+ var apkName = path.basename(candidate);
+ // Need to choose between release and debug .apk.
+ if (build_type === 'debug') {
+ return /-debug/.exec(apkName) && !/-unaligned|-unsigned/.exec(apkName);
+ }
+ if (build_type === 'release') {
+ return /-release/.exec(apkName) && !/-unaligned/.exec(apkName);
+ }
+ return true;
+ }).sort(apkSorter);
+
+ shellSilent = shellSilent;
+
+ if (ret.length === 0) {
+ return ret;
+ }
+ // Assume arch-specific build if newest apk has -x86 or -arm.
+ var archSpecific = !!/-x86|-arm/.exec(path.basename(ret[0]));
+ // And show only arch-specific ones (or non-arch-specific)
+ ret = ret.filter(function (p) {
+ return !!/-x86|-arm/.exec(path.basename(p)) === archSpecific;
+ });
+
+ if (archSpecific && ret.length > 1 && arch) {
+ ret = ret.filter(function (p) {
+ return path.basename(p).indexOf('-' + arch) !== -1;
+ });
+ }
+
+ return ret;
+}
+
+function isAutoGenerated (file) {
+ return fs.existsSync(file) && fs.readFileSync(file, 'utf8').indexOf(MARKER) > 0;
+}
diff --git a/cordova/platforms/android/cordova/lib/builders/StudioBuilder.js b/cordova/platforms/android/cordova/lib/builders/StudioBuilder.js
deleted file mode 100644
index 1689e16c5..000000000
--- a/cordova/platforms/android/cordova/lib/builders/StudioBuilder.js
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var Q = require('q');
-var fs = require('fs');
-var util = require('util');
-var path = require('path');
-var shell = require('shelljs');
-var spawn = require('cordova-common').superspawn.spawn;
-var events = require('cordova-common').events;
-var CordovaError = require('cordova-common').CordovaError;
-var check_reqs = require('../check_reqs');
-
-var GenericBuilder = require('./GenericBuilder');
-
-var MARKER = 'YOUR CHANGES WILL BE ERASED!';
-var SIGNING_PROPERTIES = '-signing.properties';
-var TEMPLATE =
- '# This file is automatically generated.\n' +
- '# Do not modify this file -- ' + MARKER + '\n';
-
-function StudioBuilder (projectRoot) {
- GenericBuilder.call(this, projectRoot);
-
- this.binDirs = {gradle: this.binDirs.studio};
-}
-
-util.inherits(StudioBuilder, GenericBuilder);
-
-StudioBuilder.prototype.getArgs = function (cmd, opts) {
- if (cmd === 'release') {
- cmd = 'cdvBuildRelease';
- } else if (cmd === 'debug') {
- cmd = 'cdvBuildDebug';
- }
- var args = [cmd, '-b', path.join(this.root, 'build.gradle')];
- if (opts.arch) {
- args.push('-PcdvBuildArch=' + opts.arch);
- }
-
- // 10 seconds -> 6 seconds
- args.push('-Dorg.gradle.daemon=true');
- // to allow dex in process
- args.push('-Dorg.gradle.jvmargs=-Xmx2048m');
- // allow NDK to be used - required by Gradle 1.5 plugin
- // args.push('-Pandroid.useDeprecatedNdk=true');
- args.push.apply(args, opts.extraArgs);
- // Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
- // args.push('-Dorg.gradle.parallel=true');
- return args;
-};
-
-/*
- * This returns a promise
- */
-
-StudioBuilder.prototype.runGradleWrapper = function (gradle_cmd) {
- var gradlePath = path.join(this.root, 'gradlew');
- var wrapperGradle = path.join(this.root, 'wrapper.gradle');
- if (fs.existsSync(gradlePath)) {
- // Literally do nothing, for some reason this works, while !fs.existsSync didn't on Windows
- } else {
- return spawn(gradle_cmd, ['-p', this.root, 'wrapper', '-b', wrapperGradle], {stdio: 'inherit'});
- }
-};
-
-StudioBuilder.prototype.readProjectProperties = function () {
-
- function findAllUniq (data, r) {
- var s = {};
- var m;
- while ((m = r.exec(data))) {
- s[m[1]] = 1;
- }
- return Object.keys(s);
- }
-
- var data = fs.readFileSync(path.join(this.root, 'project.properties'), 'utf8');
- return {
- libs: findAllUniq(data, /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg),
- gradleIncludes: findAllUniq(data, /^\s*cordova\.gradle\.include\.\d+=(.*)(?:\s|$)/mg),
- systemLibs: findAllUniq(data, /^\s*cordova\.system\.library\.\d+=(.*)(?:\s|$)/mg)
- };
-};
-
-StudioBuilder.prototype.extractRealProjectNameFromManifest = function () {
- var manifestPath = path.join(this.root, 'app', 'src', 'main', 'AndroidManifest.xml');
- var manifestData = fs.readFileSync(manifestPath, 'utf8');
- var m = /<manifest[\s\S]*?package\s*=\s*"(.*?)"/i.exec(manifestData);
- if (!m) {
- throw new CordovaError('Could not find package name in ' + manifestPath);
- }
-
- var packageName = m[1];
- var lastDotIndex = packageName.lastIndexOf('.');
- return packageName.substring(lastDotIndex + 1);
-};
-
-// Makes the project buildable, minus the gradle wrapper.
-StudioBuilder.prototype.prepBuildFiles = function () {
- // Update the version of build.gradle in each dependent library.
- var pluginBuildGradle = path.join(this.root, 'cordova', 'lib', 'plugin-build.gradle');
- var propertiesObj = this.readProjectProperties();
- var subProjects = propertiesObj.libs;
-
- // Check and copy the gradle file into the subproject
- // Called by the loop before this function def
-
- var checkAndCopy = function (subProject, root) {
- var subProjectGradle = path.join(root, subProject, 'build.gradle');
- // This is the future-proof way of checking if a file exists
- // This must be synchronous to satisfy a Travis test
- try {
- fs.accessSync(subProjectGradle, fs.F_OK);
- } catch (e) {
- shell.cp('-f', pluginBuildGradle, subProjectGradle);
- }
- };
-
- for (var i = 0; i < subProjects.length; ++i) {
- if (subProjects[i] !== 'CordovaLib') {
- checkAndCopy(subProjects[i], this.root);
- }
- }
- var name = this.extractRealProjectNameFromManifest();
- // Remove the proj.id/name- prefix from projects: https://issues.apache.org/jira/browse/CB-9149
- var settingsGradlePaths = subProjects.map(function (p) {
- var realDir = p.replace(/[/\\]/g, ':');
- var libName = realDir.replace(name + '-', '');
- var str = 'include ":' + libName + '"\n';
- if (realDir.indexOf(name + '-') !== -1) {
- str += 'project(":' + libName + '").projectDir = new File("' + p + '")\n';
- }
- return str;
- });
-
- fs.writeFileSync(path.join(this.root, 'settings.gradle'),
- '// GENERATED FILE - DO NOT EDIT\n' +
- 'include ":"\n' + settingsGradlePaths.join(''));
-
- // Update dependencies within build.gradle.
- var buildGradle = fs.readFileSync(path.join(this.root, 'app', 'build.gradle'), 'utf8');
- var depsList = '';
- var root = this.root;
- var insertExclude = function (p) {
- var gradlePath = path.join(root, p, 'build.gradle');
- var projectGradleFile = fs.readFileSync(gradlePath, 'utf-8');
- if (projectGradleFile.indexOf('CordovaLib') !== -1) {
- depsList += '{\n exclude module:("CordovaLib")\n }\n';
- } else {
- depsList += '\n';
- }
- };
- subProjects.forEach(function (p) {
- events.emit('log', 'Subproject Path: ' + p);
- var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
- if (libName !== 'app') {
- depsList += ' implementation(project(path: ":' + libName + '"))';
- insertExclude(p);
- }
- });
- // For why we do this mapping: https://issues.apache.org/jira/browse/CB-8390
- var SYSTEM_LIBRARY_MAPPINGS = [
- [/^\/?extras\/android\/support\/(.*)$/, 'com.android.support:support-$1:+'],
- [/^\/?google\/google_play_services\/libproject\/google-play-services_lib\/?$/, 'com.google.android.gms:play-services:+']
- ];
-
- propertiesObj.systemLibs.forEach(function (p) {
- var mavenRef;
- // It's already in gradle form if it has two ':'s
- if (/:.*:/.exec(p)) {
- mavenRef = p;
- } else {
- for (var i = 0; i < SYSTEM_LIBRARY_MAPPINGS.length; ++i) {
- var pair = SYSTEM_LIBRARY_MAPPINGS[i];
- if (pair[0].exec(p)) {
- mavenRef = p.replace(pair[0], pair[1]);
- break;
- }
- }
- if (!mavenRef) {
- throw new CordovaError('Unsupported system library (does not work with gradle): ' + p);
- }
- }
- depsList += ' compile "' + mavenRef + '"\n';
- });
-
- buildGradle = buildGradle.replace(/(SUB-PROJECT DEPENDENCIES START)[\s\S]*(\/\/ SUB-PROJECT DEPENDENCIES END)/, '$1\n' + depsList + ' $2');
- var includeList = '';
-
- propertiesObj.gradleIncludes.forEach(function (includePath) {
- includeList += 'apply from: "../' + includePath + '"\n';
- });
- buildGradle = buildGradle.replace(/(PLUGIN GRADLE EXTENSIONS START)[\s\S]*(\/\/ PLUGIN GRADLE EXTENSIONS END)/, '$1\n' + includeList + '$2');
- // This needs to be stored in the app gradle, not the root grade
- fs.writeFileSync(path.join(this.root, 'app', 'build.gradle'), buildGradle);
-};
-
-StudioBuilder.prototype.prepEnv = function (opts) {
- var self = this;
- return check_reqs.check_gradle()
- .then(function (gradlePath) {
- return self.runGradleWrapper(gradlePath);
- }).then(function () {
- return self.prepBuildFiles();
- }).then(function () {
- // If the gradle distribution URL is set, make sure it points to version we want.
- // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
- // For some reason, using ^ and $ don't work. This does the job, though.
- var distributionUrlRegex = /distributionUrl.*zip/;
- var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
- var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
- shell.chmod('u+w', gradleWrapperPropertiesPath);
- shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
-
- var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
- var propertiesFilePath = path.join(self.root, propertiesFile);
- if (opts.packageInfo) {
- fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
- } else if (isAutoGenerated(propertiesFilePath)) {
- shell.rm('-f', propertiesFilePath);
- }
- });
-};
-
-/*
- * Builds the project with gradle.
- * Returns a promise.
- */
-StudioBuilder.prototype.build = function (opts) {
- var wrapper = path.join(this.root, 'gradlew');
- var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts);
-
- return spawn(wrapper, args, {stdio: 'pipe'})
- .progress(function (stdio) {
- if (stdio.stderr) {
- /*
- * Workaround for the issue with Java printing some unwanted information to
- * stderr instead of stdout.
- * This function suppresses 'Picked up _JAVA_OPTIONS' message from being
- * printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
- * explanation.
- */
- var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
- if (suppressThisLine) {
- return;
- }
- process.stderr.write(stdio.stderr);
- } else {
- process.stdout.write(stdio.stdout);
- }
- }).catch(function (error) {
- if (error.toString().indexOf('failed to find target with hash string') >= 0) {
- return check_reqs.check_android_target(error).then(function () {
- // If due to some odd reason - check_android_target succeeds
- // we should still fail here.
- return Q.reject(error);
- });
- }
- return Q.reject(error);
- });
-};
-
-StudioBuilder.prototype.clean = function (opts) {
- var builder = this;
- var wrapper = path.join(this.root, 'gradlew');
- var args = builder.getArgs('clean', opts);
- return Q().then(function () {
- return spawn(wrapper, args, {stdio: 'inherit'});
- })
- .then(function () {
- shell.rm('-rf', path.join(builder.root, 'out'));
-
- ['debug', 'release'].forEach(function (config) {
- var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
- if (isAutoGenerated(propertiesFilePath)) {
- shell.rm('-f', propertiesFilePath);
- }
- });
- });
-};
-
-module.exports = StudioBuilder;
-
-function isAutoGenerated (file) {
- return fs.existsSync(file) && fs.readFileSync(file, 'utf8').indexOf(MARKER) > 0;
-}
diff --git a/cordova/platforms/android/cordova/lib/builders/builders.js b/cordova/platforms/android/cordova/lib/builders/builders.js
index aedf9be52..42fc19d72 100644
--- a/cordova/platforms/android/cordova/lib/builders/builders.js
+++ b/cordova/platforms/android/cordova/lib/builders/builders.js
@@ -1,46 +1,34 @@
/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT 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 CordovaError = require('cordova-common').CordovaError;
-
-var knownBuilders = {
- gradle: 'GradleBuilder',
- studio: 'StudioBuilder',
- none: 'GenericBuilder'
-};
+const CordovaError = require('cordova-common').CordovaError;
/**
- * Helper method that instantiates and returns a builder for specified build
- * type.
+ * Helper method that instantiates and returns a builder for specified build type.
*
- * @param {String} builderType Builder name to construct and return. Must
- * be one of 'ant', 'gradle' or 'none'
- *
- * @return {Builder} A builder instance for specified build type.
+ * @return {Builder} A builder instance for specified build type.
*/
-module.exports.getBuilder = function (builderType, projectRoot) {
- if (!knownBuilders[builderType]) { throw new CordovaError('Builder ' + builderType + ' is not supported.'); }
-
+module.exports.getBuilder = function () {
try {
- var Builder = require('./' + knownBuilders[builderType]);
- return new Builder(projectRoot);
+ const Builder = require('./ProjectBuilder');
+ return new Builder();
} catch (err) {
- throw new CordovaError('Failed to instantiate ' + knownBuilders[builderType] + ' builder: ' + err);
+ throw new CordovaError('Failed to instantiate ProjectBuilder builder: ' + err);
}
};
diff --git a/cordova/platforms/android/cordova/lib/check_reqs.js b/cordova/platforms/android/cordova/lib/check_reqs.js
index d9c5f99d5..95ef89fce 100644
--- a/cordova/platforms/android/cordova/lib/check_reqs.js
+++ b/cordova/platforms/android/cordova/lib/check_reqs.js
@@ -19,8 +19,6 @@
under the License.
*/
-/* jshint sub:true */
-
var shelljs = require('shelljs');
var child_process = require('child_process');
var Q = require('q');
diff --git a/cordova/platforms/android/cordova/lib/config/GradlePropertiesParser.js b/cordova/platforms/android/cordova/lib/config/GradlePropertiesParser.js
new file mode 100644
index 000000000..ac7f38634
--- /dev/null
+++ b/cordova/platforms/android/cordova/lib/config/GradlePropertiesParser.js
@@ -0,0 +1,97 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+let fs = require('fs');
+let path = require('path');
+let propertiesParser = require('properties-parser');
+let events = require('cordova-common').events;
+
+class GradlePropertiesParser {
+ /**
+ * Loads and Edits Gradle Properties File.
+ *
+ * @param {String} platformDir is the path of the Android platform directory
+ */
+ constructor (platformDir) {
+ this._defaults = {
+ // 10 seconds -> 6 seconds
+ 'org.gradle.daemon': 'true',
+
+ // to allow dex in process
+ 'org.gradle.jvmargs': '-Xmx2048m',
+
+ // allow NDK to be used - required by Gradle 1.5 plugin
+ 'android.useDeprecatedNdk': 'true'
+
+ // Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
+ // 'org.gradle.parallel': 'true'
+ };
+
+ this.gradleFilePath = path.join(platformDir, 'gradle.properties');
+ }
+
+ configure () {
+ events.emit('verbose', '[Gradle Properties] Preparing Configuration');
+
+ this._initializeEditor();
+ this._configureDefaults();
+ this._save();
+ }
+
+ /**
+ * Initialize the properties editor for parsing, setting, etc.
+ */
+ _initializeEditor () {
+ // Touch empty gradle.properties file if missing.
+ if (!fs.existsSync(this.gradleFilePath)) {
+ events.emit('verbose', '[Gradle Properties] File missing, creating file with Cordova defaults.');
+ fs.writeFileSync(this.gradleFilePath, '', 'utf-8');
+ }
+
+ // Create an editor for parsing, getting, and setting configurations.
+ this.gradleFile = propertiesParser.createEditor(this.gradleFilePath);
+ }
+
+ /**
+ * Validate that defaults are set and set the missing defaults.
+ */
+ _configureDefaults () {
+ // Loop though Cordova default properties and set only if missing.
+ Object.keys(this._defaults).forEach(key => {
+ let value = this.gradleFile.get(key);
+
+ if (!value) {
+ events.emit('verbose', `[Gradle Properties] Appended missing default: ${key}=${this._defaults[key]}`);
+ this.gradleFile.set(key, this._defaults[key]);
+ } else if (value !== this._defaults[key]) {
+ events.emit('info', `[Gradle Properties] Detected Gradle property "${key}" with the value of "${value}", Cordova's recommended value is "${this._defaults[key]}"`);
+ }
+ });
+ }
+
+ /**
+ * Saves any changes that has been made to the properties file.
+ */
+ _save () {
+ events.emit('verbose', '[Gradle Properties] Updating and Saving File');
+ this.gradleFile.save();
+ }
+}
+
+module.exports = GradlePropertiesParser;
diff --git a/cordova/platforms/android/cordova/lib/device.js b/cordova/platforms/android/cordova/lib/device.js
index 84b509479..b186f817e 100644
--- a/cordova/platforms/android/cordova/lib/device.js
+++ b/cordova/platforms/android/cordova/lib/device.js
@@ -19,7 +19,6 @@
under the License.
*/
-var Q = require('q');
var build = require('./build');
var path = require('path');
var Adb = require('./Adb');
@@ -53,13 +52,13 @@ module.exports.list = function (lookHarder) {
module.exports.resolveTarget = function (target) {
return this.list(true).then(function (device_list) {
if (!device_list || !device_list.length) {
- return Q.reject(new CordovaError('Failed to deploy to device, no devices found.'));
+ return Promise.reject(new CordovaError('Failed to deploy to device, no devices found.'));
}
// default device
target = target || device_list[0];
if (device_list.indexOf(target) < 0) {
- return Q.reject('ERROR: Unable to find target \'' + target + '\'.');
+ return Promise.reject(new CordovaError('ERROR: Unable to find target \'' + target + '\'.'));
}
return build.detectArchitecture(target).then(function (arch) {
@@ -74,7 +73,7 @@ module.exports.resolveTarget = function (target) {
* Returns a promise.
*/
module.exports.install = function (target, buildResults) {
- return Q().then(function () {
+ return Promise.resolve().then(function () {
if (target && typeof target === 'object') {
return target;
}
diff --git a/cordova/platforms/android/cordova/lib/emulator.js b/cordova/platforms/android/cordova/lib/emulator.js
index 63ed302fe..e87b7d470 100644
--- a/cordova/platforms/android/cordova/lib/emulator.js
+++ b/cordova/platforms/android/cordova/lib/emulator.js
@@ -19,8 +19,6 @@
under the License.
*/
-/* jshint sub:true */
-
var android_versions = require('android-versions');
var retry = require('./retry');
var build = require('./build');
@@ -34,7 +32,6 @@ var shelljs = require('shelljs');
var android_sdk = require('./android_sdk');
var check_reqs = require('./check_reqs');
-var Q = require('q');
var os = require('os');
var fs = require('fs');
var child_process = require('child_process');
@@ -170,15 +167,13 @@ module.exports.list_images_using_android = function () {
}
*/
module.exports.list_images = function () {
- return Q.fcall(function () {
+ return Promise.resolve().then(function () {
if (forgivingWhichSync('avdmanager')) {
return module.exports.list_images_using_avdmanager();
} else if (forgivingWhichSync('android')) {
return module.exports.list_images_using_android();
} else {
- return Q().then(function () {
- throw new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?');
- });
+ return Promise.reject(new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?'));
}
}).then(function (avds) {
// In case we're missing the Android OS version string from the target description, add it.
@@ -277,8 +272,8 @@ module.exports.get_available_port = function () {
module.exports.start = function (emulator_ID, boot_timeout) {
var self = this;
- return Q().then(function () {
- if (emulator_ID) return Q(emulator_ID);
+ return Promise.resolve().then(function () {
+ if (emulator_ID) return Promise.resolve(emulator_ID);
return self.best_image().then(function (best) {
if (best && best.name) {
@@ -287,7 +282,7 @@ module.exports.start = function (emulator_ID, boot_timeout) {
}
var androidCmd = check_reqs.getAbsoluteAndroidCmd();
- return Q.reject(new CordovaError('No emulator images (avds) found.\n' +
+ return Promise.reject(new CordovaError('No emulator images (avds) found.\n' +
'1. Download desired System Image by running: ' + androidCmd + ' sdk\n' +
'2. Create an AVD by running: ' + androidCmd + ' avd\n' +
'HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver\n'));
@@ -308,7 +303,7 @@ module.exports.start = function (emulator_ID, boot_timeout) {
return self.wait_for_emulator(port);
});
}).then(function (emulatorId) {
- if (!emulatorId) { return Q.reject(new CordovaError('Failed to start emulator')); }
+ if (!emulatorId) { return Promise.reject(new CordovaError('Failed to start emulator')); }
// wait for emulator to boot up
process.stdout.write('Waiting for emulator to boot (this may take a while)...');
@@ -334,7 +329,7 @@ module.exports.start = function (emulator_ID, boot_timeout) {
*/
module.exports.wait_for_emulator = function (port) {
var self = this;
- return Q().then(function () {
+ return Promise.resolve().then(function () {
var emulator_id = 'emulator-' + port;
return Adb.shell(emulator_id, 'getprop dev.bootcomplete').then(function (output) {
if (output.indexOf('1') >= 0) {
@@ -371,10 +366,13 @@ module.exports.wait_for_boot = function (emulator_id, time_remaining) {
} else {
process.stdout.write('.');
- // Check at regular intervals
- return Q.delay(time_remaining < CHECK_BOOTED_INTERVAL ? time_remaining : CHECK_BOOTED_INTERVAL).then(function () {
- var updated_time = time_remaining >= 0 ? Math.max(time_remaining - CHECK_BOOTED_INTERVAL, 0) : time_remaining;
- return self.wait_for_boot(emulator_id, updated_time);
+ return new Promise(resolve => {
+ const delay = time_remaining < CHECK_BOOTED_INTERVAL ? time_remaining : CHECK_BOOTED_INTERVAL;
+
+ setTimeout(() => {
+ const updated_time = time_remaining >= 0 ? Math.max(time_remaining - CHECK_BOOTED_INTERVAL, 0) : time_remaining;
+ resolve(self.wait_for_boot(emulator_id, updated_time));
+ }, delay);
});
}
});
@@ -400,7 +398,7 @@ module.exports.create_image = function (name, target) {
// TODO: This seems like another error case, even though it always happens.
console.error('ERROR : Unable to create an avd emulator, no targets found.');
console.error('Ensure you have targets available by running the "android" command');
- return Q.reject();
+ return Promise.reject(new CordovaError());
}, function (error) {
console.error('ERROR : Failed to create emulator image : ');
console.error(error);
@@ -411,13 +409,13 @@ module.exports.create_image = function (name, target) {
module.exports.resolveTarget = function (target) {
return this.list_started().then(function (emulator_list) {
if (emulator_list.length < 1) {
- return Q.reject('No running Android emulators found, please start an emulator before deploying your project.');
+ return Promise.reject(new CordovaError('No running Android emulators found, please start an emulator before deploying your project.'));
}
// default emulator
target = target || emulator_list[0];
if (emulator_list.indexOf(target) < 0) {
- return Q.reject('Unable to find target \'' + target + '\'. Failed to deploy to emulator.');
+ return Promise.reject(new CordovaError('Unable to find target \'' + target + '\'. Failed to deploy to emulator.'));
}
return build.detectArchitecture(target).then(function (arch) {
@@ -436,15 +434,12 @@ module.exports.install = function (givenTarget, buildResults) {
var target;
// We need to find the proper path to the Android Manifest
- var manifestPath = path.join(__dirname, '..', '..', 'app', 'src', 'main', 'AndroidManifest.xml');
- if (buildResults.buildMethod === 'gradle') {
- manifestPath = path.join(__dirname, '../../AndroidManifest.xml');
- }
- var manifest = new AndroidManifest(manifestPath);
- var pkgName = manifest.getPackageId();
+ const manifestPath = path.join(__dirname, '..', '..', 'app', 'src', 'main', 'AndroidManifest.xml');
+ const manifest = new AndroidManifest(manifestPath);
+ const pkgName = manifest.getPackageId();
// resolve the target emulator
- return Q().then(function () {
+ return Promise.resolve().then(function () {
if (givenTarget && typeof givenTarget === 'object') {
return givenTarget;
} else {
@@ -459,7 +454,7 @@ module.exports.install = function (givenTarget, buildResults) {
}).then(function () {
// This promise is always resolved, even if 'adb uninstall' fails to uninstall app
// or the app doesn't installed at all, so no error catching needed.
- return Q.when().then(function () {
+ return Promise.resolve().then(function () {
var apk_path = build.findBestApkForArchitecture(buildResults, target.arch);
var execOptions = {
@@ -479,7 +474,7 @@ module.exports.install = function (givenTarget, buildResults) {
events.emit('verbose', 'Installing apk ' + apk + ' on ' + target + '...');
var command = 'adb -s ' + target + ' install -r "' + apk + '"';
- return Q.promise(function (resolve, reject) {
+ return new Promise(function (resolve, reject) {
child_process.exec(command, opts, function (err, stdout, stderr) {
if (err) reject(new CordovaError('Error executing "' + command + '": ' + stderr));
// adb does not return an error code even if installation fails. Instead it puts a specific
diff --git a/cordova/platforms/android/cordova/lib/install-device b/cordova/platforms/android/cordova/lib/install-device
index fc4b7841f..03873883e 100755
--- a/cordova/platforms/android/cordova/lib/install-device
+++ b/cordova/platforms/android/cordova/lib/install-device
@@ -19,23 +19,23 @@
under the License.
*/
-var device = require('./device'),
- args = process.argv;
+var device = require('./device');
+var args = process.argv;
-if(args.length > 2) {
+if (args.length > 2) {
var install_target;
- if (args[2].substring(0, 9) == '--target=') {
+ if (args[2].substring(0, 9) === '--target=') {
install_target = args[2].substring(9, args[2].length);
- device.install(install_target).done(null, function(err) {
+ device.install(install_target).catch(function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
- } else {
+ } else {
console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
process.exit(2);
- }
+ }
} else {
- device.install().done(null, function(err) {
+ device.install().catch(function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/lib/install-emulator b/cordova/platforms/android/cordova/lib/install-emulator
index aa2a34f6f..2d46dbe93 100755
--- a/cordova/platforms/android/cordova/lib/install-emulator
+++ b/cordova/platforms/android/cordova/lib/install-emulator
@@ -19,20 +19,20 @@
under the License.
*/
-var emulator = require('./emulator'),
- args = process.argv;
+var emulator = require('./emulator');
+var args = process.argv;
var install_target;
-if(args.length > 2) {
- if (args[2].substring(0, 9) == '--target=') {
+if (args.length > 2) {
+ if (args[2].substring(0, 9) === '--target=') {
install_target = args[2].substring(9, args[2].length);
- } else {
+ } else {
console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
process.exit(2);
- }
+ }
}
-emulator.install(install_target).done(null, function(err) {
+emulator.install(install_target).catch(function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/lib/list-devices b/cordova/platforms/android/cordova/lib/list-devices
index 8e22c7f2f..339c6658d 100755
--- a/cordova/platforms/android/cordova/lib/list-devices
+++ b/cordova/platforms/android/cordova/lib/list-devices
@@ -22,12 +22,12 @@
var devices = require('./device');
// Usage support for when args are given
-require('./check_reqs').check_android().then(function() {
- devices.list().done(function(device_list) {
- device_list && device_list.forEach(function(dev) {
+require('./check_reqs').check_android().then(function () {
+ devices.list().then(function (device_list) {
+ device_list && device_list.forEach(function (dev) {
console.log(dev);
});
- }, function(err) {
+ }, function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/lib/list-emulator-images b/cordova/platforms/android/cordova/lib/list-emulator-images
index 25e5c81a4..03cfb190c 100755
--- a/cordova/platforms/android/cordova/lib/list-emulator-images
+++ b/cordova/platforms/android/cordova/lib/list-emulator-images
@@ -22,12 +22,12 @@
var emulators = require('./emulator');
// Usage support for when args are given
-require('./check_reqs').check_android().then(function() {
- emulators.list_images().done(function(emulator_list) {
- emulator_list && emulator_list.forEach(function(emu) {
+require('./check_reqs').check_android().then(function () {
+ emulators.list_images().then(function (emulator_list) {
+ emulator_list && emulator_list.forEach(function (emu) {
console.log(emu.name);
});
- }, function(err) {
+ }, function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/lib/list-started-emulators b/cordova/platforms/android/cordova/lib/list-started-emulators
index 43ebda25b..2a83e03a1 100755
--- a/cordova/platforms/android/cordova/lib/list-started-emulators
+++ b/cordova/platforms/android/cordova/lib/list-started-emulators
@@ -22,12 +22,12 @@
var emulators = require('./emulator');
// Usage support for when args are given
-require('./check_reqs').check_android().then(function() {
- emulators.list_started().done(function(emulator_list) {
- emulator_list && emulator_list.forEach(function(emu) {
+require('./check_reqs').check_android().then(function () {
+ emulators.list_started().then(function (emulator_list) {
+ emulator_list && emulator_list.forEach(function (emu) {
console.log(emu);
});
- }, function(err) {
+ }, function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/lib/plugin-build.gradle b/cordova/platforms/android/cordova/lib/plugin-build.gradle
index fdef1f73f..032b870e1 100644
--- a/cordova/platforms/android/cordova/lib/plugin-build.gradle
+++ b/cordova/platforms/android/cordova/lib/plugin-build.gradle
@@ -20,9 +20,7 @@
buildscript {
repositories {
- maven {
- url "https://maven.google.com"
- }
+ google()
jcenter()
}
@@ -38,7 +36,7 @@ buildscript {
apply plugin: 'com.android.library'
dependencies {
- compile fileTree(dir: 'libs', include: '*.jar')
+ implementation fileTree(dir: 'libs', include: '*.jar')
debugCompile project(path: ":CordovaLib", configuration: "debug")
releaseCompile project(path: ":CordovaLib", configuration: "release")
}
@@ -46,7 +44,6 @@ dependencies {
android {
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
- publishNonDefault true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
diff --git a/cordova/platforms/android/cordova/lib/pluginHandlers.js b/cordova/platforms/android/cordova/lib/pluginHandlers.js
index a3ebed0eb..6d1a7336e 100644
--- a/cordova/platforms/android/cordova/lib/pluginHandlers.js
+++ b/cordova/platforms/android/cordova/lib/pluginHandlers.js
@@ -14,8 +14,6 @@
*
*/
-/* jshint unused: vars */
-
var fs = require('fs');
var path = require('path');
var shell = require('shelljs');
@@ -28,14 +26,7 @@ var handlers = {
if (!obj.src) throw new CordovaError(generateAttributeError('src', 'source-file', plugin.id));
if (!obj.targetDir) throw new CordovaError(generateAttributeError('target-dir', 'source-file', plugin.id));
- var dest = path.join(obj.targetDir, path.basename(obj.src));
-
- // TODO: This code needs to be replaced, since the core plugins need to be re-mapped to a different location in
- // a later plugins release. This is for legacy plugins to work with Cordova.
-
- if (options && options.android_studio === true) {
- dest = studioPathRemap(obj);
- }
+ var dest = getInstallDestination(obj);
if (options && options.force) {
copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
@@ -44,11 +35,7 @@ var handlers = {
}
},
uninstall: function (obj, plugin, project, options) {
- var dest = path.join(obj.targetDir, path.basename(obj.src));
-
- if (options && options.android_studio === true) {
- dest = studioPathRemap(obj);
- }
+ var dest = getInstallDestination(obj);
// TODO: Add Koltin extension to uninstall, since they are handled like Java files
if (obj.src.endsWith('java')) {
@@ -61,33 +48,21 @@ var handlers = {
},
'lib-file': {
install: function (obj, plugin, project, options) {
- var dest = path.join('libs', path.basename(obj.src));
- if (options && options.android_studio === true) {
- dest = path.join('app/libs', path.basename(obj.src));
- }
+ var dest = path.join('app/libs', path.basename(obj.src));
copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
},
uninstall: function (obj, plugin, project, options) {
- var dest = path.join('libs', path.basename(obj.src));
- if (options && options.android_studio === true) {
- dest = path.join('app/libs', path.basename(obj.src));
- }
+ var dest = path.join('app/libs', path.basename(obj.src));
removeFile(project.projectDir, dest);
}
},
'resource-file': {
install: function (obj, plugin, project, options) {
- var dest = path.normalize(obj.target);
- if (options && options.android_studio === true) {
- dest = path.join('app/src/main', dest);
- }
+ var dest = path.join('app', 'src', 'main', obj.target);
copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
},
uninstall: function (obj, plugin, project, options) {
- var dest = path.normalize(obj.target);
- if (options && options.android_studio === true) {
- dest = path.join('app/src/main', dest);
- }
+ var dest = path.join('app', 'src', 'main', obj.target);
removeFile(project.projectDir, dest);
}
},
@@ -317,15 +292,43 @@ function generateAttributeError (attribute, element, id) {
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
}
-function studioPathRemap (obj) {
- // If a Java file is using the new directory structure, don't penalize it
- if (!obj.targetDir.includes('app/src/main')) {
+function getInstallDestination (obj) {
+ var APP_MAIN_PREFIX = 'app/src/main';
+ var PATH_SEPARATOR = '/';
+
+ var PATH_SEP_MATCH = '\\' + PATH_SEPARATOR;
+ var PATH_SEP_OR_EOL_MATCH = '(\\' + PATH_SEPARATOR + '|$)';
+
+ var appReg = new RegExp('^app' + PATH_SEP_OR_EOL_MATCH);
+ var libsReg = new RegExp('^libs' + PATH_SEP_OR_EOL_MATCH);
+ var srcReg = new RegExp('^src' + PATH_SEP_OR_EOL_MATCH);
+ var srcMainReg = new RegExp('^src' + PATH_SEP_MATCH + 'main' + PATH_SEP_OR_EOL_MATCH);
+
+ if (appReg.test(obj.targetDir)) {
+ // If any source file is using the new app directory structure,
+ // don't penalize it
+ return path.join(obj.targetDir, path.basename(obj.src));
+ } else {
+ // Plugin using deprecated target directory structure (GH-580)
if (obj.src.endsWith('.java')) {
- return path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
- } else {
- // For all other files, add 'app/src/main' to the targetDir if it didn't have it already
- return path.join('app/src/main', obj.targetDir, path.basename(obj.src));
+ return path.join(APP_MAIN_PREFIX, 'java', obj.targetDir.replace(srcReg, ''),
+ path.basename(obj.src));
+ } else if (obj.src.endsWith('.aidl')) {
+ return path.join(APP_MAIN_PREFIX, 'aidl', obj.targetDir.replace(srcReg, ''),
+ path.basename(obj.src));
+ } else if (libsReg.test(obj.targetDir)) {
+ if (obj.src.endsWith('.so')) {
+ return path.join(APP_MAIN_PREFIX, 'jniLibs', obj.targetDir.replace(libsReg, ''),
+ path.basename(obj.src));
+ } else {
+ return path.join('app', obj.targetDir, path.basename(obj.src));
+ }
+ } else if (srcMainReg.test(obj.targetDir)) {
+ return path.join('app', obj.targetDir, path.basename(obj.src));
}
- }
+ // For all other source files not using the new app directory structure,
+ // add 'app/src/main' to the targetDir
+ return path.join(APP_MAIN_PREFIX, obj.targetDir, path.basename(obj.src));
+ }
}
diff --git a/cordova/platforms/android/cordova/lib/prepare.js b/cordova/platforms/android/cordova/lib/prepare.js
index ac63f8a68..54aa97d1e 100644
--- a/cordova/platforms/android/cordova/lib/prepare.js
+++ b/cordova/platforms/android/cordova/lib/prepare.js
@@ -33,6 +33,8 @@ var PlatformJson = require('cordova-common').PlatformJson;
var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger;
var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
+const GradlePropertiesParser = require('./config/GradlePropertiesParser');
+
module.exports.prepare = function (cordovaProject, options) {
var self = this;
@@ -41,6 +43,9 @@ module.exports.prepare = function (cordovaProject, options) {
this._config = updateConfigFilesFrom(cordovaProject.projectConfig, munger, this.locations);
+ let gradlePropertiesParser = new GradlePropertiesParser(this.locations.root);
+ gradlePropertiesParser.configure();
+
// Update own www dir with project's www assets and plugins' assets and js-files
return Q.when(updateWww(cordovaProject, this.locations)).then(function () {
// update project according to config.xml changes.
@@ -265,6 +270,14 @@ function getImageResourcePath (resourcesDir, type, density, name, sourceName) {
return resourcePath;
}
+function getAdaptiveImageResourcePath (resourcesDir, type, density, name, sourceName) {
+ if (/\.9\.png$/.test(sourceName)) {
+ name = name.replace(/\.png$/, '.9.png');
+ }
+ var resourcePath = path.join(resourcesDir, (density ? type + '-' + density + '-v26' : type), name);
+ return resourcePath;
+}
+
function updateSplashes (cordovaProject, platformResourcesDir) {
var resources = cordovaProject.projectConfig.getSplashScreens('android');
@@ -314,20 +327,197 @@ function cleanSplashes (projectRoot, projectConfig, platformResourcesDir) {
}
function updateIcons (cordovaProject, platformResourcesDir) {
- var icons = cordovaProject.projectConfig.getIcons('android');
+ let icons = cordovaProject.projectConfig.getIcons('android');
- // if there are icon elements in config.xml
+ // Skip if there are no app defined icons in config.xml
if (icons.length === 0) {
events.emit('verbose', 'This app does not have launcher icons defined');
return;
}
- var resourceMap = mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'icon.png');
+ // 1. loop icons determin if there is an error in the setup.
+ // 2. during initial loop, also setup for legacy support.
+ let errorMissingAttributes = [];
+ let errorLegacyIconNeeded = [];
+ let hasAdaptive = false;
+ icons.forEach((icon, key) => {
+ if (
+ (icon.background && !icon.foreground)
+ || (!icon.background && icon.foreground)
+ || (!icon.background && !icon.foreground && !icon.src)
+ ) {
+ errorMissingAttributes.push(icon.density ? icon.density : 'size=' + (icon.height || icon.width));
+ }
+
+ if (icon.foreground) {
+ hasAdaptive = true;
+
+ if (
+ !icon.src
+ && (
+ icon.foreground.startsWith('@color')
+ || path.extname(path.basename(icon.foreground)) === '.xml'
+ )
+ ) {
+ errorLegacyIconNeeded.push(icon.density ? icon.density : 'size=' + (icon.height || icon.width));
+ } else if (!icon.src) {
+ icons[key].src = icon.foreground;
+ }
+ }
+ });
+
+ let errorMessage = [];
+ if (errorMissingAttributes.length > 0) {
+ errorMessage.push('One of the following attributes are set but missing the other for the density type: ' + errorMissingAttributes.join(', ') + '. Please ensure that all require attributes are defined.');
+ }
+
+ if (errorLegacyIconNeeded.length > 0) {
+ errorMessage.push('For the following icons with the density of: ' + errorLegacyIconNeeded.join(', ') + ', adaptive foreground with a defined color or vector can not be used as a standard fallback icon for older Android devices. To support older Android environments, please provide a value for the src attribute.');
+ }
+
+ if (errorMessage.length > 0) {
+ throw new CordovaError(errorMessage.join(' '));
+ }
+
+ let resourceMap = Object.assign(
+ {},
+ mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher.png'),
+ mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.png'),
+ mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_background.png'),
+ mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.xml'),
+ mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_background.xml'),
+ mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher.xml')
+ );
+
+ let preparedIcons = prepareIcons(icons);
+
+ if (hasAdaptive) {
+ resourceMap = updateIconResourceForAdaptive(preparedIcons, resourceMap, platformResourcesDir);
+ }
+
+ resourceMap = updateIconResourceForLegacy(preparedIcons, resourceMap, platformResourcesDir);
+
+ events.emit('verbose', 'Updating icons at ' + platformResourcesDir);
+ FileUpdater.updatePaths(resourceMap, { rootDir: cordovaProject.root }, logFileOp);
+}
+
+function updateIconResourceForAdaptive (preparedIcons, resourceMap, platformResourcesDir) {
+ let android_icons = preparedIcons.android_icons;
+ let default_icon = preparedIcons.default_icon;
+
+ // The source paths for icons and splashes are relative to
+ // project's config.xml location, so we use it as base path.
+ let background;
+ let foreground;
+ let targetPathBackground;
+ let targetPathForeground;
+
+ for (let density in android_icons) {
+ let backgroundVal = '@mipmap/ic_launcher_background';
+ let foregroundVal = '@mipmap/ic_launcher_foreground';
+
+ background = android_icons[density].background;
+ foreground = android_icons[density].foreground;
+
+ if (background.startsWith('@color')) {
+ // Colors Use Case
+ backgroundVal = background; // Example: @color/background_foobar_1
+ } else if (path.extname(path.basename(background)) === '.xml') {
+ // Vector Use Case
+ targetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_background.xml', path.basename(android_icons[density].background));
+ resourceMap[targetPathBackground] = android_icons[density].background;
+ } else if (path.extname(path.basename(background)) === '.png') {
+ // Images Use Case
+ targetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_background.png', path.basename(android_icons[density].background));
+ resourceMap[targetPathBackground] = android_icons[density].background;
+ }
+
+ if (foreground.startsWith('@color')) {
+ // Colors Use Case
+ foregroundVal = foreground;
+ } else if (path.extname(path.basename(foreground)) === '.xml') {
+ // Vector Use Case
+ targetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_foreground.xml', path.basename(android_icons[density].foreground));
+ resourceMap[targetPathForeground] = android_icons[density].foreground;
+ } else if (path.extname(path.basename(foreground)) === '.png') {
+ // Images Use Case
+ targetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_foreground.png', path.basename(android_icons[density].foreground));
+ resourceMap[targetPathForeground] = android_icons[density].foreground;
+ }
+
+ // create an XML for DPI and set color
+ const icLauncherTemplate = `<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="` + backgroundVal + `" />
+ <foreground android:drawable="` + foregroundVal + `" />
+</adaptive-icon>`;
+
+ let launcherXmlPath = path.join(platformResourcesDir, 'mipmap-' + density + '-v26', 'ic_launcher.xml');
+
+ // Remove the XML from the resourceMap so the file does not get removed.
+ delete resourceMap[launcherXmlPath];
+
+ fs.writeFileSync(path.resolve(launcherXmlPath), icLauncherTemplate);
+ }
+
+ // There's no "default" drawable, so assume default == mdpi.
+ if (default_icon && !android_icons.mdpi) {
+ let defaultTargetPathBackground;
+ let defaultTargetPathForeground;
+
+ if (background.startsWith('@color')) {
+ // Colors Use Case
+ targetPathBackground = default_icon.background;
+ } else if (path.extname(path.basename(background)) === '.xml') {
+ // Vector Use Case
+ defaultTargetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_background.xml', path.basename(default_icon.background));
+ resourceMap[defaultTargetPathBackground] = default_icon.background;
+ } else if (path.extname(path.basename(background)) === '.png') {
+ // Images Use Case
+ defaultTargetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_background.png', path.basename(default_icon.background));
+ resourceMap[defaultTargetPathBackground] = default_icon.background;
+ }
+
+ if (foreground.startsWith('@color')) {
+ // Colors Use Case
+ targetPathForeground = default_icon.foreground;
+ } else if (path.extname(path.basename(foreground)) === '.xml') {
+ // Vector Use Case
+ defaultTargetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_foreground.xml', path.basename(default_icon.foreground));
+ resourceMap[defaultTargetPathForeground] = default_icon.foreground;
+ } else if (path.extname(path.basename(foreground)) === '.png') {
+ // Images Use Case
+ defaultTargetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_foreground.png', path.basename(default_icon.foreground));
+ resourceMap[defaultTargetPathForeground] = default_icon.foreground;
+ }
+ }
- var android_icons = {};
- var default_icon;
+ return resourceMap;
+}
+
+function updateIconResourceForLegacy (preparedIcons, resourceMap, platformResourcesDir) {
+ let android_icons = preparedIcons.android_icons;
+ let default_icon = preparedIcons.default_icon;
+
+ // The source paths for icons and splashes are relative to
+ // project's config.xml location, so we use it as base path.
+ for (var density in android_icons) {
+ var targetPath = getImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher.png', path.basename(android_icons[density].src));
+ resourceMap[targetPath] = android_icons[density].src;
+ }
+
+ // There's no "default" drawable, so assume default == mdpi.
+ if (default_icon && !android_icons.mdpi) {
+ var defaultTargetPath = getImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher.png', path.basename(default_icon.src));
+ resourceMap[defaultTargetPath] = default_icon.src;
+ }
+
+ return resourceMap;
+}
+
+function prepareIcons (icons) {
// http://developer.android.com/design/style/iconography.html
- var sizeToDensityMap = {
+ const SIZE_TO_DENSITY_MAP = {
36: 'ldpi',
48: 'mdpi',
72: 'hdpi',
@@ -335,11 +525,15 @@ function updateIcons (cordovaProject, platformResourcesDir) {
144: 'xxhdpi',
192: 'xxxhdpi'
};
+
+ let android_icons = {};
+ let default_icon;
+
// find the best matching icon for a given density or size
// @output android_icons
var parseIcon = function (icon, icon_size) {
// do I have a platform icon for that density already
- var density = icon.density || sizeToDensityMap[icon_size];
+ var density = icon.density || SIZE_TO_DENSITY_MAP[icon_size];
if (!density) {
// invalid icon defition ( or unsupported size)
return;
@@ -355,12 +549,34 @@ function updateIcons (cordovaProject, platformResourcesDir) {
for (var i = 0; i < icons.length; i++) {
var icon = icons[i];
var size = icon.width;
+
if (!size) {
size = icon.height;
}
+
if (!size && !icon.density) {
if (default_icon) {
- events.emit('verbose', 'Found extra default icon: ' + icon.src + ' (ignoring in favor of ' + default_icon.src + ')');
+ let found = {};
+ let favor = {};
+
+ // populating found icon.
+ if (icon.background && icon.foreground) {
+ found.background = icon.background;
+ found.foreground = icon.foreground;
+ }
+ if (icon.src) {
+ found.src = icon.src;
+ }
+
+ if (default_icon.background && default_icon.foreground) {
+ favor.background = default_icon.background;
+ favor.foreground = default_icon.foreground;
+ }
+ if (default_icon.src) {
+ favor.src = default_icon.src;
+ }
+
+ events.emit('verbose', 'Found extra default icon: ' + JSON.stringify(found) + ' and ignoring in favor of ' + JSON.stringify(favor) + '.');
} else {
default_icon = icon;
}
@@ -369,36 +585,35 @@ function updateIcons (cordovaProject, platformResourcesDir) {
}
}
- // The source paths for icons and splashes are relative to
- // project's config.xml location, so we use it as base path.
- for (var density in android_icons) {
- var targetPath = getImageResourcePath(
- platformResourcesDir, 'mipmap', density, 'icon.png', path.basename(android_icons[density].src));
- resourceMap[targetPath] = android_icons[density].src;
- }
-
- // There's no "default" drawable, so assume default == mdpi.
- if (default_icon && !android_icons.mdpi) {
- var defaultTargetPath = getImageResourcePath(
- platformResourcesDir, 'mipmap', 'mdpi', 'icon.png', path.basename(default_icon.src));
- resourceMap[defaultTargetPath] = default_icon.src;
- }
-
- events.emit('verbose', 'Updating icons at ' + platformResourcesDir);
- FileUpdater.updatePaths(
- resourceMap, { rootDir: cordovaProject.root }, logFileOp);
+ return {
+ android_icons: android_icons,
+ default_icon: default_icon
+ };
}
function cleanIcons (projectRoot, projectConfig, platformResourcesDir) {
var icons = projectConfig.getIcons('android');
- if (icons.length > 0) {
- var resourceMap = mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'icon.png');
- events.emit('verbose', 'Cleaning icons at ' + platformResourcesDir);
- // No source paths are specified in the map, so updatePaths() will delete the target files.
- FileUpdater.updatePaths(
- resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
+ // Skip if there are no app defined icons in config.xml
+ if (icons.length === 0) {
+ events.emit('verbose', 'This app does not have launcher icons defined');
+ return;
}
+
+ let resourceMap = Object.assign(
+ {},
+ mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher.png'),
+ mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.png'),
+ mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_background.png'),
+ mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.xml'),
+ mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_background.xml'),
+ mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher.xml')
+ );
+
+ events.emit('verbose', 'Cleaning icons at ' + platformResourcesDir);
+
+ // No source paths are specified in the map, so updatePaths() will delete the target files.
+ FileUpdater.updatePaths(resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
}
/**
diff --git a/cordova/platforms/android/cordova/lib/retry.js b/cordova/platforms/android/cordova/lib/retry.js
index c464b9d5f..b2b9a4496 100644
--- a/cordova/platforms/android/cordova/lib/retry.js
+++ b/cordova/platforms/android/cordova/lib/retry.js
@@ -19,8 +19,6 @@
under the License.
*/
-/* jshint node: true */
-
'use strict';
var events = require('cordova-common').events;
@@ -29,21 +27,20 @@ var events = require('cordova-common').events;
* Retry a promise-returning function a number of times, propagating its
* results on success or throwing its error on a failed final attempt.
*
- * @arg {Number} attemts_left - The number of times to retry the passed call.
+ * @arg {Number} attemptsLeft - The number of times to retry the passed call.
* @arg {Function} promiseFunction - A function that returns a promise.
* @arg {...} - Arguments to pass to promiseFunction.
*
* @returns {Promise}
*/
-module.exports.retryPromise = function (attemts_left, promiseFunction) {
+module.exports.retryPromise = function (attemptsLeft, promiseFunction) {
// NOTE:
- // get all trailing arguments, by skipping the first two (attemts_left and
+ // get all trailing arguments, by skipping the first two (attemptsLeft and
// promiseFunction) because they shouldn't get passed to promiseFunction
var promiseFunctionArguments = Array.prototype.slice.call(arguments, 2);
return promiseFunction.apply(undefined, promiseFunctionArguments).then(
-
// on success pass results through
function onFulfilled (value) {
return value;
@@ -51,17 +48,16 @@ module.exports.retryPromise = function (attemts_left, promiseFunction) {
// on rejection either retry, or throw the error
function onRejected (error) {
+ attemptsLeft -= 1;
- attemts_left -= 1;
-
- if (attemts_left < 1) {
+ if (attemptsLeft < 1) {
throw error;
}
- events.emit('verbose', 'A retried call failed. Retrying ' + attemts_left + ' more time(s).');
+ events.emit('verbose', 'A retried call failed. Retrying ' + attemptsLeft + ' more time(s).');
- // retry call self again with the same arguments, except attemts_left is now lower
- var fullArguments = [attemts_left, promiseFunction].concat(promiseFunctionArguments);
+ // retry call self again with the same arguments, except attemptsLeft is now lower
+ var fullArguments = [attemptsLeft, promiseFunction].concat(promiseFunctionArguments);
return module.exports.retryPromise.apply(undefined, fullArguments);
}
);
diff --git a/cordova/platforms/android/cordova/lib/run.js b/cordova/platforms/android/cordova/lib/run.js
index 4d7927ced..221467bb1 100644
--- a/cordova/platforms/android/cordova/lib/run.js
+++ b/cordova/platforms/android/cordova/lib/run.js
@@ -19,10 +19,7 @@
under the License.
*/
-/* jshint loopfunc:true */
-
var path = require('path');
-var build = require('./build');
var emulator = require('./emulator');
var device = require('./device');
var Q = require('q');
@@ -52,6 +49,7 @@ function getInstallTarget (runOptions) {
* @return {Promise}
*/
module.exports.run = function (runOptions) {
+ runOptions = runOptions || {};
var self = this;
var install_target = getInstallTarget(runOptions);
@@ -103,16 +101,17 @@ module.exports.run = function (runOptions) {
});
});
}).then(function (resolvedTarget) {
- // Better just call self.build, but we're doing some processing of
- // build results (according to platformApi spec) so they are in different
- // format than emulator.install expects.
- // TODO: Update emulator/device.install to handle this change
- return build.run.call(self, runOptions, resolvedTarget).then(function (buildResults) {
+ return new Promise((resolve) => {
+ const builder = require('./builders/builders').getBuilder();
+ const buildOptions = require('./build').parseBuildOptions(runOptions, null, self.root);
+ resolve(builder.fetchBuildResults(buildOptions.buildType, buildOptions.arch));
+ }).then(function (buildResults) {
if (resolvedTarget && resolvedTarget.isEmulator) {
return emulator.wait_for_boot(resolvedTarget.target).then(function () {
return emulator.install(resolvedTarget, buildResults);
});
}
+
return device.install(resolvedTarget, buildResults);
});
});
diff --git a/cordova/platforms/android/cordova/lib/start-emulator b/cordova/platforms/android/cordova/lib/start-emulator
index f96bdc3ef..20c92b70b 100755
--- a/cordova/platforms/android/cordova/lib/start-emulator
+++ b/cordova/platforms/android/cordova/lib/start-emulator
@@ -19,21 +19,20 @@
under the License.
*/
-var emulator = require('./emulator'),
- args = process.argv;
+var emulator = require('./emulator');
+var args = process.argv;
var install_target;
-if(args.length > 2) {
- if (args[2].substring(0, 9) == '--target=') {
+if (args.length > 2) {
+ if (args[2].substring(0, 9) === '--target=') {
install_target = args[2].substring(9, args[2].length);
- } else {
+ } else {
console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
process.exit(2);
- }
+ }
}
-emulator.start(install_target).done(null, function(err) {
+emulator.start(install_target).catch(function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
-
diff --git a/cordova/platforms/android/cordova/log b/cordova/platforms/android/cordova/log
index 47f060505..6829f28d2 100755
--- a/cordova/platforms/android/cordova/log
+++ b/cordova/platforms/android/cordova/log
@@ -19,17 +19,17 @@
under the License.
*/
-var log = require('./lib/log'),
- reqs = require('./lib/check_reqs'),
- args = process.argv;
+var log = require('./lib/log');
+var reqs = require('./lib/check_reqs');
+var args = process.argv;
// Usage support for when args are given
-if(args.length > 2) {
+if (args.length > 2) {
log.help();
} else {
- reqs.run().done(function() {
+ reqs.run().done(function () {
return log.run();
- }, function(err) {
+ }, function (err) {
console.error('ERROR: ' + err);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/run b/cordova/platforms/android/cordova/run
index 9544c1dcf..7408a94f7 100755
--- a/cordova/platforms/android/cordova/run
+++ b/cordova/platforms/android/cordova/run
@@ -24,22 +24,23 @@ var nopt = require('nopt');
var path = require('path');
// Support basic help commands
-if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0)
+if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
require('./lib/run').help();
+}
// Do some basic argument parsing
var runOpts = nopt({
- 'verbose' : Boolean,
- 'silent' : Boolean,
- 'debug' : Boolean,
- 'release' : Boolean,
+ 'verbose': Boolean,
+ 'silent': Boolean,
+ 'debug': Boolean,
+ 'release': Boolean,
'nobuild': Boolean,
- 'buildConfig' : path,
- 'archs' : String,
- 'device' : Boolean,
+ 'buildConfig': path,
+ 'archs': String,
+ 'device': Boolean,
'emulator': Boolean,
- 'target' : String
-}, { 'd' : '--verbose' });
+ 'target': String
+}, { 'd': '--verbose' });
// Make runOptions compatible with PlatformApi run method spec
runOpts.argv = runOpts.argv.remain;
@@ -47,7 +48,7 @@ runOpts.argv = runOpts.argv.remain;
require('./loggingHelper').adjustLoggerLevel(runOpts);
new Api().run(runOpts)
-.catch(function(err) {
+.catch(function (err) {
console.error(err, err.stack);
process.exit(2);
});
diff --git a/cordova/platforms/android/cordova/version b/cordova/platforms/android/cordova/version
index 6f490b8db..01229aa6d 100755
--- a/cordova/platforms/android/cordova/version
+++ b/cordova/platforms/android/cordova/version
@@ -20,7 +20,7 @@
*/
// Coho updates this line:
-var VERSION = "7.1.2";
+var VERSION = "8.0.0-dev";
module.exports.version = VERSION;
diff --git a/cordova/platforms/android/gradle.properties b/cordova/platforms/android/gradle.properties
new file mode 100644
index 000000000..11bc459ef
--- /dev/null
+++ b/cordova/platforms/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.daemon=true
+org.gradle.jvmargs=-Xmx2048m
+android.useDeprecatedNdk=true
\ No newline at end of file
diff --git a/cordova/platforms/android/platform_www/cordova-js-src/exec.js b/cordova/platforms/android/platform_www/cordova-js-src/exec.js
index f73d87a12..39e8c97ee 100644
--- a/cordova/platforms/android/platform_www/cordova-js-src/exec.js
+++ b/cordova/platforms/android/platform_www/cordova-js-src/exec.js
@@ -109,17 +109,6 @@ function androidExec(success, fail, service, action, args) {
}
androidExec.init = function() {
- //CB-11828
- //This failsafe checks the version of Android and if it's Jellybean, it switches it to
- //using the Online Event bridge for communicating from Native to JS
- //
- //It's ugly, but it's necessary.
- var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
- var version_code = check && check[0].match(/4.[0-3].*/);
- if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
- nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
- }
-
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
channel.onNativeReady.fire();
};
diff --git a/cordova/platforms/android/platform_www/cordova.js b/cordova/platforms/android/platform_www/cordova.js
index a9f8bb0dd..4cdb1e3e5 100644
--- a/cordova/platforms/android/platform_www/cordova.js
+++ b/cordova/platforms/android/platform_www/cordova.js
@@ -1,5 +1,5 @@
// Platform: android
-// 9e8e1b716252c4a08abcd31a13013b868d6f4141
+// e040d9e9343d5f27dd4f67616660b33b92a82ff7
/*
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 = '7.1.2';
+var PLATFORM_VERSION_BUILD_LABEL = '8.0.0-dev';
// file: src/scripts/require.js
/* jshint -W079 */
@@ -975,17 +975,6 @@ function androidExec(success, fail, service, action, args) {
}
androidExec.init = function() {
- //CB-11828
- //This failsafe checks the version of Android and if it's Jellybean, it switches it to
- //using the Online Event bridge for communicating from Native to JS
- //
- //It's ugly, but it's necessary.
- var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
- var version_code = check && check[0].match(/4.[0-3].*/);
- if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
- nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
- }
-
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
channel.onNativeReady.fire();
};
@@ -2186,4 +2175,4 @@ window.cordova = require('cordova');
require('cordova/init');
-})();
+})();
\ No newline at end of file
diff --git a/cordova/platforms/android/platform_www/cordova_plugins.js b/cordova/platforms/android/platform_www/cordova_plugins.js
index 387eea4c7..12711ac06 100644
--- a/cordova/platforms/android/platform_www/cordova_plugins.js
+++ b/cordova/platforms/android/platform_www/cordova_plugins.js
@@ -1,193 +1,223 @@
cordova.define('cordova/plugin_list', function(require, exports, module) {
-module.exports = [
- {
- "id": "cordova-plugin-file.DirectoryEntry",
- "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.DirectoryReader",
- "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.DirectoryReader"
- ]
- },
- {
- "id": "cordova-plugin-file.Entry",
- "file": "plugins/cordova-plugin-file/www/Entry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Entry"
- ]
- },
- {
- "id": "cordova-plugin-file.File",
- "file": "plugins/cordova-plugin-file/www/File.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.File"
- ]
- },
- {
- "id": "cordova-plugin-file.FileEntry",
- "file": "plugins/cordova-plugin-file/www/FileEntry.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileEntry"
- ]
- },
- {
- "id": "cordova-plugin-file.FileError",
- "file": "plugins/cordova-plugin-file/www/FileError.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileError"
- ]
- },
- {
- "id": "cordova-plugin-file.FileReader",
- "file": "plugins/cordova-plugin-file/www/FileReader.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileReader"
- ]
- },
- {
- "id": "cordova-plugin-file.FileSystem",
- "file": "plugins/cordova-plugin-file/www/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadOptions",
- "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadOptions"
- ]
- },
- {
- "id": "cordova-plugin-file.FileUploadResult",
- "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileUploadResult"
- ]
- },
- {
- "id": "cordova-plugin-file.FileWriter",
- "file": "plugins/cordova-plugin-file/www/FileWriter.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.FileWriter"
- ]
- },
- {
- "id": "cordova-plugin-file.Flags",
- "file": "plugins/cordova-plugin-file/www/Flags.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Flags"
- ]
- },
- {
- "id": "cordova-plugin-file.LocalFileSystem",
- "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.LocalFileSystem"
- ],
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.Metadata",
- "file": "plugins/cordova-plugin-file/www/Metadata.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.Metadata"
- ]
- },
- {
- "id": "cordova-plugin-file.ProgressEvent",
- "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.ProgressEvent"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems",
- "file": "plugins/cordova-plugin-file/www/fileSystems.js",
- "pluginId": "cordova-plugin-file"
- },
- {
- "id": "cordova-plugin-file.requestFileSystem",
- "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
- "pluginId": "cordova-plugin-file",
- "clobbers": [
- "window.requestFileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.resolveLocalFileSystemURI",
- "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "window"
- ]
- },
- {
- "id": "cordova-plugin-file.isChrome",
- "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.androidFileSystem",
- "file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "FileSystem"
- ]
- },
- {
- "id": "cordova-plugin-file.fileSystems-roots",
- "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
- "pluginId": "cordova-plugin-file",
- "runs": true
- },
- {
- "id": "cordova-plugin-file.fileSystemPaths",
- "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
- "pluginId": "cordova-plugin-file",
- "merges": [
- "cordova"
- ],
- "runs": true
- },
- {
- "id": "cordova-plugin-device.device",
- "file": "plugins/cordova-plugin-device/www/device.js",
- "pluginId": "cordova-plugin-device",
- "clobbers": [
- "device"
- ]
- }
-];
-module.exports.metadata =
-// TOP OF METADATA
-{
- "cordova-plugin-file": "6.0.1",
- "cordova-plugin-device": "2.0.2",
- "cordova-plugin-whitelist": "1.3.3"
-};
-// BOTTOM OF METADATA
+ module.exports = [
+ {
+ "id": "cordova-plugin-camera.Camera",
+ "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "Camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverOptions",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.camera",
+ "file": "plugins/cordova-plugin-camera/www/Camera.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "navigator.camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverHandle",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverHandle.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverHandle"
+ ]
+ },
+ {
+ "id": "cordova-plugin-device.device",
+ "file": "plugins/cordova-plugin-device/www/device.js",
+ "pluginId": "cordova-plugin-device",
+ "clobbers": [
+ "device"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.DirectoryEntry",
+ "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.DirectoryEntry"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.DirectoryReader",
+ "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.DirectoryReader"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.Entry",
+ "file": "plugins/cordova-plugin-file/www/Entry.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Entry"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.File",
+ "file": "plugins/cordova-plugin-file/www/File.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.File"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileEntry",
+ "file": "plugins/cordova-plugin-file/www/FileEntry.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileEntry"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileError",
+ "file": "plugins/cordova-plugin-file/www/FileError.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileError"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileReader",
+ "file": "plugins/cordova-plugin-file/www/FileReader.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileReader"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileSystem",
+ "file": "plugins/cordova-plugin-file/www/FileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileSystem"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileUploadOptions",
+ "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileUploadOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileUploadResult",
+ "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileUploadResult"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.FileWriter",
+ "file": "plugins/cordova-plugin-file/www/FileWriter.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileWriter"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.Flags",
+ "file": "plugins/cordova-plugin-file/www/Flags.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Flags"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.LocalFileSystem",
+ "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.LocalFileSystem"
+ ],
+ "merges": [
+ "window"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.Metadata",
+ "file": "plugins/cordova-plugin-file/www/Metadata.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Metadata"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.ProgressEvent",
+ "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.ProgressEvent"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.fileSystems",
+ "file": "plugins/cordova-plugin-file/www/fileSystems.js",
+ "pluginId": "cordova-plugin-file"
+ },
+ {
+ "id": "cordova-plugin-file.requestFileSystem",
+ "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.requestFileSystem"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.resolveLocalFileSystemURI",
+ "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "window"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.isChrome",
+ "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
+ "pluginId": "cordova-plugin-file",
+ "runs": true
+ },
+ {
+ "id": "cordova-plugin-file.androidFileSystem",
+ "file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "FileSystem"
+ ]
+ },
+ {
+ "id": "cordova-plugin-file.fileSystems-roots",
+ "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
+ "pluginId": "cordova-plugin-file",
+ "runs": true
+ },
+ {
+ "id": "cordova-plugin-file.fileSystemPaths",
+ "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "cordova"
+ ],
+ "runs": true
+ }
+ ];
+ module.exports.metadata = {
+ "cordova-plugin-camera": "4.0.3",
+ "cordova-plugin-device": "2.0.2",
+ "cordova-plugin-file": "6.0.1",
+ "cordova-plugin-whitelist": "1.3.3"
+ };
});
\ No newline at end of file
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js
new file mode 100644
index 000000000..3f614ec80
--- /dev/null
+++ b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js
@@ -0,0 +1,188 @@
+cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck');
+var exec = require('cordova/exec');
+var Camera = require('./Camera');
+// XXX: commented out
+// CameraPopoverHandle = require('./CameraPopoverHandle');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * @exports camera
+ */
+var cameraExport = {};
+
+// Tack on the Camera Constants to the base camera plugin.
+for (var key in Camera) {
+ cameraExport[key] = Camera[key];
+}
+
+/**
+ * Callback function that provides an error message.
+ * @callback module:camera.onError
+ * @param {string} message - The message is provided by the device's native code.
+ */
+
+/**
+ * Callback function that provides the image data.
+ * @callback module:camera.onSuccess
+ * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
+ * @example
+ * // Show image
+ * //
+ * function cameraCallback(imageData) {
+ * var image = document.getElementById('myImage');
+ * image.src = "data:image/jpeg;base64," + imageData;
+ * }
+ */
+
+/**
+ * Optional parameters to customize the camera settings.
+ * * [Quirks](#CameraOptions-quirks)
+ * @typedef module:camera.CameraOptions
+ * @type {Object}
+ * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
+ * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
+ * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
+ * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
+ * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
+ * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
+ * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
+ * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
+ * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
+ * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
+ * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
+ * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
+ */
+
+/**
+ * @description Takes a photo using the camera, or retrieves a photo from the device's
+ * image gallery. The image is passed to the success callback as a
+ * Base64-encoded `String`, or as the URI for the image file.
+ *
+ * The `camera.getPicture` function opens the device's default camera
+ * application that allows users to snap pictures by default - this behavior occurs,
+ * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
+ * Once the user snaps the photo, the camera application closes and the application is restored.
+ *
+ * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
+ * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
+ * that allows users to select an existing image.
+ *
+ * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
+ * one of the following formats, depending on the specified
+ * `cameraOptions`:
+ *
+ * - A `String` containing the Base64-encoded photo image.
+ * - A `String` representing the image file location on local storage (default).
+ *
+ * You can do whatever you want with the encoded image or URI, for
+ * example:
+ *
+ * - Render the image in an `<img>` tag, as in the example below
+ * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
+ * - Post the data to a remote server
+ *
+ * __NOTE__: Photo resolution on newer devices is quite good. Photos
+ * selected from the device's gallery are not downscaled to a lower
+ * quality, even if a `quality` parameter is specified. To avoid common
+ * memory problems, set `Camera.destinationType` to `FILE_URI` rather
+ * than `DATA_URL`.
+ *
+ * __Supported Platforms__
+ *
+ * - Android
+ * - BlackBerry
+ * - Browser
+ * - Firefox
+ * - FireOS
+ * - iOS
+ * - Windows
+ * - WP8
+ * - Ubuntu
+ *
+ * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
+ *
+ * @example
+ * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
+ * @param {module:camera.onSuccess} successCallback
+ * @param {module:camera.onError} errorCallback
+ * @param {module:camera.CameraOptions} options CameraOptions
+ */
+cameraExport.getPicture = function (successCallback, errorCallback, options) {
+ argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
+ options = options || {};
+ var getValue = argscheck.getValue;
+
+ var quality = getValue(options.quality, 50);
+ var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
+ var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
+ var targetWidth = getValue(options.targetWidth, -1);
+ var targetHeight = getValue(options.targetHeight, -1);
+ var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
+ var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
+ var allowEdit = !!options.allowEdit;
+ var correctOrientation = !!options.correctOrientation;
+ var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
+ var popoverOptions = getValue(options.popoverOptions, null);
+ var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
+
+ var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
+ mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
+
+ exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
+ // XXX: commented out
+ // return new CameraPopoverHandle();
+};
+
+/**
+ * Removes intermediate image files that are kept in temporary storage
+ * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
+ * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
+ * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
+ *
+ * __Supported Platforms__
+ *
+ * - iOS
+ *
+ * @example
+ * navigator.camera.cleanup(onSuccess, onFail);
+ *
+ * function onSuccess() {
+ * console.log("Camera cleanup success.")
+ * }
+ *
+ * function onFail(message) {
+ * alert('Failed because: ' + message);
+ * }
+ */
+cameraExport.cleanup = function (successCallback, errorCallback) {
+ exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
+};
+
+module.exports = cameraExport;
+
+});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
new file mode 100644
index 000000000..4f4b046f1
--- /dev/null
+++ b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
@@ -0,0 +1,104 @@
+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/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
new file mode 100644
index 000000000..c970f55a3
--- /dev/null
+++ b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
@@ -0,0 +1,35 @@
+cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * @ignore in favour of iOS' one
+ * A handle to an image picker popover.
+ */
+var CameraPopoverHandle = function () {
+ this.setPosition = function (popoverOptions) {
+ console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
+ };
+};
+
+module.exports = CameraPopoverHandle;
+
+});
diff --git a/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
new file mode 100644
index 000000000..81d7d20ec
--- /dev/null
+++ b/cordova/platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
@@ -0,0 +1,55 @@
+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.
+ */
+var CameraPopoverOptions = function (x, y, width, height, arrowDir) {
+ // 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;
+};
+
+module.exports = CameraPopoverOptions;
+
+});
diff --git a/cordova/platforms/android/project.properties b/cordova/platforms/android/project.properties
index 1b79a1e37..49667a2af 100644
--- a/cordova/platforms/android/project.properties
+++ b/cordova/platforms/android/project.properties
@@ -11,3 +11,4 @@
target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
+cordova.system.library.1=com.android.support:support-v4:24.1.1+
\ No newline at end of file
diff --git a/cordova/yarn.lock b/cordova/yarn.lock
index 6ff1f8645..34895a697 100644
--- a/cordova/yarn.lock
+++ b/cordova/yarn.lock
@@ -7,32 +7,110 @@ abbrev@1:
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
+acorn-jsx@^3.0.0:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
+ integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=
+ dependencies:
+ acorn "^3.0.4"
+
+acorn@^3.0.4:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
+ integrity sha1-ReN/s56No/JbruP/U2niu18iAXo=
+
+acorn@^5.5.0:
+ version "5.7.3"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
+ integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
+
+ajv-keywords@^2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762"
+ integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=
+
+ajv@^5.2.3, ajv@^5.3.0:
+ version "5.5.2"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
+ integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=
+ dependencies:
+ co "^4.6.0"
+ fast-deep-equal "^1.0.0"
+ fast-json-stable-stringify "^2.0.0"
+ json-schema-traverse "^0.3.0"
+
+android-versions@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/android-versions/-/android-versions-1.4.0.tgz#807ea2941d7e5780e6dd61c5d9b7b6f3c0706e09"
integrity sha512-GnomfYsBq+nZh3c3UH/4r9Jt6FuTxdhUJbeHIdYOH5xBhQ8I0ZzC2/RM5IFFIjrzuNWSHb8JWP1lPK0/a26jrg==
dependencies:
semver "^5.4.1"
+ansi-escapes@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30"
+ integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==
+
+ansi-regex@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
+ integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
+
+ansi-regex@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
+ integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
+
+ansi-styles@^2.2.1:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
+ integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=
+
+ansi-styles@^3.2.1:
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
+ integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
+ dependencies:
+ color-convert "^1.9.0"
+
ansi@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/ansi/-/ansi-0.3.1.tgz#0c42d4fb17160d5a9af1e484bace1c66922c1b21"
integrity sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=
+argparse@^1.0.7:
+ version "1.0.10"
+ resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
+ integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
+ dependencies:
+ sprintf-js "~1.0.2"
+
+array-includes@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d"
+ integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.7.0"
+
+babel-code-frame@^6.22.0:
+ version "6.26.0"
+ resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
+ integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=
+ dependencies:
+ chalk "^1.1.3"
+ esutils "^2.0.2"
+ js-tokens "^3.0.2"
+
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1"
- integrity sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=
-
- version "1.6.32"
- resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.32.tgz#5867458b25ecd5bcb36b627c30bb501a13c07e89"
- integrity sha512-ljKJdR3wk9thHfLj4DtrNiOSTxvGFaMjWrG4pW75juXC4j7+XuKJVFdg4kgFMYp85PVkO05dFMj2dk2xVsH4xw==
+base64-js@^1.2.3:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
+ integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==
big-integer@^1.6.7:
version "1.6.40"
@@ -54,48 +132,142 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
+buffer-from@^1.0.0:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
+ integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
+
+builtin-modules@^1.0.0, builtin-modules@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
+ integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
+
+caller-path@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
+ integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=
+ dependencies:
+ callsites "^0.2.0"
+
+callsites@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
+ integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=
+
+chalk@^1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
+ integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=
+ dependencies:
+ ansi-styles "^2.2.1"
+ escape-string-regexp "^1.0.2"
+ has-ansi "^2.0.0"
+ strip-ansi "^3.0.0"
+ supports-color "^2.0.0"
+
+chalk@^2.0.0, chalk@^2.1.0:
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
+ integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==
+ dependencies:
+ ansi-styles "^3.2.1"
+ escape-string-regexp "^1.0.5"
+ supports-color "^5.3.0"
+
+chardet@^0.4.0:
+ version "0.4.2"
+ resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
+ integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=
+
+circular-json@^0.3.1:
+ version "0.3.3"
+ resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
+ integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==
+
+cli-cursor@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
+ integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=
+ dependencies:
+ restore-cursor "^2.0.0"
+
+cli-width@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
+ integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=
+
+co@^4.6.0:
+ version "4.6.0"
+ resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
+ integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=
+
+color-convert@^1.9.0:
+ version "1.9.3"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
+ integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
+ dependencies:
+ color-name "1.1.3"
+
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
+ integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
+
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
-cordova-android@^7.1.4:
- version "7.1.4"
- resolved "https://registry.yarnpkg.com/cordova-android/-/cordova-android-7.1.4.tgz#25261ad66cc64f42a30b70be005901fa30e2430e"
- integrity sha512-Rtvu002I83uzfVyCsE6p2krFKVHt9TSAqZUATes+zH+o9cdxYGrLHY+PKCQo4SLCdSMdrkIHCDnQPTYTp/d7+g==
+concat-stream@^1.6.0:
+ version "1.6.2"
+ resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
+ integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
+ dependencies:
+ buffer-from "^1.0.0"
+ inherits "^2.0.3"
+ readable-stream "^2.2.2"
+ typedarray "^0.0.6"
+
+contains-path@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a"
+ integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=
+
+"cordova-android@git+https://[email protected]/apache/cordova-android.git":
+ version "8.0.0-dev"
+ resolved "git+https://[email protected]/apache/cordova-android.git#5f44af375754f1fa8fddd53834cdf36f4be29a62"
dependencies:
- android-versions "1.4.0"
- base64-js "1.2.0"
- big-integer "1.6.32"
- cordova-common "2.2.5"
+ android-versions "^1.3.0"
+ cordova-common "^3.0.0"
elementtree "0.1.6"
- glob "5.0.15"
- nopt "3.0.1"
- path-is-absolute "1.0.1"
- plist "2.1.0"
- properties-parser "0.2.3"
- q "1.4.1"
- sax "0.3.5"
- semver "5.5.0"
- shelljs "0.5.3"
- xmlbuilder "8.2.2"
+ nopt "^3.0.1"
+ properties-parser "^0.2.3"
+ q "^1.4.1"
+ shelljs "^0.5.3"
- version "2.2.5"
- resolved "https://registry.yarnpkg.com/cordova-common/-/cordova-common-2.2.5.tgz#f93cef2ad494cfcbf56c46e3d612aaa9cb5fcc32"
- integrity sha1-+TzvKtSUz8v1bEbj1hKqqctfzDI=
+cordova-common@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/cordova-common/-/cordova-common-3.0.0.tgz#2134db68d25539ca7c32c9372130fc6c386dcbf2"
+ integrity sha512-bdyoW9xxzAX/nC30r1j76OG4p9ESwP0d+nXpbElNJmrnEfqB/G1TDa+3WpW1Xa17/vBYkRTChwHn30UHPgWk+w==
dependencies:
ansi "^0.3.1"
bplist-parser "^0.1.0"
- cordova-registry-mapper "^1.1.8"
- elementtree "0.1.6"
- glob "^5.0.13"
+ cross-spawn "^6.0.5"
+ elementtree "0.1.7"
+ endent "^1.1.1"
+ fs-extra "^7.0.0"
+ glob "^7.1.2"
minimatch "^3.0.0"
- plist "^2.1.0"
+ plist "^3.0.1"
q "^1.4.1"
- shelljs "^0.5.3"
+ strip-bom "^3.0.0"
underscore "^1.8.3"
- unorm "^1.3.3"
+ which "^1.3.0"
+
+cordova-plugin-camera@^4.0.3:
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/cordova-plugin-camera/-/cordova-plugin-camera-4.0.3.tgz#7373a5938318c86ccfd84e3713e2382d10fe076b"
+ integrity sha1-c3Olk4MYyGzP2E43E+I4LRD+B2s=
cordova-plugin-device@^2.0.2:
version "2.0.2"
@@ -112,10 +284,103 @@ cordova-plugin-whitelist@^1.3.3:
resolved "https://registry.yarnpkg.com/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz#b5e85ecdbbfe5aeded40a1bf4ee2372e67d96fb4"
integrity sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q=
-cordova-registry-mapper@^1.1.8:
- version "1.1.15"
- resolved "https://registry.yarnpkg.com/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz#e244b9185b8175473bff6079324905115f83dc7c"
- integrity sha1-4kS5GFuBdUc7/2B5MkkFEV+D3Hw=
+core-util-is@~1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
+ integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
+
+cross-spawn@^5.1.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
+ integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=
+ dependencies:
+ lru-cache "^4.0.1"
+ shebang-command "^1.2.0"
+ which "^1.2.9"
+
+cross-spawn@^6.0.5:
+ version "6.0.5"
+ resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
+ integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
+ dependencies:
+ nice-try "^1.0.4"
+ path-key "^2.0.1"
+ semver "^5.5.0"
+ shebang-command "^1.2.0"
+ which "^1.2.9"
+
+debug-log@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f"
+ integrity sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=
+
+debug@^2.6.8, debug@^2.6.9:
+ version "2.6.9"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
+ integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
+ dependencies:
+ ms "2.0.0"
+
+debug@^3.1.0:
+ version "3.2.6"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
+ integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
+ dependencies:
+ ms "^2.1.1"
+
+dedent@^0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
+ integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=
+
+deep-equal@~1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
+ integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=
+
+deep-is@~0.1.3:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
+ integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
+
+define-properties@^1.1.2:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
+ integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
+ dependencies:
+ object-keys "^1.0.12"
+
+defined@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
+ integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=
+
+deglob@^2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.1.tgz#d268e168727799862e8eac07042e165957c1f3be"
+ integrity sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==
+ dependencies:
+ find-root "^1.0.0"
+ glob "^7.0.5"
+ ignore "^3.0.9"
+ pkg-config "^1.1.0"
+ run-parallel "^1.1.2"
+ uniq "^1.0.1"
+
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa"
+ integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=
+ dependencies:
+ esutils "^2.0.2"
+ isarray "^1.0.0"
+
+doctrine@^2.0.2, doctrine@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
+ integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==
+ dependencies:
+ esutils "^2.0.2"
version "0.1.6"
@@ -124,17 +389,399 @@ [email protected]:
dependencies:
sax "0.3.5"
[email protected], glob@^5.0.13:
- version "5.0.15"
- resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
- integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=
+ version "0.1.7"
+ resolved "https://registry.yarnpkg.com/elementtree/-/elementtree-0.1.7.tgz#9ac91be6e52fb6e6244c4e54a4ac3ed8ae8e29c0"
+ integrity sha1-mskb5uUvtuYkTE5UpKw+2K6OKcA=
+ dependencies:
+ sax "1.1.4"
+
+endent@^1.1.1:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/endent/-/endent-1.2.0.tgz#1e43a6072d1e8e517495c0bf13c32b0c6e57206d"
+ integrity sha512-o6JTG7ce2GBLDfWjoB0XWcIoBXXtx59TGc8jHhDC8Pi6su4ifFNMpUvCmEr8ec5FPxpGVowGpmC7/JhKLk0iVw==
+ dependencies:
+ dedent "^0.7.0"
+ fast-json-parse "^1.0.3"
+ objectorarray "^1.0.3"
+ standard "^11.0.1"
+ tape "^4.8.0"
+
+error-ex@^1.2.0, error-ex@^1.3.1:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
+ integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
+ dependencies:
+ is-arrayish "^0.2.1"
+
+es-abstract@^1.5.0, es-abstract@^1.7.0:
+ version "1.12.0"
+ resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165"
+ integrity sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==
+ dependencies:
+ es-to-primitive "^1.1.1"
+ function-bind "^1.1.1"
+ has "^1.0.1"
+ is-callable "^1.1.3"
+ is-regex "^1.0.4"
+
+es-to-primitive@^1.1.1:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377"
+ integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==
+ dependencies:
+ is-callable "^1.1.4"
+ is-date-object "^1.0.1"
+ is-symbol "^1.0.2"
+
+escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
+ integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
+
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-5.0.0.tgz#4abfac554f38668e0078c664569e7b2384e5d2aa"
+ integrity sha512-rLToPAEqLMPBfWnYTu6xRhm2OWziS2n40QFqJ8jAM8NSVzeVKTa3nclhsU4DpPJQRY60F34Oo1wi/71PN/eITg==
+
+ version "11.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz#87ee0d3c9d95382dc761958cbb23da9eea31e0ba"
+ integrity sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==
+
+eslint-import-resolver-node@^0.3.1:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a"
+ integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==
+ dependencies:
+ debug "^2.6.9"
+ resolve "^1.5.0"
+
+eslint-module-utils@^2.1.1:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746"
+ integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=
dependencies:
+ debug "^2.6.8"
+ pkg-dir "^1.0.0"
+
+eslint-plugin-import@~2.9.0:
+ version "2.9.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz#26002efbfca5989b7288ac047508bd24f217b169"
+ integrity sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=
+ dependencies:
+ builtin-modules "^1.1.1"
+ contains-path "^0.1.0"
+ debug "^2.6.8"
+ doctrine "1.5.0"
+ eslint-import-resolver-node "^0.3.1"
+ eslint-module-utils "^2.1.1"
+ has "^1.0.1"
+ lodash "^4.17.4"
+ minimatch "^3.0.3"
+ read-pkg-up "^2.0.0"
+
+eslint-plugin-node@~6.0.0:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4"
+ integrity sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==
+ dependencies:
+ ignore "^3.3.6"
+ minimatch "^3.0.4"
+ resolve "^1.3.3"
+ semver "^5.4.1"
+
+eslint-plugin-promise@~3.7.0:
+ version "3.7.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz#f4bde5c2c77cdd69557a8f69a24d1ad3cfc9e67e"
+ integrity sha512-2WO+ZFh7vxUKRfR0cOIMrWgYKdR6S1AlOezw6pC52B6oYpd5WFghN+QHxvrRdZMtbo8h3dfUZ2o1rWb0UPbKtg==
+
+eslint-plugin-react@~7.7.0:
+ version "7.7.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz#f606c719dbd8a1a2b3d25c16299813878cca0160"
+ integrity sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==
+ dependencies:
+ doctrine "^2.0.2"
+ has "^1.0.1"
+ jsx-ast-utils "^2.0.1"
+ prop-types "^15.6.0"
+
+eslint-plugin-standard@~3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2"
+ integrity sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=
+
+eslint-scope@^3.7.1:
+ version "3.7.3"
+ resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535"
+ integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==
+ dependencies:
+ esrecurse "^4.1.0"
+ estraverse "^4.1.1"
+
+eslint-visitor-keys@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
+ integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
+
+eslint@~4.18.0:
+ version "4.18.2"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45"
+ integrity sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==
+ dependencies:
+ ajv "^5.3.0"
+ babel-code-frame "^6.22.0"
+ chalk "^2.1.0"
+ concat-stream "^1.6.0"
+ cross-spawn "^5.1.0"
+ debug "^3.1.0"
+ doctrine "^2.1.0"
+ eslint-scope "^3.7.1"
+ eslint-visitor-keys "^1.0.0"
+ espree "^3.5.2"
+ esquery "^1.0.0"
+ esutils "^2.0.2"
+ file-entry-cache "^2.0.0"
+ functional-red-black-tree "^1.0.1"
+ glob "^7.1.2"
+ globals "^11.0.1"
+ ignore "^3.3.3"
+ imurmurhash "^0.1.4"
+ inquirer "^3.0.6"
+ is-resolvable "^1.0.0"
+ js-yaml "^3.9.1"
+ json-stable-stringify-without-jsonify "^1.0.1"
+ levn "^0.3.0"
+ lodash "^4.17.4"
+ minimatch "^3.0.2"
+ mkdirp "^0.5.1"
+ natural-compare "^1.4.0"
+ optionator "^0.8.2"
+ path-is-inside "^1.0.2"
+ pluralize "^7.0.0"
+ progress "^2.0.0"
+ require-uncached "^1.0.3"
+ semver "^5.3.0"
+ strip-ansi "^4.0.0"
+ strip-json-comments "~2.0.1"
+ table "4.0.2"
+ text-table "~0.2.0"
+
+espree@^3.5.2:
+ version "3.5.4"
+ resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7"
+ integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==
+ dependencies:
+ acorn "^5.5.0"
+ acorn-jsx "^3.0.0"
+
+esprima@^4.0.0:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
+ integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
+
+esquery@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708"
+ integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==
+ dependencies:
+ estraverse "^4.0.0"
+
+esrecurse@^4.1.0:
+ version "4.2.1"
+ resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
+ integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==
+ dependencies:
+ estraverse "^4.1.0"
+
+estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
+ integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=
+
+esutils@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
+ integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=
+
+external-editor@^2.0.4:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5"
+ integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==
+ dependencies:
+ chardet "^0.4.0"
+ iconv-lite "^0.4.17"
+ tmp "^0.0.33"
+
+fast-deep-equal@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"
+ integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=
+
+fast-json-parse@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/fast-json-parse/-/fast-json-parse-1.0.3.tgz#43e5c61ee4efa9265633046b770fb682a7577c4d"
+ integrity sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==
+
+fast-json-stable-stringify@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
+ integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I=
+
+fast-levenshtein@~2.0.4:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
+ integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
+
+figures@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
+ integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=
+ dependencies:
+ escape-string-regexp "^1.0.5"
+
+file-entry-cache@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361"
+ integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=
+ dependencies:
+ flat-cache "^1.2.1"
+ object-assign "^4.0.1"
+
+find-root@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4"
+ integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==
+
+find-up@^1.0.0:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
+ integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=
+ dependencies:
+ path-exists "^2.0.0"
+ pinkie-promise "^2.0.0"
+
+find-up@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
+ integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c=
+ dependencies:
+ locate-path "^2.0.0"
+
+flat-cache@^1.2.1:
+ version "1.3.4"
+ resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f"
+ integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==
+ dependencies:
+ circular-json "^0.3.1"
+ graceful-fs "^4.1.2"
+ rimraf "~2.6.2"
+ write "^0.2.1"
+
+for-each@~0.3.3:
+ version "0.3.3"
+ resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
+ integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==
+ dependencies:
+ is-callable "^1.1.3"
+
+fs-extra@^7.0.0:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
+ integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
+ dependencies:
+ graceful-fs "^4.1.2"
+ jsonfile "^4.0.0"
+ universalify "^0.1.0"
+
+fs.realpath@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
+ integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
+
+function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
+
+functional-red-black-tree@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
+ integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
+
+get-stdin@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
+ integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==
+
+glob@^7.0.5, glob@^7.1.2, glob@~7.1.2:
+ version "7.1.3"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
+ integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
+ dependencies:
+ fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
- minimatch "2 || 3"
+ minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
+globals@^11.0.1:
+ version "11.9.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249"
+ integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==
+
+graceful-fs@^4.1.2, graceful-fs@^4.1.6:
+ version "4.1.15"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
+ integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
+
+has-ansi@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
+ integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=
+ dependencies:
+ ansi-regex "^2.0.0"
+
+has-flag@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
+ integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
+
+has-symbols@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
+ integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=
+
+has@^1.0.1, has@~1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
+ dependencies:
+ function-bind "^1.1.1"
+
+hosted-git-info@^2.1.4:
+ version "2.7.1"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
+ integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
+
+iconv-lite@^0.4.17:
+ version "0.4.24"
+ resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
+ integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
+ dependencies:
+ safer-buffer ">= 2.1.2 < 3"
+
+ignore@^3.0.9, ignore@^3.3.3, ignore@^3.3.6:
+ version "3.3.10"
+ resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043"
+ integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==
+
+imurmurhash@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+ integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
+
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
@@ -143,25 +790,288 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
-inherits@2:
+inherits@2, inherits@^2.0.3, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
-"minimatch@2 || 3", minimatch@^3.0.0:
+inquirer@^3.0.6:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9"
+ integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==
+ dependencies:
+ ansi-escapes "^3.0.0"
+ chalk "^2.0.0"
+ cli-cursor "^2.1.0"
+ cli-width "^2.0.0"
+ external-editor "^2.0.4"
+ figures "^2.0.0"
+ lodash "^4.3.0"
+ mute-stream "0.0.7"
+ run-async "^2.2.0"
+ rx-lite "^4.0.8"
+ rx-lite-aggregates "^4.0.8"
+ string-width "^2.1.0"
+ strip-ansi "^4.0.0"
+ through "^2.3.6"
+
+is-arrayish@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
+ integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
+
+is-builtin-module@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
+ integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74=
+ dependencies:
+ builtin-modules "^1.0.0"
+
+is-callable@^1.1.3, is-callable@^1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
+ integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==
+
+is-date-object@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
+ integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=
+
+is-fullwidth-code-point@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
+ integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
+
+is-promise@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
+ integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=
+
+is-regex@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
+ integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=
+ dependencies:
+ has "^1.0.1"
+
+is-resolvable@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88"
+ integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==
+
+is-symbol@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
+ integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==
+ dependencies:
+ has-symbols "^1.0.0"
+
+isarray@^1.0.0, isarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
+ integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
+
+isexe@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
+ integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
+
+"js-tokens@^3.0.0 || ^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
+ integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
+
+js-tokens@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
+ integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=
+
+js-yaml@^3.9.1:
+ version "3.12.0"
+ resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
+ integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==
+ dependencies:
+ argparse "^1.0.7"
+ esprima "^4.0.0"
+
+json-parse-better-errors@^1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
+ integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==
+
+json-schema-traverse@^0.3.0:
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
+ integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=
+
+json-stable-stringify-without-jsonify@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
+ integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=
+
+jsonfile@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
+ integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
+ optionalDependencies:
+ graceful-fs "^4.1.6"
+
+jsx-ast-utils@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f"
+ integrity sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=
+ dependencies:
+ array-includes "^3.0.3"
+
+levn@^0.3.0, levn@~0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
+ integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=
+ dependencies:
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+
+load-json-file@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
+ integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=
+ dependencies:
+ graceful-fs "^4.1.2"
+ parse-json "^2.2.0"
+ pify "^2.0.0"
+ strip-bom "^3.0.0"
+
+load-json-file@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
+ integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs=
+ dependencies:
+ graceful-fs "^4.1.2"
+ parse-json "^4.0.0"
+ pify "^3.0.0"
+ strip-bom "^3.0.0"
+
+locate-path@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
+ integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=
+ dependencies:
+ p-locate "^2.0.0"
+ path-exists "^3.0.0"
+
+lodash@^4.17.4, lodash@^4.3.0:
+ version "4.17.11"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
+ integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
+
+loose-envify@^1.3.1:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
+ integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
+ dependencies:
+ js-tokens "^3.0.0 || ^4.0.0"
+
+lru-cache@^4.0.1:
+ version "4.1.5"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
+ integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
+ dependencies:
+ pseudomap "^1.0.2"
+ yallist "^2.1.2"
+
+mimic-fn@^1.0.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
+ integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==
+
+minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
dependencies:
brace-expansion "^1.1.7"
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.1.tgz#bce5c42446a3291f47622a370abbf158fbbacbfd"
- integrity sha1-vOXEJEajKR9HYio3CrvxWPu6y/0=
+ version "0.0.8"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
+ integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
+
+minimist@^1.1.0, minimist@~1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
+ integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
+
+mkdirp@^0.5.1:
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
+ integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
+ dependencies:
+ minimist "0.0.8"
+
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
+ integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
+
+ms@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
+ integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
+
+ version "0.0.7"
+ resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
+ integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
+
+natural-compare@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
+ integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
+
+nice-try@^1.0.4:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
+ integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
+
+nopt@^3.0.1:
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
+ integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k=
dependencies:
abbrev "1"
+normalize-package-data@^2.3.2:
+ version "2.4.0"
+ resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f"
+ integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==
+ dependencies:
+ hosted-git-info "^2.1.4"
+ is-builtin-module "^1.0.0"
+ semver "2 || 3 || 4 || 5"
+ validate-npm-package-license "^3.0.1"
+
+object-assign@^4.0.1, object-assign@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
+ integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
+
+object-inspect@~1.6.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
+ integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==
+
+object-keys@^1.0.12:
+ version "1.0.12"
+ resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2"
+ integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==
+
+objectorarray@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/objectorarray/-/objectorarray-1.0.3.tgz#d2a2de9097c06a48d7d77264fd71406519e7c772"
+ integrity sha512-kPoflSYkAf/Onvjr4ZLaq37vDuOXjVzfwLCRuORRzYGdXkHa/vacPT0RgR+KmtkwOYFcxTMM62BRrZk8GGKHjw==
+ dependencies:
+ tape "^4.8.0"
+
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -169,76 +1079,602 @@ once@^1.3.0:
dependencies:
wrappy "1"
[email protected], path-is-absolute@^1.0.0:
+onetime@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
+ integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=
+ dependencies:
+ mimic-fn "^1.0.0"
+
+optionator@^0.8.2:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
+ integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=
+ dependencies:
+ deep-is "~0.1.3"
+ fast-levenshtein "~2.0.4"
+ levn "~0.3.0"
+ prelude-ls "~1.1.2"
+ type-check "~0.3.2"
+ wordwrap "~1.0.0"
+
+os-tmpdir@~1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
+ integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
+
+p-limit@^1.1.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
+ integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==
+ dependencies:
+ p-try "^1.0.0"
+
+p-locate@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
+ integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=
+ dependencies:
+ p-limit "^1.1.0"
+
+p-try@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
+ integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=
+
+parse-json@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
+ integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=
+ dependencies:
+ error-ex "^1.2.0"
+
+parse-json@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
+ integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=
+ dependencies:
+ error-ex "^1.3.1"
+ json-parse-better-errors "^1.0.1"
+
+path-exists@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
+ integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=
+ dependencies:
+ pinkie-promise "^2.0.0"
+
+path-exists@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
+ integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
+
+path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
[email protected], plist@^2.1.0:
+path-is-inside@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
+ integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=
+
+path-key@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
+ integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
+
+path-parse@^1.0.5, path-parse@^1.0.6:
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
+ integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
+
+path-type@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
+ integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=
+ dependencies:
+ pify "^2.0.0"
+
+pify@^2.0.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
+ integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
+
+pify@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
+ integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
+
+pinkie-promise@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
+ integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o=
+ dependencies:
+ pinkie "^2.0.0"
+
+pinkie@^2.0.0:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
+ integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=
+
+pkg-conf@^2.0.0:
version "2.1.0"
- resolved "https://registry.yarnpkg.com/plist/-/plist-2.1.0.tgz#57ccdb7a0821df21831217a3cad54e3e146a1025"
- integrity sha1-V8zbeggh3yGDEhejytVOPhRqECU=
+ resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.1.0.tgz#2126514ca6f2abfebd168596df18ba57867f0058"
+ integrity sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=
+ dependencies:
+ find-up "^2.0.0"
+ load-json-file "^4.0.0"
+
+pkg-config@^1.1.0:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4"
+ integrity sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=
dependencies:
- base64-js "1.2.0"
- xmlbuilder "8.2.2"
+ debug-log "^1.0.0"
+ find-root "^1.0.0"
+ xtend "^4.0.1"
+
+pkg-dir@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4"
+ integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q=
+ dependencies:
+ find-up "^1.0.0"
+
+plist@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c"
+ integrity sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==
+ dependencies:
+ base64-js "^1.2.3"
+ xmlbuilder "^9.0.7"
xmldom "0.1.x"
+pluralize@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
+ integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==
+
+prelude-ls@~1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
+ integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
+
+process-nextick-args@~2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
+ integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
+
+progress@^2.0.0:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
+ integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
+
+prop-types@^15.6.0:
+ version "15.6.2"
+ resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
+ integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==
+ dependencies:
+ loose-envify "^1.3.1"
+ object-assign "^4.1.1"
+
+properties-parser@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/properties-parser/-/properties-parser-0.2.3.tgz#f7591255f707abbff227c7b56b637dbb0373a10f"
integrity sha1-91kSVfcHq7/yJ8e1a2N9uwNzoQ8=
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
- integrity sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=
+pseudomap@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
+ integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
q@^1.4.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
+read-pkg-up@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be"
+ integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=
+ dependencies:
+ find-up "^2.0.0"
+ read-pkg "^2.0.0"
+
+read-pkg@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8"
+ integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=
+ dependencies:
+ load-json-file "^2.0.0"
+ normalize-package-data "^2.3.2"
+ path-type "^2.0.0"
+
+readable-stream@^2.2.2:
+ version "2.3.6"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
+ integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
+ dependencies:
+ core-util-is "~1.0.0"
+ inherits "~2.0.3"
+ isarray "~1.0.0"
+ process-nextick-args "~2.0.0"
+ safe-buffer "~5.1.1"
+ string_decoder "~1.1.1"
+ util-deprecate "~1.0.1"
+
+require-uncached@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
+ integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=
+ dependencies:
+ caller-path "^0.1.0"
+ resolve-from "^1.0.0"
+
+resolve-from@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
+ integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=
+
+resolve@^1.3.3, resolve@^1.5.0:
+ version "1.9.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06"
+ integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==
+ dependencies:
+ path-parse "^1.0.6"
+
+resolve@~1.7.1:
+ version "1.7.1"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3"
+ integrity sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==
+ dependencies:
+ path-parse "^1.0.5"
+
+restore-cursor@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
+ integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368=
+ dependencies:
+ onetime "^2.0.0"
+ signal-exit "^3.0.2"
+
+resumer@~0.0.0:
+ version "0.0.0"
+ resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759"
+ integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=
+ dependencies:
+ through "~2.3.4"
+
+rimraf@~2.6.2:
+ version "2.6.2"
+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
+ integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==
+ dependencies:
+ glob "^7.0.5"
+
+run-async@^2.2.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
+ integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA=
+ dependencies:
+ is-promise "^2.1.0"
+
+run-parallel@^1.1.2:
+ version "1.1.9"
+ resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679"
+ integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==
+
+rx-lite-aggregates@^4.0.8:
+ version "4.0.8"
+ resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be"
+ integrity sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=
+ dependencies:
+ rx-lite "*"
+
+rx-lite@*, rx-lite@^4.0.8:
+ version "4.0.8"
+ resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444"
+ integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=
+
+safe-buffer@~5.1.0, safe-buffer@~5.1.1:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
+ integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
+
+"safer-buffer@>= 2.1.2 < 3":
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
+ integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
+
version "0.3.5"
resolved "https://registry.yarnpkg.com/sax/-/sax-0.3.5.tgz#88fcfc1f73c0c8bbd5b7c776b6d3f3501eed073d"
integrity sha1-iPz8H3PAyLvVt8d2ttPzUB7tBz0=
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
- integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/sax/-/sax-1.1.4.tgz#74b6d33c9ae1e001510f179a91168588f1aedaa9"
+ integrity sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=
-semver@^5.4.1:
+"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
[email protected], shelljs@^0.5.3:
+shebang-command@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
+ integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=
+ dependencies:
+ shebang-regex "^1.0.0"
+
+shebang-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
+ integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
+
+shelljs@^0.5.3:
version "0.5.3"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.5.3.tgz#c54982b996c76ef0c1e6b59fbdc5825f5b713113"
integrity sha1-xUmCuZbHbvDB5rWfvcWCX1txMRM=
+signal-exit@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
+ integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=
+
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d"
+ integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==
+ dependencies:
+ is-fullwidth-code-point "^2.0.0"
+
+spdx-correct@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4"
+ integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==
+ dependencies:
+ spdx-expression-parse "^3.0.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-exceptions@^2.1.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977"
+ integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==
+
+spdx-expression-parse@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0"
+ integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==
+ dependencies:
+ spdx-exceptions "^2.1.0"
+ spdx-license-ids "^3.0.0"
+
+spdx-license-ids@^3.0.0:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz#a59efc09784c2a5bada13cfeaf5c75dd214044d2"
+ integrity sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==
+
+sprintf-js@~1.0.2:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
+ integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
+
+standard-engine@~8.0.0:
+ version "8.0.1"
+ resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-8.0.1.tgz#0b77be8d7ab963675717dbeac1ef1d6675fb62f0"
+ integrity sha512-LA531C3+nljom/XRvdW/hGPXwmilRkaRkENhO3FAGF1Vtq/WtCXzgmnc5S6vUHHsgv534MRy02C1ikMwZXC+tw==
+ dependencies:
+ deglob "^2.1.0"
+ get-stdin "^6.0.0"
+ minimist "^1.1.0"
+ pkg-conf "^2.0.0"
+
+standard@^11.0.1:
+ version "11.0.1"
+ resolved "https://registry.yarnpkg.com/standard/-/standard-11.0.1.tgz#49be40c76f1d564964b22bbf7309929ad0335e29"
+ integrity sha512-nu0jAcHiSc8H+gJCXeiziMVZNDYi8MuqrYJKxTgjP4xKXZMKm311boqQIzDrYI/ktosltxt2CbDjYQs9ANC8IA==
+ dependencies:
+ eslint "~4.18.0"
+ eslint-config-standard "11.0.0"
+ eslint-config-standard-jsx "5.0.0"
+ eslint-plugin-import "~2.9.0"
+ eslint-plugin-node "~6.0.0"
+ eslint-plugin-promise "~3.7.0"
+ eslint-plugin-react "~7.7.0"
+ eslint-plugin-standard "~3.0.1"
+ standard-engine "~8.0.0"
+
+string-width@^2.1.0, string-width@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
+ integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
+ dependencies:
+ is-fullwidth-code-point "^2.0.0"
+ strip-ansi "^4.0.0"
+
+string.prototype.trim@~1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
+ integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=
+ dependencies:
+ define-properties "^1.1.2"
+ es-abstract "^1.5.0"
+ function-bind "^1.0.2"
+
+string_decoder@~1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
+ integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
+ dependencies:
+ safe-buffer "~5.1.0"
+
+strip-ansi@^3.0.0:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
+ integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
+ dependencies:
+ ansi-regex "^2.0.0"
+
+strip-ansi@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
+ integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
+ dependencies:
+ ansi-regex "^3.0.0"
+
+strip-bom@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
+ integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
+
+strip-json-comments@~2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
+ integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
+
+supports-color@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
+ integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
+
+supports-color@^5.3.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
+ integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
+ dependencies:
+ has-flag "^3.0.0"
+
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"
+ integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==
+ dependencies:
+ ajv "^5.2.3"
+ ajv-keywords "^2.1.0"
+ chalk "^2.1.0"
+ lodash "^4.17.4"
+ slice-ansi "1.0.0"
+ string-width "^2.1.1"
+
+tape@^4.8.0:
+ version "4.9.1"
+ resolved "https://registry.yarnpkg.com/tape/-/tape-4.9.1.tgz#1173d7337e040c76fbf42ec86fcabedc9b3805c9"
+ integrity sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==
+ dependencies:
+ deep-equal "~1.0.1"
+ defined "~1.0.0"
+ for-each "~0.3.3"
+ function-bind "~1.1.1"
+ glob "~7.1.2"
+ has "~1.0.3"
+ inherits "~2.0.3"
+ minimist "~1.2.0"
+ object-inspect "~1.6.0"
+ resolve "~1.7.1"
+ resumer "~0.0.0"
+ string.prototype.trim "~1.1.2"
+ through "~2.3.8"
+
+text-table@~0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
+ integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
+
+through@^2.3.6, through@~2.3.4, through@~2.3.8:
+ version "2.3.8"
+ resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
+ integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
+
+tmp@^0.0.33:
+ version "0.0.33"
+ resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
+ integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
+ dependencies:
+ os-tmpdir "~1.0.2"
+
+type-check@~0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
+ integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=
+ dependencies:
+ prelude-ls "~1.1.2"
+
+typedarray@^0.0.6:
+ version "0.0.6"
+ resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
+ integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
+
underscore@^1.8.3:
version "1.9.1"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961"
integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==
-unorm@^1.3.3:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.4.1.tgz#364200d5f13646ca8bcd44490271335614792300"
- integrity sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA=
+uniq@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
+ integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=
+
+universalify@^0.1.0:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
+ integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
+
+util-deprecate@~1.0.1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
+ integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
+
+validate-npm-package-license@^3.0.1:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
+ integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==
+ dependencies:
+ spdx-correct "^3.0.0"
+ spdx-expression-parse "^3.0.0"
+
+which@^1.2.9, which@^1.3.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
+ integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
+ dependencies:
+ isexe "^2.0.0"
+
+wordwrap@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
+ integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
- version "8.2.2"
- resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773"
- integrity sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=
+write@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"
+ integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=
+ dependencies:
+ mkdirp "^0.5.1"
+
+xmlbuilder@^9.0.7:
+ version "9.0.7"
+ resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
+ integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=
version "0.1.27"
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9"
integrity sha1-1QH5ezvbQDr4757MIFcxh6rawOk=
+
+xtend@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
+ integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68=
+
+yallist@^2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
+ integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=
diff --git a/package.json b/package.json
index 12d31e331..644bf9584 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"prepare-web": "rimraf web/dist && rimraf web/node_modules && cp -r app/node_modules web && cp LICENSE.txt web && cp app/third-party.txt web && yarn build-web",
"prepare-cordova": "rimraf cordova/www/dist && rimraf cordova/www/node_modules && cp -Lr app/node_modules cordova/www && cp LICENSE.txt cordova/www && cp app/third-party.txt cordova/www",
"run-web": "yarn prepare-web && node scripts/webdavserver.js",
- "run-android": "cd cordova && cross-env CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https\\://services.gradle.org/distributions/gradle-4.4.1-all.zip cordova run android && cd ..",
+ "run-android": "cd cordova && cordova run android && cd ..",
"cordova-crosswalk": "cd cordova && cordova plugin add cordova-plugin-crosswalk-webview && cd ..",
"cordova-android": "cd cordova && cordova platform add android && cd ..",
"cordova-create": "cordova create ./cordova org.tagspaces.mobile TagSpaces",