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

@@ -3,7 +3,6 @@ var events = require('events')
var syrup = require('@devicefarmer/stf-syrup')
var Promise = require('bluebird')
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
var wire = require('../../../wire')
var wireutil = require('../../../wire/util')
@@ -37,7 +36,6 @@ module.exports = syrup.serial()
.dependency(require('../support/sdk'))
.dependency(require('../resources/service'))
.define(function(options, adb, router, push, sdk, apk) {
var deviceClient = new DeviceClient(adb, options.serial)
var log = logger.createLogger('device:plugins:service')
var messageResolver = new MessageResolver()
var plugin = new events.EventEmitter()
@@ -67,7 +65,7 @@ module.exports = syrup.serial()
function callService(intent) {
var startServiceCmd = (sdk.level < 26) ? 'startservice' : 'start-foreground-service'
log.info('using \'%s\' command for API %s', startServiceCmd, sdk.level)
return deviceClient.shell(util.format(
return adb.shell(options.serial, util.format(
'am %s --user 0 %s'
, startServiceCmd, intent
))
@@ -80,7 +78,7 @@ module.exports = syrup.serial()
.timeout(10000)
.then(function(line) {
if (line.indexOf('--user') !== -1) {
return deviceClient.shell(util.format(
return adb.shell(options.serial, util.format(
'am %s %s'
, startServiceCmd, intent
))
@@ -279,7 +277,7 @@ module.exports = syrup.serial()
.timeout(10000)
})
.then(function() {
return deviceClient.shell(util.format(
return adb.shell(options.serial, util.format(
"export CLASSPATH='%s'; exec app_process /system/bin '%s'"
, apk.path
, apk.main