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
@@ -341,6 +341,23 @@ class UIAutomatorClient:
|
||||
logger.error(f"UIAutomator2 clear_text failed: {e}")
|
||||
return False
|
||||
|
||||
def set_clipboard(self, text: str) -> bool:
|
||||
"""Set text to system clipboard via UIAutomator2.
|
||||
|
||||
Args:
|
||||
text: The string to set in the device clipboard.
|
||||
|
||||
Returns:
|
||||
True if successful, False otherwise.
|
||||
"""
|
||||
try:
|
||||
device = self._ensure_connected()
|
||||
device.set_clipboard(text)
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.debug(f"UIAutomator2 set_clipboard failed: {e}")
|
||||
return False
|
||||
|
||||
def get_hierarchy(self) -> str:
|
||||
"""Get the UI hierarchy XML from the device.
|
||||
|
||||
|
||||
Reference in new issue
Block a user