Upload files to "/"

This commit is contained in:
2025-12-02 18:18:39 +00:00
parent 1055b7dd73
commit 90d8ec248f
5 changed files with 289 additions and 0 deletions

34
press_button.ps1 Normal file
View File

@@ -0,0 +1,34 @@
# Dump and pull UI hierarchy
adb shell uiautomator dump
$dumpPath = $(adb shell uiautomator dump) -match '[^ ]+.xml' | % { $Matches[0] }
adb pull $dumpPath view.xml
# Parse XML
$xml = [xml](Get-Content view.xml)
# Recursive search for node with "AGREE"
function Find-Node($node) {
if ($node.text -like "*AGREE*") { $node }
foreach ($child in $node.node) {
Find-Node $child
}
}
$node = Find-Node $xml.hierarchy
$node = $node | Where-Object {$_.text -eq "More options"}
$bounds = $node.bounds
$bounds -match '\[(.*?)\]\[(.*?)\]'
$p1 = $Matches[1] -split ','
$p2 = $Matches[2] -split ','
$xMid = ([int]$p1[0] + [int]$p2[0]) / 2
$yMid = ([int]$p1[1] + [int]$p2[1]) / 2
$coords = "$xMid $yMid"
# Output coords
$coords = "$xMid $yMid"
Write-Host "Coords of 'AGREE AND CONTINUE': $coords"
# Tap the element (uncomment to use)
# adb shell input tap $coords