1
0
forked from BRT/arc
ARC desktop app
Go to file
trnsmkot d031eed7d2 Merge branch 'dev' into main: align main with dev content (dev takes precedence in all conflicts).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

# Conflicts:
#	database/app_data.db
#	views/DeviceWidget.cpp
#	views/DeviceWidget.h
2026-05-25 15:56:12 +05:00
android Remove outdated AppLogDAO, LogWindow, and related functionalities. Introduce NetworkErrorUtils for detailed error categorization and enhanced logging. Refactor EventHandler to support balance adjustments and optimize thread cleanup. Add retry and timeout mechanisms to network services with improved error handling. 2026-05-23 18:37:49 +05:00
assets Improve GetLastTransactionsScript to parse bottom-sheet transaction details for version 3.2.33. Add parseDushanbeAmount for enhanced number extraction. 2026-05-21 17:29:49 +05:00
build_x64 Fix for windows 2026-04-08 15:43:59 +07:00
database Remove outdated AppLogDAO, LogWindow, and related functionalities. Introduce NetworkErrorUtils for detailed error categorization and enhanced logging. Refactor EventHandler to support balance adjustments and optimize thread cleanup. Add retry and timeout mechanisms to network services with improved error handling. 2026-05-23 18:37:49 +05:00
docs Remove outdated AppLogDAO, LogWindow, and related functionalities. Introduce NetworkErrorUtils for detailed error categorization and enhanced logging. Refactor EventHandler to support balance adjustments and optimize thread cleanup. Add retry and timeout mechanisms to network services with improved error handling. 2026-05-23 18:37:49 +05:00
images Add app_version tracking: database schema migration, ADB utility support, and UI enhancements. 2026-05-18 18:42:59 +05:00
models Remove outdated AppLogDAO, LogWindow, and related functionalities. Introduce NetworkErrorUtils for detailed error categorization and enhanced logging. Refactor EventHandler to support balance adjustments and optimize thread cleanup. Add retry and timeout mechanisms to network services with improved error handling. 2026-05-23 18:37:49 +05:00
services Remove outdated AppLogDAO, LogWindow, and related functionalities. Introduce NetworkErrorUtils for detailed error categorization and enhanced logging. Refactor EventHandler to support balance adjustments and optimize thread cleanup. Add retry and timeout mechanisms to network services with improved error handling. 2026-05-23 18:37:49 +05:00
tessdata Switch Tesseract initialization to memory-based loading of rus.traineddata to fix issues with paths containing Cyrillic characters (Windows). 2026-04-30 19:52:07 +07:00
tests/mock_server Remove outdated AppLogDAO, LogWindow, and related functionalities. Introduce NetworkErrorUtils for detailed error categorization and enhanced logging. Refactor EventHandler to support balance adjustments and optimize thread cleanup. Add retry and timeout mechanisms to network services with improved error handling. 2026-05-23 18:37:49 +05:00
tools/adb Add ADB utilities with platform-specific support 2025-06-11 16:21:13 +07:00
tutorials Add PayByCardScript and PayByPhoneScript for Dushanbe automation, including transaction flow, OCR-based operation ID extraction, and enhanced logging. 2026-04-06 12:51:18 +07:00
views Remove outdated AppLogDAO, LogWindow, and related functionalities. Introduce NetworkErrorUtils for detailed error categorization and enhanced logging. Refactor EventHandler to support balance adjustments and optimize thread cleanup. Add retry and timeout mechanisms to network services with improved error handling. 2026-05-23 18:37:49 +05:00
.gitignore Expand .gitignore to exclude cache, generated files, dumps, and test build directories. 2026-05-19 11:24:40 +05:00
arc.ico Refactor project naming and executable targets, enhance UI with no-devices label, tutorial handling, and app branding updates. 2026-03-24 14:03:39 +07:00
arc.png Refactor project naming and executable targets, enhance UI with no-devices label, tutorial handling, and app branding updates. 2026-03-24 14:03:39 +07:00
build_x64.bat Fix for windows 2026-05-19 17:23:34 +07:00
BUILD.md Fix for windows 2026-03-09 18:17:05 +07:00
CMakeLists.txt Add OCR utilities and backend integration for enhanced screen dump analysis: 2026-04-30 19:39:21 +07:00
config.ini Add enhanced error handling, logging, and monitoring capabilities across systems. Include archive naming, retry logic for partial PIN entry, API response error dialogs, and support for monitoring tokens. 2026-05-21 13:52:29 +05:00
eng.traineddata Fix for windows 2026-03-09 17:20:03 +07:00
main.cpp Integrate DeviceScreener with NetworkService for status synchronization, including debounce logic for online/offline transitions and periodic sync initiation. Refactor startDeviceScreener and startNetworkService to enable inter-component interaction. 2026-05-22 16:19:41 +05:00
migrations.sql Add app_version tracking: database schema migration, ADB utility support, and UI enhancements. 2026-05-18 18:42:59 +05:00
no_devices.png Refactor project naming and executable targets, enhance UI with no-devices label, tutorial handling, and app branding updates. 2026-03-24 14:03:39 +07:00
README.md Add README with build instructions, architecture overview, and links to project documentation (docs/, BUILD.md, API specs, mock server, tutorials). 2026-05-25 15:48:53 +05:00
rus.traineddata Test 2025-04-16 09:05:20 -07:00
split_zip.ps1 Fix for windows 2026-04-12 15:17:28 +07:00

ARC Desktop

Десктопное Qt6/C++ приложение для мониторинга и автоматизации Android-приложений мобильных банков через ADB. Принимает задачи с бэкенда (получение профиля/балансов, выписка по транзакциям, создание платежей), исполняет их в реальном приложении банка на подключённом устройстве и возвращает результат.

Репозиторий: git@git.brtservice.io:BRT/arc.git


Быстрый старт

git clone git@git.brtservice.io:BRT/arc.git
cd arc

# macOS
brew install qt tesseract leptonica
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
./ARCDesktopProject

Подробнее — см. BUILD.md (macOS + Windows).

При первом запуске потребуется токен авторизации; настройки лежат в config.ini.


Документация

Все актуальные материалы в каталоге docs/. Точка входа — docs/index.md.

Архитектура и фичи

Документ О чём
docs/index.md Общая схема приложения, потоки, технологии
docs/events.md Жизненный цикл задачи: API → БД → выполнение скриптом → отчёт
docs/bank-setup-wizard.md BankSetupWizard — мастер заведения банковского профиля (Ozon, Black, Dushanbe)
docs/status-sync.md Синхронизация online/offline статусов устройств и сервиса
docs/black_tasks.md Скрипты для банка Black (Birbank)
docs/ozon_tasks.md Скрипты для Ozon

Backend API

Документ О чём
docs/api/auth.md Логин, refresh, хранение токенов
docs/api/profile.md bank_profile и material (карты)
docs/api/device.md Регистрация десктопов и Android-устройств, отправка скриншотов
docs/api/task.md Получение задач, отправка результатов
docs/api/network.md Полная карта HTTP-вызовов приложения
docs/api/openapi.json OpenAPI спецификация бэкенда

Сборка и тесты

Документ О чём
BUILD.md Сборка под macOS и Windows
tests/mock_server/README.md Локальный mock-бэкенд для интеграционных тестов
tests/mock_server/WINDOWS.md Особенности запуска моков на Windows
tutorials/ui_info.md Туториал по UI приложения

Архитектура

MainWindow (Qt6 GUI)
  ├── DeviceScreener  (QThread) — опрос ADB-устройств, скриншоты
  ├── EventHandler    (QThread) — оркестратор задач, запуск bank-скриптов
  └── NetworkService  (QThread) — REST API + monitoring relay
android/<bank>/        — автоматизация конкретного банка (ozon, black, dushanbe, ...)
  ├── *Script.{h,cpp}       — CommonScript, LoginAndCheckAccountsScript, PayByCardScript, GetLastTransactionsScript, ...
  └── ScreenXmlParser       — парсинг ADB UI dump

android/adb/           — обёртка над adb (скриншот, tap, swipe, input, uiautomator dump)
android/ocr/           — Tesseract + утилиты поиска текста на скриншоте
android/dump/          — захват UI-дампов

database/              — SQLite через DatabaseManager (singleton) + DAO-слой
  Таблицы: devices → applications → accounts → transactions/events

models/                — POCO: DeviceInfo, AccountInfo, EventInfo, TransactionInfo, ...
services/              — фоновые потоки (DeviceScreener, EventHandler, NetworkService, AppLogger, LogArchiveSender)
views/                 — Qt-виджеты: MainWindow, DeviceWidget, BankSetupWizard, AccountWindow, ...

Полная диаграмма потоков и сигналов — docs/index.md, детально по задачам — docs/events.md.


Технологии

  • Qt 6 (Widgets, Network, Sql, Xml)
  • C++17, CMake (опционально Ninja)
  • SQLite (через QtSql)
  • ADB (платформенные бинари в tools/adb/)
  • Tesseract OCR + Leptonica (eng.traineddata, rus.traineddata)

Поддерживаемые банки (в текущем config.ini): Ozon, Black (Birbank), Dushanbe City Bank. Список расширяется через [apps] list= в config.ini.


Конфигурация

Главный файл — config.ini:

Секция Назначение
[common] Версия, валюты, токен
[apps] list= Активные банки
[db] dbPath= Путь к SQLite (./database/app_data.db)
[net] apiBase, пути ручек, мониторинг-релей
[<bank>] android_package_name, currency, country, app_version, ...

Схема БД — migrations.sql (5 таблиц).


Полезные пути

  • Логи приложения: application.log (в корне), архив отправляется через LogArchiveSender на monitoringBase
  • ADB-бинари для Windows: tools/adb/windows/
  • Тестовые скриншоты/XML: assets/<bank>/
  • Иконки и ресурсы: images/, arc.icns, arc.ico, app.rc

Скрипты бэкенда и операционные ссылки

  • Backend API (prod): см. apiBase в config.ini
  • Monitoring relay: 142.93.102.40:8080 — релеит /monitoring/log и /monitoring/dump в Telegram (systemd arc-monitoring.service)