hid-support icon indicating copy to clipboard operation
hid-support copied to clipboard

Can not input text on iphone dialog and many more input.

Open karmamaster opened this issue 6 years ago • 9 comments

Hello Mringwal, I was tried to use Hid-support to input text to the text box on iphone, everything is work well until I tried to input a text to google search box or iphone pop up dialog, it is not working. Hid-Support do not enter any text string to these input box.

Please help, Thanks

karmamaster avatar Mar 27 '18 18:03 karmamaster

what iOS version is this?

mringwal avatar Mar 28 '18 16:03 mringwal

I am working all version of IOS 10 (exclude 10.3.3) and all version of ios 9. These iphone are jailbroken

More info: I have tried to use autotouch to test their writetext function and it is working well but not with hid-support. Furthermore, I have detected that the hid-support can not write a string with space character in it, exp: "this is test string" and the hid can only write "this" but not the whole string, but it is filled whole string with autotouch!

Do you have any idea please! Thanks.

karmamaster avatar Mar 28 '18 16:03 karmamaster

@mringwal Please help me or point me a direction to fix this bug

karmamaster avatar Mar 29 '18 15:03 karmamaster

No idea about autotouch.

hid-support on iOS 7+ injects into backboardd and uses a function to query which app is in front at position 100,100 and then sends an IOHIDEvent to that app. If there's a pop-up, it might send the key input to another app.

was the 'iphone pop up' a system dialog, like 'enter wifi password' or so? I think this worked with older versions. there's code that tries to detect if there's a dialog by SpringBoard (the Wifi popup is probably shown by SpringBoard), maybe the system dialog detection is broken.

I guess there should be a better way to figure out which app is in front/has the keyboard focus.

You could try different coordinates to see if this changes the behaviour a bit.

sorry, I didn't use/work with iOS JB since quite a while. I'll release an update if you or someone can provide a fix for it.

mringwal avatar Apr 01 '18 15:04 mringwal

Yeah, Seems like that the "pop up" is a system dialog. Hid is neither work on "enter wifi password" nor "enter apple id" dialog too.

Can you talk more about "position 100,100"? I will very glad to help if I could

karmamaster avatar Apr 01 '18 19:04 karmamaster

Position (100,100) is used here: https://github.com/mringwal/hid-support/blob/master/hidspringboard/Tweak.xm#L436

I have a vague recollection that a GSEvent could just be sent to the frontmost application.

mringwal avatar Apr 04 '18 08:04 mringwal

doesn't work for me on iOS 10.3.3 either [CAWindowServer serverIfRunning] always return nil, so it simply cannot find the client-port of the front-most application. I tried to use GSGetPurpleApplicationPort() which returns non-zero port, but still can't make it work.

laoyur avatar May 15 '18 04:05 laoyur

seems like we can use IOHIDEventCreateKeyboardEvent to generate keyboard event for text typing but I don't know how to input unicode string by this way :(

laoyur avatar May 15 '18 04:05 laoyur

IOHIDEventCreateKeyboardEvent could be used, but I didn't find a way to enter any text (unicode). Because of this, on iOS 7+ hidsupport sends the text as GSEvent to the app and then simulates the typing inside the app itself.

mringwal avatar May 16 '18 20:05 mringwal