Skip to content

Commit

Permalink
fix adb cmd on driller
Browse files Browse the repository at this point in the history
den4uk committed Nov 14, 2020
1 parent 213adee commit b51f338
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions andriller/driller.py
Original file line number Diff line number Diff line change
@@ -75,10 +75,10 @@ def InitialAdbRead(self):

def get_permission():
self.su = False
if self.ROOT in self.adb_out('id'):
if self.ROOT in self.adb.adb_out('id'):
self.permisson = self.ROOT
return self.permisson
if self.ROOT in self.adb_out('id', su=True):
if self.ROOT in self.adb.adb_out('id', su=True):
self.permisson = self.ROOTSU
self.su = True
else:
@@ -107,7 +107,7 @@ def get_accounts(dump):

# Build Props
with suppress(TimeoutError):
build_prop = self.adb_out('cat /system/build.prop', su=self.su, timeout=5)
build_prop = self.adb.adb_out('cat /system/build.prop', su=self.su, timeout=5)
if build_prop:
build_prop = build_prop.split('\n')
props = [
@@ -120,20 +120,20 @@ def get_accounts(dump):

# WIFI
with suppress(TimeoutError):
_wifi = self.adb_out('dumpsys wifi', timeout=5)
_wifi = self.adb.adb_out('dumpsys wifi', timeout=5)
if _wifi:
self.REPORT['wifi mac'] = get_wifi(_wifi.split('\n'))

# IMEI
with suppress(TimeoutError):
_usbinfo = self.adb_out('dumpsys iphonesubinfo', timeout=5)
_usbinfo = self.adb.adb_out('dumpsys iphonesubinfo', timeout=5)
if _usbinfo:
self.REPORT['imei'] = get_prop(_usbinfo.split('\n'), 'Device ID')

# IMEI for Android v6+
# with suppress(TimeoutError):
# rex = re.compile(b' ([0-9a-f]{8})')
# _data = self.adb_out('service call iphonesubinfo 1', timeout=2)
# _data = self.adb.adb_out('service call iphonesubinfo 1', timeout=2)
# if _data and len(_data) > 9:
# plen = int(b''.join(_data[:2]), 16)

@@ -147,7 +147,7 @@ def get_accounts(dump):
# SIM Card
with suppress(TimeoutError, Exception):
if self.adb.exists('/data/system/SimCard.dat'):
_simdat = self.adb_out('cat /data/system/SimCard.dat', su=self.su, timeout=5)
_simdat = self.adb.adb_out('cat /data/system/SimCard.dat', su=self.su, timeout=5)
sims = [
'CurrentSimSerialNumber',
'CurrentSimPhoneNumber',
@@ -161,7 +161,7 @@ def get_accounts(dump):

# Accounts
with suppress(TimeoutError):
_acc = self.adb_out('dumpsys account', timeout=5)
_acc = self.adb.adb_out('dumpsys account', timeout=5)
self.REPORT['accounts'] = get_accounts(_acc)

@staticmethod

0 comments on commit b51f338

Please sign in to comment.