Revert all adbkit upgrades (#207)

This commit is contained in:
Karol Wrótniak
2021-03-10 19:22:32 +01:00
committed by GitHub
parent 84bf212497
commit 53acc928f5
25 changed files with 60 additions and 105 deletions

View File

@@ -4,7 +4,6 @@ var path = require('path')
var Promise = require('bluebird')
var syrup = require('@devicefarmer/stf-syrup')
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
var logger = require('../../../util/logger')
var pathutil = require('../../../util/pathutil')
@@ -19,7 +18,6 @@ module.exports = syrup.serial()
.dependency(require('../support/sdk'))
.define(function(options, adb, properties, abi, sdk) {
var log = logger.createLogger('device:resources:minicap')
var deviceClient = new DeviceClient(adb, options.serial)
var resources = {
bin: new Resource({
@@ -64,7 +62,7 @@ module.exports = syrup.serial()
}
function removeResource(res) {
return deviceClient.shell(['rm', '-f', res.dest])
return adb.shell(options.serial, ['rm', '-f', res.dest])
.timeout(10000)
.then(function(out) {
return streamutil.readAll(out)
@@ -73,7 +71,7 @@ module.exports = syrup.serial()
}
function pushResource(res) {
return deviceClient.push(res.src, res.dest, res.mode)
return adb.push(options.serial, res.src, res.dest, res.mode)
.timeout(10000)
.then(function(transfer) {
return new Promise(function(resolve, reject) {
@@ -88,7 +86,7 @@ module.exports = syrup.serial()
log.info('Installing "%s" as "%s"', res.src, res.dest)
function checkExecutable(res) {
return deviceClient.stat(res.dest)
return adb.stat(options.serial, res.dest)
.timeout(5000)
.then(function(stats) {
// Can't use fs.constants.S_IXUSR due to differences on Windows.
@@ -138,7 +136,7 @@ module.exports = syrup.serial()
bin: resources.bin.dest
, lib: resources.lib.dest
, run: function(cmd) {
return deviceClient.shell(util.format(
return adb.shell(options.serial, util.format(
'LD_LIBRARY_PATH=%s exec %s %s'
, path.dirname(resources.lib.dest)
, resources.bin.dest

View File

@@ -9,14 +9,12 @@ var pathutil = require('../../../util/pathutil')
var devutil = require('../../../util/devutil')
var streamutil = require('../../../util/streamutil')
var Resource = require('./util/resource')
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
module.exports = syrup.serial()
.dependency(require('../support/adb'))
.dependency(require('../support/properties'))
.dependency(require('../support/abi'))
.define(function(options, adb, properties, abi) {
var deviceClient = new DeviceClient(adb, options.serial)
var log = logger.createLogger('device:resources:minirev')
var resources = {
@@ -38,7 +36,7 @@ module.exports = syrup.serial()
}
function removeResource(res) {
return deviceClient.shell(['rm', '-f', res.dest])
return adb.shell(options.serial, ['rm', '-f', res.dest])
.timeout(10000)
.then(function(out) {
return streamutil.readAll(out)
@@ -47,7 +45,7 @@ module.exports = syrup.serial()
}
function pushResource(res) {
return deviceClient.push(res.src, res.dest, res.mode)
return adb.push(options.serial, res.src, res.dest, res.mode)
.timeout(10000)
.then(function(transfer) {
return new Promise(function(resolve, reject) {
@@ -62,7 +60,7 @@ module.exports = syrup.serial()
log.info('Installing "%s" as "%s"', res.src, res.dest)
function checkExecutable(res) {
return deviceClient.stat(res.dest)
return adb.stat(options.serial, res.dest)
.timeout(5000)
.then(function(stats) {
// Can't use fs.constants.S_IXUSR due to differences on Windows.

View File

@@ -9,13 +9,11 @@ var pathutil = require('../../../util/pathutil')
var devutil = require('../../../util/devutil')
var streamutil = require('../../../util/streamutil')
var Resource = require('./util/resource')
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
module.exports = syrup.serial()
.dependency(require('../support/adb'))
.dependency(require('../support/abi'))
.define(function(options, adb, abi) {
var deviceClient = new DeviceClient(adb, options.serial)
var log = logger.createLogger('device:resources:minitouch')
var resources = {
@@ -37,7 +35,7 @@ module.exports = syrup.serial()
}
function removeResource(res) {
return deviceClient.shell(['rm', '-f', res.dest])
return adb.shell(options.serial, ['rm', '-f', res.dest])
.timeout(10000)
.then(function(out) {
return streamutil.readAll(out)
@@ -46,7 +44,7 @@ module.exports = syrup.serial()
}
function pushResource(res) {
return deviceClient.push(res.src, res.dest, res.mode)
return adb.push(options.serial, res.src, res.dest, res.mode)
.timeout(10000)
.then(function(transfer) {
return new Promise(function(resolve, reject) {
@@ -61,7 +59,7 @@ module.exports = syrup.serial()
log.info('Installing "%s" as "%s"', res.src, res.dest)
function checkExecutable(res) {
return deviceClient.stat(res.dest)
return adb.stat(options.serial, res.dest)
.timeout(5000)
.then(function(stats) {
// Can't use fs.constants.S_IXUSR due to differences on Windows.
@@ -109,7 +107,7 @@ module.exports = syrup.serial()
return {
bin: resources.bin.dest
, run: function(cmd) {
return deviceClient.shell(util.format(
return adb.shell(options.serial, util.format(
'exec %s%s'
, resources.bin.dest
, cmd ? util.format(' %s', cmd) : ''

View File

@@ -1,6 +1,5 @@
var util = require('util')
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
var syrup = require('@devicefarmer/stf-syrup')
var ProtoBuf = require('protobufjs')
var semver = require('semver')
@@ -13,7 +12,6 @@ var logger = require('../../../util/logger')
module.exports = syrup.serial()
.dependency(require('../support/adb'))
.define(function(options, adb) {
var deviceClient = new DeviceClient(adb, options.serial)
var log = logger.createLogger('device:resources:service')
var builder = ProtoBuf.loadProtoFile(
pathutil.vendor('STFService/wire.proto'))
@@ -32,7 +30,7 @@ module.exports = syrup.serial()
}
function getPath() {
return deviceClient.shell(['pm', 'path', resource.pkg])
return adb.shell(options.serial, ['pm', 'path', resource.pkg])
.timeout(10000)
.then(function(out) {
return streamutil.findLine(out, (/^package:/))
@@ -48,7 +46,7 @@ module.exports = syrup.serial()
return getPath()
.then(function(installedPath) {
log.info('Running version check')
return deviceClient.shell(util.format(
return adb.shell(options.serial, util.format(
"export CLASSPATH='%s';" +
" exec app_process /system/bin '%s' --version 2>/dev/null"
, installedPath
@@ -76,11 +74,11 @@ module.exports = syrup.serial()
log.info('Installing STFService')
// Uninstall first to make sure we don't have any certificate
// issues.
return deviceClient.uninstall(resource.pkg)
return adb.uninstall(options.serial, resource.pkg)
.timeout(15000)
.then(function() {
return promiseutil.periodicNotify(
deviceClient.install(resource.apk)
adb.install(options.serial, resource.apk)
, 20000
)
.timeout(65000)