Instrument Android composition input for native diagnosis
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user