mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Nexus 9 support. Home button doesn't work, presumably due to auto-unlocking.
This commit is contained in:
parent
28adf6fd96
commit
6b5ecf3afb
7 changed files with 77 additions and 11 deletions
|
@ -11,26 +11,31 @@ var streamutil = require('../../../util/streamutil')
|
||||||
module.exports = syrup.serial()
|
module.exports = syrup.serial()
|
||||||
.dependency(require('../support/adb'))
|
.dependency(require('../support/adb'))
|
||||||
.dependency(require('../support/properties'))
|
.dependency(require('../support/properties'))
|
||||||
.define(function(options, adb, properties) {
|
.dependency(require('../support/abi'))
|
||||||
|
.define(function(options, adb, properties, abi) {
|
||||||
var log = logger.createLogger('device:resources:remote')
|
var log = logger.createLogger('device:resources:remote')
|
||||||
|
|
||||||
var resources = {
|
var resources = {
|
||||||
bin: {
|
bin: {
|
||||||
src: pathutil.vendor(util.format(
|
src: pathutil.requiredMatch(abi.b32.map(function(supportedAbi) {
|
||||||
'remote/libs/%s/remote%s'
|
return pathutil.vendor(util.format(
|
||||||
, properties['ro.product.cpu.abi']
|
'remote/libs/%s/remote%s'
|
||||||
, properties['ro.build.version.sdk'] < 16 ? '-nopie' : ''
|
, supportedAbi
|
||||||
))
|
, abi.pie ? '' : '-nopie'
|
||||||
|
))
|
||||||
|
}))
|
||||||
, dest: '/data/local/tmp/remote'
|
, dest: '/data/local/tmp/remote'
|
||||||
, comm: 'remote'
|
, comm: 'remote'
|
||||||
, mode: 0755
|
, mode: 0755
|
||||||
}
|
}
|
||||||
, lib: {
|
, lib: {
|
||||||
src: pathutil.vendor(util.format(
|
src: pathutil.requiredMatch(abi.b32.map(function(supportedAbi) {
|
||||||
'remote/external/android-%d/%s/remote_external.so'
|
return pathutil.vendor(util.format(
|
||||||
, properties['ro.build.version.sdk']
|
'remote/external/android-%d/%s/remote_external.so'
|
||||||
, properties['ro.product.cpu.abi']
|
, properties['ro.build.version.sdk']
|
||||||
))
|
, supportedAbi
|
||||||
|
))
|
||||||
|
}))
|
||||||
, dest: '/data/local/tmp/remote_external.so'
|
, dest: '/data/local/tmp/remote_external.so'
|
||||||
, mode: 0755
|
, mode: 0755
|
||||||
}
|
}
|
||||||
|
|
45
lib/units/device/support/abi.js
Normal file
45
lib/units/device/support/abi.js
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
var syrup = require('stf-syrup')
|
||||||
|
var _ = require('lodash')
|
||||||
|
|
||||||
|
var logger = require('../../../util/logger')
|
||||||
|
|
||||||
|
module.exports = syrup.serial()
|
||||||
|
.dependency(require('./properties'))
|
||||||
|
.define(function(options, properties) {
|
||||||
|
var log = logger.createLogger('device:support:abi')
|
||||||
|
return (function() {
|
||||||
|
|
||||||
|
function split(list) {
|
||||||
|
return list ? list.split(',') : []
|
||||||
|
}
|
||||||
|
|
||||||
|
var abi = {
|
||||||
|
primary: properties['ro.product.cpu.abi']
|
||||||
|
, pie: properties['ro.build.version.sdk'] >= 16
|
||||||
|
, all: []
|
||||||
|
, b32: []
|
||||||
|
, b64: []
|
||||||
|
}
|
||||||
|
|
||||||
|
// Since Android 5.0
|
||||||
|
if (properties['ro.product.cpu.abilist']) {
|
||||||
|
abi.all = split(properties['ro.product.cpu.abilist'])
|
||||||
|
abi.b64 = split(properties['ro.product.cpu.abilist64'])
|
||||||
|
abi.b32 = split(properties['ro.product.cpu.abilist32'])
|
||||||
|
}
|
||||||
|
// Up to Android 4.4
|
||||||
|
else {
|
||||||
|
abi.all.push(abi.primary)
|
||||||
|
abi.b32.push(abi.primary)
|
||||||
|
if (properties['ro.product.cpu.abi2']) {
|
||||||
|
abi.all.push(properties['ro.product.cpu.abi2'])
|
||||||
|
abi.b32.push(properties['ro.product.cpu.abi2'])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info('Supports ABIs %s', abi.all.join(', '))
|
||||||
|
|
||||||
|
return abi
|
||||||
|
|
||||||
|
})()
|
||||||
|
})
|
|
@ -1,4 +1,6 @@
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
|
var fs = require('fs')
|
||||||
|
var util = require('util')
|
||||||
|
|
||||||
// Export
|
// Export
|
||||||
module.exports.root = function(target) {
|
module.exports.root = function(target) {
|
||||||
|
@ -19,3 +21,17 @@ module.exports.vendor = function(target) {
|
||||||
module.exports.module = function(target) {
|
module.exports.module = function(target) {
|
||||||
return path.resolve(__dirname, '../../node_modules', target)
|
return path.resolve(__dirname, '../../node_modules', target)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Export
|
||||||
|
module.exports.requiredMatch = function(candidates) {
|
||||||
|
for (var i = 0, l = candidates.length; i < l; ++i) {
|
||||||
|
if (fs.existsSync(candidates[i])) {
|
||||||
|
return candidates[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error(util.format(
|
||||||
|
'At least one of these paths should exist: %s'
|
||||||
|
, candidates.join(', ')
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
BIN
vendor/remote/external/android-21/arm64-v8a/remote_external.so
vendored
Executable file
BIN
vendor/remote/external/android-21/arm64-v8a/remote_external.so
vendored
Executable file
Binary file not shown.
BIN
vendor/remote/external/android-21/armeabi-v7a/remote_external.so
vendored
Executable file
BIN
vendor/remote/external/android-21/armeabi-v7a/remote_external.so
vendored
Executable file
Binary file not shown.
BIN
vendor/remote/external/android-21/x86/remote_external.so
vendored
Executable file
BIN
vendor/remote/external/android-21/x86/remote_external.so
vendored
Executable file
Binary file not shown.
BIN
vendor/remote/external/android-21/x86_64/remote_external.so
vendored
Executable file
BIN
vendor/remote/external/android-21/x86_64/remote_external.so
vendored
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue