ok-script 0.0.74__tar.gz → 0.0.76__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.74 → ok-script-0.0.76}/PKG-INFO +1 -1
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/adb/DeviceManager.py +3 -1
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/firebase/Analytics.py +12 -2
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/App.py +4 -2
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/MainWindow.py +1 -2
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/StartController.py +1 -1
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/about/AboutTab.py +1 -1
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/about/VersionCard.py +23 -21
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/debug/DebugTab.py +45 -2
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/interaction/ADBInteraction.py +2 -2
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/interaction/BaseInteraction.py +5 -2
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/interaction/Win32Interaction.py +2 -2
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/ocr/OCR.py +4 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/task/ExecutorOperation.py +9 -9
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/task/TaskExecutor.py +2 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/update/GithubMultiDownloader.py +3 -3
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/update/Updater.py +8 -5
- {ok-script-0.0.74 → ok-script-0.0.76}/ok_script.egg-info/PKG-INFO +1 -1
- {ok-script-0.0.74 → ok-script-0.0.76}/setup.py +1 -1
- {ok-script-0.0.74 → ok-script-0.0.76}/README.md +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/OK.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/alas/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/alas/emulator_base.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/alas/emulator_windows.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/alas/platform_base.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/alas/platform_windows.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/alas/utils.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/BaseCaptureMethod.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/HwndWindow.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/adb/ADBCaptureMethod.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/adb/WindowsCaptureFactory.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/adb/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/adb/bin/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/image/ImageCaptureMethod.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/image/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/BaseWindowsCaptureMethod.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/BitBltCaptureMethod.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/DesktopDuplicationCaptureMethod.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/WindowsGraphicsCaptureMethod.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/d3d11.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/dump.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/utils.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/capture/windows/window.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/color/Color.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/color/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/config/Config.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/config/InfoDict.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/config/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/feature/Box.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/feature/Feature.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/feature/FeatureSet.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/feature/FindFeature.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/feature/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/firebase/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/Communicate.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/MessageWindow.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/TabTitles.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/about/HttpTextEdit.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/about/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/common/OKIcon.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/common/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/common/config.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/common/style_sheet.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/debug/AspectRatioWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/debug/FrameWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/debug/InfoWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/debug/LoggerWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/debug/Screenshot.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/debug/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/i18n/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/i18n/path.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/i18n/update.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/icon/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/icon/icon.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/overlay/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/qss/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/resources.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/settings/SettingTab.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/settings/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/start/SelectCaptureListView.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/start/StartCard.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/start/StartTab.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/start/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/LabelAndDropDown.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/StartButton.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/TaskCard.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/tasks/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/util/Alert.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/util/InitWorker.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/util/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/Card.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/EmptyCard.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/StartLoadingDialog.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/StatusBar.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/Tab.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/TabWidget.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/gui/widget/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/interaction/DoNothingInteraction.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/interaction/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/logging/Logger.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/logging/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/ocr/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/delegate.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/export.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/idldsl.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/inspectable.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/roapi.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/types.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/winstring.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/save/BlackBarProcessor.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/save/PostProcessor.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/save/SaveByInterval.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/save/SaveByKeyPress.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/save/SaveMethodBase.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/save/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/scene/FeatureScene.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/scene/Scene.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/scene/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/stats/StreamStats.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/stats/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/task/BaseTask.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/task/OneTimeTask.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/task/TriggerTask.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/task/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/update/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/update/gen_md5.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/Handler.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/exit_event.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/json.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/list.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/path.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/thread.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/win32_process.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok/util/yaml.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok_script.egg-info/SOURCES.txt +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok_script.egg-info/requires.txt +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/ok_script.egg-info/top_level.txt +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/setup.cfg +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/tests/__init__.py +0 -0
- {ok-script-0.0.74 → ok-script-0.0.76}/tests/test_updater.py +0 -0
|
@@ -126,6 +126,8 @@ class DeviceManager:
|
|
|
126
126
|
self.device_dict[imei] = phone_device
|
|
127
127
|
|
|
128
128
|
def refresh_emulators(self):
|
|
129
|
+
if self.adb_capture_config is None:
|
|
130
|
+
return
|
|
129
131
|
from ok.alas.emulator_windows import EmulatorManager
|
|
130
132
|
manager = EmulatorManager()
|
|
131
133
|
installed_emulators = manager.all_emulator_instances
|
|
@@ -370,7 +372,7 @@ class DeviceManager:
|
|
|
370
372
|
packages = [packages]
|
|
371
373
|
for package in packages:
|
|
372
374
|
if package == front.package:
|
|
373
|
-
return
|
|
375
|
+
return False
|
|
374
376
|
|
|
375
377
|
def adb_start_package(self, package):
|
|
376
378
|
self.shell(f'monkey -p {package} -c android.intent.category.LAUNCHER 1')
|
|
@@ -7,6 +7,7 @@ import uuid
|
|
|
7
7
|
import requests
|
|
8
8
|
import wmi
|
|
9
9
|
|
|
10
|
+
import ok.gui
|
|
10
11
|
from ok.config.Config import Config
|
|
11
12
|
from ok.logging.Logger import get_logger
|
|
12
13
|
from ok.util.Handler import Handler
|
|
@@ -58,11 +59,20 @@ class Analytics:
|
|
|
58
59
|
self._user_properties = {
|
|
59
60
|
"os": 'windows',
|
|
60
61
|
"os_version": os_version,
|
|
61
|
-
"os_build": os_build,
|
|
62
|
+
"os_build": str(os_build),
|
|
62
63
|
"cpu": cpu_name,
|
|
63
|
-
"memory": int(total_memory),
|
|
64
|
+
"memory": str(int(total_memory)),
|
|
64
65
|
"gpu": gpu_name,
|
|
65
66
|
}
|
|
67
|
+
config = ok.gui.device_manager.config
|
|
68
|
+
if config:
|
|
69
|
+
self._user_properties["device"] = config.get('preferred')
|
|
70
|
+
self._user_properties["device_capture"] = config.get('capture')
|
|
71
|
+
capture = ok.gui.device_manager.capture_method
|
|
72
|
+
if capture:
|
|
73
|
+
width, height = ok.gui.device_manager.capture_method._size
|
|
74
|
+
if width and height:
|
|
75
|
+
self._user_properties["device_sr"] = f'{width}x{height}'
|
|
66
76
|
return self._user_properties
|
|
67
77
|
|
|
68
78
|
#
|
|
@@ -61,8 +61,10 @@ class App:
|
|
|
61
61
|
logger.debug(f"translator install success {QCoreApplication.translate('MainWindow', 'Debug')}")
|
|
62
62
|
else:
|
|
63
63
|
logger.debug(f"No translation available for {self.locale}, falling back to English/default. {full_path}")
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
if self.config.get('update'):
|
|
65
|
+
self.updater = Updater(self.config, exit_event)
|
|
66
|
+
else:
|
|
67
|
+
self.updater = None
|
|
66
68
|
self.start_controller = StartController(self.config, exit_event)
|
|
67
69
|
|
|
68
70
|
def center_window(self, window):
|
|
@@ -68,8 +68,7 @@ class MainWindow(MSFluentWindow):
|
|
|
68
68
|
communicate.executor_paused.connect(self.executor_paused)
|
|
69
69
|
communicate.tab.connect(self.navigate_tab)
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
self.shortcut.activated.connect(dump_threads)
|
|
71
|
+
|
|
73
72
|
|
|
74
73
|
# Create a context menu for the tray
|
|
75
74
|
menu = QMenu()
|
|
@@ -45,7 +45,7 @@ class StartController(QObject):
|
|
|
45
45
|
communicate.starting_emulator.emit(True, self.tr('Start game timeout!'), 0)
|
|
46
46
|
return
|
|
47
47
|
communicate.starting_emulator.emit(False, None, int(remaining_time))
|
|
48
|
-
time.sleep(
|
|
48
|
+
time.sleep(2)
|
|
49
49
|
else:
|
|
50
50
|
communicate.starting_emulator.emit(True,
|
|
51
51
|
self.tr('Game path does not exist, Please open game manually!'), 0)
|
|
@@ -24,7 +24,7 @@ class AboutTab(Tab):
|
|
|
24
24
|
|
|
25
25
|
# Set the layout on the widget
|
|
26
26
|
self.addWidget(about_label)
|
|
27
|
-
if ok.gui.app.updater.enabled():
|
|
27
|
+
if ok.gui.app.updater is not None and ok.gui.app.updater.enabled():
|
|
28
28
|
self.download_latest_button = PushButton(self.tr('Download Release'))
|
|
29
29
|
self.download_latest_button.clicked.connect(self.download_latest)
|
|
30
30
|
self.download_latest_debug_button = PushButton(self.tr('Download Debug'))
|
|
@@ -14,27 +14,29 @@ class VersionCard(SettingCard):
|
|
|
14
14
|
|
|
15
15
|
def __init__(self, icon, title, version, debug, parent=None):
|
|
16
16
|
super().__init__(icon, title, f'{version} {self.get_type(debug)}')
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
|
|
18
|
+
if ok.gui.app.updater is not None:
|
|
19
|
+
self.downloading_text = QLabel()
|
|
20
|
+
self.hBoxLayout.addWidget(self.downloading_text)
|
|
21
|
+
self.hBoxLayout.addSpacing(16)
|
|
22
|
+
|
|
23
|
+
self.download_bar = ProgressBar(self)
|
|
24
|
+
self.download_bar.setFixedWidth(80)
|
|
25
|
+
self.download_bar.setFixedHeight(6)
|
|
26
|
+
self.hBoxLayout.addWidget(self.download_bar)
|
|
27
|
+
self.hBoxLayout.addSpacing(16)
|
|
28
|
+
|
|
29
|
+
self.check_update_button = PushButton(self.tr("Check for updates"))
|
|
30
|
+
self.check_update_button.clicked.connect(self.check_update)
|
|
31
|
+
self.hBoxLayout.addWidget(self.check_update_button)
|
|
32
|
+
self.hBoxLayout.addSpacing(16)
|
|
33
|
+
self.update_button = PushButton()
|
|
34
|
+
self.update_button.clicked.connect(self.show_update_dialog)
|
|
35
|
+
self.hBoxLayout.addWidget(self.update_button)
|
|
36
|
+
self.hBoxLayout.addSpacing(16)
|
|
37
|
+
self.update_buttons(0, "")
|
|
38
|
+
communicate.check_update.connect(self.update_update)
|
|
39
|
+
communicate.download_update.connect(self.download_update)
|
|
38
40
|
|
|
39
41
|
def download_update(self, percent, progress, done, error):
|
|
40
42
|
if done and not error:
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import subprocess
|
|
2
|
+
from ctypes import windll, wintypes
|
|
2
3
|
|
|
3
|
-
from PySide6.QtCore import Qt, Signal
|
|
4
|
-
from PySide6.
|
|
4
|
+
from PySide6.QtCore import Qt, Signal, QEvent
|
|
5
|
+
from PySide6.QtGui import QShortcut, QKeySequence
|
|
6
|
+
from PySide6.QtWidgets import QWidget, QFileDialog, QCompleter, QVBoxLayout, QHBoxLayout, QMessageBox
|
|
7
|
+
from _ctypes import byref
|
|
5
8
|
from qfluentwidgets import PushButton, FlowLayout, ComboBox, SearchLineEdit, TextEdit
|
|
6
9
|
|
|
7
10
|
import ok.gui
|
|
@@ -40,11 +43,16 @@ class DebugTab(Tab):
|
|
|
40
43
|
dump_button = PushButton(self.tr("Dump Threads(HotKey:Ctrl+Alt+D)"))
|
|
41
44
|
dump_button.clicked.connect(lambda: self.handler.post(dump_threads))
|
|
42
45
|
layout.addWidget(dump_button)
|
|
46
|
+
# self.dump_shortcut = QShortcut(QKeySequence("Ctrl+Alt+D"), self)
|
|
47
|
+
# self.dump_shortcut.activated.connect(dump_threads)
|
|
43
48
|
|
|
44
49
|
capture_button = PushButton(self.tr("Capture Screenshot"))
|
|
45
50
|
capture_button.clicked.connect(lambda: self.handler.post(self.capture))
|
|
46
51
|
layout.addWidget(capture_button)
|
|
47
52
|
|
|
53
|
+
# self.shortcut = QShortcut(QKeySequence("Ctrl+Alt+S"), self)
|
|
54
|
+
# self.shortcut.activated.connect(lambda: self.handler.post(self.capture))
|
|
55
|
+
|
|
48
56
|
ocr_button = PushButton("OCR")
|
|
49
57
|
ocr_button.clicked.connect(lambda: self.handler.post(self.ocr))
|
|
50
58
|
layout.addWidget(ocr_button)
|
|
@@ -90,6 +98,41 @@ class DebugTab(Tab):
|
|
|
90
98
|
self.result_edit = TextEdit()
|
|
91
99
|
call_task_container.addWidget(self.result_edit, stretch=1)
|
|
92
100
|
self.update_result_text.connect(self.result_edit.setText)
|
|
101
|
+
self.handler.post(self.bind_hot_keys)
|
|
102
|
+
self.handler.post(self.check_hotkey, 0.1)
|
|
103
|
+
|
|
104
|
+
def check_hotkey(self):
|
|
105
|
+
# Example event type, you should use the appropriate QEvent.Type for your case
|
|
106
|
+
msg = wintypes.MSG()
|
|
107
|
+
|
|
108
|
+
# PeekMessageW is used to check for a hotkey press
|
|
109
|
+
if windll.user32.PeekMessageW(byref(msg), None, 0, 0, 1):
|
|
110
|
+
if msg.message == 0x0312: # WM_HOTKEY
|
|
111
|
+
logger.debug(f'hotkey pressed {msg}')
|
|
112
|
+
if msg.wParam == 1:
|
|
113
|
+
dump_threads()
|
|
114
|
+
elif msg.wParam == 2:
|
|
115
|
+
self.handler.post(self.capture)
|
|
116
|
+
|
|
117
|
+
# Repost the check_hotkey method to be called after 100 ms
|
|
118
|
+
self.handler.post(self.check_hotkey, 0.1)
|
|
119
|
+
|
|
120
|
+
def bind_hot_keys(self):
|
|
121
|
+
MOD_ALT = 0x0001
|
|
122
|
+
MOD_CONTROL = 0x0002
|
|
123
|
+
VK_D = 0x44 # Virtual-Key code for 'D'
|
|
124
|
+
VK_S = 0x53
|
|
125
|
+
|
|
126
|
+
if not windll.user32.RegisterHotKey(None, 1, MOD_ALT | MOD_CONTROL, VK_D):
|
|
127
|
+
print("Failed to register hotkey for Alt+Ctrl+D")
|
|
128
|
+
if not windll.user32.RegisterHotKey(None, 2, MOD_ALT | MOD_CONTROL, VK_S):
|
|
129
|
+
print("Failed to register hotkey for Alt+Ctrl+S")
|
|
130
|
+
logger.debug('bind_hot_keys')
|
|
131
|
+
|
|
132
|
+
def __del__(self):
|
|
133
|
+
# Unregister the hotkeys
|
|
134
|
+
windll.user32.UnregisterHotKey(None, 1)
|
|
135
|
+
windll.user32.UnregisterHotKey(None, 2)
|
|
93
136
|
|
|
94
137
|
def call(self):
|
|
95
138
|
func_name = self.target_function_edit.text()
|
|
@@ -23,8 +23,8 @@ class ADBBaseInteraction(BaseInteraction):
|
|
|
23
23
|
def swipe(self, from_x, from_y, to_x, to_y, duration):
|
|
24
24
|
self.device_manager.device.shell(f"input swipe {from_x} {from_y} {to_x} {to_y} {duration}")
|
|
25
25
|
|
|
26
|
-
def click(self, x=-1, y=-1, move_back=False):
|
|
27
|
-
super().click(x, y)
|
|
26
|
+
def click(self, x=-1, y=-1, move_back=False, name=None):
|
|
27
|
+
super().click(x, y, name=name)
|
|
28
28
|
x = int(x * self.width / self.capture.width)
|
|
29
29
|
y = int(y * self.height / self.capture.height)
|
|
30
30
|
self.device_manager.shell(f"input tap {x} {y}")
|
|
@@ -23,5 +23,8 @@ class BaseInteraction:
|
|
|
23
23
|
def move_relative(self, x, y):
|
|
24
24
|
self.move(int(self.capture.width * x), int(self.capture.height * y))
|
|
25
25
|
|
|
26
|
-
def click(self, x=-1, y=-1):
|
|
27
|
-
|
|
26
|
+
def click(self, x=-1, y=-1, name=None):
|
|
27
|
+
if name is None:
|
|
28
|
+
logger.info(f"click {x, y}")
|
|
29
|
+
else:
|
|
30
|
+
logger.info(f"click {name} {x, y}")
|
|
@@ -64,8 +64,8 @@ class Win32Interaction(BaseInteraction):
|
|
|
64
64
|
# Release the left mouse button
|
|
65
65
|
pydirectinput.mouseUp()
|
|
66
66
|
|
|
67
|
-
def click(self, x=-1, y=-1, move_back=False):
|
|
68
|
-
super().click(x, y)
|
|
67
|
+
def click(self, x=-1, y=-1, move_back=False, name=None):
|
|
68
|
+
super().click(x, y, name=name)
|
|
69
69
|
if not self.capture.clickable():
|
|
70
70
|
logger.info(f"window in background, not clickable")
|
|
71
71
|
return
|
|
@@ -57,6 +57,10 @@ class OCR:
|
|
|
57
57
|
pos = res[0]
|
|
58
58
|
text = res[1]
|
|
59
59
|
confidence = res[2]
|
|
60
|
+
width, height = int(pos[2][0] - pos[0][0]), int(pos[2][1] - pos[0][1])
|
|
61
|
+
if width <= 0 or height <= 0:
|
|
62
|
+
logger.error(f'ocr result negative box {text} {confidence} {width}x{height} pos:{pos}')
|
|
63
|
+
continue
|
|
60
64
|
if confidence >= threshold:
|
|
61
65
|
detected_box = Box(int(pos[0][0]), int(pos[0][1]), int(pos[2][0] - pos[0][0]),
|
|
62
66
|
int(pos[2][1] - pos[0][1]),
|
|
@@ -33,11 +33,11 @@ class ExecutorOperation:
|
|
|
33
33
|
def is_scene(self, the_scene):
|
|
34
34
|
return isinstance(self.executor.current_scene, the_scene)
|
|
35
35
|
|
|
36
|
-
def click(self, x, y, move_back=False):
|
|
36
|
+
def click(self, x, y, move_back=False, name=None):
|
|
37
37
|
frame = self.executor.nullable_frame()
|
|
38
38
|
communicate.emit_draw_box("click", [Box(max(0, x - 10), max(0, y - 10), 20, 20, name="click")], "green", frame)
|
|
39
39
|
self.executor.reset_scene()
|
|
40
|
-
self.executor.interaction.click(x, y, move_back)
|
|
40
|
+
self.executor.interaction.click(x, y, move_back, name=name)
|
|
41
41
|
|
|
42
42
|
def swipe_relative(self, from_x, from_y, to_x, to_y, duration=0.5):
|
|
43
43
|
self.swipe(int(self.width * from_x), int(self.height * from_y), int(self.width * to_x),
|
|
@@ -103,7 +103,7 @@ class ExecutorOperation:
|
|
|
103
103
|
return int(percent * self.executor.method.width)
|
|
104
104
|
|
|
105
105
|
def click_relative(self, x, y, move_back=False):
|
|
106
|
-
self.click(int(self.width * x), int(self.height * y), move_back)
|
|
106
|
+
self.click(int(self.width * x), int(self.height * y), move_back, name=f'relative({x:.2f}, {y:.2f})')
|
|
107
107
|
|
|
108
108
|
@property
|
|
109
109
|
def height(self):
|
|
@@ -117,18 +117,18 @@ class ExecutorOperation:
|
|
|
117
117
|
self.executor.interaction.move_relative(x, y)
|
|
118
118
|
|
|
119
119
|
def click_box(self, box: Box | List[Box] = None, relative_x=0.5, relative_y=0.5, raise_if_not_found=True):
|
|
120
|
-
if box is None:
|
|
121
|
-
self.logger.error(f"click_box box is None")
|
|
122
|
-
if raise_if_not_found:
|
|
123
|
-
raise Exception(f"click_box box is None")
|
|
124
|
-
return
|
|
125
120
|
if isinstance(box, list):
|
|
126
121
|
if len(box) > 0:
|
|
127
122
|
box = box[0]
|
|
128
123
|
else:
|
|
129
124
|
self.logger.error(f"No box")
|
|
125
|
+
if box is None:
|
|
126
|
+
self.logger.error(f"click_box box is None")
|
|
127
|
+
if raise_if_not_found:
|
|
128
|
+
raise Exception(f"click_box box is None")
|
|
129
|
+
return
|
|
130
130
|
x, y = box.relative_with_variance(relative_x, relative_y)
|
|
131
|
-
self.click(x, y)
|
|
131
|
+
self.click(x, y, name=box.name)
|
|
132
132
|
|
|
133
133
|
def wait_scene(self, scene_type=None, time_out=0, pre_action=None, post_action=None):
|
|
134
134
|
return self.executor.wait_scene(scene_type, time_out, pre_action, post_action)
|
|
@@ -277,6 +277,8 @@ class TaskExecutor:
|
|
|
277
277
|
traceback.print_exc()
|
|
278
278
|
stack_trace_str = traceback.format_exc()
|
|
279
279
|
logger.error(f"{name} exception: {e}, traceback: {stack_trace_str}")
|
|
280
|
+
if self._frame:
|
|
281
|
+
communicate.screenshot.emit(self.frame, name)
|
|
280
282
|
self.current_task = None
|
|
281
283
|
if isinstance(self.current_task, OneTimeTask):
|
|
282
284
|
self.current_task.running = False
|
|
@@ -44,8 +44,8 @@ class GithubMultiDownloader:
|
|
|
44
44
|
elif len(self.proxys) > 0:
|
|
45
45
|
proxy = self.proxys.pop(0) # Remove the first item
|
|
46
46
|
self.proxys.append(proxy) # Add the removed item to the end
|
|
47
|
-
prefix = '
|
|
48
|
-
url = proxy + prefix + url if proxy is not None else None
|
|
47
|
+
prefix = '' if proxy == "" else '/'
|
|
48
|
+
url = (proxy + prefix + url) if proxy is not None else None
|
|
49
49
|
return url, proxy
|
|
50
50
|
|
|
51
51
|
def download_part(self, part_size, start, end, file, giturl, last_proxy=None):
|
|
@@ -74,7 +74,7 @@ class GithubMultiDownloader:
|
|
|
74
74
|
|
|
75
75
|
headers = {'Range': f'bytes={part_start}-{end}'}
|
|
76
76
|
url, proxy = self.next_url(giturl)
|
|
77
|
-
if
|
|
77
|
+
if proxy is None:
|
|
78
78
|
logger.error(f'all proxies failed to download {file}')
|
|
79
79
|
return
|
|
80
80
|
logger.debug(f'start multi part downloading {part_size} {target_size} {target_size <= part_size} {file} {url}')
|
|
@@ -350,11 +350,14 @@ class Updater:
|
|
|
350
350
|
|
|
351
351
|
|
|
352
352
|
def is_newer_or_eq_version(base_version, target_version):
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
try:
|
|
354
|
+
base_version = list(map(int, base_version[1:].split('.')))
|
|
355
|
+
target_version = list(map(int, target_version[1:].split('.')))
|
|
356
|
+
# Compare the versions
|
|
357
|
+
return base_version <= target_version
|
|
358
|
+
except Exception as e:
|
|
359
|
+
logger.error(f'is_newer_or_eq_version error {base_version} {target_version}', e)
|
|
360
|
+
return False
|
|
358
361
|
|
|
359
362
|
|
|
360
363
|
def convert_size(size_bytes):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok-script-0.0.74 → ok-script-0.0.76}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|