Skip to content

Commit

Permalink
android: fix tests for amd64 emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Dec 12, 2023
1 parent 8baa27e commit 8ec0925
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pwnlib/adb/adb.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
from pwnlib.context import LocalContext
from pwnlib.context import context
from pwnlib.device import Device
from pwnlib.exception import PwnlibException
from pwnlib.log import getLogger
from pwnlib.protocols.adb import AdbClient
from pwnlib.util.packing import _decode
Expand Down Expand Up @@ -122,7 +123,7 @@ def current_device(any=False):
>>> device = adb.current_device(any=True)
>>> device # doctest: +ELLIPSIS
AdbDevice(serial='emulator-5554', type='device', port='emulator', product='sdk_...phone_armv7', model='sdk ...phone armv7', device='generic')
AdbDevice(serial='emulator-5554', type='device', port='emulator', product='sdk_...phone_...', model='...', device='generic...')
>>> device.port
'emulator'
"""
Expand Down Expand Up @@ -252,13 +253,13 @@ class AdbDevice(Device):
>>> device = adb.wait_for_device()
>>> device.arch
'arm'
'amd64'
>>> device.bits
32
64
>>> device.os
'android'
>>> device.product # doctest: +ELLIPSIS
'sdk_...phone_armv7'
'sdk_...phone_...'
>>> device.serial
'emulator-5554'
"""
Expand Down Expand Up @@ -1364,7 +1365,7 @@ def compile(source):
>>> filename = adb.compile(temp)
>>> sent = adb.push(filename, "/data/local/tmp")
>>> adb.process(sent).recvall() # doctest: +ELLIPSIS
b'... /system/bin/linker\n...'
b'... /system/lib64/libc.so\n...'
"""

ndk_build = misc.which('ndk-build')
Expand Down Expand Up @@ -1491,7 +1492,7 @@ class Partitions(object):
def by_name_dir(self):
try:
return next(find('/dev/block/platform','by-name'))
except StopIteration:
except (StopIteration, PwnlibException):
return '/dev/block'

@context.quietfunc
Expand Down

0 comments on commit 8ec0925

Please sign in to comment.