feat: implement robust multi-tier text input architecture and ADB diagnostics
- Android Text Input & IME Normalization:
- Implement progressive 3-tier input architecture in AndroidAdbDriver and AndroidDeviceController:
- Tier 1 (Primary): Zero-dependency clipboard injection + KEYCODE_PASTE (immune to IME Pinyin interception, full Unicode/Emoji support, preserves multiline formatting).
- Tier 2 (Broadcast): Base64 broadcast injection when ADBKeyboard is active.
- Tier 3 (Fallback): Native ADB physical keyevent fallback.
- Add literal newline normalization (\r\n, \n, \r) to prevent JSON escape string corruption (e.g. '10086\n' -> '10086、n').
- Add set_clipboard method to UIAutomatorClient without auxiliary APK requirements.
- Diagnostics & System Probes:
- Add adb_keys diagnostics probe for ADB key auth checks.
- Integrate diagnostics into CLI doctor command.
- Admin Console & Showcase UI:
- Improve model service and system router in admin console.
- Enhance workspace stream view and session state in showcase UI.
This commit is contained in:
1 parent
42b8988661
commit
ea3708a98f
19 files changed
+785
-89
No files matched your search
@@ -133,11 +133,28 @@ class ReadinessEngine:
|
||||
timestamp=time.time(),
|
||||
)
|
||||
|
||||
async def heal_adb_keys(self, force: bool = False) -> dict[str, Any]:
|
||||
"""Auto-heal corrupted or 0-byte ADB authentication keys."""
|
||||
from artemis.core.diagnostics.adb_keys import heal_adb_keys
|
||||
|
||||
logger.info("[ReadinessEngine] Auto-healing ADB authentication keys...")
|
||||
return await asyncio.to_thread(heal_adb_keys, None, force)
|
||||
|
||||
async def restart_adb_server(self) -> dict[str, Any]:
|
||||
"""Execute adb kill-server && adb start-server to recover connectivity."""
|
||||
"""Execute adb kill-server && adb start-server to recover connectivity, auto-healing corrupted keys if needed."""
|
||||
from artemis.core.diagnostics.adb_keys import heal_adb_keys, inspect_adb_keys
|
||||
|
||||
adb_path = shutil.which("adb") or "adb"
|
||||
|
||||
def _restart_sync():
|
||||
# If keys are corrupted, heal them first
|
||||
key_status = inspect_adb_keys()
|
||||
if key_status.is_corrupted:
|
||||
logger.warning(
|
||||
f"[ReadinessEngine] Corrupted ADB keys detected ({key_status.error_reason}). Auto-healing..."
|
||||
)
|
||||
return heal_adb_keys(adb_path=adb_path)
|
||||
|
||||
try:
|
||||
subprocess.run(
|
||||
[adb_path, "kill-server"],
|
||||
|
||||
Reference in new issue
Block a user