Skip to content

Commit

Permalink
delete deprecated debug folder and fix atx error
Browse files Browse the repository at this point in the history
  • Loading branch information
pur1fying committed Jul 19, 2024
1 parent 4fccbec commit 655dfd8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 88 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

!.editorconfig
!.gitignore
!ATX.apk
!LICENSE
!README.md
!build.bat
Expand Down
29 changes: 24 additions & 5 deletions core/Baas_thread.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import shutil
from datetime import datetime
import cv2
from core.exception import ScriptError
Expand Down Expand Up @@ -286,15 +287,12 @@ def _init_emulator(self) -> bool:
try:
self.adb_port = self.config.get('adbPort')
self.logger.info("adb port: " + str(self.adb_port))

self.check_atx_agent_cache()
if not self.adb_port or self.adb_port == '0':
self.connection = u2.connect()
else:
self.connection = u2.connect(f'127.0.0.1:{self.adb_port}')
if 'com.github.uiautomator' not in self.connection.app_list():
self.connection.app_install('ATX.apk')
self.connection.uiautomator.start()
self.wait_uiautomator_start()
self.check_atx()
self.first_start_u2 = False
self.last_refresh_u2_time = time.time()
temp = self.connection.window_size()
Expand All @@ -309,6 +307,27 @@ def _init_emulator(self) -> bool:
self.logger.error("Emulator initialization failed")
return False

def check_atx_agent_cache(self):
self.logger.info("--------------Check ATX Agent Cache----------------")
dire = "C:\\Users\\pc\\.uiautomator2\\cache\\atx-agent_0.10.0_linux_386.tar.gz-1f8cdf3239"
if os.path.exists(dire + "\\atx-agent"):
return
self.logger.info("atx-agent cache [ atx-agent ] not found in path [ " + dire + " ]")
if not os.path.exists(dire):
self.logger.info("make dir [ " + dire + " ]")
os.makedirs(dire)
if not os.path.exists(dire + "\\atx-agent"):
self.logger.info("copy atx-agent to [ " + dire + " ]")
shutil.copy("src/atx_app/atx-agent", dire + "\\atx-agent")

def check_atx(self):
self.logger.info("--------------Check ATX install ----------------")
if 'com.github.uiautomator' not in self.connection.app_list():
self.logger.info("ATX not found on stimulator, install")
self.connection.app_install("src/atx_app/ATX.apk")
self.connection.uiautomator.start()
self.wait_uiautomator_start()

def send(self, msg, task=None):
if msg == "start":
if self.button_signal is not None:
Expand Down
38 changes: 0 additions & 38 deletions debug/debugger.py

This file was deleted.

41 changes: 0 additions & 41 deletions debug/templates/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def check_python():

def check_atx():
logger.info("Checking atx-agent...")
if not os.path.exists('./ATX.apk'):
if not os.path.exists('src/atx_app/ATX.apk'):
logger.info("Downloading atx-agent...")
download_file(GET_ATX_URL)

Expand Down
3 changes: 1 addition & 2 deletions module/lesson.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from core import color, picture


def implement(self):
self.quick_method_to_main_page()
self.lesson_times = self.config["lesson_times"]
Expand Down Expand Up @@ -364,5 +363,5 @@ def choose_lesson(self, res, region):
max_relationship = res[1][j]
choice = j
if choice != -1:
break
return choice
return choice
File renamed without changes.
Binary file added src/atx_app/atx-agent
Binary file not shown.

0 comments on commit 655dfd8

Please sign in to comment.