This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
AutoUpdateBot is a Python automation framework for Android app management and APK collection. It automates:
- Detecting app updates across third-party app stores (7723, HYKB, CCPlay)
- Downloading and extracting APK files from Android emulators via ADB
- Parsing APK metadata (version, package name, icons, screenshots)
- Uploading files via SFTP and reporting to backend APIs
- Running multiple specialized bots for different platforms
device/device.py:DeviceManagerwraps uiautomator2 for Android emulator interactionsocr/rapid_ocr.py:OcrEnginesingleton for text detection in screenshots using RapidOCRenv_loader.py: Environment setup for bundled ADB/AAPT binaries
Each service is a separate class accepting config for dependency injection:
updater.py:UpdateService- UI automation for update detection via uiautomator2 watchersextractor.py:ApkExtractor- Pulls APK files from device via ADBparser.py:ApkParser- Extracts metadata using aaptuploader.py:SftpUploader- SFTP file uploadsreporter.py:ReportService- API notificationsapp_manager.py:AppManager- Package/version managementworker_service.py: Background task queue processing
Specialized bots for each app store, each with standalone GUI:
7723/: Bot7723 forcom.upgadata.up7723hykb/: BotHYKB forcom.xmcy.hykbccplay/: CCPlayBot forcom.lion.market
All bots use sys.path.append() to access project root modules.
FastAPI REST server on port 10000 for task management.
Run main bot:
python main.py # CLI mode
python gui_main.py # GUI modeRun individual bots:
python cmd/7723/gui_main.py
python cmd/hykb/gui_main.py
python cmd/ccplay/gui_main.pyBuild executables (PyInstaller):
pyinstaller 7723.spec # Build 7723 bot
pyinstaller hykb.spec # Build HYKB bot
pyinstaller ccplay.spec # Build CCPlay bot
pyinstaller ui.spec # Build main GUIRun API server:
python api/main.py # Start FastAPI on port 10000settings.yaml: Main config (emulator serial, API URLs, SFTP credentials, detection keywords)watcher.yaml: File watcher and Redis queue configuration
Default emulator: 127.0.0.1:7555
- Environment Setup: Always call
setup_env()fromcore.env_loaderfirst - adds bundled ADB to PATH - Service Instantiation: Services accept
configdict for dynamic reconfiguration - Device Access:
DeviceManager.dexposes the raw uiautomator2 object - Logging: Structured logging with
[ServiceName]prefixes - Daily Log Tracking: Bots track processed items in daily logs to avoid duplicates
- Package Path: All
cmd/bots usesys.path.append()to import from project root
- uiautomator2: Android device automation
- rapidocr-onnxruntime: OCR for UI element detection
- pyaxmlparser: APK manifest parsing
- paramiko: SFTP uploads
- FastAPI/uvicorn: REST API server
- redis: Task queue coordination
- PyYAML: Configuration loading
- tkinter: GUI framework
Bundled binaries are in bin/:
bin/adb- ADB executablebin/aapt/aapt.exe- AAPT for APK parsing
These are automatically added to PATH via setup_env().
Logs, screenshots, APKs, and build artifacts are excluded via .gitignore.