cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From za...@apache.org
Subject [28/52] [abbrv] [partial] cordova-firefoxos git commit: CB-4548 Install new node-firefox-* dependencies in node_modules
Date Wed, 01 Apr 2015 14:22:55 GMT
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tcpusb/socket.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tcpusb/socket.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tcpusb/socket.js
new file mode 100644
index 0000000..67fa54f
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tcpusb/socket.js
@@ -0,0 +1,391 @@
+(function() {
+  var Auth, EventEmitter, Forge, Parser, Promise, Protocol, RollingCounter, ServiceMap, Socket, crypto, debug,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  crypto = require('crypto');
+
+  EventEmitter = require('events').EventEmitter;
+
+  Promise = require('bluebird');
+
+  Forge = require('node-forge');
+
+  debug = require('debug')('adb:tcpusb:socket');
+
+  Parser = require('../parser');
+
+  Protocol = require('../protocol');
+
+  Auth = require('../auth');
+
+  ServiceMap = require('./servicemap');
+
+  RollingCounter = require('./rollingcounter');
+
+  Socket = (function(_super) {
+    var AUTH_RSAPUBLICKEY, AUTH_SIGNATURE, AUTH_TOKEN, A_AUTH, A_CLSE, A_CNXN, A_OKAY, A_OPEN, A_SYNC, A_WRTE, TOKEN_LENGTH, UINT32_MAX;
+
+    __extends(Socket, _super);
+
+    A_SYNC = 0x434e5953;
+
+    A_CNXN = 0x4e584e43;
+
+    A_OPEN = 0x4e45504f;
+
+    A_OKAY = 0x59414b4f;
+
+    A_CLSE = 0x45534c43;
+
+    A_WRTE = 0x45545257;
+
+    A_AUTH = 0x48545541;
+
+    UINT32_MAX = 0xFFFFFFFF;
+
+    AUTH_TOKEN = 1;
+
+    AUTH_SIGNATURE = 2;
+
+    AUTH_RSAPUBLICKEY = 3;
+
+    TOKEN_LENGTH = 20;
+
+    function Socket(client, serial, socket, options) {
+      var _base;
+      this.client = client;
+      this.serial = serial;
+      this.socket = socket;
+      this.options = options != null ? options : {};
+      (_base = this.options).auth || (_base.auth = Promise.resolve(true));
+      this.ended = false;
+      this.parser = new Parser(this.socket);
+      this.version = 1;
+      this.maxPayload = 4096;
+      this.authorized = false;
+      this.syncToken = new RollingCounter(UINT32_MAX);
+      this.remoteId = new RollingCounter(UINT32_MAX);
+      this.services = new ServiceMap;
+      this.remoteAddress = this.socket.remoteAddress;
+      this.token = null;
+      this.signature = null;
+      this._inputLoop();
+    }
+
+    Socket.prototype.end = function() {
+      if (!this.ended) {
+        this.socket.end();
+        this.services.end();
+        this.emit('end');
+        this.ended = true;
+      }
+      return this;
+    };
+
+    Socket.prototype._inputLoop = function() {
+      return this._readMessage().then((function(_this) {
+        return function(message) {
+          return _this._route(message);
+        };
+      })(this)).then((function(_this) {
+        return function() {
+          return setImmediate(_this._inputLoop.bind(_this));
+        };
+      })(this))["catch"](Parser.PrematureEOFError, (function(_this) {
+        return function() {
+          return _this.end();
+        };
+      })(this))["catch"]((function(_this) {
+        return function(err) {
+          debug("Error: " + err.message);
+          _this.emit('error', err);
+          return _this.end();
+        };
+      })(this));
+    };
+
+    Socket.prototype._readMessage = function() {
+      return this.parser.readBytes(24).then(function(header) {
+        return {
+          command: header.readUInt32LE(0),
+          arg0: header.readUInt32LE(4),
+          arg1: header.readUInt32LE(8),
+          length: header.readUInt32LE(12),
+          check: header.readUInt32LE(16),
+          magic: header.readUInt32LE(20)
+        };
+      }).then((function(_this) {
+        return function(message) {
+          return _this.parser.readBytes(message.length).then(function(data) {
+            message.data = data;
+            return message;
+          });
+        };
+      })(this)).then((function(_this) {
+        return function(message) {
+          return _this._validateMessage(message);
+        };
+      })(this));
+    };
+
+    Socket.prototype._route = function(message) {
+      if (this.ended) {
+        return;
+      }
+      this.emit('userActivity', message);
+      switch (message.command) {
+        case A_SYNC:
+          return this._handleSyncMessage(message);
+        case A_CNXN:
+          return this._handleConnectionMessage(message);
+        case A_OPEN:
+          return this._handleOpenMessage(message);
+        case A_OKAY:
+          return this._handleOkayMessage(message);
+        case A_CLSE:
+          return this._handleCloseMessage(message);
+        case A_WRTE:
+          return this._handleWriteMessage(message);
+        case A_AUTH:
+          return this._handleAuthMessage(message);
+        default:
+          return this.emit('error', new Error("Unknown command " + message.command));
+      }
+    };
+
+    Socket.prototype._handleSyncMessage = function(message) {
+      return this._writeHeader(A_SYNC, 1, this.syncToken.next(), 0);
+    };
+
+    Socket.prototype._handleConnectionMessage = function(message) {
+      debug('A_CNXN', message);
+      return this._createToken().then((function(_this) {
+        return function(token) {
+          _this.token = token;
+          return _this._writeMessage(A_AUTH, AUTH_TOKEN, 0, _this.token);
+        };
+      })(this));
+    };
+
+    Socket.prototype._handleAuthMessage = function(message) {
+      debug('A_AUTH', message);
+      switch (message.arg0) {
+        case AUTH_SIGNATURE:
+          if (!this.signature) {
+            this.signature = message.data;
+          }
+          return this._writeMessage(A_AUTH, AUTH_TOKEN, 0, this.token);
+        case AUTH_RSAPUBLICKEY:
+          return Auth.parsePublicKey(message.data.slice(0, -1)).then((function(_this) {
+            return function(key) {
+              var digest, sig;
+              digest = _this.token.toString('binary');
+              sig = _this.signature.toString('binary');
+              if (key.verify(digest, sig)) {
+                return _this.options.auth(key).then(function() {
+                  return _this._deviceId().then(function(id) {
+                    _this.authorized = true;
+                    return _this._writeMessage(A_CNXN, _this.version, _this.maxPayload, "device::" + id);
+                  });
+                })["catch"](function(err) {
+                  return _this.end();
+                });
+              } else {
+                return _this.end();
+              }
+            };
+          })(this));
+        default:
+          return this.end();
+      }
+    };
+
+    Socket.prototype._handleOpenMessage = function(message) {
+      var command, localId, remoteId, service;
+      if (!this.authorized) {
+        return;
+      }
+      debug('A_OPEN', message);
+      localId = message.arg0;
+      remoteId = this.remoteId.next();
+      service = message.data.slice(0, -1);
+      command = service.toString().split(':', 1)[0];
+      return this.client.transport(this.serial).then((function(_this) {
+        return function(transport) {
+          var parser, pump;
+          if (_this.ended) {
+            return;
+          }
+          debug("Calling " + service);
+          _this.services.put(remoteId, transport);
+          transport.write(Protocol.encodeData(service));
+          parser = transport.parser;
+          pump = function() {
+            return new Promise(function(resolve, reject) {
+              var maybeRead, out;
+              out = parser.raw();
+              maybeRead = function() {
+                var chunk, _results;
+                _results = [];
+                while (chunk = _this._readChunk(out)) {
+                  _results.push(_this._writeMessage(A_WRTE, remoteId, localId, chunk));
+                }
+                return _results;
+              };
+              out.on('readable', maybeRead);
+              return out.on('end', resolve);
+            });
+          };
+          parser.readAscii(4).then(function(reply) {
+            switch (reply) {
+              case Protocol.OKAY:
+                _this._writeHeader(A_OKAY, remoteId, localId);
+                return pump();
+              case Protocol.FAIL:
+                return parser.readError();
+              default:
+                return parser.unexpected(reply, 'OKAY or FAIL');
+            }
+          })["catch"](Parser.PrematureEOFError, function() {
+            return true;
+          })["finally"](function() {
+            return _this._close(remoteId, localId);
+          })["catch"](Parser.FailError, function(err) {
+            debug("Unable to open transport: " + err);
+            return _this.end();
+          });
+        };
+      })(this));
+    };
+
+    Socket.prototype._handleOkayMessage = function(message) {
+      var localId, remoteId;
+      if (!this.authorized) {
+        return;
+      }
+      debug('A_OKAY', message);
+      localId = message.arg0;
+      return remoteId = message.arg1;
+    };
+
+    Socket.prototype._handleCloseMessage = function(message) {
+      var localId, remoteId;
+      if (!this.authorized) {
+        return;
+      }
+      debug('A_CLSE', message);
+      localId = message.arg0;
+      remoteId = message.arg1;
+      return this._close(remoteId, localId);
+    };
+
+    Socket.prototype._handleWriteMessage = function(message) {
+      var localId, remote, remoteId;
+      if (!this.authorized) {
+        return;
+      }
+      debug('A_WRTE', message);
+      localId = message.arg0;
+      remoteId = message.arg1;
+      if (remote = this.services.get(remoteId)) {
+        remote.write(message.data);
+        this._writeHeader(A_OKAY, remoteId, localId);
+      } else {
+        debug("A_WRTE to unknown socket pair " + localId + "/" + remoteId);
+      }
+      return true;
+    };
+
+    Socket.prototype._close = function(remoteId, localId) {
+      var remote;
+      if (remote = this.services.remove(remoteId)) {
+        remote.end();
+        return this._writeHeader(A_CLSE, remoteId, localId);
+      }
+    };
+
+    Socket.prototype._writeHeader = function(command, arg0, arg1, length, checksum) {
+      var header;
+      if (this.ended) {
+        return;
+      }
+      header = new Buffer(24);
+      header.writeUInt32LE(command, 0);
+      header.writeUInt32LE(arg0 || 0, 4);
+      header.writeUInt32LE(arg1 || 0, 8);
+      header.writeUInt32LE(length || 0, 12);
+      header.writeUInt32LE(checksum || 0, 16);
+      header.writeUInt32LE(this._magic(command), 20);
+      return this.socket.write(header);
+    };
+
+    Socket.prototype._writeMessage = function(command, arg0, arg1, data) {
+      if (this.ended) {
+        return;
+      }
+      if (!Buffer.isBuffer(data)) {
+        data = new Buffer(data);
+      }
+      this._writeHeader(command, arg0, arg1, data.length, this._checksum(data));
+      return this.socket.write(data);
+    };
+
+    Socket.prototype._validateMessage = function(message) {
+      if (message.magic !== this._magic(message.command)) {
+        throw new Error("Command failed magic check");
+      }
+      if (message.check !== this._checksum(message.data)) {
+        throw new Error("Message checksum doesn't match received message");
+      }
+      return message;
+    };
+
+    Socket.prototype._readChunk = function(stream) {
+      return stream.read(this.maxPayload) || stream.read();
+    };
+
+    Socket.prototype._checksum = function(data) {
+      var char, sum, _i, _len;
+      if (!Buffer.isBuffer(data)) {
+        throw new Error("Unable to calculate checksum of non-Buffer");
+      }
+      sum = 0;
+      for (_i = 0, _len = data.length; _i < _len; _i++) {
+        char = data[_i];
+        sum += char;
+      }
+      return sum;
+    };
+
+    Socket.prototype._magic = function(command) {
+      return (command ^ 0xffffffff) >>> 0;
+    };
+
+    Socket.prototype._createToken = function() {
+      return Promise.promisify(crypto.randomBytes)(TOKEN_LENGTH);
+    };
+
+    Socket.prototype._deviceId = function() {
+      return this.client.getProperties(this.serial).then(function(properties) {
+        var prop;
+        return ((function() {
+          var _i, _len, _ref, _results;
+          _ref = ['ro.product.name', 'ro.product.model', 'ro.product.device'];
+          _results = [];
+          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+            prop = _ref[_i];
+            _results.push("" + prop + "=" + properties[prop] + ";");
+          }
+          return _results;
+        })()).join('');
+      });
+    };
+
+    return Socket;
+
+  })(EventEmitter);
+
+  module.exports = Socket;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tracker.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tracker.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tracker.js
new file mode 100644
index 0000000..ca96230
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/tracker.js
@@ -0,0 +1,92 @@
+(function() {
+  var EventEmitter, Parser, Promise, Tracker,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  EventEmitter = require('events').EventEmitter;
+
+  Promise = require('bluebird');
+
+  Parser = require('./parser');
+
+  Tracker = (function(_super) {
+    __extends(Tracker, _super);
+
+    function Tracker(command) {
+      this.command = command;
+      this.deviceList = [];
+      this.deviceMap = {};
+      this.reader = this.read()["catch"](Parser.PrematureEOFError, (function(_this) {
+        return function(err) {
+          return _this.emit('end');
+        };
+      })(this))["catch"](Promise.CancellationError, (function(_this) {
+        return function(err) {
+          _this.command.connection.end();
+          return _this.emit('end');
+        };
+      })(this))["catch"]((function(_this) {
+        return function(err) {
+          _this.emit('error', err);
+          return _this.emit('end');
+        };
+      })(this));
+    }
+
+    Tracker.prototype.read = function() {
+      return this.command._readDevices().cancellable().then((function(_this) {
+        return function(list) {
+          _this.update(list);
+          return _this.read();
+        };
+      })(this));
+    };
+
+    Tracker.prototype.update = function(newList) {
+      var changeSet, device, newMap, oldDevice, _i, _j, _len, _len1, _ref;
+      changeSet = {
+        removed: [],
+        changed: [],
+        added: []
+      };
+      newMap = {};
+      for (_i = 0, _len = newList.length; _i < _len; _i++) {
+        device = newList[_i];
+        oldDevice = this.deviceMap[device.id];
+        if (oldDevice) {
+          if (oldDevice.type !== device.type) {
+            changeSet.changed.push(device);
+            this.emit('change', device, oldDevice);
+          }
+        } else {
+          changeSet.added.push(device);
+          this.emit('add', device);
+        }
+        newMap[device.id] = device;
+      }
+      _ref = this.deviceList;
+      for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
+        device = _ref[_j];
+        if (!newMap[device.id]) {
+          changeSet.removed.push(device);
+          this.emit('remove', device);
+        }
+      }
+      this.emit('changeSet', changeSet);
+      this.deviceList = newList;
+      this.deviceMap = newMap;
+      return this;
+    };
+
+    Tracker.prototype.end = function() {
+      this.reader.cancel();
+      return this;
+    };
+
+    return Tracker;
+
+  })(EventEmitter);
+
+  module.exports = Tracker;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/util.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/util.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/util.js
new file mode 100644
index 0000000..8207028
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/adb/util.js
@@ -0,0 +1,16 @@
+(function() {
+  var Auth, Parser;
+
+  Parser = require('./parser');
+
+  Auth = require('./auth');
+
+  module.exports.readAll = function(stream, callback) {
+    return new Parser(stream).readAll(stream).nodeify(callback);
+  };
+
+  module.exports.parsePublicKey = function(keyString, callback) {
+    return Auth.parsePublicKey(keyString).nodeify(callback);
+  };
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/cli.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/cli.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/cli.js
new file mode 100644
index 0000000..11dc9cf
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/lib/cli.js
@@ -0,0 +1,42 @@
+(function() {
+  var Auth, Promise, forge, fs, pkg, program;
+
+  fs = require('fs');
+
+  program = require('commander');
+
+  Promise = require('bluebird');
+
+  forge = require('node-forge');
+
+  pkg = require('../package');
+
+  Auth = require('./adb/auth');
+
+  Promise.longStackTraces();
+
+  program.version(pkg.version);
+
+  program.command('pubkey-convert <file>').option('-f, --format <format>', 'format (pem or openssh)', String, 'pem').description('Converts an ADB-generated public key into PEM format.').action(function(file, options) {
+    return Auth.parsePublicKey(fs.readFileSync(file)).then(function(key) {
+      switch (options.format.toLowerCase()) {
+        case 'pem':
+          return console.log(forge.pki.publicKeyToPem(key).trim());
+        case 'openssh':
+          return console.log(forge.ssh.publicKeyToOpenSSH(key, 'adbkey').trim());
+        default:
+          console.error("Unsupported format '" + options.format + "'");
+          return process.exit(1);
+      }
+    });
+  });
+
+  program.command('pubkey-fingerprint <file>').description('Outputs the fingerprint of an ADB-generated public key.').action(function(file) {
+    return Auth.parsePublicKey(fs.readFileSync(file)).then(function(key) {
+      return console.log('%s %s', key.fingerprint, key.comment);
+    });
+  });
+
+  program.parse(process.argv);
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/LICENSE b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/LICENSE
new file mode 100644
index 0000000..2ffff3d
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/LICENSE
@@ -0,0 +1,13 @@
+Copyright © CyberAgent, Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/README.md
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/README.md b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/README.md
new file mode 100644
index 0000000..df54e35
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/README.md
@@ -0,0 +1,240 @@
+# adbkit-logcat
+
+**adbkit-logcat** provides a [Node.js][nodejs] interface for working with output produced by the Android [`logcat` tool][logcat-site]. It takes a log stream (that you must create separately), parses it, and emits log entries in real-time as they occur. Possible use cases include storing logs in a database, forwarding logs via [MessagePack][msgpack], or just advanced filtering.
+
+## Getting started
+
+Install via NPM:
+
+```bash
+npm install --save adbkit-logcat
+```
+
+Note that while adbkit-logcat is written in CoffeeScript, it is compiled to JavaScript before publishing to NPM, which means that you are not required to use CoffeeScript.
+
+### Examples
+
+#### Output all log messages
+
+##### JavaScript
+
+```javascript
+var logcat = require('adbkit-logcat');
+var spawn = require('child_process').spawn;
+
+// Retrieve a binary log stream
+var proc = spawn('adb', ['logcat', '-B']);
+
+// Connect logcat to the stream
+reader = logcat.readStream(proc.stdout);
+reader.on('entry', function(entry) {
+  console.log(entry.message);
+});
+
+// Make sure we don't leave anything hanging
+process.on('exit', function() {
+  proc.kill();
+});
+```
+
+##### CoffeeScript
+
+```coffeescript
+Logcat = require 'adbkit-logcat'
+{spawn} = require 'child_process'
+
+# Retrieve a binary log stream
+proc = spawn 'adb', ['logcat', '-B']
+
+# Connect logcat to the stream
+reader = Logcat.readStream proc.stdout
+reader.on 'entry', (entry) ->
+  console.log entry.message
+
+# Make sure we don't leave anything hanging
+process.on 'exit', ->
+  proc.kill()
+```
+
+## API
+
+### Logcat
+
+#### logcat.Priority
+
+Exposes `Priority`. See below for details.
+
+#### logcat.Reader
+
+Exposes `Reader`. See below for details.
+
+#### logcat.readStream(stream[, options])
+
+Creates a logcat reader instance from the provided logcat event [`Stream`][node-stream]. Note that you must create the stream separately.
+
+* **stream** The event stream to read.
+* **options** Optional. The following options are supported:
+    - **format** The format of the stream. Currently, the only supported value is `'binary'`, which (for example) `adb logcat -B` produces. Defaults to `'binary'`.
+    - **fixLineFeeds** All programs run via the ADB shell transform any `'\n'` in the output to `'\r\n'`, which breaks binary content. If set, this option reverses the transformation before parsing the stream. Defaults to `true`.
+* Returns: The `Reader` instance.
+
+### Priority
+
+#### Constants
+
+The following static properties are available:
+
+* **Priority.UNKNOWN** i.e. `0`.
+* **Priority.DEFAULT** i.e. `1`. Not available when reading a stream.
+* **Priority.VERBOSE** i.e. `2`.
+* **Priority.DEBUG** i.e. `3`.
+* **Priority.INFO** i.e. `4`.
+* **Priority.WARN** i.e. `5`.
+* **Priority.ERROR** i.e. `6`.
+* **Priority.FATAL** i.e. `7`.
+* **Priority.SILENT** i.e. `8`. Not available when reading a stream.
+
+#### Priority.fromLetter(letter)
+
+Static method to convert the given `letter` into a numeric priority. For example, `Priority.fromName('d')` would return `Priority.DEBUG`.
+
+* **letter** The priority as a `String`. Any single, case-insensitive character matching the first character of any `Priority` constant is accepted.
+* Returns: The priority as a `Number`, or `undefined`.
+
+#### Priority.fromName(name)
+
+Static method to convert the given `name` into a numeric priority. For example, `Priority.fromName('debug')` (or `Priority.fromName('d')`) would return `Priority.DEBUG`.
+
+* **name** The priority as a `String`. Any full, case-insensitive match of the `Priority` constants is accepted. If no match is found, falls back to `Priority.fromLetter()`.
+* Returns: The priority as a `Number`, or `undefined`.
+
+#### Priority.toLetter(priority)
+
+Static method to convert the numeric priority into its letter representation. For example, `Priority.toLetter(Priority.DEBUG)` would return `'D'`.
+
+* **priority** The priority as a `Number`. Any `Priority` constant value is accepted.
+* Returns: The priority as a `String` letter, or `undefined`.
+
+#### Priority.toName(priority)
+
+Static method to convert the numeric priority into its full string representation. For example, `Priority.toLetter(Priority.DEBUG)` would return `'DEBUG'`.
+
+* **priority** The priority as a `Number`. Any `Priority` constant value is accepted.
+* Returns: The priority as a `String`, or `undefined`.
+
+### Reader
+
+A reader instance, which is an [`EventEmitter`][node-events].
+
+#### Events
+
+The following events are available:
+
+* **error** **(err)** Emitted when an error occurs.
+    * **err** An `Error`.
+* **end** Emitted when the stream ends.
+* **finish** Emitted when the stream finishes.
+* **entry** **(entry)** Emitted when the stream finishes.
+    * **entry** A log `Entry`. See below for details.
+
+#### constructor([options])
+
+For advanced users. Manually constructs a `Reader` instance. Useful for testing and/or playing around. Normally you would use `logcat.readStream()` to create the instance.
+
+* **options** See `logcat.readStream()` for details.
+* Returns: N/A
+
+#### reader.connect(stream)
+
+For advanced users. When instantiated manually (not via `logcat.readStream()`), connects the `Reader` instance to the given stream.
+
+* **stream** See `logcat.readStream()` for details.
+* Returns: The `Reader` instance.
+
+#### reader.end()
+
+Convenience method for ending the stream.
+
+* Returns: The `Reader` instance.
+
+#### reader.exclude(tag)
+
+Skip entries with the provided tag. Alias for `reader.include(tag, Priority.SILENT)`. Note that even skipped events have to be parsed so that they can be ignored.
+
+* **tag** The tag string to exclude. If `'*'`, works the same as `reader.excludeAll()`.
+* Returns: The `Reader` instance.
+
+#### reader.excludeAll()
+
+Skip **ALL** entries. Alias for `reader.includeAll(Priority.SILENT)`. Any entries you wish to see must be included via `include()`/`includeAll()`.
+
+* Returns: The `Reader` instance.
+
+#### reader.include(tag[, priority])
+
+Include all entries with the given tag and a priority higher or equal to the given `priority`.
+
+* **tag** The tag string to include. If `'*'`, works the same as `reader.includeAll(priority)`.
+* **priority** Optional. A lower bound for the priority. Any numeric `Priority` constant or any `String` value accepted by `Priority.fromName()` is accepted. Defaults to `Priority.DEBUG`.
+* Returns: The `Reader` instance.
+
+#### reader.includeAll([priority])
+
+Include all entries with a priority higher or equal to the given `priority`.
+
+* **tag** The tag string to exclude.
+* **priority** Optional. See `reader.include()` for details.
+* Returns: The `Reader` instance.
+
+#### reader.resetFilters()
+
+Resets all inclusions/exclusions.
+
+* Returns: The `Reader` instance.
+
+### Entry
+
+A log entry.
+
+#### Properties
+
+The following properties are available:
+
+* **date** Event time as a `Date`.
+* **pid** Process ID as a `Number`.
+* **tid** Thread ID as a `Number`.
+* **priority** Event priority as a `Number`. You can use `logcat.Priority` to convert the value into a `String`.
+* **tag** Event tag as a `String`.
+* **message** Message as a `String`.
+
+#### entry.toBinary()
+
+Converts the entry back to the binary log format.
+
+* Returns: The binary event as a [`Buffer`][node-buffer].
+
+## More information
+
+* Liblog
+    - [logprint.c][logprint-source]
+* Logcat
+    - [logcat.cpp][logcat-source]
+
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md).
+
+## License
+
+See [LICENSE](LICENSE).
+
+Copyright © CyberAgent, Inc. All Rights Reserved.
+
+[nodejs]: <http://nodejs.org/>
+[msgpack]: <http://msgpack.org/>
+[logcat-site]: <http://developer.android.com/tools/help/logcat.html>
+[logprint-source]: <https://github.com/android/platform_system_core/blob/master/liblog/logprint.c>
+[logcat-source]: <https://github.com/android/platform_system_core/blob/master/logcat/logcat.cpp>
+[node-stream]: <http://nodejs.org/api/stream.html>
+[node-events]: <http://nodejs.org/api/events.html>
+[node-buffer]: <http://nodejs.org/api/buffer.html>

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/index.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/index.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/index.js
new file mode 100644
index 0000000..607433c
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/index.js
@@ -0,0 +1,15 @@
+(function() {
+  var Path;
+
+  Path = require('path');
+
+  module.exports = (function() {
+    switch (Path.extname(__filename)) {
+      case '.coffee':
+        return require('./src/logcat');
+      default:
+        return require('./lib/logcat');
+    }
+  })();
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat.js
new file mode 100644
index 0000000..d224f07
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat.js
@@ -0,0 +1,25 @@
+(function() {
+  var Logcat, Priority, Reader;
+
+  Reader = require('./logcat/reader');
+
+  Priority = require('./logcat/priority');
+
+  Logcat = (function() {
+    function Logcat() {}
+
+    Logcat.readStream = function(stream, options) {
+      return new Reader(options).connect(stream);
+    };
+
+    return Logcat;
+
+  })();
+
+  Logcat.Reader = Reader;
+
+  Logcat.Priority = Priority;
+
+  module.exports = Logcat;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/entry.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/entry.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/entry.js
new file mode 100644
index 0000000..1a7f5d2
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/entry.js
@@ -0,0 +1,76 @@
+(function() {
+  var Entry;
+
+  Entry = (function() {
+    function Entry() {
+      this.date = null;
+      this.pid = -1;
+      this.tid = -1;
+      this.priority = null;
+      this.tag = null;
+      this.message = null;
+    }
+
+    Entry.prototype.setDate = function(date) {
+      this.date = date;
+    };
+
+    Entry.prototype.setPid = function(pid) {
+      this.pid = pid;
+    };
+
+    Entry.prototype.setTid = function(tid) {
+      this.tid = tid;
+    };
+
+    Entry.prototype.setPriority = function(priority) {
+      this.priority = priority;
+    };
+
+    Entry.prototype.setTag = function(tag) {
+      this.tag = tag;
+    };
+
+    Entry.prototype.setMessage = function(message) {
+      this.message = message;
+    };
+
+    Entry.prototype.toBinary = function() {
+      var buffer, cursor, length;
+      length = 20;
+      length += 1;
+      length += this.tag.length;
+      length += 1;
+      length += this.message.length;
+      length += 1;
+      buffer = new Buffer(length);
+      cursor = 0;
+      buffer.writeUInt16LE(length - 20, cursor);
+      cursor += 4;
+      buffer.writeInt32LE(this.pid, cursor);
+      cursor += 4;
+      buffer.writeInt32LE(this.tid, cursor);
+      cursor += 4;
+      buffer.writeInt32LE(Math.floor(this.date.getTime() / 1000), cursor);
+      cursor += 4;
+      buffer.writeInt32LE((this.date.getTime() % 1000) * 1000000, cursor);
+      cursor += 4;
+      buffer[cursor] = this.priority;
+      cursor += 1;
+      buffer.write(this.tag, cursor, this.tag.length);
+      cursor += this.tag.length;
+      buffer[cursor] = 0x00;
+      cursor += 1;
+      buffer.write(this.message, cursor, this.message.length);
+      cursor += this.message.length;
+      buffer[cursor] = 0x00;
+      return buffer;
+    };
+
+    return Entry;
+
+  })();
+
+  module.exports = Entry;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser.js
new file mode 100644
index 0000000..e3c2939
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser.js
@@ -0,0 +1,32 @@
+(function() {
+  var EventEmitter, Parser, _ref,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  EventEmitter = require('events').EventEmitter;
+
+  Parser = (function(_super) {
+    __extends(Parser, _super);
+
+    function Parser() {
+      _ref = Parser.__super__.constructor.apply(this, arguments);
+      return _ref;
+    }
+
+    Parser.get = function(type) {
+      var parser;
+      parser = require("./parser/" + type);
+      return new parser();
+    };
+
+    Parser.prototype.parse = function() {
+      throw new Error("parse() is unimplemented");
+    };
+
+    return Parser;
+
+  })(EventEmitter);
+
+  module.exports = Parser;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser/binary.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser/binary.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser/binary.js
new file mode 100644
index 0000000..b861ace
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/parser/binary.js
@@ -0,0 +1,78 @@
+(function() {
+  var Binary, Entry, Parser, Priority,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  Parser = require('../parser');
+
+  Entry = require('../entry');
+
+  Priority = require('../priority');
+
+  Binary = (function(_super) {
+    var HEADER_LENGTH;
+
+    __extends(Binary, _super);
+
+    HEADER_LENGTH = 20;
+
+    function Binary() {
+      this.buffer = new Buffer('');
+    }
+
+    Binary.prototype.parse = function(chunk) {
+      var cursor, data, entry, length, nsec, sec;
+      this.buffer = Buffer.concat([this.buffer, chunk]);
+      while (this.buffer.length > HEADER_LENGTH) {
+        cursor = 0;
+        length = this.buffer.readUInt16LE(cursor);
+        if (this.buffer.length < HEADER_LENGTH + length) {
+          break;
+        }
+        entry = new Entry;
+        cursor += 4;
+        entry.setPid(this.buffer.readInt32LE(cursor));
+        cursor += 4;
+        entry.setTid(this.buffer.readInt32LE(cursor));
+        cursor += 4;
+        sec = this.buffer.readInt32LE(cursor);
+        cursor += 4;
+        nsec = this.buffer.readInt32LE(cursor);
+        entry.setDate(new Date(sec * 1000 + nsec / 1000000));
+        cursor += 4;
+        data = this.buffer.slice(cursor, cursor + length);
+        cursor += length;
+        this.buffer = this.buffer.slice(cursor);
+        this._processEntry(entry, data);
+      }
+      if (this.buffer.length) {
+        this.emit('wait');
+      } else {
+        this.emit('drain');
+      }
+    };
+
+    Binary.prototype._processEntry = function(entry, data) {
+      var cursor, length;
+      entry.setPriority(data[0]);
+      cursor = 1;
+      length = data.length;
+      while (cursor < length) {
+        if (data[cursor] === 0) {
+          entry.setTag(data.slice(1, cursor).toString());
+          entry.setMessage(data.slice(cursor + 1, length - 1).toString());
+          this.emit('entry', entry);
+          return;
+        }
+        cursor += 1;
+      }
+      this.emit('error', new Error("Unprocessable entry data '" + data + "'"));
+    };
+
+    return Binary;
+
+  })(Parser);
+
+  module.exports = Binary;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/priority.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/priority.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/priority.js
new file mode 100644
index 0000000..532ea62
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/priority.js
@@ -0,0 +1,89 @@
+(function() {
+  var Priority;
+
+  Priority = (function() {
+    var letterNames, letters, names;
+
+    function Priority() {}
+
+    Priority.UNKNOWN = 0;
+
+    Priority.DEFAULT = 1;
+
+    Priority.VERBOSE = 2;
+
+    Priority.DEBUG = 3;
+
+    Priority.INFO = 4;
+
+    Priority.WARN = 5;
+
+    Priority.ERROR = 6;
+
+    Priority.FATAL = 7;
+
+    Priority.SILENT = 8;
+
+    names = {
+      0: 'UNKNOWN',
+      1: 'DEFAULT',
+      2: 'VERBOSE',
+      3: 'DEBUG',
+      4: 'INFO',
+      5: 'WARN',
+      6: 'ERROR',
+      7: 'FATAL',
+      8: 'SILENT'
+    };
+
+    letters = {
+      '?': Priority.UNKNOWN,
+      'V': Priority.VERBOSE,
+      'D': Priority.DEBUG,
+      'I': Priority.INFO,
+      'W': Priority.WARN,
+      'E': Priority.ERROR,
+      'F': Priority.FATAL,
+      'S': Priority.SILENT
+    };
+
+    letterNames = {
+      0: '?',
+      1: '?',
+      2: 'V',
+      3: 'D',
+      4: 'I',
+      5: 'W',
+      6: 'E',
+      7: 'F',
+      8: 'S'
+    };
+
+    Priority.fromName = function(name) {
+      var value;
+      value = Priority[name.toUpperCase()];
+      if (value || value === 0) {
+        return value;
+      }
+      return Priority.fromLetter(name);
+    };
+
+    Priority.toName = function(value) {
+      return names[value];
+    };
+
+    Priority.fromLetter = function(letter) {
+      return letters[letter.toUpperCase()];
+    };
+
+    Priority.toLetter = function(value) {
+      return letterNames[value];
+    };
+
+    return Priority;
+
+  })();
+
+  module.exports = Priority;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/reader.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/reader.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/reader.js
new file mode 100644
index 0000000..7f07626
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/reader.js
@@ -0,0 +1,137 @@
+(function() {
+  var EventEmitter, Parser, Priority, Reader, Transform,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  EventEmitter = require('events').EventEmitter;
+
+  Parser = require('./parser');
+
+  Transform = require('./transform');
+
+  Priority = require('./priority');
+
+  Reader = (function(_super) {
+    __extends(Reader, _super);
+
+    Reader.ANY = '*';
+
+    function Reader(options) {
+      var _base;
+      this.options = options != null ? options : {};
+      (_base = this.options).format || (_base.format = 'binary');
+      if (this.options.fixLineFeeds == null) {
+        this.options.fixLineFeeds = true;
+      }
+      this.filters = {
+        all: -1,
+        tags: {}
+      };
+      this.parser = Parser.get(this.options.format);
+      this.stream = null;
+    }
+
+    Reader.prototype.exclude = function(tag) {
+      if (tag === Reader.ANY) {
+        return this.excludeAll();
+      }
+      this.filters.tags[tag] = Priority.SILENT;
+      return this;
+    };
+
+    Reader.prototype.excludeAll = function() {
+      this.filters.all = Priority.SILENT;
+      return this;
+    };
+
+    Reader.prototype.include = function(tag, priority) {
+      if (priority == null) {
+        priority = Priority.DEBUG;
+      }
+      if (tag === Reader.ANY) {
+        return this.includeAll(priority);
+      }
+      this.filters.tags[tag] = this._priority(priority);
+      return this;
+    };
+
+    Reader.prototype.includeAll = function(priority) {
+      if (priority == null) {
+        priority = Priority.DEBUG;
+      }
+      this.filters.all = this._priority(priority);
+      return this;
+    };
+
+    Reader.prototype.resetFilters = function() {
+      this.filters.all = -1;
+      this.filters.tags = {};
+      return this;
+    };
+
+    Reader.prototype._hook = function() {
+      var transform,
+        _this = this;
+      if (this.options.fixLineFeeds) {
+        transform = this.stream.pipe(new Transform);
+        transform.on('data', function(data) {
+          return _this.parser.parse(data);
+        });
+      } else {
+        this.stream.on('data', function(data) {
+          return _this.parser.parse(data);
+        });
+      }
+      this.stream.on('error', function(err) {
+        return _this.emit('error', err);
+      });
+      this.stream.on('end', function() {
+        return _this.emit('end');
+      });
+      this.stream.on('finish', function() {
+        return _this.emit('finish');
+      });
+      this.parser.on('entry', function(entry) {
+        if (_this._filter(entry)) {
+          return _this.emit('entry', entry);
+        }
+      });
+      this.parser.on('error', function(err) {
+        return _this.emit('error', err);
+      });
+    };
+
+    Reader.prototype._filter = function(entry) {
+      var priority;
+      priority = this.filters.tags[entry.tag];
+      if (!(priority >= 0)) {
+        priority = this.filters.all;
+      }
+      return entry.priority >= priority;
+    };
+
+    Reader.prototype._priority = function(priority) {
+      if (typeof priority === 'number') {
+        return priority;
+      }
+      return Priority.fromName(priority);
+    };
+
+    Reader.prototype.connect = function(stream) {
+      this.stream = stream;
+      this._hook();
+      return this;
+    };
+
+    Reader.prototype.end = function() {
+      this.stream.end();
+      return this;
+    };
+
+    return Reader;
+
+  })(EventEmitter);
+
+  module.exports = Reader;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/transform.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/transform.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/transform.js
new file mode 100644
index 0000000..b6fe7a2
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/lib/logcat/transform.js
@@ -0,0 +1,51 @@
+(function() {
+  var Stream, Transform,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  Stream = require('stream');
+
+  Transform = (function(_super) {
+    __extends(Transform, _super);
+
+    function Transform(options) {
+      this.savedR = null;
+      Transform.__super__.constructor.call(this, options);
+    }
+
+    Transform.prototype._transform = function(chunk, encoding, done) {
+      var hi, last, lo;
+      lo = 0;
+      hi = 0;
+      if (this.savedR) {
+        if (chunk[0] !== 0x0a) {
+          this.push(this.savedR);
+        }
+        this.savedR = null;
+      }
+      last = chunk.length - 1;
+      while (hi <= last) {
+        if (chunk[hi] === 0x0d) {
+          if (hi === last) {
+            this.savedR = chunk.slice(last);
+            break;
+          } else if (chunk[hi + 1] === 0x0a) {
+            this.push(chunk.slice(lo, hi));
+            lo = hi + 1;
+          }
+        }
+        hi += 1;
+      }
+      if (hi !== lo) {
+        this.push(chunk.slice(lo, hi));
+      }
+      done();
+    };
+
+    return Transform;
+
+  })(Stream.Transform);
+
+  module.exports = Transform;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/package.json
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/package.json b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/package.json
new file mode 100644
index 0000000..6fe20fd
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-logcat/package.json
@@ -0,0 +1,75 @@
+{
+  "name": "adbkit-logcat",
+  "version": "1.0.3",
+  "description": "A Node.js interface for working with Android's logcat output.",
+  "keywords": [
+    "adb",
+    "adbkit",
+    "logcat"
+  ],
+  "bugs": {
+    "url": "https://github.com/CyberAgent/adbkit-logcat/issues"
+  },
+  "license": "Apache-2.0",
+  "author": {
+    "name": "CyberAgent, Inc.",
+    "email": "npm@cyberagent.co.jp",
+    "url": "http://www.cyberagent.co.jp/"
+  },
+  "main": "./index",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/CyberAgent/adbkit-logcat.git"
+  },
+  "scripts": {
+    "postpublish": "grunt clean",
+    "prepublish": "grunt coffee",
+    "test": "grunt test"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "chai": "~1.8.1",
+    "coffee-script": "~1.6.3",
+    "grunt": "~0.4.1",
+    "grunt-cli": "~0.1.11",
+    "grunt-coffeelint": "~0.0.7",
+    "grunt-contrib-clean": "~0.5.0",
+    "grunt-contrib-coffee": "~0.7.0",
+    "grunt-contrib-watch": "~0.5.3",
+    "grunt-exec": "~0.4.2",
+    "grunt-jsonlint": "~1.0.2",
+    "grunt-notify": "~0.2.16",
+    "mocha": "~1.14.0",
+    "sinon": "~1.7.3",
+    "sinon-chai": "~2.4.0"
+  },
+  "engines": {
+    "node": ">= 0.10.4"
+  },
+  "homepage": "https://github.com/CyberAgent/adbkit-logcat",
+  "_id": "adbkit-logcat@1.0.3",
+  "dist": {
+    "shasum": "8b5fef57086c02c9e24004af5706ee508d83db07",
+    "tarball": "http://registry.npmjs.org/adbkit-logcat/-/adbkit-logcat-1.0.3.tgz"
+  },
+  "_from": "adbkit-logcat@~1.0.3",
+  "_npmVersion": "1.4.3",
+  "_npmUser": {
+    "name": "sorccu",
+    "email": "simo@shoqolate.com"
+  },
+  "maintainers": [
+    {
+      "name": "sorccu",
+      "email": "simo@shoqolate.com"
+    },
+    {
+      "name": "cyberagent",
+      "email": "npm@cyberagent.co.jp"
+    }
+  ],
+  "directories": {},
+  "_shasum": "8b5fef57086c02c9e24004af5706ee508d83db07",
+  "_resolved": "https://registry.npmjs.org/adbkit-logcat/-/adbkit-logcat-1.0.3.tgz",
+  "readme": "ERROR: No README data found!"
+}

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/LICENSE b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/LICENSE
new file mode 100644
index 0000000..2ffff3d
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/LICENSE
@@ -0,0 +1,13 @@
+Copyright © CyberAgent, Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/README.md
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/README.md b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/README.md
new file mode 100644
index 0000000..97977bb
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/README.md
@@ -0,0 +1,469 @@
+# adbkit-monkey
+
+**adbkit-monkey** provides a [Node.js][nodejs] interface for working with the Android [`monkey` tool][monkey-site]. Albeit undocumented, they monkey program can be started in TCP mode with the `--port` argument. In this mode, it accepts a [range of commands][monkey-proto] that can be used to interact with the UI in a non-random manner. This mode is also used internally by the [`monkeyrunner` tool][monkeyrunner-site], although the documentation claims no relation to the monkey tool.
+
+## Getting started
+
+Install via NPM:
+
+```bash
+npm install --save adbkit-monkey
+```
+
+Note that while adbkit-monkey is written in CoffeeScript, it is compiled to JavaScript before publishing to NPM, which means that you are not required to use CoffeeScript.
+
+### Examples
+
+The following examples assume that monkey is already running (via `adb shell monkey --port 1080`) and a port forwarding (`adb forward tcp:1080 tcp:1080`) has been set up.
+
+#### Press the home button
+
+```javascript
+var assert = require('assert');
+var monkey = require('adbkit-monkey');
+
+var client = monkey.connect({ port: 1080 });
+
+client.press(3 /* KEYCODE_HOME */, function(err) {
+  assert.ifError(err);
+  console.log('Pressed home button');
+  client.end();
+});
+```
+
+#### Drag out the notification bar
+
+```javascript
+var assert = require('assert');
+var monkey = require('adbkit-monkey');
+
+var client = monkey.connect({ port: 1080 });
+
+client.multi()
+  .touchDown(100, 0)
+  .sleep(5)
+  .touchMove(100, 20)
+  .sleep(5)
+  .touchMove(100, 40)
+  .sleep(5)
+  .touchMove(100, 60)
+  .sleep(5)
+  .touchMove(100, 80)
+  .sleep(5)
+  .touchMove(100, 100)
+  .sleep(5)
+  .touchUp(100, 100)
+  .sleep(5)
+  .execute(function(err) {
+    assert.ifError(err);
+    console.log('Dragged out the notification bar');
+    client.end();
+  });
+```
+
+#### Get display size
+
+```javascript
+var assert = require('assert');
+var monkey = require('adbkit-monkey');
+
+var client = monkey.connect({ port: 1080 });
+
+client.getDisplayWidth(function(err, width) {
+  assert.ifError(err);
+  client.getDisplayHeight(function(err, height) {
+    assert.ifError(err);
+    console.log('Display size is %dx%d', width, height);
+    client.end();
+  });
+});
+```
+
+#### Type text
+
+Note that you should manually focus a text field first.
+
+```javascript
+var assert = require('assert');
+var monkey = require('adbkit-monkey');
+
+var client = monkey.connect({ port: 1080 });
+
+client.type('hello monkey!', function(err) {
+  assert.ifError(err);
+  console.log('Said hello to monkey');
+  client.end();
+});
+```
+
+## API
+
+### Monkey
+
+#### monkey.connect(options)
+
+Uses [Net.connect()][node-net] to open a new TCP connection to monkey. Useful when combined with `adb forward`.
+
+* **options** Any options [`Net.connect()`][node-net] accepts.
+* Returns: A new monkey `Client` instance.
+
+#### monkey.connectStream(stream)
+
+Attaches a monkey client to an existing monkey protocol stream.
+
+* **stream** The monkey protocol [`Stream`][node-stream].
+* Returns: A new monkey `Client` instance.
+
+### Client
+
+Implements `Api`. See below for details.
+
+#### Events
+
+The following events are available:
+
+* **error** **(err)** Emitted when an error occurs.
+    * **err** An `Error`.
+* **end** Emitted when the stream ends.
+* **finish** Emitted when the stream finishes.
+
+#### client.end()
+
+Ends the underlying stream/connection.
+
+* Returns: The `Client` instance.
+
+#### client.multi()
+
+Returns a new API wrapper that buffers commands for simultaneous delivery instead of sending them individually. When used with `api.sleep()`, allows simple gestures to be executed.
+
+* Returns: A new `Multi` instance. See `Multi` below.
+
+#### client.send(command, callback)
+
+Sends a raw protocol command to monkey.
+
+* **command** The command to send. When `String`, a single command is sent. When `Array`, a series of commands is sent at once.
+* **callback(err, value, command)** Called when monkey responds to the command. If multiple commands were sent, the callback will be called once for each command.
+    * **err** `null` when successful, `Error` otherwise.
+    * **value** The response value, if any.
+    * **command** The command the response is for.
+* Returns: The `Client` instance.
+
+### Api
+
+The monkey API implemented by `Client` and `Multi`.
+
+#### api.done(callback)
+
+Closes the current monkey session and allows a new session to connect.
+
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.flipClose(callback)
+
+Simulates closing the keyboard.
+
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.flipOpen(callback)
+
+Simulates opening the keyboard.
+
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.get(name, callback)
+
+Gets the value of a variable. Use `api.list()` to retrieve a list of supported variables.
+
+* **name** The name of the variable.
+* **callback(err, value)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+    * **value** The value of the variable.
+* Returns: The `Api` implementation instance.
+
+#### api.getAmCurrentAction(callback)
+
+Alias for `api.get('am.current.action', callback)`.
+
+#### api.getAmCurrentCategories(callback)
+
+Alias for `api.get('am.current.categories', callback)`.
+
+#### api.getAmCurrentCompClass(callback)
+
+Alias for `api.get('am.current.comp.class', callback)`.
+
+#### api.getAmCurrentCompPackage(callback)
+
+Alias for `api.get('am.current.comp.package', callback)`.
+
+#### api.getCurrentData(callback)
+
+Alias for `api.get('am.current.data', callback)`.
+
+#### api.getAmCurrentPackage(callback)
+
+Alias for `api.get('am.current.package', callback)`.
+
+#### api.getBuildBoard(callback)
+
+Alias for `api.get('build.board', callback)`.
+
+#### api.getBuildBrand(callback)
+
+Alias for `api.get('build.brand', callback)`.
+
+#### api.getBuildCpuAbi(callback)
+
+Alias for `api.get('build.cpu_abi', callback)`.
+
+#### api.getBuildDevice(callback)
+
+Alias for `api.get('build.device', callback)`.
+
+#### api.getBuildDisplay(callback)
+
+Alias for `api.get('build.display', callback)`.
+
+#### api.getBuildFingerprint(callback)
+
+Alias for `api.get('build.fingerprint', callback)`.
+
+#### api.getBuildHost(callback)
+
+Alias for `api.get('build.host', callback)`.
+
+#### api.getBuildId(callback)
+
+Alias for `api.get('build.id', callback)`.
+
+#### api.getBuildManufacturer(callback)
+
+Alias for `api.get('build.manufacturer', callback)`.
+
+#### api.getBuildModel(callback)
+
+Alias for `api.get('build.model', callback)`.
+
+#### api.getBuildProduct(callback)
+
+Alias for `api.get('build.product', callback)`.
+
+#### api.getBuildTags(callback)
+
+Alias for `api.get('build.tags', callback)`.
+
+#### api.getBuildType(callback)
+
+Alias for `api.get('build.type', callback)`.
+
+#### api.getBuildUser(callback)
+
+Alias for `api.get('build.user', callback)`.
+
+#### api.getBuildVersionCodename(callback)
+
+Alias for `api.get('build.version.codename', callback)`.
+
+#### api.getBuildVersionIncremental(callback)
+
+Alias for `api.get('build.version.incremental', callback)`.
+
+#### api.getBuildVersionRelease(callback)
+
+Alias for `api.get('build.version.release', callback)`.
+
+#### api.getBuildVersionSdk(callback)
+
+Alias for `api.get('build.version.sdk', callback)`.
+
+#### api.getClockMillis(callback)
+
+Alias for `api.get('clock.millis', callback)`.
+
+#### api.getClockRealtime(callback)
+
+Alias for `api.get('clock.realtime', callback)`.
+
+#### api.getClockUptime(callback)
+
+Alias for `api.get('clock.uptime', callback)`.
+
+#### api.getDisplayDensity(callback)
+
+Alias for `api.get('display.density', callback)`.
+
+#### api.getDisplayHeight(callback)
+
+Alias for `api.get('display.height', callback)`. Note that the height may exclude any virtual home button row.
+
+#### api.getDisplayWidth(callback)
+
+Alias for `api.get('display.width', callback)`.
+
+#### api.keyDown(keyCode, callback)
+
+Sends a key down event. Should be coupled with `api.keyUp()`. Note that `api.press()` performs the two events automatically.
+
+* **keyCode** The [key code][android-keycodes]. All monkeys support numeric keycodes, and some support automatic conversion from key names to key codes (e.g. `'home'` to `KEYCODE_HOME`). This will not work for number keys however. The most portable method is to simply use numeric key codes.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.keyUp(keyCode, callback)
+
+Sends a key up event. Should be coupled with `api.keyDown()`. Note that `api.press()` performs the two events automatically.
+
+* **keyCode** See `api.keyDown()`.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.list(callback)
+
+Lists supported variables.
+
+* **callback(err, vars)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+    * **vars** An array of supported variable names, to be used with `api.get()`.
+* Returns: The `Api` implementation instance.
+
+#### api.press(keyCode, callback)
+
+Sends a key press event.
+
+* **keyCode** See `api.keyDown()`.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.quit(callback)
+
+Closes the current monkey session and quits monkey.
+
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.sleep(ms, callback)
+
+Sleeps for the given duration. Can be useful for simulating gestures.
+
+* **ms** How many milliseconds to sleep for.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.tap(x, y, callback)
+
+Taps the given coordinates.
+
+* **x** The x coordinate.
+* **y** The y coordinate.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.touchDown(x, y, callback)
+
+Sends a touch down event on the given coordinates.
+
+* **x** The x coordinate.
+* **y** The y coordinate.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.touchMove(x, y, callback)
+
+Sends a touch move event on the given coordinates.
+
+* **x** The x coordinate.
+* **y** The y coordinate.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.touchUp(x, y, callback)
+
+Sends a touch up event on the given coordinates.
+
+* **x** The x coordinate.
+* **y** The y coordinate.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.trackball(x, y, callback)
+
+Sends a trackball event on the given coordinates.
+
+* **x** The x coordinate.
+* **y** The y coordinate.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.type(text, callback)
+
+Types the given text.
+
+* **text** A text `String`. Note that only characters for which [key codes][android-keycodes] exist can be entered. Also note that any IME in use may or may not transform the text.
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+#### api.wake(callback)
+
+Wakes the device from sleep and allows user input.
+
+* **callback(err)** Called when monkey responds.
+    * **err** `null` when successful, `Error` otherwise.
+* Returns: The `Api` implementation instance.
+
+### Multi
+
+Buffers `Api` commands and delivers them simultaneously for greater control over timing.
+
+Implements all `Api` methods, but without the last `callback` parameter.
+
+#### multi.execute(callback)
+
+Sends all buffered commands.
+
+* **callback(err, values)** Called when monkey has responded to all commands (i.e. just once at the end).
+    * **err** `null` when successful, `Error` otherwise.
+    * **values** An array of all response values, identical to individual `Api` responses.
+
+## More information
+
+* [Monkey][monkey-site]
+    - [Source code][monkey-source]
+    - [Protocol][monkey-proto]
+* [Monkeyrunner][monkeyrunner-site]
+
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md).
+
+## License
+
+See [LICENSE](LICENSE).
+
+Copyright © CyberAgent, Inc. All Rights Reserved.
+
+[nodejs]: <http://nodejs.org/>
+[monkey-site]: <http://developer.android.com/tools/help/monkey.html>
+[monkey-source]: <https://github.com/android/platform_development/blob/master/cmds/monkey/>
+[monkey-proto]: <https://github.com/android/platform_development/blob/master/cmds/monkey/README.NETWORK.txt>
+[monkeyrunner-site]: <http://developer.android.com/tools/help/monkeyrunner_concepts.html>
+[node-net]: <http://nodejs.org/api/net.html>
+[node-stream]: <http://nodejs.org/api/stream.html>
+[android-keycodes]: <http://developer.android.com/reference/android/view/KeyEvent.html>

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/index.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/index.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/index.js
new file mode 100644
index 0000000..a81226d
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/index.js
@@ -0,0 +1,15 @@
+(function() {
+  var Path;
+
+  Path = require('path');
+
+  module.exports = (function() {
+    switch (Path.extname(__filename)) {
+      case '.coffee':
+        return require('./src/monkey');
+      default:
+        return require('./lib/monkey');
+    }
+  })();
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey.js
new file mode 100644
index 0000000..9e81c56
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey.js
@@ -0,0 +1,29 @@
+(function() {
+  var Client, Connection, Monkey;
+
+  Client = require('./monkey/client');
+
+  Connection = require('./monkey/connection');
+
+  Monkey = (function() {
+    function Monkey() {}
+
+    Monkey.connect = function(options) {
+      return new Connection().connect(options);
+    };
+
+    Monkey.connectStream = function(stream) {
+      return new Client().connect(stream);
+    };
+
+    return Monkey;
+
+  })();
+
+  Monkey.Connection = Connection;
+
+  Monkey.Client = Client;
+
+  module.exports = Monkey;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/api.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/api.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/api.js
new file mode 100644
index 0000000..34fce09
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/api.js
@@ -0,0 +1,276 @@
+(function() {
+  var Api, EventEmitter, _ref,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  EventEmitter = require('events').EventEmitter;
+
+  Api = (function(_super) {
+    __extends(Api, _super);
+
+    function Api() {
+      _ref = Api.__super__.constructor.apply(this, arguments);
+      return _ref;
+    }
+
+    Api.prototype.send = function() {
+      throw new Error("send is not implemented");
+    };
+
+    Api.prototype.keyDown = function(keyCode, callback) {
+      this.send("key down " + keyCode, callback);
+      return this;
+    };
+
+    Api.prototype.keyUp = function(keyCode, callback) {
+      this.send("key up " + keyCode, callback);
+      return this;
+    };
+
+    Api.prototype.touchDown = function(x, y, callback) {
+      this.send("touch down " + x + " " + y, callback);
+      return this;
+    };
+
+    Api.prototype.touchUp = function(x, y, callback) {
+      this.send("touch up " + x + " " + y, callback);
+      return this;
+    };
+
+    Api.prototype.touchMove = function(x, y, callback) {
+      this.send("touch move " + x + " " + y, callback);
+      return this;
+    };
+
+    Api.prototype.trackball = function(dx, dy, callback) {
+      this.send("trackball " + dx + " " + dy, callback);
+      return this;
+    };
+
+    Api.prototype.flipOpen = function(callback) {
+      this.send("flip open", callback);
+      return this;
+    };
+
+    Api.prototype.flipClose = function(callback) {
+      this.send("flip close", callback);
+      return this;
+    };
+
+    Api.prototype.wake = function(callback) {
+      this.send("wake", callback);
+      return this;
+    };
+
+    Api.prototype.tap = function(x, y, callback) {
+      this.send("tap " + x + " " + y, callback);
+      return this;
+    };
+
+    Api.prototype.press = function(keyCode, callback) {
+      this.send("press " + keyCode, callback);
+      return this;
+    };
+
+    Api.prototype.type = function(str, callback) {
+      str = str.replace(/"/g, '\\"');
+      if (str.indexOf(' ') === -1) {
+        this.send("type " + str, callback);
+      } else {
+        this.send("type \"" + str + "\"", callback);
+      }
+      return this;
+    };
+
+    Api.prototype.list = function(callback) {
+      var _this = this;
+      this.send("listvar", function(err, vars) {
+        if (err) {
+          return _this(callback(err));
+        }
+        if (err) {
+          return callback(err);
+        } else {
+          return callback(null, vars.split(/\s+/g));
+        }
+      });
+      return this;
+    };
+
+    Api.prototype.get = function(name, callback) {
+      this.send("getvar " + name, callback);
+      return this;
+    };
+
+    Api.prototype.quit = function(callback) {
+      this.send("quit", callback);
+      return this;
+    };
+
+    Api.prototype.done = function(callback) {
+      this.send("done", callback);
+      return this;
+    };
+
+    Api.prototype.sleep = function(ms, callback) {
+      this.send("sleep " + ms, callback);
+      return this;
+    };
+
+    Api.prototype.getAmCurrentAction = function(callback) {
+      this.get('am.current.action', callback);
+      return this;
+    };
+
+    Api.prototype.getAmCurrentCategories = function(callback) {
+      this.get('am.current.categories', callback);
+      return this;
+    };
+
+    Api.prototype.getAmCurrentCompClass = function(callback) {
+      this.get('am.current.comp.class', callback);
+      return this;
+    };
+
+    Api.prototype.getAmCurrentCompPackage = function(callback) {
+      this.get('am.current.comp.package', callback);
+      return this;
+    };
+
+    Api.prototype.getAmCurrentData = function(callback) {
+      this.get('am.current.data', callback);
+      return this;
+    };
+
+    Api.prototype.getAmCurrentPackage = function(callback) {
+      this.get('am.current.package', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildBoard = function(callback) {
+      this.get('build.board', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildBrand = function(callback) {
+      this.get('build.brand', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildCpuAbi = function(callback) {
+      this.get('build.cpu_abi', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildDevice = function(callback) {
+      this.get('build.device', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildDisplay = function(callback) {
+      this.get('build.display', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildFingerprint = function(callback) {
+      this.get('build.fingerprint', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildHost = function(callback) {
+      this.get('build.host', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildId = function(callback) {
+      this.get('build.id', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildManufacturer = function(callback) {
+      this.get('build.manufacturer', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildModel = function(callback) {
+      this.get('build.model', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildProduct = function(callback) {
+      this.get('build.product', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildTags = function(callback) {
+      this.get('build.tags', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildType = function(callback) {
+      this.get('build.type', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildUser = function(callback) {
+      this.get('build.user', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildVersionCodename = function(callback) {
+      this.get('build.version.codename', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildVersionIncremental = function(callback) {
+      this.get('build.version.incremental', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildVersionRelease = function(callback) {
+      this.get('build.version.release', callback);
+      return this;
+    };
+
+    Api.prototype.getBuildVersionSdk = function(callback) {
+      this.get('build.version.sdk', callback);
+      return this;
+    };
+
+    Api.prototype.getClockMillis = function(callback) {
+      this.get('clock.millis', callback);
+      return this;
+    };
+
+    Api.prototype.getClockRealtime = function(callback) {
+      this.get('clock.realtime', callback);
+      return this;
+    };
+
+    Api.prototype.getClockUptime = function(callback) {
+      this.get('clock.uptime', callback);
+      return this;
+    };
+
+    Api.prototype.getDisplayDensity = function(callback) {
+      this.get('display.density', callback);
+      return this;
+    };
+
+    Api.prototype.getDisplayHeight = function(callback) {
+      this.get('display.height', callback);
+      return this;
+    };
+
+    Api.prototype.getDisplayWidth = function(callback) {
+      this.get('display.width', callback);
+      return this;
+    };
+
+    return Api;
+
+  })(EventEmitter);
+
+  module.exports = Api;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/client.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/client.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/client.js
new file mode 100644
index 0000000..b6e1278
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/client.js
@@ -0,0 +1,98 @@
+(function() {
+  var Api, Client, Command, Multi, Parser, Queue, Reply,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  Api = require('./api');
+
+  Command = require('./command');
+
+  Reply = require('./reply');
+
+  Queue = require('./queue');
+
+  Multi = require('./multi');
+
+  Parser = require('./parser');
+
+  Client = (function(_super) {
+    __extends(Client, _super);
+
+    function Client() {
+      this.commandQueue = new Queue;
+      this.parser = new Parser;
+      this.stream = null;
+    }
+
+    Client.prototype._hook = function() {
+      var _this = this;
+      this.stream.on('data', function(data) {
+        return _this.parser.parse(data);
+      });
+      this.stream.on('error', function(err) {
+        return _this.emit('error', err);
+      });
+      this.stream.on('end', function() {
+        return _this.emit('end');
+      });
+      this.stream.on('finish', function() {
+        return _this.emit('finish');
+      });
+      this.parser.on('reply', function(reply) {
+        return _this._consume(reply);
+      });
+      this.parser.on('error', function(err) {
+        return _this.emit('error', err);
+      });
+    };
+
+    Client.prototype._consume = function(reply) {
+      var command;
+      if (command = this.commandQueue.dequeue()) {
+        if (reply.isError()) {
+          command.callback(reply.toError(), null, command.command);
+        } else {
+          command.callback(null, reply.value, command.command);
+        }
+      } else {
+        throw new Error("Command queue depleted, but replies still coming in");
+      }
+    };
+
+    Client.prototype.connect = function(stream) {
+      this.stream = stream;
+      this._hook();
+      return this;
+    };
+
+    Client.prototype.end = function() {
+      this.stream.end();
+      return this;
+    };
+
+    Client.prototype.send = function(commands, callback) {
+      var command, _i, _len;
+      if (Array.isArray(commands)) {
+        for (_i = 0, _len = commands.length; _i < _len; _i++) {
+          command = commands[_i];
+          this.commandQueue.enqueue(new Command(command, callback));
+        }
+        this.stream.write("" + (commands.join('\n')) + "\n");
+      } else {
+        this.commandQueue.enqueue(new Command(commands, callback));
+        this.stream.write("" + commands + "\n");
+      }
+      return this;
+    };
+
+    Client.prototype.multi = function() {
+      return new Multi(this);
+    };
+
+    return Client;
+
+  })(Api);
+
+  module.exports = Client;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/command.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/command.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/command.js
new file mode 100644
index 0000000..41062e0
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/command.js
@@ -0,0 +1,17 @@
+(function() {
+  var Command;
+
+  Command = (function() {
+    function Command(command, callback) {
+      this.command = command;
+      this.callback = callback;
+      this.next = null;
+    }
+
+    return Command;
+
+  })();
+
+  module.exports = Command;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/connection.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/connection.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/connection.js
new file mode 100644
index 0000000..b52ee14
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/connection.js
@@ -0,0 +1,42 @@
+(function() {
+  var Client, Connection, Net, _ref,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  Net = require('net');
+
+  Client = require('./client');
+
+  Connection = (function(_super) {
+    __extends(Connection, _super);
+
+    function Connection() {
+      _ref = Connection.__super__.constructor.apply(this, arguments);
+      return _ref;
+    }
+
+    Connection.prototype.connect = function(options) {
+      var stream;
+      stream = Net.connect(options);
+      stream.setNoDelay(true);
+      return Connection.__super__.connect.call(this, stream);
+    };
+
+    Connection.prototype._hook = function() {
+      var _this = this;
+      this.stream.on('connect', function() {
+        return _this.emit('connect');
+      });
+      this.stream.on('close', function(hadError) {
+        return _this.emit('close', hadError);
+      });
+      return Connection.__super__._hook.call(this);
+    };
+
+    return Connection;
+
+  })(Client);
+
+  module.exports = Connection;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/multi.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/multi.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/multi.js
new file mode 100644
index 0000000..80e8214
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/multi.js
@@ -0,0 +1,85 @@
+(function() {
+  var Api, Command, Multi,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  Api = require('./api');
+
+  Command = require('./command');
+
+  Multi = (function(_super) {
+    __extends(Multi, _super);
+
+    function Multi(monkey) {
+      var _this = this;
+      this.monkey = monkey;
+      this.commands = [];
+      this.replies = [];
+      this.errors = [];
+      this.counter = 0;
+      this.sent = false;
+      this.callback = null;
+      this.collector = function(err, result, cmd) {
+        if (err) {
+          _this.errors.push("" + cmd + ": " + err.message);
+        }
+        _this.replies.push(result);
+        _this.counter -= 1;
+        return _this._maybeFinish();
+      };
+    }
+
+    Multi.prototype._maybeFinish = function() {
+      var _this = this;
+      if (this.counter === 0) {
+        if (this.errors.length) {
+          setImmediate(function() {
+            return _this.callback(new Error(_this.errors.join(', ')));
+          });
+        } else {
+          setImmediate(function() {
+            return _this.callback(null, _this.replies);
+          });
+        }
+      }
+    };
+
+    Multi.prototype._forbidReuse = function() {
+      if (this.sent) {
+        throw new Error("Reuse not supported");
+      }
+    };
+
+    Multi.prototype.send = function(command) {
+      this._forbidReuse();
+      this.commands.push(new Command(command, this.collector));
+    };
+
+    Multi.prototype.execute = function(callback) {
+      var command, parts, _i, _len, _ref;
+      this._forbidReuse();
+      this.counter = this.commands.length;
+      this.sent = true;
+      this.callback = callback;
+      if (this.counter === 0) {
+        return;
+      }
+      parts = [];
+      _ref = this.commands;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        command = _ref[_i];
+        this.monkey.commandQueue.enqueue(command);
+        parts.push(command.command);
+      }
+      parts.push('');
+      this.commands = [];
+      this.monkey.stream.write(parts.join('\n'));
+    };
+
+    return Multi;
+
+  })(Api);
+
+  module.exports = Multi;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/parser.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/parser.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/parser.js
new file mode 100644
index 0000000..75dcb9f
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/parser.js
@@ -0,0 +1,66 @@
+(function() {
+  var EventEmitter, Parser, Reply,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  EventEmitter = require('events').EventEmitter;
+
+  Reply = require('./reply');
+
+  Parser = (function(_super) {
+    __extends(Parser, _super);
+
+    function Parser(options) {
+      this.column = 0;
+      this.buffer = new Buffer('');
+    }
+
+    Parser.prototype.parse = function(chunk) {
+      this.buffer = Buffer.concat([this.buffer, chunk]);
+      while (this.column < this.buffer.length) {
+        if (this.buffer[this.column] === 0x0a) {
+          this._parseLine(this.buffer.slice(0, this.column));
+          this.buffer = this.buffer.slice(this.column + 1);
+          this.column = 0;
+        }
+        this.column += 1;
+      }
+      if (this.buffer.length) {
+        this.emit('wait');
+      } else {
+        this.emit('drain');
+      }
+    };
+
+    Parser.prototype._parseLine = function(line) {
+      switch (line[0]) {
+        case 0x4f:
+          if (line.length === 2) {
+            this.emit('reply', new Reply(Reply.OK, null));
+          } else {
+            this.emit('reply', new Reply(Reply.OK, line.toString('ascii', 3)));
+          }
+          break;
+        case 0x45:
+          if (line.length === 5) {
+            this.emit('reply', new Reply(Reply.ERROR, null));
+          } else {
+            this.emit('reply', new Reply(Reply.ERROR, line.toString('ascii', 6)));
+          }
+          break;
+        default:
+          this._complain(line);
+      }
+    };
+
+    Parser.prototype._complain = function(line) {
+      this.emit('error', new SyntaxError("Unparseable line '" + line + "'"));
+    };
+
+    return Parser;
+
+  })(EventEmitter);
+
+  module.exports = Parser;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/queue.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/queue.js b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/queue.js
new file mode 100644
index 0000000..19d6615
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/adbkit-monkey/lib/monkey/queue.js
@@ -0,0 +1,38 @@
+(function() {
+  var Queue;
+
+  Queue = (function() {
+    function Queue() {
+      this.head = null;
+      this.tail = null;
+    }
+
+    Queue.prototype.enqueue = function(item) {
+      if (this.tail) {
+        this.tail.next = item;
+      } else {
+        this.head = item;
+      }
+      this.tail = item;
+    };
+
+    Queue.prototype.dequeue = function() {
+      var item;
+      item = this.head;
+      if (item) {
+        if (item === this.tail) {
+          this.tail = null;
+        }
+        this.head = item.next;
+        item.next = null;
+      }
+      return item;
+    };
+
+    return Queue;
+
+  })();
+
+  module.exports = Queue;
+
+}).call(this);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message