virresh / matvt

Virtual Mouse for Android TV that can be controlled via remote itself.
GNU General Public License v3.0
229 stars 37 forks source link

[Flip-Phones] Click and Swipe don't work on Android 11 Go / Sonim XP3plus #37

Open ybtag opened 2 years ago

ybtag commented 2 years ago

I used your app with great success on the Sonim XP3 flip phone. But on the new model, the XP3plus, which runs on Android 11 Go, clicking and swiping don't work at all. I don't know if this is an issue with the way that Accessibility works on Android 11 Go or if it's more specific to this phone model. However, another app which uses Accessibility to click on Nodes, switchboard, works fine on this phone.

The Center Key of the DPAD still has the same KEYCODE value

I would be glad to contribute code, but I'm not very familiar with the way Accessibility works

virresh commented 2 years ago

Hi @ybtag Thanks for reporting. This is a known issue with Android 11. It is a bug introduced by Google and has been fixed in Android 12. Unfortunately, I do not know of a reliable way to get it working on Android 11. There is an experimental ADB based engine, but I programmed it only for Android TVs. I do not expect it to work on flipphones.

Sorry, I don't know much about flipphones and cannot comment on the feasibility of the ADB based engine for flipphones.

Experimental build for Android 11 on TVs - https://github.com/virresh/matvt/issues/28#issuecomment-991885056

Link to thread with code references to the buggy patch and the fix in Android - https://github.com/virresh/matvt/issues/28#issuecomment-1020814825

ybtag commented 2 years ago

Thanks for the info. Unfortunately, the experimental build didn't work either. Could you make the source code available as a branch? I was reduced to editing Smali code to experiment with this 😁

ybtag commented 2 years ago

Okay, I have a little more understanding now. dispatchGesture is not working on Android 11 due to Google's mistake. But the old backup method which was kept in MATVT works a little. This involves sending events to an accessibility node. For some reason only the click functionality is working, though. This is the method used by the Switchboard app I referenced earlier.

ybtag commented 2 years ago

So I've done some very hacky modifications to my fork so that it always sends Click to the nodes no matter what they contain. Here is my fork. This will have to do until @virresh decides if he wants to share the source code for his experimental adb engine. Maybe if he would I could try to see if I could get it working with the Sonim xp3plus.

virresh commented 2 years ago

Hey @ybtag This is great! Thanks a lot for choosing to open source your fork! Really appreciate your efforts 😄

I thought I'd made the source open, my bad. I've pushed a branch test-adb-server here - https://github.com/virresh/matvt/tree/test-adb-server with the source code for the pre-release.

Hope this helps. Looking forward to your hacks 😃

PS: Pls don't mind the messy code, I've not been able to take out enough time to clean it up. Always open for discussion if there's anything that isn't clear.

ybtag commented 2 years ago

Thank you @virresh! Of course I made it open source. Please don't take to heart the actions of a few bad apples

ownaginatious commented 2 years ago

Hey there, I just got a new Schok Flip phone also running Android 11 Go. Unfortunately, it too seems to suffer from the issue where click and swipe don't do anything. The phone has a built in virtual cursor app so I shouldn't need this, but that is completely broken and won't start right out of the box... nice.

Anyway, just checking in as it has been a while: has there been any progress here or elsewhere in finding/creating a workaround? I can try to dedicate some time to investigating further if not.

virresh commented 2 years ago

Hey @ownaginatious , Nope, I'm not aware of any further progress. ybtag did attempt to port it, their last message is at https://github.com/virresh/matvt/issues/24#issuecomment-1053835789

I've commented some ideas on working around that, but I'm not in favor of implementing it because it seems too brittle and would probably break on almost every other phone.

virresh commented 2 years ago

Although in case you would like to hack on it and implement it, I'll always be happy to help with merging the contribution

ownaginatious commented 2 years ago

@virresh thanks for the response and the linked thread :+1: After looking through the details, I agree that the only viable solution looks a bit too convoluted to be worth spending time on :disappointed:

I actually ended up returning the phone after noticing the company just didn't install the virtual mouse app that was promised in the manual, probably after noticing it didn't work in Android 11 Go (wouldn't be surprised if they just stole this project's source code :wink:).

Thanks anyway though! At the very least, I know there are many happy Android <11 Go dumbphone users out there happily using your app :) Hopefully there will be many happy Android >11 Go users in the future too!

ookokokok commented 2 years ago

Hey there, I just got a new Schok Flip phone also running Android 11 Go. Unfortunately, it too seems to suffer from the issue where click and swipe don't do anything. The phone has a built in virtual cursor app so I shouldn't need this, but that is completely broken and won't start right out of the box... nice.

Anyway, just checking in as it has been a while: has there been any progress here or elsewhere in finding/creating a workaround? I can try to dedicate some time to investigating further if not.

I have spent around a week not giving up trying to find a solution to the Schok Flip's cursor. Is there an APK I can set up with a few ADB commands so I can get a little cursor? Does anyone have an idea??

virresh commented 2 years ago

Hey @ookokokok Someone mentioned that they might have found a workaround - https://github.com/virresh/matvt/issues/24#issuecomment-1214449222

We'll have to wait for their results, then probably you can try that as well if it works.