Verify Pixel focus through its native launcher alias

This commit is contained in:
waozi committed 2026-10-09 09:44:19 -03:00
1 parent 71db89c9da
commit 31b1ebe64e
1 file changed
+3 -2
+3 -2
View File
@@ -91,9 +91,10 @@ def main():
def guard():
if adb("shell", "pidof", args.package) != pid:
raise RuntimeError("Inbe restarted; stopping the geometry check")
focus = adb("shell", "dumpsys", "window", "windows")
focus = adb("shell", "dumpsys", "window")
current = next((line for line in focus.splitlines() if "mCurrentFocus=" in line), "")
if args.package + "/xyz.waozi.inbe.MainActivity" not in current:
if not any(args.package + "/xyz.waozi.inbe." + component in current
for component in ("MainActivity", "SkyCradleLauncher")):
raise RuntimeError("Inbe is not the focused application; refusing changes")
last_sample = -1