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:
commit
cdcb6891bc
33 changed files with 65839 additions and 0 deletions
3
emulator/shot.sh
Executable file
3
emulator/shot.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
# shot.sh name: screenshot the emulator into the scratchpad.
|
||||
sleep ${2:-1}; $HOME/Android/Sdk/platform-tools/adb exec-out screencap -p > /tmp/claude-1000/-home-vrubel-services-chessBaseLinux/86c7ee93-82be-4380-9d11-393872d0bb51/scratchpad/$1.png
|
||||
21
emulator/tap.py
Executable file
21
emulator/tap.py
Executable 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue