bk138 / droidVNC-NG

VNC server app for Android that does not require root privileges.
GNU General Public License v2.0
1.22k stars 177 forks source link

mouse buttons don't work on certain Android 11 devices #171

Closed Farsebo closed 8 months ago

Farsebo commented 9 months ago

If you'd like to put out an incentive for fixing this bug, you can do so at https://issuehunt.io/r/bk138/droidVNC-NG

Describe the bug

To Reproduce

Expected Behavior during a mouse click, there are no records in the logs at all, when the mouse moves, the logs are written

Logs/Backtraces

Your environment (please complete the following information):

Additional context

Farsebo commented 9 months ago

home and esc, work properly

bk138 commented 9 months ago

Sorry, can you describe in more detail what does not work?

Farsebo commented 9 months ago

yes, nothing happens when you press the right or left mouse button. when connected via vnc

bk138 commented 9 months ago

I just tried with an API level 30 (Android 11) emulator image, clicks without movement do yield an action on the device screen. Can you please try with an emulator or another device so we can rule out that your specific device is the culprit?

Farsebo commented 9 months ago

I don't have devices with version 11 from another manufacturer. On 10 versions of other manufacturers, the buttons work. Although the devices are different. On the 10th version of android, smartphones. On version 11, media players.

https://ugoos.store/products/ugoos-x4q-plus-mini-pc

bk138 commented 9 months ago

It seems this is about a quirky device, so I can't really help here. You might want to play around with the code in https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L180 to see if you get a click somehow and i might be able to merge your changes.

If you're able to root the device, you can also go another way and use Android InputManager system API.

Farsebo commented 9 months ago

tapxq4.txt log via adb was performed by pressing the right and left keys one at a time

root is available on the device, but I didn't understand how to use Android InputManager system API

bk138 commented 9 months ago

tapxq4.txt log via adb was performed by pressing the right and left keys one at a time

root is available on the device, but I didn't understand how to use Android InputManager system API

I can't see any logs in there; https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L180 does not print any OTOH.

Farsebo commented 9 months ago

10-05 12:15:20.993 583 677 D InputDispatcher: Waiting to send key to Window{17d2000 u0 com.android.vending/com.google.android.finsky.activities.MainActivity} because there are unprocessed events that may cause focus to change 10-05 12:21:57.035 583 677 D InputDispatcher: Waiting to send key to Window{c92d644 u0 com.android.launcher3/com.android.launcher3.Launcher} because there are unprocessed events that may cause focus to change right click

Farsebo commented 9 months ago

10-05 12:32:27.093 7739 7776 W Conscrypt: Could not set socket write timeout: java.net.SocketException: Socket closed 10-05 12:32:27.093 7739 7776 W Conscrypt: at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@233717033@23.37.17 (150300-570218080):226) 10-05 12:32:27.093 7739 7776 W Conscrypt: at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.setSoWriteTimeout(:com.google.android.gms@233717033@23.37.17 (150300-570218080):4) 10-05 12:32:28.181 825 825 I ThermalService: CPU temperatures: [51.4] 10-05 12:32:28.937 7739 10279 W Conscrypt: Could not set socket write timeout: java.net.SocketException: Socket closed 10-05 12:32:28.939 7739 10279 W Conscrypt: at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@233717033@23.37.17 (150300-570218080):226) 10-05 12:32:28.939 7739 10279 W Conscrypt: at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.setSoWriteTimeout(:com.google.android.gms@233717033@23.37.17 (150300-570218080):4) I drew a line in a graphic editor, there are no logs for a single left-click

by clicking the left mouse button in the editor, logs stopped appearing when drawing with the left button...

Farsebo commented 9 months ago

I checked again. It turns out that when you click the left mouse button, no records are formed in the logs, logs appear only when interacting with parts of the interface. When you click the left mouse button, a log of the form is formed: "10-05 12:53:52.007 583 677 D InputDispatcher: Waiting to send key to Window{c92d644 u0 com.android.launcher3/com.android.launcher3.Launcher} because there are unprocessed events that may cause focus to change" where the value "c92d644 u0" is not constant

bk138 commented 9 months ago

To be honest, seems a thing specific to the devices+OS combination. You could write a small example program that injects events like droidVNC-NG's InputService does and see how you can modify it to work.

Farsebo commented 9 months ago

anydesk when you click the left button, nothing is recorded in the log, but work. when you press the right button, nothing happens teamv does not work

bk138 commented 9 months ago

anydesk when you click the left button, nothing is recorded in the log, but work. when you press the right button, nothing happens teamv does not work

Good point checking those! So it seems an issue of the underlying OS.

Farsebo commented 9 months ago

tapxq4input.txt I found the I/O logs via the command: adb shell dumpsys input

is this enough for some solutions for now, or is there something else to look for?

Farsebo commented 9 months ago

so is it possible to do something with these logs, or do you need some more information?

bk138 commented 9 months ago

I for my part can not do anything with the logs, sorry. I think it might be the device if other apps fail as well.

Farsebo commented 9 months ago

but anydesk works

are there any vnc server alternatives that can be run for verification?

bk138 commented 9 months ago

We'd need to look at their source to see how exactly they do it, otherwise it's just stabbing at the dark. Maybe you can find some open-source app unrelated to remote desktop that uses the same functionality...

bk138 commented 8 months ago

Tentatively closing, please re-open or post here if there's new info available.