mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Revert all adbkit upgrades (#207)
This commit is contained in:
@@ -6,7 +6,6 @@ var adbkit = require('@devicefarmer/adbkit')
|
||||
var logger = require('../../../../util/logger')
|
||||
var wire = require('../../../../wire')
|
||||
var wireutil = require('../../../../wire/util')
|
||||
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
|
||||
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('../../support/adb'))
|
||||
@@ -16,7 +15,6 @@ module.exports = syrup.serial()
|
||||
.dependency(require('../../resources/minicap'))
|
||||
.dependency(require('../util/display'))
|
||||
.define(function(options, adb, router, push, storage, minicap, display) {
|
||||
var deviceClient = new DeviceClient(adb, options.serial)
|
||||
var log = logger.createLogger('device:plugins:screen:capture')
|
||||
var plugin = Object.create(null)
|
||||
|
||||
@@ -39,14 +37,14 @@ module.exports = syrup.serial()
|
||||
'-P %s -s >%s', projectionFormat(), file))
|
||||
.then(adbkit.util.readAll)
|
||||
.then(function() {
|
||||
return deviceClient.stat(file)
|
||||
return adb.stat(options.serial, file)
|
||||
})
|
||||
.then(function(stats) {
|
||||
if (stats.size === 0) {
|
||||
throw new Error('Empty screenshot; possibly secure screen?')
|
||||
}
|
||||
|
||||
return deviceClient.pull(file)
|
||||
return adb.pull(options.serial, file)
|
||||
.then(function(transfer) {
|
||||
return storage.store('image', transfer, {
|
||||
filename: util.format('%s.jpg', options.serial)
|
||||
@@ -56,7 +54,7 @@ module.exports = syrup.serial()
|
||||
})
|
||||
})
|
||||
.finally(function() {
|
||||
return deviceClient.shell(['rm', '-f', file])
|
||||
return adb.shell(options.serial, ['rm', '-f', file])
|
||||
.then(adbkit.util.readAll)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ var BroadcastSet = require('./util/broadcastset')
|
||||
var StateQueue = require('../../../../util/statequeue')
|
||||
var RiskyStream = require('../../../../util/riskystream')
|
||||
var FailCounter = require('../../../../util/failcounter')
|
||||
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
|
||||
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('../../support/adb'))
|
||||
@@ -25,7 +24,6 @@ module.exports = syrup.serial()
|
||||
.dependency(require('../util/display'))
|
||||
.dependency(require('./options'))
|
||||
.define(function(options, adb, minicap, display, screenOptions) {
|
||||
var deviceClient = new DeviceClient(adb, options.serial)
|
||||
var log = logger.createLogger('device:plugins:screen:stream')
|
||||
|
||||
function FrameProducer(config) {
|
||||
@@ -278,7 +276,7 @@ module.exports = syrup.serial()
|
||||
|
||||
FrameProducer.prototype._connectService = function() {
|
||||
function tryConnect(times, delay) {
|
||||
return deviceClient.openLocal('localabstract:minicap')
|
||||
return adb.openLocal(options.serial, 'localabstract:minicap')
|
||||
.timeout(10000)
|
||||
.then(function(out) {
|
||||
return out
|
||||
@@ -369,7 +367,7 @@ module.exports = syrup.serial()
|
||||
log.info('Sending %s to minicap', signal)
|
||||
return Promise.all([
|
||||
output.waitForEnd()
|
||||
, deviceClient.shell(['kill', signum, pid])
|
||||
, adb.shell(options.serial, ['kill', signum, pid])
|
||||
.then(adbkit.util.readAll)
|
||||
.return(true)
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user