Instrument Android composition input for native diagnosis

This commit is contained in:
NINI
2026-10-05 05:21:19 +09:00
parent 4c411e446d
commit e5f19d6fef
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -12,8 +12,10 @@ function Varint([int]$Value) {
}
$message=[Collections.Generic.List[byte]]::new()
for ($offset=0; $offset -lt $Contacts.Count; $offset+=4) {
# AVD touch injection uses portrait physical coordinates even when the app is landscape-left.
$fields=@(1080-$Contacts[$offset+1],$Contacts[$offset],$Contacts[$offset+2],$Contacts[$offset+3])
$touch=[Collections.Generic.List[byte]]::new()
for ($field=0; $field -lt 4; $field++) { $touch.Add([byte](8*($field+1))); $touch.AddRange([byte[]](Varint $Contacts[$offset+$field])) }
for ($field=0; $field -lt 4; $field++) { $touch.Add([byte](8*($field+1))); $touch.AddRange([byte[]](Varint $fields[$field])) }
$message.Add(10); $message.AddRange([byte[]](Varint $touch.Count)); $message.AddRange($touch.ToArray())
}
$frame=[byte[]]::new($message.Count+5); $frame[1]=($message.Count -shr 24) -band 255; $frame[2]=($message.Count -shr 16) -band 255