Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,24 @@ def check_system_requirements(device_type: DeviceType = DeviceType.ADB) -> bool:
if device_type == DeviceType.ADB:
print("3. Checking ADB Keyboard...", end=" ")
try:
result = subprocess.run(
ADB_IME_ID = "com.android.adbkeyboard/.AdbIME"
ime_ok = (ADB_IME_ID in subprocess.run(
["adb", "shell", "ime", "list", "-s"],
capture_output=True,
text=True,
timeout=10,
)
ime_list = result.stdout.strip()

if "com.android.adbkeyboard/.AdbIME" in ime_list:
).stdout or ADB_IME_ID in subprocess.run(
["adb", "shell", "dumpsys", "input_method"],
capture_output=True,
text=True,
timeout=3,
).stdout or ADB_IME_ID in subprocess.run(
["adb", "shell", "settings", "get", "secure", "enabled_input_methods"],
capture_output=True,
text=True,
timeout=3,
).stdout)
if ime_ok:
print("✅ OK")
else:
print("❌ FAILED")
Expand Down Expand Up @@ -261,8 +270,8 @@ def check_model_api(base_url: str, model_name: str, api_key: str = "EMPTY") -> b
print(" 1. Check your network connection")
print(" 2. Verify the server is responding")
elif (
"Name or service not known" in error_msg
or "nodename nor servname" in error_msg
"Name or service not known" in error_msg
or "nodename nor servname" in error_msg
):
print(f" Error: Cannot resolve hostname")
print(" Solution:")
Expand Down Expand Up @@ -603,4 +612,4 @@ def main():


if __name__ == "__main__":
main()
main()