honeynet / droidbot

A lightweight test input generator for Android. Similar to Monkey, but with more intelligence and cool features!
MIT License
791 stars 230 forks source link

Fail on using -cv mode #115

Open josebeo2016 opened 4 years ago

josebeo2016 commented 4 years ago

I try to run droidbot to analyze an game apk (which written based on Unity). And I got this error:

WARNING:UtgGreedySearchPolicy:exception during sending events: 'NoneType' object has no attribute 'state_str'
Corrupt JPEG data: premature end of data segment
Traceback (most recent call last):
  File "/root/droidbot/droidbot/input_policy.py", line 69, in start
    input_manager.add_event(event)
  File "/root/droidbot/droidbot/input_manager.py", line 98, in add_event
    event_log.start()
  File "/root/droidbot/droidbot/input_event.py", line 231, in start
    self.event_str = self.event.get_event_str(self.from_state)
  File "/root/droidbot/droidbot/input_event.py", line 365, in get_event_str
    return "%s(state=%s, name=%s)" % (self.__class__.__name__, state.state_str, self.name)
AttributeError: 'NoneType' object has no attribute 'state_str'
WARNING:Device:exception in get_current_state: too many values to unpack (expected 2)
Traceback (most recent call last):
  File "/root/droidbot/droidbot/device.py", line 805, in get_current_state
    views = self.get_views()
  File "/root/droidbot/droidbot/device.py", line 870, in get_views
    views = self.minicap.get_views()
  File "/root/droidbot/droidbot/adapter/minicap.py", line 282, in get_views
    view_bounds = cv.find_views(img)
  File "/root/droidbot/droidbot/adapter/cv.py", line 74, in find_views
    contours, hierarchy = cv2.findContours(edges, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
ValueError: too many values to unpack (expected 2)
yuanchun-li commented 4 years ago

Looks like the screenshot was broken. Does the error also occur on other devices or apps?

josebeo2016 commented 4 years ago

Looks like the screenshot was broken. Does the error also occur on other devices or apps?

It's not happening on all apps, but almost game apps. I try on 2 different phones but get same error. cv_mode currently doesn't support for the emulator, does it?

kunalvasudevan commented 3 years ago

we can update Read me file that help in it .