ok-script 0.0.65__tar.gz → 0.0.67__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ok-script-0.0.65 → ok-script-0.0.67}/PKG-INFO +1 -1
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/OK.py +13 -12
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/alas/emulator_base.py +270 -270
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/alas/emulator_windows.py +544 -548
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/alas/platform_base.py +207 -207
- ok-script-0.0.67/ok/alas/platform_windows.py +52 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/alas/utils.py +1 -22
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/HwndWindow.py +55 -16
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/adb/ADBCaptureMethod.py +11 -8
- ok-script-0.0.67/ok/capture/adb/DeviceManager.py +366 -0
- ok-script-0.0.67/ok/capture/adb/StartController.py +92 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/adb/WindowsCaptureFactory.py +4 -2
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/BaseWindowsCaptureMethod.py +1 -0
- ok-script-0.0.67/ok/capture/windows/BitBltCaptureMethod.py +117 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/WindowsGraphicsCaptureMethod.py +1 -1
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/feature/FeatureSet.py +45 -32
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/feature/FindFeature.py +9 -4
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/App.py +2 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/Communicate.py +1 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/MainWindow.py +35 -10
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/debug/DebugTab.py +6 -5
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/start/SelectCaptureListView.py +12 -7
- ok-script-0.0.67/ok/gui/start/StartCard.py +85 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/start/StartTab.py +20 -37
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/TaskCard.py +2 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/util/Alert.py +9 -0
- ok-script-0.0.67/ok/gui/widget/StartLoadingDialog.py +66 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/Tab.py +1 -7
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/task/BaseTask.py +10 -5
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/task/ExecutorOperation.py +3 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/task/TaskExecutor.py +29 -21
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/task/TriggerTask.py +1 -1
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/Handler.py +8 -1
- {ok-script-0.0.65 → ok-script-0.0.67}/ok_script.egg-info/PKG-INFO +1 -1
- {ok-script-0.0.65 → ok-script-0.0.67}/ok_script.egg-info/SOURCES.txt +2 -1
- {ok-script-0.0.65 → ok-script-0.0.67}/setup.py +1 -1
- ok-script-0.0.65/ok/alas/platform_windows.py +0 -321
- ok-script-0.0.65/ok/capture/adb/DeviceManager.py +0 -320
- ok-script-0.0.65/ok/capture/windows/BitBltCaptureMethod.py +0 -97
- ok-script-0.0.65/ok/gui/start/SelectHwndWindow.py +0 -55
- ok-script-0.0.65/ok/gui/start/StartCard.py +0 -175
- {ok-script-0.0.65 → ok-script-0.0.67}/README.md +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/alas/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/BaseCaptureMethod.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/adb/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/adb/bin/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/image/ImageCaptureMethod.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/image/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/DesktopDuplicationCaptureMethod.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/d3d11.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/dump.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/utils.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/capture/windows/window.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/color/Color.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/color/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/config/Config.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/config/InfoDict.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/config/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/feature/Box.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/feature/Feature.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/feature/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/firebase/FireBaseAnalytics.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/firebase/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/MessageWindow.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/TabTitles.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/about/AboutTab.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/about/HttpTextEdit.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/about/VersionCard.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/about/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/common/OKIcon.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/common/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/common/config.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/common/style_sheet.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/debug/AspectRatioWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/debug/FrameWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/debug/InfoWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/debug/LoggerWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/debug/Screenshot.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/debug/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/i18n/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/i18n/path.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/i18n/update.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/icon/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/icon/icon.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/overlay/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/qss/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/resources.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/settings/SettingTab.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/settings/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/start/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/LabelAndDropDown.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/StartButton.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/tasks/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/util/InitWorker.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/util/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/Card.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/EmptyCard.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/StatusBar.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/TabWidget.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/gui/widget/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/interaction/ADBInteraction.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/interaction/BaseInteraction.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/interaction/DoNothingInteraction.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/interaction/Win32Interaction.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/interaction/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/logging/Logger.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/logging/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/ocr/OCR.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/ocr/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/Windows/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/delegate.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/export.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/idldsl.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/inspectable.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/roapi.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/types.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/rotypes/winstring.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/save/BlackBarProcessor.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/save/PostProcessor.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/save/SaveByInterval.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/save/SaveByKeyPress.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/save/SaveMethodBase.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/save/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/scene/FeatureScene.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/scene/Scene.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/scene/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/stats/StreamStats.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/stats/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/task/OneTimeTask.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/task/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/update/GithubMultiDownloader.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/update/Updater.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/update/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/update/gen_md5.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/exit_event.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/json.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/list.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/path.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/thread.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/win32_process.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok/util/yaml.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok_script.egg-info/requires.txt +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/ok_script.egg-info/top_level.txt +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/setup.cfg +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/tests/__init__.py +0 -0
- {ok-script-0.0.65 → ok-script-0.0.67}/tests/test_updater.py +0 -0
|
@@ -40,6 +40,7 @@ class OK:
|
|
|
40
40
|
self.init_device_manager()
|
|
41
41
|
from ok.gui.debug.Screenshot import Screenshot
|
|
42
42
|
self.screenshot = Screenshot(self.exit_event)
|
|
43
|
+
self.do_init()
|
|
43
44
|
if config.get("use_gui"):
|
|
44
45
|
from ok.gui.App import App
|
|
45
46
|
self.app = App(config, self.exit_event)
|
|
@@ -47,7 +48,6 @@ class OK:
|
|
|
47
48
|
else:
|
|
48
49
|
self.device_manager.set_preferred_device()
|
|
49
50
|
self.device_manager.start()
|
|
50
|
-
self.do_init()
|
|
51
51
|
except Exception as e:
|
|
52
52
|
logger.error(f'__init__ error', e)
|
|
53
53
|
self.quit()
|
|
@@ -56,8 +56,7 @@ class OK:
|
|
|
56
56
|
def start(self):
|
|
57
57
|
try:
|
|
58
58
|
if self.config.get("use_gui"):
|
|
59
|
-
|
|
60
|
-
self.app.show_main_window()
|
|
59
|
+
self.app.show_main_window()
|
|
61
60
|
self.app.exec()
|
|
62
61
|
else:
|
|
63
62
|
self.task_executor.start()
|
|
@@ -100,13 +99,16 @@ class OK:
|
|
|
100
99
|
inference_num_threads = self.config.get('ocr').get('inference_num_threads', -1)
|
|
101
100
|
self.ocr = RapidOCR(inference_num_threads=inference_num_threads)
|
|
102
101
|
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
template_matching = self.config.get('template_matching')
|
|
103
|
+
if template_matching is not None:
|
|
104
|
+
coco_feature_folder = self.config.get('template_matching').get('coco_feature_folder')
|
|
105
105
|
from ok.feature.FeatureSet import FeatureSet
|
|
106
106
|
self.feature_set = FeatureSet(coco_feature_folder,
|
|
107
|
-
default_horizontal_variance=
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
default_horizontal_variance=template_matching.get(
|
|
108
|
+
'default_horizontal_variance', 0),
|
|
109
|
+
default_vertical_variance=template_matching.get('default_vertical_variance',
|
|
110
|
+
0),
|
|
111
|
+
default_threshold=template_matching.get('default_threshold', 0))
|
|
110
112
|
|
|
111
113
|
from ok.task.TaskExecutor import TaskExecutor
|
|
112
114
|
self.task_executor = TaskExecutor(self.device_manager, exit_event=self.exit_event,
|
|
@@ -116,8 +118,7 @@ class OK:
|
|
|
116
118
|
feature_set=self.feature_set,
|
|
117
119
|
ocr=self.ocr, config_folder=self.config.get("config_folder"))
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
ok.gui.executor = self.task_executor
|
|
121
|
+
ok.gui.executor = self.task_executor
|
|
121
122
|
|
|
122
123
|
return True
|
|
123
124
|
|
|
@@ -135,8 +136,8 @@ class OK:
|
|
|
135
136
|
if self.device_manager is None:
|
|
136
137
|
from ok.capture.adb.DeviceManager import DeviceManager
|
|
137
138
|
self.device_manager = DeviceManager(self.config.get("config_folder") or "config",
|
|
138
|
-
self.config.get('
|
|
139
|
-
self.config.get('
|
|
139
|
+
self.config.get('windows'),
|
|
140
|
+
self.config.get('adb'),
|
|
140
141
|
self.config.get("debug"),
|
|
141
142
|
self.exit_event)
|
|
142
143
|
ok.gui.device_manager = self.device_manager
|
|
@@ -1,270 +1,270 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import re
|
|
3
|
-
import typing as t
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
from ok.alas.utils import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def abspath(path):
|
|
10
|
-
return os.path.abspath(path)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def get_serial_pair(serial):
|
|
14
|
-
"""
|
|
15
|
-
Args:
|
|
16
|
-
serial (str):
|
|
17
|
-
|
|
18
|
-
Returns:
|
|
19
|
-
str, str: `127.0.0.1:5555+{X}` and `emulator-5554+{X}`, 0 <= X <= 32
|
|
20
|
-
"""
|
|
21
|
-
if serial.startswith('127.0.0.1:'):
|
|
22
|
-
try:
|
|
23
|
-
port = int(serial[10:])
|
|
24
|
-
if 5555 <= port <= 5555 + 32:
|
|
25
|
-
return f'127.0.0.1:{port}', f'emulator-{port - 1}'
|
|
26
|
-
except (ValueError, IndexError):
|
|
27
|
-
pass
|
|
28
|
-
if serial.startswith('emulator-'):
|
|
29
|
-
try:
|
|
30
|
-
port = int(serial[9:])
|
|
31
|
-
if 5554 <= port <= 5554 + 32:
|
|
32
|
-
return f'127.0.0.1:{port + 1}', f'emulator-{port}'
|
|
33
|
-
except (ValueError, IndexError):
|
|
34
|
-
pass
|
|
35
|
-
|
|
36
|
-
return None, None
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def remove_duplicated_path(paths):
|
|
40
|
-
"""
|
|
41
|
-
Args:
|
|
42
|
-
paths (list[str]):
|
|
43
|
-
|
|
44
|
-
Returns:
|
|
45
|
-
list[str]:
|
|
46
|
-
"""
|
|
47
|
-
paths = sorted(set(paths))
|
|
48
|
-
dic = {}
|
|
49
|
-
for path in paths:
|
|
50
|
-
dic.setdefault(path.lower(), path)
|
|
51
|
-
return list(dic.values())
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
@dataclass
|
|
55
|
-
class EmulatorInstanceBase:
|
|
56
|
-
# Serial for adb connection
|
|
57
|
-
serial: str
|
|
58
|
-
# Emulator instance name, used for start/stop emulator
|
|
59
|
-
name: str
|
|
60
|
-
# Path to emulator .exe
|
|
61
|
-
path: str
|
|
62
|
-
|
|
63
|
-
def __str__(self):
|
|
64
|
-
return f'{self.type}(serial="{self.serial}", name="{self.name}", path="{self.path}")'
|
|
65
|
-
|
|
66
|
-
@
|
|
67
|
-
def type(self) -> str:
|
|
68
|
-
"""
|
|
69
|
-
Returns:
|
|
70
|
-
str: Emulator type, such as Emulator.NoxPlayer
|
|
71
|
-
"""
|
|
72
|
-
return self.emulator.type
|
|
73
|
-
|
|
74
|
-
@
|
|
75
|
-
def emulator(self):
|
|
76
|
-
"""
|
|
77
|
-
Returns:
|
|
78
|
-
Emulator:
|
|
79
|
-
"""
|
|
80
|
-
return EmulatorBase(self.path)
|
|
81
|
-
|
|
82
|
-
def __eq__(self, other):
|
|
83
|
-
if isinstance(other, str) and self.type == other:
|
|
84
|
-
return True
|
|
85
|
-
if isinstance(other, list) and self.type in other:
|
|
86
|
-
return True
|
|
87
|
-
if isinstance(other, EmulatorInstanceBase):
|
|
88
|
-
return super().__eq__(other) and self.type == other.type
|
|
89
|
-
return super().__eq__(other)
|
|
90
|
-
|
|
91
|
-
def __hash__(self):
|
|
92
|
-
return hash(str(self))
|
|
93
|
-
|
|
94
|
-
def __bool__(self):
|
|
95
|
-
return True
|
|
96
|
-
|
|
97
|
-
@
|
|
98
|
-
def MuMuPlayer12_id(self):
|
|
99
|
-
"""
|
|
100
|
-
Convert MuMu 12 instance name to instance id.
|
|
101
|
-
Example names:
|
|
102
|
-
MuMuPlayer-12.0-3
|
|
103
|
-
YXArkNights-12.0-1
|
|
104
|
-
|
|
105
|
-
Returns:
|
|
106
|
-
int: Instance ID, or None if this is not a MuMu 12 instance
|
|
107
|
-
"""
|
|
108
|
-
res = re.search(r'MuMuPlayer(?:Global)?-12.0-(\d+)', self.name)
|
|
109
|
-
if res:
|
|
110
|
-
return int(res.group(1))
|
|
111
|
-
res = re.search(r'YXArkNights-12.0-(\d+)', self.name)
|
|
112
|
-
if res:
|
|
113
|
-
return int(res.group(1))
|
|
114
|
-
|
|
115
|
-
return None
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class EmulatorBase:
|
|
119
|
-
# Values here must match those in argument.yaml EmulatorInfo.Emulator.option
|
|
120
|
-
NoxPlayer = 'NoxPlayer'
|
|
121
|
-
NoxPlayer64 = 'NoxPlayer64'
|
|
122
|
-
NoxPlayerFamily = [NoxPlayer, NoxPlayer64]
|
|
123
|
-
BlueStacks4 = 'BlueStacks4'
|
|
124
|
-
BlueStacks5 = 'BlueStacks5'
|
|
125
|
-
BlueStacks4HyperV = 'BlueStacks4HyperV'
|
|
126
|
-
BlueStacks5HyperV = 'BlueStacks5HyperV'
|
|
127
|
-
BlueStacksFamily = [BlueStacks4, BlueStacks5]
|
|
128
|
-
LDPlayer3 = 'LDPlayer3'
|
|
129
|
-
LDPlayer4 = 'LDPlayer4'
|
|
130
|
-
LDPlayer9 = 'LDPlayer9'
|
|
131
|
-
LDPlayerFamily = [LDPlayer3, LDPlayer4, LDPlayer9]
|
|
132
|
-
MuMuPlayer = 'MuMuPlayer'
|
|
133
|
-
MuMuPlayerX = 'MuMuPlayerX'
|
|
134
|
-
MuMuPlayer12 = 'MuMuPlayer12'
|
|
135
|
-
MuMuPlayerFamily = [MuMuPlayer, MuMuPlayerX, MuMuPlayer12]
|
|
136
|
-
MEmuPlayer = 'MEmuPlayer'
|
|
137
|
-
|
|
138
|
-
@classmethod
|
|
139
|
-
def path_to_type(cls, path: str) -> str:
|
|
140
|
-
"""
|
|
141
|
-
Args:
|
|
142
|
-
path: Path to .exe file
|
|
143
|
-
|
|
144
|
-
Returns:
|
|
145
|
-
str: Emulator type, such as Emulator.NoxPlayer,
|
|
146
|
-
or '' if this is not a emulator.
|
|
147
|
-
"""
|
|
148
|
-
return ''
|
|
149
|
-
|
|
150
|
-
def iter_instances(self) -> t.Iterable[EmulatorInstanceBase]:
|
|
151
|
-
"""
|
|
152
|
-
Yields:
|
|
153
|
-
EmulatorInstance: Emulator instances found in this emulator
|
|
154
|
-
"""
|
|
155
|
-
pass
|
|
156
|
-
|
|
157
|
-
def iter_adb_binaries(self) -> t.Iterable[str]:
|
|
158
|
-
"""
|
|
159
|
-
Yields:
|
|
160
|
-
str: Filepath to adb binaries found in this emulator
|
|
161
|
-
"""
|
|
162
|
-
pass
|
|
163
|
-
|
|
164
|
-
def __init__(self, path):
|
|
165
|
-
# Path to .exe file
|
|
166
|
-
self.path = path
|
|
167
|
-
# Path to emulator folder
|
|
168
|
-
self.dir = os.path.dirname(path)
|
|
169
|
-
# str: Emulator type, or '' if this is not a emulator.
|
|
170
|
-
self.type = self.__class__.path_to_type(path)
|
|
171
|
-
|
|
172
|
-
def __eq__(self, other):
|
|
173
|
-
if isinstance(other, str) and self.type == other:
|
|
174
|
-
return True
|
|
175
|
-
if isinstance(other, list) and self.type in other:
|
|
176
|
-
return True
|
|
177
|
-
return super().__eq__(other)
|
|
178
|
-
|
|
179
|
-
def __str__(self):
|
|
180
|
-
return f'{self.type}(path="{self.path}")'
|
|
181
|
-
|
|
182
|
-
__repr__ = __str__
|
|
183
|
-
|
|
184
|
-
def __hash__(self):
|
|
185
|
-
return hash(self.path)
|
|
186
|
-
|
|
187
|
-
def __bool__(self):
|
|
188
|
-
return True
|
|
189
|
-
|
|
190
|
-
def abspath(self, path, folder=None):
|
|
191
|
-
if folder is None:
|
|
192
|
-
folder = self.dir
|
|
193
|
-
return abspath(os.path.join(folder, path))
|
|
194
|
-
|
|
195
|
-
@classmethod
|
|
196
|
-
def is_emulator(cls, path: str) -> bool:
|
|
197
|
-
"""
|
|
198
|
-
Args:
|
|
199
|
-
path: Path to .exe file.
|
|
200
|
-
|
|
201
|
-
Returns:
|
|
202
|
-
bool: If this is a emulator.
|
|
203
|
-
"""
|
|
204
|
-
return bool(cls.path_to_type(path))
|
|
205
|
-
|
|
206
|
-
def list_folder(self, folder, is_dir=False, ext=None):
|
|
207
|
-
"""
|
|
208
|
-
Safely list files in a folder
|
|
209
|
-
|
|
210
|
-
Args:
|
|
211
|
-
folder:
|
|
212
|
-
is_dir:
|
|
213
|
-
ext:
|
|
214
|
-
|
|
215
|
-
Returns:
|
|
216
|
-
list[str]:
|
|
217
|
-
"""
|
|
218
|
-
folder = self.abspath(folder)
|
|
219
|
-
return list(iter_folder(folder, is_dir=is_dir, ext=ext))
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
class EmulatorManagerBase:
|
|
223
|
-
@staticmethod
|
|
224
|
-
def iter_running_emulator():
|
|
225
|
-
"""
|
|
226
|
-
Yields:
|
|
227
|
-
str: Path to emulator executables, may contains duplicate values
|
|
228
|
-
"""
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
@
|
|
232
|
-
def all_emulators(self) -> t.List[EmulatorBase]:
|
|
233
|
-
"""
|
|
234
|
-
Get all emulators installed on current computer.
|
|
235
|
-
"""
|
|
236
|
-
return []
|
|
237
|
-
|
|
238
|
-
@
|
|
239
|
-
def all_emulator_instances(self) -> t.List[EmulatorInstanceBase]:
|
|
240
|
-
"""
|
|
241
|
-
Get all emulator instances installed on current computer.
|
|
242
|
-
"""
|
|
243
|
-
return []
|
|
244
|
-
|
|
245
|
-
@
|
|
246
|
-
def all_emulator_serials(self) -> t.List[str]:
|
|
247
|
-
"""
|
|
248
|
-
Returns:
|
|
249
|
-
list[str]: All possible serials on current computer.
|
|
250
|
-
"""
|
|
251
|
-
out = []
|
|
252
|
-
for emulator in self.all_emulator_instances:
|
|
253
|
-
out.append(emulator.serial)
|
|
254
|
-
# Also add serial like `emulator-5554`
|
|
255
|
-
port_serial, emu_serial = get_serial_pair(emulator.serial)
|
|
256
|
-
if emu_serial:
|
|
257
|
-
out.append(emu_serial)
|
|
258
|
-
return out
|
|
259
|
-
|
|
260
|
-
@
|
|
261
|
-
def all_adb_binaries(self) -> t.List[str]:
|
|
262
|
-
"""
|
|
263
|
-
Returns:
|
|
264
|
-
list[str]: All adb binaries of emulators on current computer.
|
|
265
|
-
"""
|
|
266
|
-
out = []
|
|
267
|
-
for emulator in self.all_emulators:
|
|
268
|
-
for exe in emulator.iter_adb_binaries():
|
|
269
|
-
out.append(exe)
|
|
270
|
-
return out
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
import typing as t
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
from ok.alas.utils import iter_folder
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def abspath(path):
|
|
10
|
+
return os.path.abspath(path)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_serial_pair(serial):
|
|
14
|
+
"""
|
|
15
|
+
Args:
|
|
16
|
+
serial (str):
|
|
17
|
+
|
|
18
|
+
Returns:
|
|
19
|
+
str, str: `127.0.0.1:5555+{X}` and `emulator-5554+{X}`, 0 <= X <= 32
|
|
20
|
+
"""
|
|
21
|
+
if serial.startswith('127.0.0.1:'):
|
|
22
|
+
try:
|
|
23
|
+
port = int(serial[10:])
|
|
24
|
+
if 5555 <= port <= 5555 + 32:
|
|
25
|
+
return f'127.0.0.1:{port}', f'emulator-{port - 1}'
|
|
26
|
+
except (ValueError, IndexError):
|
|
27
|
+
pass
|
|
28
|
+
if serial.startswith('emulator-'):
|
|
29
|
+
try:
|
|
30
|
+
port = int(serial[9:])
|
|
31
|
+
if 5554 <= port <= 5554 + 32:
|
|
32
|
+
return f'127.0.0.1:{port + 1}', f'emulator-{port}'
|
|
33
|
+
except (ValueError, IndexError):
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
return None, None
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def remove_duplicated_path(paths):
|
|
40
|
+
"""
|
|
41
|
+
Args:
|
|
42
|
+
paths (list[str]):
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
list[str]:
|
|
46
|
+
"""
|
|
47
|
+
paths = sorted(set(paths))
|
|
48
|
+
dic = {}
|
|
49
|
+
for path in paths:
|
|
50
|
+
dic.setdefault(path.lower(), path)
|
|
51
|
+
return list(dic.values())
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass
|
|
55
|
+
class EmulatorInstanceBase:
|
|
56
|
+
# Serial for adb connection
|
|
57
|
+
serial: str
|
|
58
|
+
# Emulator instance name, used for start/stop emulator
|
|
59
|
+
name: str
|
|
60
|
+
# Path to emulator .exe
|
|
61
|
+
path: str
|
|
62
|
+
|
|
63
|
+
def __str__(self):
|
|
64
|
+
return f'{self.type}(serial="{self.serial}", name="{self.name}", path="{self.path}")'
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def type(self) -> str:
|
|
68
|
+
"""
|
|
69
|
+
Returns:
|
|
70
|
+
str: Emulator type, such as Emulator.NoxPlayer
|
|
71
|
+
"""
|
|
72
|
+
return self.emulator.type
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def emulator(self):
|
|
76
|
+
"""
|
|
77
|
+
Returns:
|
|
78
|
+
Emulator:
|
|
79
|
+
"""
|
|
80
|
+
return EmulatorBase(self.path)
|
|
81
|
+
|
|
82
|
+
def __eq__(self, other):
|
|
83
|
+
if isinstance(other, str) and self.type == other:
|
|
84
|
+
return True
|
|
85
|
+
if isinstance(other, list) and self.type in other:
|
|
86
|
+
return True
|
|
87
|
+
if isinstance(other, EmulatorInstanceBase):
|
|
88
|
+
return super().__eq__(other) and self.type == other.type
|
|
89
|
+
return super().__eq__(other)
|
|
90
|
+
|
|
91
|
+
def __hash__(self):
|
|
92
|
+
return hash(str(self))
|
|
93
|
+
|
|
94
|
+
def __bool__(self):
|
|
95
|
+
return True
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def MuMuPlayer12_id(self):
|
|
99
|
+
"""
|
|
100
|
+
Convert MuMu 12 instance name to instance id.
|
|
101
|
+
Example names:
|
|
102
|
+
MuMuPlayer-12.0-3
|
|
103
|
+
YXArkNights-12.0-1
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
int: Instance ID, or None if this is not a MuMu 12 instance
|
|
107
|
+
"""
|
|
108
|
+
res = re.search(r'MuMuPlayer(?:Global)?-12.0-(\d+)', self.name)
|
|
109
|
+
if res:
|
|
110
|
+
return int(res.group(1))
|
|
111
|
+
res = re.search(r'YXArkNights-12.0-(\d+)', self.name)
|
|
112
|
+
if res:
|
|
113
|
+
return int(res.group(1))
|
|
114
|
+
|
|
115
|
+
return None
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class EmulatorBase:
|
|
119
|
+
# Values here must match those in argument.yaml EmulatorInfo.Emulator.option
|
|
120
|
+
NoxPlayer = 'NoxPlayer'
|
|
121
|
+
NoxPlayer64 = 'NoxPlayer64'
|
|
122
|
+
NoxPlayerFamily = [NoxPlayer, NoxPlayer64]
|
|
123
|
+
BlueStacks4 = 'BlueStacks4'
|
|
124
|
+
BlueStacks5 = 'BlueStacks5'
|
|
125
|
+
BlueStacks4HyperV = 'BlueStacks4HyperV'
|
|
126
|
+
BlueStacks5HyperV = 'BlueStacks5HyperV'
|
|
127
|
+
BlueStacksFamily = [BlueStacks4, BlueStacks5]
|
|
128
|
+
LDPlayer3 = 'LDPlayer3'
|
|
129
|
+
LDPlayer4 = 'LDPlayer4'
|
|
130
|
+
LDPlayer9 = 'LDPlayer9'
|
|
131
|
+
LDPlayerFamily = [LDPlayer3, LDPlayer4, LDPlayer9]
|
|
132
|
+
MuMuPlayer = 'MuMuPlayer'
|
|
133
|
+
MuMuPlayerX = 'MuMuPlayerX'
|
|
134
|
+
MuMuPlayer12 = 'MuMuPlayer12'
|
|
135
|
+
MuMuPlayerFamily = [MuMuPlayer, MuMuPlayerX, MuMuPlayer12]
|
|
136
|
+
MEmuPlayer = 'MEmuPlayer'
|
|
137
|
+
|
|
138
|
+
@classmethod
|
|
139
|
+
def path_to_type(cls, path: str) -> str:
|
|
140
|
+
"""
|
|
141
|
+
Args:
|
|
142
|
+
path: Path to .exe file
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
str: Emulator type, such as Emulator.NoxPlayer,
|
|
146
|
+
or '' if this is not a emulator.
|
|
147
|
+
"""
|
|
148
|
+
return ''
|
|
149
|
+
|
|
150
|
+
def iter_instances(self) -> t.Iterable[EmulatorInstanceBase]:
|
|
151
|
+
"""
|
|
152
|
+
Yields:
|
|
153
|
+
EmulatorInstance: Emulator instances found in this emulator
|
|
154
|
+
"""
|
|
155
|
+
pass
|
|
156
|
+
|
|
157
|
+
def iter_adb_binaries(self) -> t.Iterable[str]:
|
|
158
|
+
"""
|
|
159
|
+
Yields:
|
|
160
|
+
str: Filepath to adb binaries found in this emulator
|
|
161
|
+
"""
|
|
162
|
+
pass
|
|
163
|
+
|
|
164
|
+
def __init__(self, path):
|
|
165
|
+
# Path to .exe file
|
|
166
|
+
self.path = path
|
|
167
|
+
# Path to emulator folder
|
|
168
|
+
self.dir = os.path.dirname(path)
|
|
169
|
+
# str: Emulator type, or '' if this is not a emulator.
|
|
170
|
+
self.type = self.__class__.path_to_type(path)
|
|
171
|
+
|
|
172
|
+
def __eq__(self, other):
|
|
173
|
+
if isinstance(other, str) and self.type == other:
|
|
174
|
+
return True
|
|
175
|
+
if isinstance(other, list) and self.type in other:
|
|
176
|
+
return True
|
|
177
|
+
return super().__eq__(other)
|
|
178
|
+
|
|
179
|
+
def __str__(self):
|
|
180
|
+
return f'{self.type}(path="{self.path}")'
|
|
181
|
+
|
|
182
|
+
__repr__ = __str__
|
|
183
|
+
|
|
184
|
+
def __hash__(self):
|
|
185
|
+
return hash(self.path)
|
|
186
|
+
|
|
187
|
+
def __bool__(self):
|
|
188
|
+
return True
|
|
189
|
+
|
|
190
|
+
def abspath(self, path, folder=None):
|
|
191
|
+
if folder is None:
|
|
192
|
+
folder = self.dir
|
|
193
|
+
return abspath(os.path.join(folder, path))
|
|
194
|
+
|
|
195
|
+
@classmethod
|
|
196
|
+
def is_emulator(cls, path: str) -> bool:
|
|
197
|
+
"""
|
|
198
|
+
Args:
|
|
199
|
+
path: Path to .exe file.
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
bool: If this is a emulator.
|
|
203
|
+
"""
|
|
204
|
+
return bool(cls.path_to_type(path))
|
|
205
|
+
|
|
206
|
+
def list_folder(self, folder, is_dir=False, ext=None):
|
|
207
|
+
"""
|
|
208
|
+
Safely list files in a folder
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
folder:
|
|
212
|
+
is_dir:
|
|
213
|
+
ext:
|
|
214
|
+
|
|
215
|
+
Returns:
|
|
216
|
+
list[str]:
|
|
217
|
+
"""
|
|
218
|
+
folder = self.abspath(folder)
|
|
219
|
+
return list(iter_folder(folder, is_dir=is_dir, ext=ext))
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
class EmulatorManagerBase:
|
|
223
|
+
@staticmethod
|
|
224
|
+
def iter_running_emulator():
|
|
225
|
+
"""
|
|
226
|
+
Yields:
|
|
227
|
+
str: Path to emulator executables, may contains duplicate values
|
|
228
|
+
"""
|
|
229
|
+
return
|
|
230
|
+
|
|
231
|
+
@property
|
|
232
|
+
def all_emulators(self) -> t.List[EmulatorBase]:
|
|
233
|
+
"""
|
|
234
|
+
Get all emulators installed on current computer.
|
|
235
|
+
"""
|
|
236
|
+
return []
|
|
237
|
+
|
|
238
|
+
@property
|
|
239
|
+
def all_emulator_instances(self) -> t.List[EmulatorInstanceBase]:
|
|
240
|
+
"""
|
|
241
|
+
Get all emulator instances installed on current computer.
|
|
242
|
+
"""
|
|
243
|
+
return []
|
|
244
|
+
|
|
245
|
+
@property
|
|
246
|
+
def all_emulator_serials(self) -> t.List[str]:
|
|
247
|
+
"""
|
|
248
|
+
Returns:
|
|
249
|
+
list[str]: All possible serials on current computer.
|
|
250
|
+
"""
|
|
251
|
+
out = []
|
|
252
|
+
for emulator in self.all_emulator_instances:
|
|
253
|
+
out.append(emulator.serial)
|
|
254
|
+
# Also add serial like `emulator-5554`
|
|
255
|
+
port_serial, emu_serial = get_serial_pair(emulator.serial)
|
|
256
|
+
if emu_serial:
|
|
257
|
+
out.append(emu_serial)
|
|
258
|
+
return out
|
|
259
|
+
|
|
260
|
+
@property
|
|
261
|
+
def all_adb_binaries(self) -> t.List[str]:
|
|
262
|
+
"""
|
|
263
|
+
Returns:
|
|
264
|
+
list[str]: All adb binaries of emulators on current computer.
|
|
265
|
+
"""
|
|
266
|
+
out = []
|
|
267
|
+
for emulator in self.all_emulators:
|
|
268
|
+
for exe in emulator.iter_adb_binaries():
|
|
269
|
+
out.append(exe)
|
|
270
|
+
return out
|