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

cv mode issue #156

Closed Trac91iu closed 9 months ago

Trac91iu commented 9 months ago

Hi there, I have problems using the -cv mode for all my apps. Here are the logs:

INFO:androguard.apk:Starting analysis on AndroidManifest.xml INFO:androguard.apk:APK file was successfully validated! WARNING:androguard.core.api_specific_resources:Requested API level 33 is larger than maximum we have, returning API level 28 instead. INFO:DroidBot:Starting DroidBot INFO:Device:waiting for device ls: 2>/dev/null: No such file or directory mkdir: '/data/local/tmp/minicap-devel': File exists 54619 PID: 20658 INFO: Using projection 1080x2400@1080x2400/0 INFO: (external/MY_minicap/src/minicap_30.cpp:243) Creating SurfaceComposerClient INFO: (external/MY_minicap/src/minicap_30.cpp:246) Performing SurfaceComposerClient init check INFO: (external/MY_minicap/src/minicap_30.cpp:257) Creating virtual display INFO: (external/MY_minicap/src/minicap_30.cpp:263) Creating buffer queue INFO: (external/MY_minicap/src/minicap_30.cpp:266) Setting buffer options INFO: (external/MY_minicap/src/minicap_30.cpp:270) Creating CPU consumer INFO: (external/MY_minicap/src/minicap_30.cpp:274) Creating frame waiter INFO: (external/MY_minicap/src/minicap_30.cpp:278) Publishing virtual display INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 7835652 bytes for JPG encoder 54620 INFO: (jni/minicap/minicap.cpp:448) New client connection [CONNECTION] ADB is enabled and connected. [CONNECTION] TelnetConsole is not enabled. [CONNECTION] DroidBotAppConn is enabled and connected. [CONNECTION] Minicap is enabled and connected. [CONNECTION] Logcat is enabled and connected. [CONNECTION] UserInputMonitor is enabled and connected. [CONNECTION] ProcessMonitor is enabled and connected. [CONNECTION] DroidBotIme is enabled and connected. INFO:Device:App installed: com.xiaomi.smarthome INFO:Device:Main activity: com.xiaomi.smarthome.SmartHomeMainActivity INFO:AppEnvManager:Start deploying environment, policy is none INFO:InputEventManager:start sending events, policy is bfs_greedy INFO:Device:CV mode WARNING:Device:exception in get_current_state: 'NoneType' object is not iterable Traceback (most recent call last): File "/Users/tracy/Documents/GitHub/droidbot/device.py", line 809, in get_current_state views = self.get_views() File "/Users/tracy/Documents/GitHub/droidbot/device.py", line 877, in get_views views = self.minicap.get_views() File "/Users/tracy/Documents/GitHub/droidbot/adapter/minicap.py", line 333, in get_views for x,y,w,h in view_bounds: TypeError: 'NoneType' object is not iterable WARNING:Device:Failed to get current state! INFO:Device:CV mode WARNING:Device:exception in get_current_state: 'NoneType' object is not iterable Traceback (most recent call last): File "/Users/tracy/Documents/GitHub/droidbot/device.py", line 809, in get_current_state views = self.get_views() File "/Users/tracy/Documents/GitHub/droidbot/device.py", line 877, in get_views views = self.minicap.get_views() File "/Users/tracy/Documents/GitHub/droidbot/adapter/minicap.py", line 333, in get_views for x,y,w,h in view_bounds: TypeError: 'NoneType' object is not iterable WARNING:Device:Failed to get current state! WARNING:UtgGreedySearchPolicy:exception during sending events: 'NoneType' object has no attribute 'state_str' Traceback (most recent call last): File "/Users/tracy/Documents/GitHub/droidbot-confiot/droidbot/input_policy.py", line 79, in start_to_activity event_str = event.get_event_str(self.device.get_current_state()) File "/Users/tracy/Documents/GitHub/droidbot-confiot/droidbot/input_event.py", line 403, 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' INFO:Device:CV mode WARNING:Device:exception in get_current_state: 'NoneType' object is not iterable Traceback (most recent call last): File "/Users/tracy/Documents/GitHub/droidbot/device.py", line 809, in get_current_state views = self.get_views() File "/Users/tracy/Documents/GitHub/droidbot/device.py", line 877, in get_views views = self.minicap.get_views() File "/Users/tracy/Documents/GitHub/droidbot/adapter/minicap.py", line 333, in get_views for x,y,w,h in view_bounds: TypeError: 'NoneType' object is not iterable WARNING:Device:Failed to get current state!

I have no idea why it can not get current state.

Trac91iu commented 9 months ago

I delete the return value by mistake. I have no problem now.