-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadb_get_data.py
43 lines (27 loc) · 961 Bytes
/
adb_get_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/python3
from adb_base import *
def adb_get_devices():
(stdout, stderr), p = adb_exec(["devices"])
l1 = str(stdout).split('\\n')[1:]
l = []
for e in l1:
if e != "'" and len(e) != 0:
l = l + [e]
for i in range(len(l)):
l[i] = l[i].split('\\t')[0]
return l
def adb_get_name(dev):
return "%s %s" % (adb_get_prop(dev, "ro.product.brand"),
adb_get_prop(dev, "ro.product.model"))
def adb_get_abis(dev):
return adb_get_prop(dev, "ro.product.cpu.abilist").split(',')
def adb_get_sdkver(dev):
return int(adb_get_prop(dev, "ro.build.version.sdk"))
def adb_get_sdkrel(dev):
return adb_get_prop(dev, "ro.build.version.release")
def adb_get_board(dev):
return adb_get_prop(dev, "ro.board.platform")
def adb_get_platform(dev):
return adb_get_prop(dev, "ro.boot.hardware")
def adb_get_product_name(dev):
return adb_get_prop(dev, "ro.product.name")