Skip to content

Commit

Permalink
Merge pull request #16 from cb1kenobi/timob-25160
Browse files Browse the repository at this point in the history
[TIMOB-25160] Updated adb devices call to parse device info from 'get…
  • Loading branch information
feons committed Aug 17, 2017
2 parents dc413ec + 6128e2f commit cc43aa0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions lib/adb.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @module adb
*
* @copyright
* Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved.
* Copyright (c) 2009-2017 by Appcelerator, Inc. All Rights Reserved.
*
* @license
* Licensed under the terms of the Apache Public License
Expand Down Expand Up @@ -370,14 +370,16 @@ function parseDevices(adb, callback, err, data) {
return;
}

adb.shell(info.id, 'cat /system/build.prop', function (err, data) {
adb.shell(info.id, 'getprop', function (err, data) {
if (!err && data) {
const re = /^\[([^\]]*)\]: \[(.*)\]\s*$/;
data.toString().split('\n').forEach(function (line) {
var p = line.indexOf('='),
key, value;
if (p != -1) {
value = line.substring(p + 1).trim();
switch (key = line.substring(0, p)) {
const m = line.match(re);
if (m) {
const key = m[1];
const value = m[2];

switch (key) {
case 'ro.product.model.internal':
info.modelnumber = value;
break;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"titanium",
"mobile"
],
"version": "0.4.2",
"version": "0.4.3",
"author": {
"name": "Appcelerator, Inc.",
"email": "info@appcelerator.com"
Expand Down

0 comments on commit cc43aa0

Please sign in to comment.