virresh / matvt

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

Enable matvt with adb #18

Closed johnd0e closed 2 years ago

johnd0e commented 2 years ago

My android tv device does not have UI (1)to grant Overlay permission, and (2)to enable Accessibility service First is rather easy with adb, but I don't know how to do second.

Could you give me a hint?

virresh commented 2 years ago

@johnd0e the following commands should hopefully work for granting necessary permissions via adb:

adb shell appops set io.github.virresh.matvt SYSTEM_ALERT_WINDOW allow
adb shell settings put secure accessibility_enabled 1
adb shell settings put secure enabled_accessibility_services io.github.virresh.matvt/io.github.virresh.matvt.services.MouseEventService
adb shell am startservice io.github.virresh.matvt/io.github.virresh.matvt.services.MouseEventService

Let me know if you face issues.

PS: Sometimes the same command might be required to run more than once

johnd0e commented 2 years ago

Executed twice but still unable to start service:

sheldon:/ $ am startservice io.github.virresh.matvt/io.github.virresh.matvt.se
ce io.github.virresh.matvt/io.github.virresh.matvt.se                         <rvices.MouseEventService

Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=io.github.virresh.matvt/.services.MouseEventService }
Error: Requires permission android.permission.BIND_ACCESSIBILITY_SERVICE
255|sheldon:/ $
KFMDMSolutions commented 2 years ago

btw as far as i remember the service starts by itself so you only need this three commends

adb shell appops set io.github.virresh.matvt SYSTEM_ALERT_WINDOW allow adb shell settings put secure accessibility_enabled 1 adb shell settings put secure enabled_accessibility_services io.github.virresh.matvt/io.github.virresh.matvt.services.MouseEventService

johnd0e commented 2 years ago

@KFMDMSolutions Just tried. All three succeded, but I still see "Accessibility Permissions: Not Granted"

virresh commented 2 years ago

@johnd0e , can you mention the Android version and TV Model if possible? I'm not sure at the moment why it's not working, asking this information for potential future investigation.

johnd0e commented 2 years ago

https://www.amazon.com/fire-tv-stick-lite/dp/B07YNLBS7R/ Fire OS 7 based on Android 9

sweenwolf commented 2 years ago

https://www.amazon.com/fire-tv-stick-lite/dp/B07YNLBS7R/ Fire OS 7 based on Android 9

FireOS no longer supports Accessibility (Heart of this App), This app will not work on Your Device.

johnd0e commented 2 years ago

Thank you for reply.