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

VNC Input not working but still able to see whats on the screen #194

Closed elvanowen closed 3 months ago

elvanowen commented 3 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 After a while, VNC input stop working but will still show what is on the screen. Manual control through phone will still be reflected through the VNC, only input from VNC didn't work.

Expected Behavior Expecting VNC input to work

Logs/Backtraces Seeing these NullPointerException errors from logcat:

03-12 12:41:09.451  6343  6343 D droidvnc-ng (native): vncUpdateFramebuffer: copy took 4.045 ms
03-12 12:41:09.516  6343  6343 D droidvnc-ng (native): vncUpdateFramebuffer: copy took 3.563 ms
03-12 12:41:09.531  6343 16049 E InputService: onPointerEvent: failed: java.lang.NullPointerException: Attempt to read from field 'java.util.Map net.christianbeier.droidvnc_ng.InputService.mInputContexts' on a null object reference in method 'void net.christianbeier.droidvnc_ng.InputService.onPointerEvent(int, int, int, long)'
03-12 12:41:09.531  6343 16049 E InputService:  at net.christianbeier.droidvnc_ng.InputService.onPointerEvent(InputService.java:187)
03-12 12:41:09.531  6343 16049 E InputService: onPointerEvent: failed: java.lang.NullPointerException: Attempt to read from field 'java.util.Map net.christianbeier.droidvnc_ng.InputService.mInputContexts' on a null object reference in method 'void net.christianbeier.droidvnc_ng.InputService.onPointerEvent(int, int, int, long)'
03-12 12:41:09.531  6343 16049 E InputService:  at net.christianbeier.droidvnc_ng.InputService.onPointerEvent(InputService.java:187)
03-12 12:41:09.533  6343 16049 E InputService: onPointerEvent: failed: java.lang.NullPointerException: Attempt to read from field 'java.util.Map net.christianbeier.droidvnc_ng.InputService.mInputContexts' on a null object reference in method 'void net.christianbeier.droidvnc_ng.InputService.onPointerEvent(int, int, int, long)'
03-12 12:41:09.533  6343 16049 E InputService:  at net.christianbeier.droidvnc_ng.InputService.onPointerEvent(InputService.java:187)
03-12 12:41:09.554  6343 16049 E InputService: onPointerEvent: failed: java.lang.NullPointerException: Attempt to read from field 'java.util.Map net.christianbeier.droidvnc_ng.InputService.mInputContexts' on a null object reference in method 'void net.christianbeier.droidvnc_ng.InputService.onPointerEvent(int, int, int, long)'

Your environment (please complete the following information):

bk138 commented 3 months ago

Seems the InputService has gone. Few questions:

elvanowen commented 3 months ago

Here is a more complete log if it might be useful for you. (deleted)

Would you be confident to try out some debug apk's I'd post here?

Sure, I can give it a try.

bk138 commented 3 months ago

Looks like the InputService gets destroyed by the OS. Are you running any other a11y services?

elvanowen commented 3 months ago

There were only 2 services running:

# adb shell dumpsys accessibility
...
Bound services:{Service[label=droidVNC-NG, feedbackType[], capabilities=32, eventTypes=TYPE_WINDOWS_CHANGED, notificationTimeout=50, requestA11yBtn=false],
                     Service[label=Accessibility menu, feedbackType[FEEDBACK_GENERIC], capabilities=8, eventTypes=, notificationTimeout=0, requestA11yBtn=true]}
Enabled services:{{com.android.settings/com.android.settings.accessibility.accessibilitymenu.AccessibilityMenuService}, {net.christianbeier.droidvnc_ng/net.christianbeier.droidvnc_ng.InputService}}
...

I will try to turn off the accessibility menu and see if it fixes the issue.

bk138 commented 3 months ago

Maybe one of the many things mentioned in https://github.com/bitwarden/mobile/issues/596 might help?

bk138 commented 3 months ago

Tentatively closing, please post here once there is new info available.