CB-9967 deleted legacy platform specific files
diff --git a/src/legacy-exec/amazon-fireos/android/nativeapiprovider.js b/src/legacy-exec/amazon-fireos/android/nativeapiprovider.js
deleted file mode 100644
index 2e9aa67..0000000
--- a/src/legacy-exec/amazon-fireos/android/nativeapiprovider.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/**
- * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
- */
-
-var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
-var currentApi = nativeApi;
-
-module.exports = {
-    get: function() { return currentApi; },
-    setPreferPrompt: function(value) {
-        currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
-    },
-    // Used only by tests.
-    set: function(value) {
-        currentApi = value;
-    }
-};
diff --git a/src/legacy-exec/amazon-fireos/android/promptbasednativeapi.js b/src/legacy-exec/amazon-fireos/android/promptbasednativeapi.js
deleted file mode 100644
index f7fb6bc..0000000
--- a/src/legacy-exec/amazon-fireos/android/promptbasednativeapi.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/**
- * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
- */
-
-module.exports = {
-    exec: function(bridgeSecret, service, action, callbackId, argsJson) {
-        return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
-    },
-    setNativeToJsBridgeMode: function(bridgeSecret, value) {
-        prompt(value, 'gap_bridge_mode:' + bridgeSecret);
-    },
-    retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
-        return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
-    }
-};
diff --git a/src/legacy-exec/amazon-fireos/exec.js b/src/legacy-exec/amazon-fireos/exec.js
deleted file mode 100644
index 87cd52c..0000000
--- a/src/legacy-exec/amazon-fireos/exec.js
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Execute a cordova command.  It is up to the native side whether this action
- * is synchronous or asynchronous.  The native side can return:
- *      Synchronous: PluginResult object as a JSON string
- *      Asynchronous: Empty string ""
- * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
- * depending upon the result of the action.
- *
- * @param {Function} success    The success callback
- * @param {Function} fail       The fail callback
- * @param {String} service      The name of the service to use
- * @param {String} action       Action to be run in cordova
- * @param {String[]} [args]     Zero or more arguments to pass to the method
- */
-var cordova = require('cordova'),
-    nativeApiProvider = require('cordova/android/nativeapiprovider'),
-    utils = require('cordova/utils'),
-    base64 = require('cordova/base64'),
-    channel = require('cordova/channel'),
-    jsToNativeModes = {
-        PROMPT: 0,
-        JS_OBJECT: 1
-    },
-    nativeToJsModes = {
-        // Polls for messages using the JS->Native bridge.
-        POLLING: 0,
-        // For LOAD_URL to be viable, it would need to have a work-around for
-        // the bug where the soft-keyboard gets dismissed when a message is sent.
-        LOAD_URL: 1,
-        // For the ONLINE_EVENT to be viable, it would need to intercept all event
-        // listeners (both through addEventListener and window.ononline) as well
-        // as set the navigator property itself.
-        ONLINE_EVENT: 2,
-        // Uses reflection to access private APIs of the WebView that can send JS
-        // to be executed.
-        // Requires Android 3.2.4 or above.
-        PRIVATE_API: 3
-    },
-    jsToNativeBridgeMode,  // Set lazily.
-    nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
-    pollEnabled = false,
-    messagesFromNative = [],
-    bridgeSecret = -1;
-
-function androidExec(success, fail, service, action, args) {
-    if (bridgeSecret < 0) {
-        // If we ever catch this firing, we'll need to queue up exec()s
-        // and fire them once we get a secret. For now, I don't think
-        // it's possible for exec() to be called since plugins are parsed but
-        // not run until until after onNativeReady.
-        throw new Error('exec() called without bridgeSecret');
-    }
-    // Set default bridge modes if they have not already been set.
-    // By default, we use the failsafe, since addJavascriptInterface breaks too often
-    if (jsToNativeBridgeMode === undefined) {
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
-    }
-
-    // Process any ArrayBuffers in the args into a string.
-    for (var i = 0; i < args.length; i++) {
-        if (utils.typeName(args[i]) == 'ArrayBuffer') {
-            args[i] = base64.fromArrayBuffer(args[i]);
-        }
-    }
-
-    var callbackId = service + cordova.callbackId++,
-        argsJson = JSON.stringify(args);
-
-    if (success || fail) {
-        cordova.callbacks[callbackId] = {success:success, fail:fail};
-    }
-
-    var messages = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
-    // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
-    // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2.  See CB-2666.
-    if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && messages === "@Null arguments.") {
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
-        androidExec(success, fail, service, action, args);
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
-        return;
-    } else {
-        androidExec.processMessages(messages, true);
-    }
-}
-
-androidExec.init = function() {
-    bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
-    channel.onNativeReady.fire();
-};
-
-function pollOnceFromOnlineEvent() {
-    pollOnce(true);
-}
-
-function pollOnce(opt_fromOnlineEvent) {
-    if (bridgeSecret < 0) {
-        // This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
-        // We know there's nothing to retrieve, so no need to poll.
-        return;
-    }
-    var msg = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
-    androidExec.processMessages(msg);
-}
-
-function pollingTimerFunc() {
-    if (pollEnabled) {
-        pollOnce();
-        setTimeout(pollingTimerFunc, 50);
-    }
-}
-
-function hookOnlineApis() {
-    function proxyEvent(e) {
-        cordova.fireWindowEvent(e.type);
-    }
-    // The network module takes care of firing online and offline events.
-    // It currently fires them only on document though, so we bridge them
-    // to window here (while first listening for exec()-releated online/offline
-    // events).
-    window.addEventListener('online', pollOnceFromOnlineEvent, false);
-    window.addEventListener('offline', pollOnceFromOnlineEvent, false);
-    cordova.addWindowEventHandler('online');
-    cordova.addWindowEventHandler('offline');
-    document.addEventListener('online', proxyEvent, false);
-    document.addEventListener('offline', proxyEvent, false);
-}
-
-hookOnlineApis();
-
-androidExec.jsToNativeModes = jsToNativeModes;
-androidExec.nativeToJsModes = nativeToJsModes;
-
-androidExec.setJsToNativeBridgeMode = function(mode) {
-    if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
-        mode = jsToNativeModes.PROMPT;
-    }
-    nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT);
-    jsToNativeBridgeMode = mode;
-};
-
-androidExec.setNativeToJsBridgeMode = function(mode) {
-    if (mode == nativeToJsBridgeMode) {
-        return;
-    }
-    if (nativeToJsBridgeMode == nativeToJsModes.POLLING) {
-        pollEnabled = false;
-    }
-
-    nativeToJsBridgeMode = mode;
-    // Tell the native side to switch modes.
-    // Otherwise, it will be set by androidExec.init()
-    if (bridgeSecret >= 0) {
-        nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
-    }
-
-    if (mode == nativeToJsModes.POLLING) {
-        pollEnabled = true;
-        setTimeout(pollingTimerFunc, 1);
-    }
-};
-
-function buildPayload(payload, message) {
-    var payloadKind = message.charAt(0);
-    if (payloadKind == 's') {
-        payload.push(message.slice(1));
-    } else if (payloadKind == 't') {
-        payload.push(true);
-    } else if (payloadKind == 'f') {
-        payload.push(false);
-    } else if (payloadKind == 'N') {
-        payload.push(null);
-    } else if (payloadKind == 'n') {
-        payload.push(+message.slice(1));
-    } else if (payloadKind == 'A') {
-        var data = message.slice(1);
-        payload.push(base64.toArrayBuffer(data));
-    } else if (payloadKind == 'S') {
-        payload.push(window.atob(message.slice(1)));
-    } else if (payloadKind == 'M') {
-        var multipartMessages = message.slice(1);
-        while (multipartMessages !== "") {
-            var spaceIdx = multipartMessages.indexOf(' ');
-            var msgLen = +multipartMessages.slice(0, spaceIdx);
-            var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
-            multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
-            buildPayload(payload, multipartMessage);
-        }
-    } else {
-        payload.push(JSON.parse(message));
-    }
-}
-
-// Processes a single message, as encoded by NativeToJsMessageQueue.java.
-function processMessage(message) {
-    try {
-        var firstChar = message.charAt(0);
-        if (firstChar == 'J') {
-            eval(message.slice(1));
-        } else if (firstChar == 'S' || firstChar == 'F') {
-            var success = firstChar == 'S';
-            var keepCallback = message.charAt(1) == '1';
-            var spaceIdx = message.indexOf(' ', 2);
-            var status = +message.slice(2, spaceIdx);
-            var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
-            var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
-            var payloadMessage = message.slice(nextSpaceIdx + 1);
-            var payload = [];
-            buildPayload(payload, payloadMessage);
-            cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
-        } else {
-            console.log("processMessage failed: invalid message: " + JSON.stringify(message));
-        }
-    } catch (e) {
-        console.log("processMessage failed: Error: " + e);
-        console.log("processMessage failed: Stack: " + e.stack);
-        console.log("processMessage failed: Message: " + message);
-    }
-}
-
-var isProcessing = false;
-
-// This is called from the NativeToJsMessageQueue.java.
-androidExec.processMessages = function(messages, opt_useTimeout) {
-    if (messages) {
-        messagesFromNative.push(messages);
-    }
-    // Check for the reentrant case.
-    if (isProcessing) {
-        return;
-    }
-    if (opt_useTimeout) {
-        window.setTimeout(androidExec.processMessages, 0);
-        return;
-    }
-    isProcessing = true;
-    try {
-        // TODO: add setImmediate polyfill and process only one message at a time.
-        while (messagesFromNative.length) {
-            var msg = popMessageFromQueue();
-            // The Java side can send a * message to indicate that it
-            // still has messages waiting to be retrieved.
-            if (msg == '*' && messagesFromNative.length === 0) {
-                setTimeout(pollOnce, 0);
-                return;
-            }
-            processMessage(msg);
-        }
-    } finally {
-        isProcessing = false;
-    }
-};
-
-function popMessageFromQueue() {
-    var messageBatch = messagesFromNative.shift();
-    if (messageBatch == '*') {
-        return '*';
-    }
-
-    var spaceIdx = messageBatch.indexOf(' ');
-    var msgLen = +messageBatch.slice(0, spaceIdx);
-    var message = messageBatch.substr(spaceIdx + 1, msgLen);
-    messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
-    if (messageBatch) {
-        messagesFromNative.unshift(messageBatch);
-    }
-    return message;
-}
-
-module.exports = androidExec;
diff --git a/src/legacy-exec/amazon-fireos/platform.js b/src/legacy-exec/amazon-fireos/platform.js
deleted file mode 100644
index e380c2e..0000000
--- a/src/legacy-exec/amazon-fireos/platform.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'amazon-fireos',
-    bootstrap: function() {
-        var channel = require('cordova/channel'),
-            cordova = require('cordova'),
-            exec = require('cordova/exec'),
-            modulemapper = require('cordova/modulemapper');
-
-        // Get the shared secret needed to use the bridge.
-        exec.init();
-
-        // TODO: Extract this as a proper plugin.
-        modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
-
-        // Inject a listener for the backbutton on the document.
-        var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
-        backButtonChannel.onHasSubscribersChange = function() {
-            // If we just attached the first handler or detached the last handler,
-            // let native know we need to override the back button.
-            exec(null, null, "App", "overrideBackbutton", [this.numHandlers == 1]);
-        };
-
-        // Add hardware MENU and SEARCH button handlers
-        cordova.addDocumentEventHandler('menubutton');
-        cordova.addDocumentEventHandler('searchbutton');
-
-        function bindButtonChannel(buttonName) {
-            // generic button bind used for volumeup/volumedown buttons
-            var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
-            volumeButtonChannel.onHasSubscribersChange = function() {
-                exec(null, null, "App", "overrideButton", [buttonName, this.numHandlers == 1]);
-            };
-        }
-        // Inject a listener for the volume buttons on the document.
-        bindButtonChannel('volumeup');
-        bindButtonChannel('volumedown');
-
-        // Let native code know we are all done on the JS side.
-        // Native code will then un-hide the WebView.
-        channel.onCordovaReady.subscribe(function() {
-            exec(null, null, "App", "show", []);
-        });
-    }
-};
diff --git a/src/legacy-exec/amazon-fireos/plugin/android/app.js b/src/legacy-exec/amazon-fireos/plugin/android/app.js
deleted file mode 100644
index 7fccc40..0000000
--- a/src/legacy-exec/amazon-fireos/plugin/android/app.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-module.exports = {
-    /**
-    * Clear the resource cache.
-    */
-    clearCache:function() {
-        exec(null, null, "App", "clearCache", []);
-    },
-
-    /**
-    * Load the url into the webview or into new browser instance.
-    *
-    * @param url           The URL to load
-    * @param props         Properties that can be passed in to the activity:
-    *      wait: int                           => wait msec before loading URL
-    *      loadingDialog: "Title,Message"      => display a native loading dialog
-    *      loadUrlTimeoutValue: int            => time in msec to wait before triggering a timeout error
-    *      clearHistory: boolean              => clear webview history (default=false)
-    *      openExternal: boolean              => open in a new browser (default=false)
-    *
-    * Example:
-    *      navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
-    */
-    loadUrl:function(url, props) {
-        exec(null, null, "App", "loadUrl", [url, props]);
-    },
-
-    /**
-    * Cancel loadUrl that is waiting to be loaded.
-    */
-    cancelLoadUrl:function() {
-        exec(null, null, "App", "cancelLoadUrl", []);
-    },
-
-    /**
-    * Clear web history in this web view.
-    * Instead of BACK button loading the previous web page, it will exit the app.
-    */
-    clearHistory:function() {
-        exec(null, null, "App", "clearHistory", []);
-    },
-
-    /**
-    * Go to previous page displayed.
-    * This is the same as pressing the backbutton on Android device.
-    */
-    backHistory:function() {
-        exec(null, null, "App", "backHistory", []);
-    },
-
-    /**
-    * Override the default behavior of the Android back button.
-    * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
-    *
-    * Note: The user should not have to call this method.  Instead, when the user
-    *       registers for the "backbutton" event, this is automatically done.
-    *
-    * @param override        T=override, F=cancel override
-    */
-    overrideBackbutton:function(override) {
-        exec(null, null, "App", "overrideBackbutton", [override]);
-    },
-
-    /**
-    * Override the default behavior of the Android volume button.
-    * If overridden, when the volume button is pressed, the "volume[up|down]button"
-    * JavaScript event will be fired.
-    *
-    * Note: The user should not have to call this method.  Instead, when the user
-    *       registers for the "volume[up|down]button" event, this is automatically done.
-    *
-    * @param button          volumeup, volumedown
-    * @param override        T=override, F=cancel override
-    */
-    overrideButton:function(button, override) {
-        exec(null, null, "App", "overrideButton", [button, override]);
-    },
-
-    /**
-    * Exit and terminate the application.
-    */
-    exitApp:function() {
-        return exec(null, null, "App", "exitApp", []);
-    }
-};
diff --git a/src/legacy-exec/android/android/nativeapiprovider.js b/src/legacy-exec/android/android/nativeapiprovider.js
deleted file mode 100644
index 2e9aa67..0000000
--- a/src/legacy-exec/android/android/nativeapiprovider.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/**
- * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
- */
-
-var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
-var currentApi = nativeApi;
-
-module.exports = {
-    get: function() { return currentApi; },
-    setPreferPrompt: function(value) {
-        currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
-    },
-    // Used only by tests.
-    set: function(value) {
-        currentApi = value;
-    }
-};
diff --git a/src/legacy-exec/android/android/promptbasednativeapi.js b/src/legacy-exec/android/android/promptbasednativeapi.js
deleted file mode 100644
index f7fb6bc..0000000
--- a/src/legacy-exec/android/android/promptbasednativeapi.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-/**
- * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
- */
-
-module.exports = {
-    exec: function(bridgeSecret, service, action, callbackId, argsJson) {
-        return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
-    },
-    setNativeToJsBridgeMode: function(bridgeSecret, value) {
-        prompt(value, 'gap_bridge_mode:' + bridgeSecret);
-    },
-    retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
-        return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
-    }
-};
diff --git a/src/legacy-exec/android/exec.js b/src/legacy-exec/android/exec.js
deleted file mode 100644
index fa8b41b..0000000
--- a/src/legacy-exec/android/exec.js
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Execute a cordova command.  It is up to the native side whether this action
- * is synchronous or asynchronous.  The native side can return:
- *      Synchronous: PluginResult object as a JSON string
- *      Asynchronous: Empty string ""
- * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
- * depending upon the result of the action.
- *
- * @param {Function} success    The success callback
- * @param {Function} fail       The fail callback
- * @param {String} service      The name of the service to use
- * @param {String} action       Action to be run in cordova
- * @param {String[]} [args]     Zero or more arguments to pass to the method
- */
-var cordova = require('cordova'),
-    nativeApiProvider = require('cordova/android/nativeapiprovider'),
-    utils = require('cordova/utils'),
-    base64 = require('cordova/base64'),
-    channel = require('cordova/channel'),
-    jsToNativeModes = {
-        PROMPT: 0,
-        JS_OBJECT: 1
-    },
-    nativeToJsModes = {
-        // Polls for messages using the JS->Native bridge.
-        POLLING: 0,
-        // For LOAD_URL to be viable, it would need to have a work-around for
-        // the bug where the soft-keyboard gets dismissed when a message is sent.
-        LOAD_URL: 1,
-        // For the ONLINE_EVENT to be viable, it would need to intercept all event
-        // listeners (both through addEventListener and window.ononline) as well
-        // as set the navigator property itself.
-        ONLINE_EVENT: 2
-    },
-    jsToNativeBridgeMode,  // Set lazily.
-    nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
-    pollEnabled = false,
-    bridgeSecret = -1;
-
-var messagesFromNative = [];
-var isProcessing = false;
-var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve();
-var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); };
-
-function androidExec(success, fail, service, action, args) {
-    if (bridgeSecret < 0) {
-        // If we ever catch this firing, we'll need to queue up exec()s
-        // and fire them once we get a secret. For now, I don't think
-        // it's possible for exec() to be called since plugins are parsed but
-        // not run until until after onNativeReady.
-        throw new Error('exec() called without bridgeSecret');
-    }
-    // Set default bridge modes if they have not already been set.
-    // By default, we use the failsafe, since addJavascriptInterface breaks too often
-    if (jsToNativeBridgeMode === undefined) {
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
-    }
-
-    // Process any ArrayBuffers in the args into a string.
-    for (var i = 0; i < args.length; i++) {
-        if (utils.typeName(args[i]) == 'ArrayBuffer') {
-            args[i] = base64.fromArrayBuffer(args[i]);
-        }
-    }
-
-    var callbackId = service + cordova.callbackId++,
-        argsJson = JSON.stringify(args);
-
-    if (success || fail) {
-        cordova.callbacks[callbackId] = {success:success, fail:fail};
-    }
-
-    var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
-    // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
-    // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2.  See CB-2666.
-    if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") {
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
-        androidExec(success, fail, service, action, args);
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
-    } else if (msgs) {
-        messagesFromNative.push(msgs);
-        // Always process async to avoid exceptions messing up stack.
-        nextTick(processMessages);
-    }
-}
-
-androidExec.init = function() {
-    bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
-    channel.onNativeReady.fire();
-};
-
-function pollOnceFromOnlineEvent() {
-    pollOnce(true);
-}
-
-function pollOnce(opt_fromOnlineEvent) {
-    if (bridgeSecret < 0) {
-        // This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
-        // We know there's nothing to retrieve, so no need to poll.
-        return;
-    }
-    var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
-    if (msgs) {
-        messagesFromNative.push(msgs);
-        // Process sync since we know we're already top-of-stack.
-        processMessages();
-    }
-}
-
-function pollingTimerFunc() {
-    if (pollEnabled) {
-        pollOnce();
-        setTimeout(pollingTimerFunc, 50);
-    }
-}
-
-function hookOnlineApis() {
-    function proxyEvent(e) {
-        cordova.fireWindowEvent(e.type);
-    }
-    // The network module takes care of firing online and offline events.
-    // It currently fires them only on document though, so we bridge them
-    // to window here (while first listening for exec()-releated online/offline
-    // events).
-    window.addEventListener('online', pollOnceFromOnlineEvent, false);
-    window.addEventListener('offline', pollOnceFromOnlineEvent, false);
-    cordova.addWindowEventHandler('online');
-    cordova.addWindowEventHandler('offline');
-    document.addEventListener('online', proxyEvent, false);
-    document.addEventListener('offline', proxyEvent, false);
-}
-
-hookOnlineApis();
-
-androidExec.jsToNativeModes = jsToNativeModes;
-androidExec.nativeToJsModes = nativeToJsModes;
-
-androidExec.setJsToNativeBridgeMode = function(mode) {
-    if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
-        mode = jsToNativeModes.PROMPT;
-    }
-    nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT);
-    jsToNativeBridgeMode = mode;
-};
-
-androidExec.setNativeToJsBridgeMode = function(mode) {
-    if (mode == nativeToJsBridgeMode) {
-        return;
-    }
-    if (nativeToJsBridgeMode == nativeToJsModes.POLLING) {
-        pollEnabled = false;
-    }
-
-    nativeToJsBridgeMode = mode;
-    // Tell the native side to switch modes.
-    // Otherwise, it will be set by androidExec.init()
-    if (bridgeSecret >= 0) {
-        nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
-    }
-
-    if (mode == nativeToJsModes.POLLING) {
-        pollEnabled = true;
-        setTimeout(pollingTimerFunc, 1);
-    }
-};
-
-function buildPayload(payload, message) {
-    var payloadKind = message.charAt(0);
-    if (payloadKind == 's') {
-        payload.push(message.slice(1));
-    } else if (payloadKind == 't') {
-        payload.push(true);
-    } else if (payloadKind == 'f') {
-        payload.push(false);
-    } else if (payloadKind == 'N') {
-        payload.push(null);
-    } else if (payloadKind == 'n') {
-        payload.push(+message.slice(1));
-    } else if (payloadKind == 'A') {
-        var data = message.slice(1);
-        payload.push(base64.toArrayBuffer(data));
-    } else if (payloadKind == 'S') {
-        payload.push(window.atob(message.slice(1)));
-    } else if (payloadKind == 'M') {
-        var multipartMessages = message.slice(1);
-        while (multipartMessages !== "") {
-            var spaceIdx = multipartMessages.indexOf(' ');
-            var msgLen = +multipartMessages.slice(0, spaceIdx);
-            var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
-            multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
-            buildPayload(payload, multipartMessage);
-        }
-    } else {
-        payload.push(JSON.parse(message));
-    }
-}
-
-// Processes a single message, as encoded by NativeToJsMessageQueue.java.
-function processMessage(message) {
-    var firstChar = message.charAt(0);
-    if (firstChar == 'J') {
-        // This is deprecated on the .java side. It doesn't work with CSP enabled.
-        eval(message.slice(1));
-    } else if (firstChar == 'S' || firstChar == 'F') {
-        var success = firstChar == 'S';
-        var keepCallback = message.charAt(1) == '1';
-        var spaceIdx = message.indexOf(' ', 2);
-        var status = +message.slice(2, spaceIdx);
-        var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
-        var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
-        var payloadMessage = message.slice(nextSpaceIdx + 1);
-        var payload = [];
-        buildPayload(payload, payloadMessage);
-        cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
-    } else {
-        console.log("processMessage failed: invalid message: " + JSON.stringify(message));
-    }
-}
-
-function processMessages() {
-    // Check for the reentrant case.
-    if (isProcessing) {
-        return;
-    }
-    if (messagesFromNative.length === 0) {
-        return;
-    }
-    isProcessing = true;
-    try {
-        var msg = popMessageFromQueue();
-        // The Java side can send a * message to indicate that it
-        // still has messages waiting to be retrieved.
-        if (msg == '*' && messagesFromNative.length === 0) {
-            nextTick(pollOnce);
-            return;
-        }
-        processMessage(msg);
-    } finally {
-        isProcessing = false;
-        if (messagesFromNative.length > 0) {
-            nextTick(processMessages);
-        }
-    }
-}
-
-function popMessageFromQueue() {
-    var messageBatch = messagesFromNative.shift();
-    if (messageBatch == '*') {
-        return '*';
-    }
-
-    var spaceIdx = messageBatch.indexOf(' ');
-    var msgLen = +messageBatch.slice(0, spaceIdx);
-    var message = messageBatch.substr(spaceIdx + 1, msgLen);
-    messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
-    if (messageBatch) {
-        messagesFromNative.unshift(messageBatch);
-    }
-    return message;
-}
-
-module.exports = androidExec;
diff --git a/src/legacy-exec/android/platform.js b/src/legacy-exec/android/platform.js
deleted file mode 100644
index bffc675..0000000
--- a/src/legacy-exec/android/platform.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'android',
-    bootstrap: function() {
-        var channel = require('cordova/channel'),
-            cordova = require('cordova'),
-            exec = require('cordova/exec'),
-            modulemapper = require('cordova/modulemapper');
-
-        // Get the shared secret needed to use the bridge.
-        exec.init();
-
-        // TODO: Extract this as a proper plugin.
-        modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
-
-        var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
-        // Inject a listener for the backbutton on the document.
-        var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
-        backButtonChannel.onHasSubscribersChange = function() {
-            // If we just attached the first handler or detached the last handler,
-            // let native know we need to override the back button.
-            exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]);
-        };
-
-        // Add hardware MENU and SEARCH button handlers
-        cordova.addDocumentEventHandler('menubutton');
-        cordova.addDocumentEventHandler('searchbutton');
-
-        function bindButtonChannel(buttonName) {
-            // generic button bind used for volumeup/volumedown buttons
-            var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
-            volumeButtonChannel.onHasSubscribersChange = function() {
-                exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]);
-            };
-        }
-        // Inject a listener for the volume buttons on the document.
-        bindButtonChannel('volumeup');
-        bindButtonChannel('volumedown');
-
-        // Let native code know we are all done on the JS side.
-        // Native code will then un-hide the WebView.
-        channel.onCordovaReady.subscribe(function() {
-            exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
-            exec(null, null, APP_PLUGIN_NAME, "show", []);
-        });
-    }
-};
-
-function onMessageFromNative(msg) {
-    var cordova = require('cordova');
-    var action = msg.action;
-
-    switch (action)
-    {
-        // Button events
-        case 'backbutton':
-        case 'menubutton':
-        case 'searchbutton':
-        // App life cycle events
-        case 'pause':
-        case 'resume':
-        // Volume events
-        case 'volumedownbutton':
-        case 'volumeupbutton':
-            cordova.fireDocumentEvent(action);
-            break;
-        default:
-            throw new Error('Unknown event action ' + action);
-    }
-}
diff --git a/src/legacy-exec/android/plugin/android/app.js b/src/legacy-exec/android/plugin/android/app.js
deleted file mode 100644
index 22cf96e..0000000
--- a/src/legacy-exec/android/plugin/android/app.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
-
-module.exports = {
-    /**
-    * Clear the resource cache.
-    */
-    clearCache:function() {
-        exec(null, null, APP_PLUGIN_NAME, "clearCache", []);
-    },
-
-    /**
-    * Load the url into the webview or into new browser instance.
-    *
-    * @param url           The URL to load
-    * @param props         Properties that can be passed in to the activity:
-    *      wait: int                           => wait msec before loading URL
-    *      loadingDialog: "Title,Message"      => display a native loading dialog
-    *      loadUrlTimeoutValue: int            => time in msec to wait before triggering a timeout error
-    *      clearHistory: boolean              => clear webview history (default=false)
-    *      openExternal: boolean              => open in a new browser (default=false)
-    *
-    * Example:
-    *      navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
-    */
-    loadUrl:function(url, props) {
-        exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
-    },
-
-    /**
-    * Cancel loadUrl that is waiting to be loaded.
-    */
-    cancelLoadUrl:function() {
-        exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []);
-    },
-
-    /**
-    * Clear web history in this web view.
-    * Instead of BACK button loading the previous web page, it will exit the app.
-    */
-    clearHistory:function() {
-        exec(null, null, APP_PLUGIN_NAME, "clearHistory", []);
-    },
-
-    /**
-    * Go to previous page displayed.
-    * This is the same as pressing the backbutton on Android device.
-    */
-    backHistory:function() {
-        exec(null, null, APP_PLUGIN_NAME, "backHistory", []);
-    },
-
-    /**
-    * Override the default behavior of the Android back button.
-    * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
-    *
-    * Note: The user should not have to call this method.  Instead, when the user
-    *       registers for the "backbutton" event, this is automatically done.
-    *
-    * @param override        T=override, F=cancel override
-    */
-    overrideBackbutton:function(override) {
-        exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]);
-    },
-
-    /**
-    * Override the default behavior of the Android volume button.
-    * If overridden, when the volume button is pressed, the "volume[up|down]button"
-    * JavaScript event will be fired.
-    *
-    * Note: The user should not have to call this method.  Instead, when the user
-    *       registers for the "volume[up|down]button" event, this is automatically done.
-    *
-    * @param button          volumeup, volumedown
-    * @param override        T=override, F=cancel override
-    */
-    overrideButton:function(button, override) {
-        exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]);
-    },
-
-    /**
-    * Exit and terminate the application.
-    */
-    exitApp:function() {
-        return exec(null, null, APP_PLUGIN_NAME, "exitApp", []);
-    }
-};
diff --git a/src/legacy-exec/blackberry10/exec.js b/src/legacy-exec/blackberry10/exec.js
deleted file mode 100644
index 1bfd564..0000000
--- a/src/legacy-exec/blackberry10/exec.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var cordova = require('cordova'),
-    execProxy = require('cordova/exec/proxy');
-
-function RemoteFunctionCall(functionUri) {
-    var params = {};
-
-    function composeUri() {
-        return "http://localhost:8472/" + functionUri;
-    }
-
-    function createXhrRequest(uri, isAsync) {
-        var request = new XMLHttpRequest();
-        request.open("POST", uri, isAsync);
-        request.setRequestHeader("Content-Type", "application/json");
-        return request;
-    }
-
-    this.addParam = function (name, value) {
-        params[name] = encodeURIComponent(JSON.stringify(value));
-    };
-
-    this.makeAsyncCall = function () {
-        var requestUri = composeUri(),
-            request = new XMLHttpRequest(),
-            didSucceed,
-            response,
-            fail = function () {
-                var callbackId = JSON.parse(decodeURIComponent(params.callbackId));
-                response = JSON.parse(decodeURIComponent(request.responseText) || "null");
-                cordova.callbacks[callbackId].fail && cordova.callbacks[callbackId].fail(response.msg, response);
-                delete cordova.callbacks[callbackId];
-            };
-
-        request.open("POST", requestUri, true /* async */);
-        request.setRequestHeader("Content-Type", "application/json");
-        request.timeout = 1000; // Timeout in 1000ms
-        request.ontimeout = fail;
-        request.onerror = fail;
-
-        request.onload = function () {
-            response = JSON.parse(decodeURIComponent(request.responseText) || "null");
-            if (request.status === 200) {
-                didSucceed = response.code === cordova.callbackStatus.OK || response.code === cordova.callbackStatus.NO_RESULT;
-                cordova.callbackFromNative(
-                        JSON.parse(decodeURIComponent(params.callbackId)),
-                        didSucceed,
-                        response.code,
-                        [ didSucceed ? response.data : response.msg ],
-                        !!response.keepCallback
-                        );
-            } else {
-                fail();
-            }
-        };
-
-        request.send(JSON.stringify(params));
-    };
-
-    this.makeSyncCall = function () {
-        var requestUri = composeUri(),
-        request = createXhrRequest(requestUri, false),
-        response;
-        try {
-            request.send(JSON.stringify(params));
-            response = JSON.parse(decodeURIComponent(request.responseText) || "null");
-        } catch (e) {
-            console.error('makeSyncCall failed', e);
-            response = { code: 500, msg: 'exec bridge failure' };
-        }
-        return response;
-    };
-
-}
-
-module.exports = function (success, fail, service, action, args, sync) {
-    var uri = service + "/" + action,
-    request = new RemoteFunctionCall(uri),
-    callbackId = service + cordova.callbackId++,
-    proxy,
-    response,
-    name,
-    didSucceed;
-
-    cordova.callbacks[callbackId] = {
-        success: success,
-        fail: fail
-    };
-
-    proxy = execProxy.get(service, action);
-
-    if (proxy) {
-        proxy(success, fail, args);
-    }
-
-    else {
-
-        request.addParam("callbackId", callbackId);
-
-        for (name in args) {
-            if (Object.hasOwnProperty.call(args, name)) {
-                request.addParam(name, args[name]);
-            }
-        }
-
-        if (sync !== undefined && !sync) {
-            request.makeAsyncCall();
-            return;
-        }
-
-        response = request.makeSyncCall();
-
-        if (response.code < 0) {
-            if (fail) {
-                fail(response.msg, response);
-            }
-            delete cordova.callbacks[callbackId];
-        } else {
-            didSucceed = response.code === cordova.callbackStatus.OK || response.code === cordova.callbackStatus.NO_RESULT;
-            cordova.callbackFromNative(
-                callbackId,
-                didSucceed,
-                response.code,
-                [ didSucceed ? response.data : response.msg ],
-                !!response.keepCallback
-            );
-        }
-    }
-
-};
diff --git a/src/legacy-exec/blackberry10/platform.js b/src/legacy-exec/blackberry10/platform.js
deleted file mode 100644
index 9fcbda0..0000000
--- a/src/legacy-exec/blackberry10/platform.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-
-    id: "blackberry10",
-
-    bootstrap: function() {
-
-        var channel = require('cordova/channel'),
-            addEventListener = document.addEventListener;
-
-        //ready as soon as the plugins are
-        channel.onPluginsReady.subscribe(function () {
-            channel.onNativeReady.fire();
-        });
-
-        //pass document online/offline event listeners to window
-        document.addEventListener = function (type) {
-            if (type === "online" || type === "offline") {
-                window.addEventListener.apply(window, arguments);
-            } else {
-                addEventListener.apply(document, arguments);
-            }
-        };
-
-        //map blackberry.event to document
-        if (!window.blackberry) {
-            window.blackberry = {};
-        }
-        window.blackberry.event =
-        {
-            addEventListener: document.addEventListener,
-            removeEventListener: document.removeEventListener
-        };
-
-    }
-
-};
diff --git a/src/legacy-exec/browser/confighelper.js b/src/legacy-exec/browser/confighelper.js
deleted file mode 100644
index b6d606e..0000000
--- a/src/legacy-exec/browser/confighelper.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var config;
-
-function Config(xhr) {
-    function loadPreferences(xhr) {
-       var parser = new DOMParser();
-       var doc = parser.parseFromString(xhr.responseText, "application/xml");
-
-       var preferences = doc.getElementsByTagName("preference");
-       return Array.prototype.slice.call(preferences);
-    }
-
-    this.xhr = xhr;
-    this.preferences = loadPreferences(this.xhr);
-}
-
-function readConfig(success, error) {
-    var xhr;
-
-    if(typeof config != 'undefined') {
-        success(config);
-    }
-
-    function fail(msg) {
-        console.error(msg);
-
-        if(error) {
-            error(msg);
-        }
-    }
-
-    var xhrStatusChangeHandler = function() {
-        if (xhr.readyState == 4) {
-            if (xhr.status == 200 || xhr.status == 304 || xhr.status === 0 /* file:// */) {
-                config = new Config(xhr);
-                success(config);
-            }
-            else {
-                fail('[Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: ' + xhr.statusText);
-            }
-        }
-    };
-
-    if ("ActiveXObject" in window) {
-        // Needed for XHR-ing via file:// protocol in IE
-        xhr = new window.ActiveXObject("MSXML2.XMLHTTP");
-        xhr.onreadystatechange = xhrStatusChangeHandler;
-    } else {
-        xhr = new XMLHttpRequest();
-        xhr.addEventListener("load", xhrStatusChangeHandler);
-    }
-
-    try {
-        xhr.open("get", "/config.xml", true);
-        xhr.send();
-    } catch(e) {
-        fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
-    }
-}
-
-/**
- * Reads a preference value from config.xml.
- * Returns preference value or undefined if it does not exist.
- * @param {String} preferenceName Preference name to read */
-Config.prototype.getPreferenceValue = function getPreferenceValue(preferenceName) {
-    var preferenceItem = this.preferences && this.preferences.filter(function(item) {
-        return item.attributes.name && item.attributes.name.value === preferenceName;
-    });
-
-    if(preferenceItem && preferenceItem[0] && preferenceItem[0].attributes && preferenceItem[0].attributes.value) {
-        return preferenceItem[0].attributes.value.value;
-    }
-};
-
-exports.readConfig = readConfig;
diff --git a/src/legacy-exec/browser/exec.js b/src/legacy-exec/browser/exec.js
deleted file mode 100644
index 744282e..0000000
--- a/src/legacy-exec/browser/exec.js
+++ /dev/null
@@ -1,48 +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 cordova = require('cordova');
-var execProxy = require('cordova/exec/proxy');
-
-module.exports = function(success, fail, service, action, args) {
-
-    var proxy = execProxy.get(service, action);
-
-    if (proxy) {
-        var callbackId = service + cordova.callbackId++;
-
-        if (typeof success == "function" || typeof fail == "function") {
-            cordova.callbacks[callbackId] = {success:success, fail:fail};
-        }
-
-        try {
-            proxy(success, fail, args);
-        }
-        catch(e) {
-            // TODO throw maybe?
-            var msg = "Exception calling :: " + service + " :: " + action  + " ::exception=" + e;
-            console.log(msg);
-        }
-    }
-    else {
-        fail && fail("Missing Command Error");
-    }
-};
diff --git a/src/legacy-exec/browser/platform.js b/src/legacy-exec/browser/platform.js
deleted file mode 100644
index 0514059..0000000
--- a/src/legacy-exec/browser/platform.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'browser',
-    cordovaVersion: '3.4.0',
-
-    bootstrap: function() {
-
-        var modulemapper = require('cordova/modulemapper');
-        var channel = require('cordova/channel');
-
-        modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
-
-        channel.onNativeReady.fire();
-
-        // FIXME is this the right place to clobber pause/resume? I am guessing not
-        // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
-        document.addEventListener('webkitvisibilitychange', function() {
-            if (document.webkitHidden) {
-                channel.onPause.fire();
-            }
-            else {
-                channel.onResume.fire();
-            }
-        }, false);
-
-    // End of bootstrap
-    }
-};
diff --git a/src/legacy-exec/firefoxos/exec.js b/src/legacy-exec/firefoxos/exec.js
deleted file mode 100644
index 60410ee..0000000
--- a/src/legacy-exec/firefoxos/exec.js
+++ /dev/null
@@ -1,44 +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 firefoxos = require('cordova/platform');
-var cordova = require('cordova');
-var execProxy = require('cordova/exec/proxy');
-
-module.exports = function(success, fail, service, action, args) {
-    var proxy = execProxy.get(service,action);
-    if(proxy) {
-        var callbackId = service + cordova.callbackId++;
-        //console.log("EXEC:" + service + " : " + action);
-        if (typeof success == "function" || typeof fail == "function") {
-            cordova.callbacks[callbackId] = {success:success, fail:fail};
-        }
-        try {
-            proxy(success, fail, args);
-        }
-        catch(e) {
-            console.log("Exception calling native with command :: " + service + " :: " + action  + " ::exception=" + e);
-        }
-    }
-    else {
-        fail && fail("Missing Command Error");
-    }
-};
diff --git a/src/legacy-exec/firefoxos/init.js b/src/legacy-exec/firefoxos/init.js
deleted file mode 100644
index b25d4af..0000000
--- a/src/legacy-exec/firefoxos/init.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This file has been copied into the firefoxos platform and patched
- * to fix a problem with replacing the navigator object. We will have
- * to keep this file up-to-date with the common init.js.
- */
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-
-var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
-
-function logUnfiredChannels(arr) {
-    for (var i = 0; i < arr.length; ++i) {
-        if (arr[i].state != 2) {
-            console.log('Channel not fired: ' + arr[i].type);
-        }
-    }
-}
-
-window.setTimeout(function() {
-    if (channel.onDeviceReady.state != 2) {
-        console.log('deviceready has not fired after 5 seconds.');
-        logUnfiredChannels(platformInitChannelsArray);
-        logUnfiredChannels(channel.deviceReadyChannelsArray);
-    }
-}, 5000);
-
-// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
-// We replace it so that properties that can't be clobbered can instead be overridden.
-function replaceNavigator(origNavigator) {
-    var CordovaNavigator = function() {};
-    CordovaNavigator.prototype = origNavigator;
-    var newNavigator = new CordovaNavigator();
-    // This work-around really only applies to new APIs that are newer than Function.bind.
-    // Without it, APIs such as getGamepads() break.
-    if (CordovaNavigator.bind) {
-        for (var key in origNavigator) {
-            try {
-                if (typeof origNavigator[key] == 'function') {
-                    newNavigator[key] = origNavigator[key].bind(origNavigator);
-                }
-            } catch(e) {
-                // This try/catch was added for Firefox OS 1.0 and 1.1
-                // because it throws an security exception when trying
-                // to access a few properties of the navigator object.
-                // It has been fixed in 1.2.
-            }
-        }
-    }
-    return newNavigator;
-}
-if (window.navigator) {
-    window.navigator = replaceNavigator(window.navigator);
-}
-
-if (!window.console) {
-    window.console = {
-        log: function(){}
-    };
-}
-if (!window.console.warn) {
-    window.console.warn = function(msg) {
-        this.log("warn: " + msg);
-    };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState == 'complete' || document.readyState == 'interactive') {
-    channel.onDOMContentLoaded.fire();
-} else {
-    document.addEventListener('DOMContentLoaded', function() {
-        channel.onDOMContentLoaded.fire();
-    }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
-    channel.onNativeReady.fire();
-}
-
-modulemapper.clobbers('cordova', 'cordova');
-modulemapper.clobbers('cordova/exec', 'cordova.exec');
-modulemapper.clobbers('cordova/exec', 'Cordova.exec');
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-pluginloader.load(function() {
-    channel.onPluginsReady.fire();
-});
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function() {
-    modulemapper.mapModules(window);
-
-    platform.initialize && platform.initialize();
-
-    // Fire event to notify that all objects are created
-    channel.onCordovaReady.fire();
-
-    // Fire onDeviceReady event once page has fully loaded, all
-    // constructors have run and cordova info has been received from native
-    // side.
-    channel.join(function() {
-        require('cordova').fireDocumentEvent('deviceready');
-    }, channel.deviceReadyChannelsArray);
-
-}, platformInitChannelsArray);
-
diff --git a/src/legacy-exec/firefoxos/platform.js b/src/legacy-exec/firefoxos/platform.js
deleted file mode 100644
index b7d89b8..0000000
--- a/src/legacy-exec/firefoxos/platform.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'firefoxos',
-
-    bootstrap: function() {
-        var modulemapper = require('cordova/modulemapper');
-
-        modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
-        require('cordova/channel').onNativeReady.fire();
-    }
-};
diff --git a/src/legacy-exec/ios/exec.js b/src/legacy-exec/ios/exec.js
deleted file mode 100644
index 11cc92b..0000000
--- a/src/legacy-exec/ios/exec.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.
- *
-*/
-
-/**
- * Creates a gap bridge iframe used to notify the native code about queued
- * commands.
- */
-var cordova = require('cordova'),
-    channel = require('cordova/channel'),
-    utils = require('cordova/utils'),
-    base64 = require('cordova/base64'),
-    // XHR mode does not work on iOS 4.2.
-    // XHR mode's main advantage is working around a bug in -webkit-scroll, which
-    // doesn't exist only on iOS 5.x devices.
-    // IFRAME_NAV is the fastest.
-    // IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature.
-    jsToNativeModes = {
-        IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
-        // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
-        XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
-        XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
-        XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
-        IFRAME_HASH_NO_PAYLOAD: 4, // Not fully baked. A bit faster than IFRAME_NAV, but risks jank since poke happens synchronously.
-        IFRAME_HASH_WITH_PAYLOAD: 5, // Slower than no payload. Maybe since it has to be URI encoded / decoded.
-        WK_WEBVIEW_BINDING: 6 // Only way that works for WKWebView :)
-    },
-    bridgeMode,
-    execIframe,
-    execHashIframe,
-    hashToggle = 1,
-    execXhr,
-    requestCount = 0,
-    vcHeaderValue = null,
-    commandQueue = [], // Contains pending JS->Native messages.
-    isInContextOfEvalJs = 0,
-    failSafeTimerId = 0;
-
-function shouldBundleCommandJson() {
-    if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
-        return true;
-    }
-    if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
-        var payloadLength = 0;
-        for (var i = 0; i < commandQueue.length; ++i) {
-            payloadLength += commandQueue[i].length;
-        }
-        // The value here was determined using the benchmark within CordovaLibApp on an iPad 3.
-        return payloadLength < 4500;
-    }
-    return false;
-}
-
-function massageArgsJsToNative(args) {
-    if (!args || utils.typeName(args) != 'Array') {
-        return args;
-    }
-    var ret = [];
-    args.forEach(function(arg, i) {
-        if (utils.typeName(arg) == 'ArrayBuffer') {
-            ret.push({
-                'CDVType': 'ArrayBuffer',
-                'data': base64.fromArrayBuffer(arg)
-            });
-        } else {
-            ret.push(arg);
-        }
-    });
-    return ret;
-}
-
-function massageMessageNativeToJs(message) {
-    if (message.CDVType == 'ArrayBuffer') {
-        var stringToArrayBuffer = function(str) {
-            var ret = new Uint8Array(str.length);
-            for (var i = 0; i < str.length; i++) {
-                ret[i] = str.charCodeAt(i);
-            }
-            return ret.buffer;
-        };
-        var base64ToArrayBuffer = function(b64) {
-            return stringToArrayBuffer(atob(b64));
-        };
-        message = base64ToArrayBuffer(message.data);
-    }
-    return message;
-}
-
-function convertMessageToArgsNativeToJs(message) {
-    var args = [];
-    if (!message || !message.hasOwnProperty('CDVType')) {
-        args.push(message);
-    } else if (message.CDVType == 'MultiPart') {
-        message.messages.forEach(function(e) {
-            args.push(massageMessageNativeToJs(e));
-        });
-    } else {
-        args.push(massageMessageNativeToJs(message));
-    }
-    return args;
-}
-
-function iOSExec() {
-    if (bridgeMode === undefined) {
-        bridgeMode = jsToNativeModes.IFRAME_NAV;
-    }
-
-    if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
-        bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
-    }
-
-    var successCallback, failCallback, service, action, actionArgs, splitCommand;
-    var callbackId = null;
-    if (typeof arguments[0] !== "string") {
-        // FORMAT ONE
-        successCallback = arguments[0];
-        failCallback = arguments[1];
-        service = arguments[2];
-        action = arguments[3];
-        actionArgs = arguments[4];
-
-        // Since we need to maintain backwards compatibility, we have to pass
-        // an invalid callbackId even if no callback was provided since plugins
-        // will be expecting it. The Cordova.exec() implementation allocates
-        // an invalid callbackId and passes it even if no callbacks were given.
-        callbackId = 'INVALID';
-    } else {
-        // FORMAT TWO, REMOVED
-        try {
-            splitCommand = arguments[0].split(".");
-            action = splitCommand.pop();
-            service = splitCommand.join(".");
-            actionArgs = Array.prototype.splice.call(arguments, 1);
-
-            console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
-                       "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");"
-            );
-            return;
-        } catch (e) {}
-    }
-
-    // If actionArgs is not provided, default to an empty array
-    actionArgs = actionArgs || [];
-
-    // Register the callbacks and add the callbackId to the positional
-    // arguments if given.
-    if (successCallback || failCallback) {
-        callbackId = service + cordova.callbackId++;
-        cordova.callbacks[callbackId] =
-            {success:successCallback, fail:failCallback};
-    }
-
-    actionArgs = massageArgsJsToNative(actionArgs);
-
-    var command = [callbackId, service, action, actionArgs];
-
-    if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
-        window.webkit.messageHandlers.cordova.postMessage(command);
-    } else {
-        // Stringify and queue the command. We stringify to command now to
-        // effectively clone the command arguments in case they are mutated before
-        // the command is executed.
-        commandQueue.push(JSON.stringify(command));
-    
-        // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
-        // then the queue will be flushed when it returns; no need for a poke.
-        // Also, if there is already a command in the queue, then we've already
-        // poked the native side, so there is no reason to do so again.
-        if (!isInContextOfEvalJs && commandQueue.length == 1) {
-            pokeNative();
-        }
-    }
-}
-
-function pokeNative() {
-    switch (bridgeMode) {
-    case jsToNativeModes.XHR_NO_PAYLOAD:
-    case jsToNativeModes.XHR_WITH_PAYLOAD:
-    case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
-        pokeNativeViaXhr();
-        break;
-    default: // iframe-based.
-        pokeNativeViaIframe();
-    }
-}
-
-function pokeNativeViaXhr() {
-    // This prevents sending an XHR when there is already one being sent.
-    // This should happen only in rare circumstances (refer to unit tests).
-    if (execXhr && execXhr.readyState != 4) {
-        execXhr = null;
-    }
-    // Re-using the XHR improves exec() performance by about 10%.
-    execXhr = execXhr || new XMLHttpRequest();
-    // Changing this to a GET will make the XHR reach the URIProtocol on 4.2.
-    // For some reason it still doesn't work though...
-    // Add a timestamp to the query param to prevent caching.
-    execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
-    if (!vcHeaderValue) {
-        vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1];
-    }
-    execXhr.setRequestHeader('vc', vcHeaderValue);
-    execXhr.setRequestHeader('rc', ++requestCount);
-    if (shouldBundleCommandJson()) {
-        execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
-    }
-    execXhr.send(null);
-}
-
-function pokeNativeViaIframe() {
-    // CB-5488 - Don't attempt to create iframe before document.body is available.
-    if (!document.body) {
-        setTimeout(pokeNativeViaIframe);
-        return;
-    }
-    if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
-        // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735)
-        if (!execHashIframe) {
-            execHashIframe = document.createElement('iframe');
-            execHashIframe.style.display = 'none';
-            document.body.appendChild(execHashIframe);
-            // Hash changes don't work on about:blank, so switch it to file:///.
-            execHashIframe.contentWindow.history.replaceState(null, null, 'file:///#');
-        }
-        // The delegate method is called only when the hash changes, so toggle it back and forth.
-        hashToggle = hashToggle ^ 3;
-        var hashValue = '%0' + hashToggle;
-        if (bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
-            hashValue += iOSExec.nativeFetchMessages();
-        }
-        execHashIframe.contentWindow.location.hash = hashValue;
-    } else {
-        // Check if they've removed it from the DOM, and put it back if so.
-        if (execIframe && execIframe.contentWindow) {
-            execIframe.contentWindow.location = 'gap://ready';
-        } else {
-            execIframe = document.createElement('iframe');
-            execIframe.style.display = 'none';
-            execIframe.src = 'gap://ready';
-            document.body.appendChild(execIframe);
-        }
-        // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
-        // This makes the bridge ~ 7% slower, but works around the poke getting lost
-        // when the iframe is removed from the DOM.
-        // An onunload listener could be used in the case where the iframe has just been
-        // created, but since unload events fire only once, it doesn't work in the normal
-        // case of iframe reuse (where unload will have already fired due to the attempted
-        // navigation of the page).
-        failSafeTimerId = setTimeout(function() {
-            if (commandQueue.length) {
-                pokeNative();
-            }
-        }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
-    }
-}
-
-iOSExec.jsToNativeModes = jsToNativeModes;
-
-iOSExec.setJsToNativeBridgeMode = function(mode) {
-    // Remove the iFrame since it may be no longer required, and its existence
-    // can trigger browser bugs.
-    // https://issues.apache.org/jira/browse/CB-593
-    if (execIframe) {
-        if (execIframe.parentNode) {
-            execIframe.parentNode.removeChild(execIframe);
-        }
-        execIframe = null;
-    }
-    bridgeMode = mode;
-};
-
-iOSExec.nativeFetchMessages = function() {
-    // Stop listing for window detatch once native side confirms poke.
-    if (failSafeTimerId) {
-        clearTimeout(failSafeTimerId);
-        failSafeTimerId = 0;
-    }
-    // Each entry in commandQueue is a JSON string already.
-    if (!commandQueue.length) {
-        return '';
-    }
-    var json = '[' + commandQueue.join(',') + ']';
-    commandQueue.length = 0;
-    return json;
-};
-
-iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, debug) {
-    return iOSExec.nativeEvalAndFetch(function() {
-        var success = status === 0 || status === 1;
-        var args = convertMessageToArgsNativeToJs(message);
-        function nc2() {
-            cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
-        }
-        // CB-8468
-        if (debug) {
-            setTimeout(nc2, 0);
-        } else {
-            nc2();
-        }
-    });
-};
-
-iOSExec.nativeEvalAndFetch = function(func) {
-    // This shouldn't be nested, but better to be safe.
-    isInContextOfEvalJs++;
-    try {
-        func();
-        return iOSExec.nativeFetchMessages();
-    } finally {
-        isInContextOfEvalJs--;
-    }
-};
-
-module.exports = iOSExec;
diff --git a/src/legacy-exec/ios/platform.js b/src/legacy-exec/ios/platform.js
deleted file mode 100644
index 36529ba..0000000
--- a/src/legacy-exec/ios/platform.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'ios',
-    bootstrap: function() {
-        require('cordova/channel').onNativeReady.fire();
-    }
-};
-
diff --git a/src/legacy-exec/osx/exec.js b/src/legacy-exec/osx/exec.js
deleted file mode 100644
index ff52009..0000000
--- a/src/legacy-exec/osx/exec.js
+++ /dev/null
@@ -1,117 +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.
- *
-*/
-
-/**
- * Creates a gap bridge used to notify the native code about commands.
-
- * @private
- */
-var cordova = require('cordova'),
-    channel = require('cordova/channel'),
-    utils = require('cordova/utils'),
-    base64 = require('cordova/base64');
-
-
-function massageMessageNativeToJs(message) {
-    if (message.CDVType == 'ArrayBuffer') {
-        var stringToArrayBuffer = function(str) {
-            var ret = new Uint8Array(str.length);
-            for (var i = 0; i < str.length; i++) {
-                ret[i] = str.charCodeAt(i);
-            }
-            return ret.buffer;
-        };
-        var base64ToArrayBuffer = function(b64) {
-            return stringToArrayBuffer(atob(b64));
-        };
-        message = base64ToArrayBuffer(message.data);
-    }
-    return message;
-}
-
-function convertMessageToArgsNativeToJs(message) {
-    var args = [];
-    if (!message || !message.hasOwnProperty('CDVType')) {
-        args.push(message);
-    } else if (message.CDVType == 'MultiPart') {
-        message.messages.forEach(function(e) {
-            args.push(massageMessageNativeToJs(e));
-        });
-    } else {
-        args.push(massageMessageNativeToJs(message));
-    }
-    return args;
-}
-
-function massageArgsJsToNative(args) {
-    if (!args || utils.typeName(args) != 'Array') {
-        return args;
-    }
-    var ret = [];
-    args.forEach(function(arg, i) {
-        if (utils.typeName(arg) == 'ArrayBuffer') {
-            ret.push({
-                'CDVType': 'ArrayBuffer',
-                'data': base64.fromArrayBuffer(arg)
-            });
-        } else {
-            ret.push(arg);
-        }
-    });
-    return ret;
-}
-
-function OSXExec() {
-
-    var successCallback, failCallback, service, action, actionArgs, splitCommand;
-    var callbackId = 'INVALID';
-
-    successCallback = arguments[0];
-    failCallback = arguments[1];
-    service = arguments[2];
-    action = arguments[3];
-    actionArgs = arguments[4];
-
-    // Register the callbacks and add the callbackId to the positional
-    // arguments if given.
-    if (successCallback || failCallback) {
-        callbackId = service + cordova.callbackId++;
-        cordova.callbacks[callbackId] =
-            {success:successCallback, fail:failCallback};
-    }
-
-    actionArgs = massageArgsJsToNative(actionArgs);
-
-    if (window.cordovabridge && window.cordovabridge.exec) {
-        window.cordovabridge.exec(callbackId, service, action, actionArgs);
-    } else {
-        alert('window.cordovabridge binding is missing.');
-    }
-}
-
-
-OSXExec.nativeCallback = function(callbackId, status, message, keepCallback) {
-    var success = status === 0 || status === 1;
-    var args = convertMessageToArgsNativeToJs(message);
-    cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
-};
-
-module.exports = OSXExec;
diff --git a/src/legacy-exec/osx/platform.js b/src/legacy-exec/osx/platform.js
deleted file mode 100644
index c74c2be..0000000
--- a/src/legacy-exec/osx/platform.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: "osx",
-    initialize:function() {
-    }
-};
-
diff --git a/src/legacy-exec/osx/plugin/osx/.gitignore b/src/legacy-exec/osx/plugin/osx/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/src/legacy-exec/osx/plugin/osx/.gitignore
+++ /dev/null
diff --git a/src/legacy-exec/ubuntu/exec.js b/src/legacy-exec/ubuntu/exec.js
deleted file mode 100644
index 1c3e04c..0000000
--- a/src/legacy-exec/ubuntu/exec.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var cordova = require('cordova'),
-    utils = require('cordova/utils');
-
-var callbackId = 1;
-cordova.callbacks = [];
-
-cordova.callback = function() {
-    var scId = arguments[0];
-    var callbackRef = null;
-
-    var parameters = [];
-    for (var i = 1; i < arguments.length; i++) {
-        parameters[i-1] = arguments[i];
-    }
-    callbackRef = cordova.callbacks[scId];
-
-    // Even IDs are success-, odd are error-callbacks - make sure we remove both
-    if ((scId % 2) !== 0) {
-        scId = scId - 1;
-    }
-    // Remove both the success as well as the error callback from the stack
-    delete cordova.callbacks[scId];
-    delete cordova.callbacks[scId + 1];
-
-    if (typeof callbackRef == "function") callbackRef.apply(this, parameters);
-};
-
-cordova.callbackWithoutRemove = function() {
-    var scId = arguments[0];
-    var callbackRef = null;
-
-    var parameters = [];
-    for (var i = 1; i < arguments.length; i++) {
-        parameters[i-1] = arguments[i];
-    }
-    callbackRef = cordova.callbacks[scId];
-
-    if (typeof(callbackRef) == "function") callbackRef.apply(this, parameters);
-};
-
-var _initialized = false;
-function ubuntuExec(success, fail, service, action, args) {
-    if (callbackId % 2) {
-        callbackId++;
-    }
-
-    var scId = callbackId++;
-    var ecId = callbackId++;
-    cordova.callbacks[scId] = success;
-    cordova.callbacks[ecId] = fail;
-
-    args.unshift(ecId);
-    args.unshift(scId);
-
-    if (!_initialized) {
-        _initialized = true;
-        window.oxide.addMessageHandler("EXECUTE", function (msg) {
-            eval(msg.args.code);
-        });
-    }
-
-    window.oxide.sendMessage("from-cordova", {messageType: "callPluginFunction", plugin: service, func: action, params: args});
-}
-module.exports = ubuntuExec;
diff --git a/src/legacy-exec/ubuntu/platform.js b/src/legacy-exec/ubuntu/platform.js
deleted file mode 100644
index cf792a2..0000000
--- a/src/legacy-exec/ubuntu/platform.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: "ubuntu",
-    bootstrap: function() {
-        var channel = require("cordova/channel"),
-            cordova = require('cordova'),
-            exec = require('cordova/exec'),
-            modulemapper = require('cordova/modulemapper');
-
-        modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
-        require('cordova/channel').onNativeReady.fire();
-    }
-};
diff --git a/src/legacy-exec/webos/exec.js b/src/legacy-exec/webos/exec.js
deleted file mode 100644
index 2a0e0d8..0000000
--- a/src/legacy-exec/webos/exec.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var execProxy = require('cordova/exec/proxy');
-
-module.exports = function(success, fail, service, action, args) {
-    var proxy = execProxy.get(service,action);
-    if(proxy) {
-        try {
-            proxy(success, fail, args);
-        } catch(e) {
-            console.log("Exception calling exec with command :: " + service + " :: " + action  + " ::exception=" + e);
-        }
-    } else {
-        fail && fail("Missing Command Error");
-    }
-};
diff --git a/src/legacy-exec/webos/platform.js b/src/legacy-exec/webos/platform.js
deleted file mode 100644
index 78c654a..0000000
--- a/src/legacy-exec/webos/platform.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'webos',
-    bootstrap: function() {
-        var channel = require('cordova/channel');
-        var isLegacy = /(?:web|hpw)OS\/(\d+)/.test(navigator.userAgent);
-        var webOSjsLib = (window.webOS!==undefined);
-        if(!webOSjsLib && window.PalmSystem && window.PalmSystem.stageReady && isLegacy) {
-            window.PalmSystem.stageReady();
-        }
-        
-        // create global legacy Mojo object if it does not exist
-        window.Mojo = window.Mojo || {};
-
-        // Check for support for page visibility api
-        if(typeof document.webkitHidden !== "undefined") {
-            document.addEventListener("webkitvisibilitychange", function(e) {
-                if(document.webkitHidden) {
-                    channel.onPause.fire();
-                } else {
-                    channel.onResume.fire();
-                }
-            });
-        } else { //backward compatability with webOS devices that don't support Page Visibility API
-            // LunaSysMgr calls this when the windows is maximized or opened.
-            window.Mojo.stageActivated = function() {
-                channel.onResume.fire();
-            };
-            // LunaSysMgr calls this when the windows is minimized or closed.
-            window.Mojo.stageDeactivated = function() {
-                channel.onPause.fire();
-            };
-        }
-
-        if(isLegacy && !webOSjsLib) {
-            var lp = JSON.parse(PalmSystem.launchParams || "{}") || {};
-            window.cordova.fireDocumentEvent("webOSLaunch", {type:"webOSLaunch", detail:lp});
-            // LunaSysMgr calls this whenever an app is "launched;"
-            window.Mojo.relaunch = function(e) {
-                var lp = JSON.parse(PalmSystem.launchParams || "{}") || {};
-                if(lp['palm-command'] && lp['palm-command'] == 'open-app-menu') {
-                    window.cordova.fireDocumentEvent("menubutton");
-                    return true;
-                } else {
-                    window.cordova.fireDocumentEvent("webOSRelaunch", {type:"webOSRelaunch", detail:lp});
-                }
-            };
-        }
-        document.addEventListener("keydown", function(e) {
-            // back gesture/button varies by version and build
-            if(e.keyCode == 27 || e.keyIdentifier == "U+1200001" ||
-                    e.keyIdentifier == "U+001B" || e.keyIdentifier == "Back") {
-                window.cordova.fireDocumentEvent("backbutton", e);
-            }
-        });
-        // SmartTV webOS uses HTML5 History API, so bind to that
-        // Leave freedom upto developers to enforce History states as they please
-        // rather than enforcing particular states
-        window.addEventListener("popstate", function(e) {
-            window.cordova.fireDocumentEvent("backbutton", e);
-        });
-
-        require('cordova/modulemapper').clobbers('cordova/webos/service', 'navigator.service');
-        channel.onNativeReady.fire();
-    }
-};
diff --git a/src/legacy-exec/webos/webos/service.js b/src/legacy-exec/webos/webos/service.js
deleted file mode 100644
index 315cb4a..0000000
--- a/src/legacy-exec/webos/webos/service.js
+++ /dev/null
@@ -1,118 +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 isLegacy = /(?:web|hpw)OS\/(\d+)/.test(navigator.userAgent);
-
-function LS2Request(uri, params) {
-    this.uri = uri;
-    params = params || {};
-    if(params.method) {
-        if(this.uri.charAt(this.uri.length-1) != "/") {
-            this.uri += "/";
-        }
-        this.uri += params.method;
-    }
-    if(typeof params.onSuccess === 'function') {
-        this.onSuccess = params.onSuccess;
-    }
-    if(typeof params.onFailure === 'function') {
-        this.onFailure = params.onFailure;
-    }
-    if(typeof params.onComplete === 'function') {
-        this.onComplete = params.onComplete;
-    }
-    this.params = (typeof params.parameters === 'object') ? params.parameters : {};
-    this.subscribe = params.subscribe || false;
-    if(this.subscribe) {
-        this.params.subscribe = params.subscribe;
-    }
-    if(this.params.subscribe) {
-        this.subscribe = this.params.subscribe;
-    }
-    this.resubscribe = params.resubscribe || false;
-    this.send();
-}
-
-LS2Request.prototype.send = function() {
-    if(!window.PalmServiceBridge) {
-        console.error("PalmServiceBridge not found.");
-        return;
-    }
-    this.bridge = new PalmServiceBridge();
-    var self = this;
-    this.bridge.onservicecallback = this.callback = function(msg) {
-        var parsedMsg;
-        if(self.cancelled) {
-            return;
-        }
-        try {
-            parsedMsg = JSON.parse(msg);
-        } catch(e) {
-            parsedMsg = {
-                errorCode: -1,
-                errorText: msg
-            };
-        }
-        if((parsedMsg.errorCode || parsedMsg.returnValue===false) && self.onFailure) {
-            self.onFailure(parsedMsg);
-            if(self.resubscribe && self.subscribe) {
-                self.delayID = setTimeout(function() {
-                    self.send();
-                }, LS2Request.resubscribeDelay);
-            }
-        } else if(self.onSuccess) {
-            self.onSuccess(parsedMsg);
-        }
-        if(self.onComplete) {
-            self.onComplete(parsedMsg);
-        }
-        if(!self.subscribe) {
-            self.cancel();
-        }
-    };
-    this.bridge.call(this.uri, JSON.stringify(this.params));
-};
-
-LS2Request.prototype.cancel = function() {
-    this.cancelled = true;
-    if(this.resubscribeJob) {
-        clearTimeout(this.delayID);
-    }
-    if(this.bridge) {
-        this.bridge.cancel();
-        this.bridge = undefined;
-    }
-};
-
-LS2Request.prototype.toString = function() {
-    return "[LS2Request]";
-};
-
-LS2Request.resubscribeDelay = 10000;
-
-module.exports = {
-    request: function (uri, params) {
-        var req = new LS2Request(uri, params);
-        return req;
-    },
-    systemPrefix: ((isLegacy) ? "com.palm." : "com.webos."),
-    protocol: "luna://"
-};
diff --git a/src/legacy-exec/windows/exec.js b/src/legacy-exec/windows/exec.js
deleted file mode 100644
index 18f559a..0000000
--- a/src/legacy-exec/windows/exec.js
+++ /dev/null
@@ -1,111 +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.
- *
-*/
-
-/*jslint sloppy:true, plusplus:true*/
-/*global require, module, console */
-
-var cordova = require('cordova');
-var execProxy = require('cordova/exec/proxy');
-
-/**
- * Execute a cordova command.  It is up to the native side whether this action
- * is synchronous or asynchronous.  The native side can return:
- *      Synchronous: PluginResult object as a JSON string
- *      Asynchronous: Empty string ""
- * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
- * depending upon the result of the action.
- *
- * @param {Function} success    The success callback
- * @param {Function} fail       The fail callback
- * @param {String} service      The name of the service to use
- * @param {String} action       Action to be run in cordova
- * @param {String[]} [args]     Zero or more arguments to pass to the method
- */
-module.exports = function (success, fail, service, action, args) {
-
-    var proxy = execProxy.get(service, action),
-        callbackId,
-        onSuccess,
-        onError;
-
-    args = args || [];
-
-    if (proxy) {
-        callbackId = service + cordova.callbackId++;
-        // console.log("EXEC:" + service + " : " + action);
-        if (typeof success === "function" || typeof fail === "function") {
-            cordova.callbacks[callbackId] = {success: success, fail: fail};
-        }
-        try {
-            // callbackOptions param represents additional optional parameters command could pass back, like keepCallback or
-            // custom callbackId, for example {callbackId: id, keepCallback: true, status: cordova.callbackStatus.JSON_EXCEPTION }
-            // CB-5806 [Windows8] Add keepCallback support to proxy
-            onSuccess = function (result, callbackOptions) {
-                callbackOptions = callbackOptions || {};
-                var callbackStatus;
-                // covering both undefined and null.
-                // strict null comparison was causing callbackStatus to be undefined
-                // and then no callback was called because of the check in cordova.callbackFromNative
-                // see CB-8996 Mobilespec app hang on windows
-                if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
-                    callbackStatus = callbackOptions.status;
-                }
-                else {
-                    callbackStatus = cordova.callbackStatus.OK;
-                }
-                cordova.callbackSuccess(callbackOptions.callbackId || callbackId,
-                    {
-                        status: callbackStatus,
-                        message: result,
-                        keepCallback: callbackOptions.keepCallback || false
-                    });
-            };
-            onError = function (err, callbackOptions) {
-                callbackOptions = callbackOptions || {};
-                var callbackStatus;
-                // covering both undefined and null.
-                // strict null comparison was causing callbackStatus to be undefined
-                // and then no callback was called because of the check in cordova.callbackFromNative
-                // see CB-8996 Mobilespec app hang on windows
-                if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
-                    callbackStatus = callbackOptions.status;
-                }
-                else {
-                    callbackStatus = cordova.callbackStatus.OK;
-                }
-                cordova.callbackError(callbackOptions.callbackId || callbackId,
-                    {
-                        status: callbackStatus,
-                        message: err,
-                        keepCallback: callbackOptions.keepCallback || false
-                    });
-            };
-            proxy(onSuccess, onError, args);
-
-        } catch (e) {
-            console.log("Exception calling native with command :: " + service + " :: " + action  + " ::exception=" + e);
-        }
-    } else {
-        if (typeof fail === "function") {
-            fail("Missing Command Error");
-        }
-    }
-};
diff --git a/src/legacy-exec/windows/platform.js b/src/legacy-exec/windows/platform.js
deleted file mode 100644
index 3d49081..0000000
--- a/src/legacy-exec/windows/platform.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'windows',
-    bootstrap:function() {
-        var cordova = require('cordova'),
-            exec = require('cordova/exec'),
-            channel = cordova.require('cordova/channel'),
-            modulemapper = require('cordova/modulemapper');
-
-        modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
-        channel.onNativeReady.fire();
-
-        var onWinJSReady = function () {
-            var app = WinJS.Application;
-            var checkpointHandler = function checkpointHandler() {
-                cordova.fireDocumentEvent('pause',null,true);
-            };
-
-            var resumingHandler = function resumingHandler() {
-                cordova.fireDocumentEvent('resume',null,true);
-            };
-
-            app.addEventListener("checkpoint", checkpointHandler);
-            Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false);
-            app.start();
-        };
-
-        if (!window.WinJS) {
-            var scriptElem = document.createElement("script");
-
-            if (navigator.appVersion.indexOf('MSAppHost/3.0') !== -1) {
-                // Windows 10 UWP
-                scriptElem.src = '/WinJS/js/base.js';
-            } else if (navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1) {
-                // windows phone 8.1 + Mobile IE 11
-                scriptElem.src = "//Microsoft.Phone.WinJS.2.1/js/base.js";
-            } else if (navigator.appVersion.indexOf("MSAppHost/2.0;") !== -1) {
-                // windows 8.1 + IE 11
-                scriptElem.src = "//Microsoft.WinJS.2.0/js/base.js";
-            }
-            scriptElem.addEventListener("load", onWinJSReady);
-            document.head.appendChild(scriptElem);
-        }
-        else {
-            onWinJSReady();
-        }
-    }
-};
diff --git a/src/legacy-exec/wp8/exec.js b/src/legacy-exec/wp8/exec.js
deleted file mode 100644
index 25fcf5c..0000000
--- a/src/legacy-exec/wp8/exec.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var cordova = require('cordova'),
-    base64 = require('cordova/base64');
-
-/**
- * Execute a cordova command.  It is up to the native side whether this action
- * is synchronous or asynchronous.  The native side can return:
- *      Synchronous: PluginResult object as a JSON string
- *      Asynchronous: Empty string ""
- * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
- * depending upon the result of the action.
- *
- * @param {Function} success    The success callback
- * @param {Function} fail       The fail callback
- * @param {String} service      The name of the service to use
- * @param {String} action       Action to be run in cordova
- * @param {String[]} [args]     Zero or more arguments to pass to the method
-
- */
-
-module.exports = function(success, fail, service, action, args) {
-
-    var callbackId = service + cordova.callbackId++;
-    if (typeof success == "function" || typeof fail == "function") {
-        cordova.callbacks[callbackId] = {success:success, fail:fail};
-    }
-    args = args || [];
-    // generate a new command string, ex. DebugConsole/log/DebugConsole23/["wtf dude?"]
-    for(var n = 0; n < args.length; n++)
-    {
-        // special case for ArrayBuffer which could not be stringified out of the box
-        if(typeof ArrayBuffer !== "undefined" && args[n] instanceof ArrayBuffer)
-        {
-            args[n] = base64.fromArrayBuffer(args[n]);
-        }
-
-        if(typeof args[n] !== "string")
-        {
-            args[n] = JSON.stringify(args[n]);
-        }
-    }
-    var command = service + "/" + action + "/" + callbackId + "/" + JSON.stringify(args);
-    // pass it on to Notify
-    try {
-        if(window.external) {
-            window.external.Notify(command);
-        }
-        else {
-            console.log("window.external not available :: command=" + command);
-        }
-    }
-    catch(e) {
-        console.log("Exception calling native with command :: " + command + " :: exception=" + e);
-    }
-};
-
diff --git a/src/legacy-exec/wp8/platform.js b/src/legacy-exec/wp8/platform.js
deleted file mode 100644
index 237d4f5..0000000
--- a/src/legacy-exec/wp8/platform.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'windowsphone',
-    bootstrap: function() {
-        var cordova = require('cordova'),
-               exec = require('cordova/exec');
-
-        // Inject a listener for the backbutton, and tell native to override the flag (true/false) when we have 1 or more, or 0, listeners
-        var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
-        backButtonChannel.onHasSubscribersChange = function() {
-            exec(null, null, "CoreEvents", "overridebackbutton", [this.numHandlers == 1]);
-        };
-    }
-};
diff --git a/tasks/lib/bundle-browserify.js b/tasks/lib/bundle-browserify.js
index 3a1c3f9..8eaecb8 100644
--- a/tasks/lib/bundle-browserify.js
+++ b/tasks/lib/bundle-browserify.js
@@ -25,9 +25,16 @@
 var copyProps    = require('./copy-props');
 
 module.exports = function bundle(platform, debug, commitId, platformVersion, platformPath) {
-    platformPath = fs.existsSync(platformPath) && fs.existsSync(path.join(platformPath, 'cordova-js-src')) ?
-        path.join(platformPath, 'cordova-js-src') :
-        path.resolve(root, 'src', 'legacy-exec', platform);
+
+    if (fs.existsSync(platformPath) && fs.existsSync(path.join(platformPath, 'cordova-js-src'))) {
+        platformPath = path.join(platformPath, 'cordova-js-src');   
+    } else {
+        if(platform === 'test') {
+            platformPath = path.resolve(root, 'src', 'legacy-exec', platform);
+        } else {
+            console.log('Your version of '  + platform + ' does not contain cordova-js-src. Update to a newer version of ' + platform + '.');
+        }
+    }    
 
     var platformDirname = platform === 'amazon-fireos' ? 'android' : platform;
 
@@ -45,16 +52,18 @@
 
     // test doesn't support custom paths
     if (platform === 'test') {
-        var testFilesPath;
         var androidPath = path.resolve(pkgJson['cordova-platforms']['cordova-android']);
         var iosPath = path.resolve(pkgJson['cordova-platforms']['cordova-ios']);
+        var testFilesPath = path.resolve(androidPath, 'cordova-js-src', 'android');
         // Add android platform-specific modules that have tests to the test bundle.
         if(fs.existsSync(androidPath)) {
-            testFilesPath = path.resolve(androidPath, 'cordova-js-src', 'android');
+            
             modules['cordova/android/exec'] = path.resolve(androidPath, 'cordova-js-src', 'exec.js');
         } else {
-            testFilesPath = path.resolve('src', 'legacy-exec', 'android', 'android');
-            modules['cordova/android/exec'] = path.resolve(root, 'src', 'legacy-exec', 'android', 'exec.js');
+            //testFilesPath = path.resolve('src', 'legacy-exec', 'android', 'android');
+            //modules['cordova/android/exec'] = path.resolve(root, 'src', 'legacy-exec', 'android', 'exec.js');
+            console.log('Couldn\'t add android test files.');
+            throw 'Stopped process';
         }
         copyProps(modules, collectFiles(testFilesPath, 'cordova/android'));
 
@@ -62,7 +71,9 @@
         if(fs.existsSync(iosPath)) {
             modules['cordova/ios/exec'] = path.join(iosPath, 'cordova-js-src', 'exec.js');
         } else {
-            modules['cordova/ios/exec'] = path.resolve(root, 'src', 'legacy-exec', 'ios', 'exec.js');
+            //modules['cordova/ios/exec'] = path.resolve(root, 'src', 'legacy-exec', 'ios', 'exec.js');
+            console.log('Couldn\'t add iOS test files.');
+            throw 'Stopped process';
         }
         copyProps(modules, collectFiles(testFilesPath, 'cordova/ios'));
     }
diff --git a/tasks/lib/bundle.js b/tasks/lib/bundle.js
index 0446e72..32653c9 100644
--- a/tasks/lib/bundle.js
+++ b/tasks/lib/bundle.js
@@ -30,27 +30,34 @@
     var scripts = collectFiles(path.join('src', 'scripts'));
     var platformDep;
     modules[''] = path.join('src', 'cordova.js');
-
+   
     //check to see if platform has cordova-js-src directory
     if(fs.existsSync(platformPath) && fs.existsSync(path.join(platformPath, 'cordova-js-src'))) {
+        console.log(platformPath);
         copyProps(modules, collectFiles(path.join(platformPath, 'cordova-js-src')));
     } else {
         // for platforms that don't have a release with cordova-js-src yet
         // or if platform === test
-        copyProps(modules, collectFiles(path.join('src', 'legacy-exec', platform)));
+        if(platform === 'test') {
+            copyProps(modules, collectFiles(path.join('src', 'legacy-exec', platform)));
+        } else {
+            console.log('Your version of '  + platform + ' does not contain cordova-js-src. Update to a newer version of ' + platform + '.');
+            throw 'Stopped process';
+        }
     }
     //test doesn't support custom paths
     if (platform === 'test') {
-        var testFilesPath;
         var androidPath = path.resolve(pkgJson['cordova-platforms']['cordova-android']);
         var iosPath = path.resolve(pkgJson['cordova-platforms']['cordova-ios']);
+        var testFilesPath = path.resolve(androidPath, 'cordova-js-src', 'android');
         // Add android platform-specific modules that have tests to the test bundle.
         if(fs.existsSync(androidPath)) {
-            testFilesPath = path.resolve(androidPath, 'cordova-js-src', 'android');
             modules['android/exec'] = path.resolve(androidPath, 'cordova-js-src', 'exec.js');
         } else {
-            testFilesPath = path.resolve('src', 'legacy-exec', 'android', 'android');
-            modules['android/exec'] = path.resolve('src', 'legacy-exec', 'android', 'exec.js');
+            // testFilesPath = path.resolve('src', 'legacy-exec', 'android', 'android');
+            // modules['android/exec'] = path.resolve('src', 'legacy-exec', 'android', 'exec.js');
+            console.log('Couldn\'t add android test files.');
+            throw 'Stopped process';
         }
         copyProps(modules, collectFiles(testFilesPath, 'android'));
 
@@ -58,7 +65,9 @@
         if(fs.existsSync(iosPath)) {
             modules['ios/exec'] = path.join(iosPath, 'cordova-js-src', 'exec.js');
         } else {
-            modules['ios/exec'] = path.join('src', 'legacy-exec', 'ios', 'exec.js');
+            //modules['ios/exec'] = path.join('src', 'legacy-exec', 'ios', 'exec.js');
+            console.log('Couldn\'t add iOS test files.');
+            throw 'Stopped process';
         }
     }
 
@@ -75,38 +84,38 @@
 
     // write initial scripts
     if (!scripts['require']) {
-        throw new Error("didn't find a script for 'require'")
+        throw new Error("didn't find a script for 'require'");
     }
 
-    writeScript(output, scripts['require'], debug)
+    writeScript(output, scripts['require'], debug);
 
     // write modules
-    var moduleIds = Object.keys(modules)
-    moduleIds.sort()
+    var moduleIds = Object.keys(modules);
+    moduleIds.sort();
 
     for (var i=0; i<moduleIds.length; i++) {
-        var moduleId = moduleIds[i]
+        var moduleId = moduleIds[i];
 
-        writeModule(output, modules[moduleId], moduleId, debug)
+        writeModule(output, modules[moduleId], moduleId, debug);
     }
 
-    output.push("window.cordova = require('cordova');")
+    output.push("window.cordova = require('cordova');");
 
     // write final scripts
     if (!scripts['bootstrap']) {
-        throw new Error("didn't find a script for 'bootstrap'")
+        throw new Error("didn't find a script for 'bootstrap'");
     }
 
-    writeScript(output, scripts['bootstrap'], debug)
+    writeScript(output, scripts['bootstrap'], debug);
 
-    var bootstrapPlatform = 'bootstrap-' + platform
+    var bootstrapPlatform = 'bootstrap-' + platform;
     if (scripts[bootstrapPlatform]) {
-        writeScript(output, scripts[bootstrapPlatform], debug)
+        writeScript(output, scripts[bootstrapPlatform], debug);
     }
 
     // write trailer
-    output.push('})();')
+    output.push('})();');
 
-    return output.join('\n')
-}
+    return output.join('\n');
+};