Socket
Socket
Sign inDemoInstall

@devicefarmer/adbkit

Package Overview
Dependencies
10
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.11.1 to 2.11.2

.semaphore/publish.yml

13

index.js
(function() {
var Path;
module.exports = require('./lib/adb');
Path = require('path');
module.exports = (function() {
switch (Path.extname(__filename)) {
case '.coffee':
return require('./src/adb');
default:
return require('./lib/adb');
}
})();
}).call(this);

@@ -1,2 +0,4 @@

var ClearCommand, Client, Connection, ForwardCommand, FrameBufferCommand, GetDevicePathCommand, GetFeaturesCommand, GetPackagesCommand, GetPropertiesCommand, GetSerialNoCommand, GetStateCommand, HostConnectCommand, HostDevicesCommand, HostDevicesWithPathsCommand, HostDisconnectCommand, HostKillCommand, HostTrackDevicesCommand, HostTransportCommand, HostVersionCommand, InstallCommand, IsInstalledCommand, ListForwardsCommand, ListReversesCommand, LocalCommand, LogCommand, Logcat, LogcatCommand, Monkey, MonkeyCommand, Parser, ProcStat, Promise, RebootCommand, RemountCommand, ReverseCommand, RootCommand, ScreencapCommand, ShellCommand, StartActivityCommand, StartServiceCommand, Sync, SyncCommand, TcpCommand, TcpIpCommand, TcpUsbServer, TrackJdwpCommand, UninstallCommand, UsbCommand, WaitBootCompleteCommand, WaitForDeviceCommand, debug;
var ClearCommand, Client, Connection, EventEmitter, ForwardCommand, FrameBufferCommand, GetDevicePathCommand, GetFeaturesCommand, GetPackagesCommand, GetPropertiesCommand, GetSerialNoCommand, GetStateCommand, HostConnectCommand, HostDevicesCommand, HostDevicesWithPathsCommand, HostDisconnectCommand, HostKillCommand, HostTrackDevicesCommand, HostTransportCommand, HostVersionCommand, InstallCommand, IsInstalledCommand, ListForwardsCommand, ListReversesCommand, LocalCommand, LogCommand, Logcat, LogcatCommand, Monkey, MonkeyCommand, Parser, ProcStat, Promise, RebootCommand, RemountCommand, ReverseCommand, RootCommand, ScreencapCommand, ShellCommand, StartActivityCommand, StartServiceCommand, Sync, SyncCommand, TcpCommand, TcpIpCommand, TcpUsbServer, TrackJdwpCommand, UninstallCommand, UsbCommand, WaitBootCompleteCommand, WaitForDeviceCommand, debug,
extend = 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; },
hasProp = {}.hasOwnProperty;

@@ -9,2 +11,4 @@ Monkey = require('@devicefarmer/adbkit-monkey');

EventEmitter = require('events').EventEmitter;
debug = require('debug')('adb:client');

@@ -104,5 +108,7 @@

Client = (function() {
Client = (function(superClass) {
var NoUserOptionError;
extend(Client, superClass);
function Client(options1) {

@@ -120,13 +126,10 @@ var base, base1;

Client.prototype.connection = function() {
var conn, connectListener, errorListener, resolver;
resolver = Promise.defer();
conn = new Connection(this.options).on('error', errorListener = function(err) {
return resolver.reject(err);
}).on('connect', connectListener = function() {
return resolver.resolve(conn);
}).connect();
return resolver.promise["finally"](function() {
conn.removeListener('error', errorListener);
return conn.removeListener('connect', connectListener);
});
var connection;
connection = new Connection(this.options);
connection.on('error', (function(_this) {
return function(err) {
return _this.emit('error', err);
};
})(this));
return connection.connect();
};

@@ -574,4 +577,4 @@

})();
})(EventEmitter);
module.exports = Client;

@@ -41,3 +41,3 @@ var Command, HostDevicesWithPathsCommand, Protocol,

HostDevicesWithPathsCommand.prototype._parseDevices = function(value) {
var devices, i, id, len, line, path, ref, ref1, type;
var device, devices, i, id, len, line, model, path, product, ref, ref1, transportId, type;
devices = [];

@@ -51,7 +51,12 @@ if (!value.length) {

if (line) {
ref1 = line.split(/\s+/), id = ref1[0], type = ref1[1], path = ref1[2];
ref1 = line.split(/\s+/), id = ref1[0], type = ref1[1], path = ref1[2], product = ref1[3], model = ref1[4], device = ref1[5], transportId = ref1[6];
devices.push({
id: id,
type: type,
path: path
path: path,
product: product
}, {
model: model,
device: device,
transportId: transportId
});

@@ -58,0 +63,0 @@ }

@@ -1,2 +0,2 @@

var Connection, EventEmitter, Net, Parser, debug, dump, execFile,
var Connection, EventEmitter, Net, Parser, Promise, debug, dump, execFile,
extend = 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; },

@@ -7,2 +7,4 @@ hasProp = {}.hasOwnProperty;

Promise = require('bluebird');
debug = require('debug')('adb:connection');

@@ -52,7 +54,2 @@

})(this));
this.socket.on('error', (function(_this) {
return function(err) {
return _this._handleError(err);
};
})(this));
this.socket.on('close', (function(_this) {

@@ -63,3 +60,30 @@ return function(hadError) {

})(this));
return this;
return new Promise((function(_this) {
return function(resolve, reject) {
_this.socket.once('connect', resolve);
return _this.socket.once('error', reject);
};
})(this))["catch"]((function(_this) {
return function(err) {
if (err.code === 'ECONNREFUSED' && !_this.triedStarting) {
debug("Connection was refused, let's try starting the server once");
_this.triedStarting = true;
return _this.startServer().then(function() {
return _this.connect();
});
} else {
_this.end();
throw err;
}
};
})(this)).then((function(_this) {
return function() {
_this.socket.on('error', function(err) {
if (_this.socket.listenerCount('error') === 1) {
return _this.emit('error', err);
}
});
return _this;
};
})(this));
};

@@ -77,31 +101,16 @@

Connection.prototype.startServer = function(callback) {
debug("Starting ADB server via '" + this.options.bin + " start-server'");
return this._exec(['start-server'], {}, callback);
Connection.prototype.startServer = function() {
var args, port;
port = this.options.port;
args = port ? ['-P', port, 'start-server'] : ['start-server'];
debug("Starting ADB server via '" + this.options.bin + " " + (args.join(' ')) + "'");
return this._exec(args, {});
};
Connection.prototype._exec = function(args, options, callback) {
Connection.prototype._exec = function(args, options) {
debug("CLI: " + this.options.bin + " " + (args.join(' ')));
execFile(this.options.bin, args, options, callback);
return this;
return Promise.promisify(execFile)(this.options.bin, args, options);
};
Connection.prototype._handleError = function(err) {
if (err.code === 'ECONNREFUSED' && !this.triedStarting) {
debug("Connection was refused, let's try starting the server once");
this.triedStarting = true;
this.startServer((function(_this) {
return function(err) {
if (err) {
return _this._handleError(err);
}
return _this.connect();
};
})(this));
} else {
debug("Connection had an error: " + err.message);
this.emit('error', err);
this.end();
}
};
Connection.prototype._handleError = function(err) {};

@@ -108,0 +117,0 @@ return Connection;

@@ -155,3 +155,3 @@ var Entry, EventEmitter, Fs, Parser, Path, Promise, Protocol, PullTransfer, PushTransfer, Stats, Sync, debug,

return function() {
var endListener, errorListener, readableListener, resolver, track, waitForDrain, writeNext, writer;
var connErrorListener, endListener, errorListener, readableListener, resolver, track, waitForDrain, writeNext, writer;
resolver = Promise.defer();

@@ -198,2 +198,7 @@ writer = Promise.resolve().cancellable();

});
_this.connection.on('error', connErrorListener = function(err) {
stream.destroy(err);
_this.connection.end();
return resolver.reject(err);
});
return resolver.promise["finally"](function() {

@@ -203,2 +208,3 @@ stream.removeListener('end', endListener);

stream.removeListener('error', errorListener);
_this.connection.removeListener('error', connErrorListener);
return writer.cancel();

@@ -205,0 +211,0 @@ });

@@ -1,2 +0,2 @@

var Auth, EventEmitter, Forge, Packet, PacketReader, Parser, Promise, Protocol, RollingCounter, Service, ServiceMap, Socket, crypto, debug,
var Auth, EventEmitter, Packet, PacketReader, Parser, Promise, Protocol, RollingCounter, Service, ServiceMap, Socket, crypto, debug,
extend = 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; },

@@ -11,4 +11,2 @@ hasProp = {}.hasOwnProperty;

Forge = require('node-forge');
debug = require('debug')('adb:tcpusb:socket');

@@ -15,0 +13,0 @@

{
"name": "@devicefarmer/adbkit",
"version": "2.11.1",
"version": "2.11.2",
"description": "A pure Node.js client for the Android Debug Bridge.",

@@ -16,9 +16,9 @@ "keywords": [

"bugs": {
"url": "https://github.com/openstf/adbkit/issues"
"url": "https://github.com/DeviceFarmer/adbkit/issues"
},
"license": "Apache-2.0",
"author": {
"name": "The OpenSTF Project",
"name": "Device Farmer",
"email": "contact@openstf.io",
"url": "https://openstf.io"
"url": "https://devicefarmer.github.io/"
},

@@ -28,3 +28,3 @@ "main": "./index",

"type": "git",
"url": "https://github.com/openstf/adbkit.git"
"url": "https://github.com/DeviceFarmer/adbkit.git"
},

@@ -42,3 +42,3 @@ "scripts": {

"debug": "~2.6.3",
"node-forge": "^0.7.1",
"node-forge": "^0.9.1",
"split": "~0.3.3"

@@ -45,0 +45,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc