Private files: secrets, test databases, assistant memory and sessions, restore.sh

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-23 02:17:33 +03:00
commit cdcb6891bc
33 changed files with 65839 additions and 0 deletions

21
emulator/tap.py Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""tap.py TEXT: tap the first on-screen element whose text or description contains TEXT."""
import re, subprocess, sys, os
adb = os.path.expanduser("~/Android/Sdk/platform-tools/adb")
xml = subprocess.run([adb, "exec-out", "uiautomator", "dump", "/dev/tty"], capture_output=True, text=True).stdout
want = sys.argv[1]
exact = want.startswith("=")
if exact:
want = want[1:]
for m in re.finditer(r'<node [^>]*>', xml):
n = m.group(0)
t = (re.search(r' text="([^"]*)"', n) or [None, ""])[1]
d = (re.search(r'content-desc="([^"]*)"', n) or [None, ""])[1]
if not re.search(r'bounds=', n):
continue
if (t == want or d == want) if exact else (want in t or want in d):
x1, y1, x2, y2 = map(int, re.search(r'bounds="\[(\d+),(\d+)\]\[(\d+),(\d+)\]"', n).groups())
subprocess.run([adb, "shell", "input", "tap", str((x1 + x2) // 2), str((y1 + y2) // 2)])
print("tapped", t or d, (x1 + x2) // 2, (y1 + y2) // 2)
sys.exit(0)
print("not found:", want); sys.exit(1)