I'm developing an app that intercepts toast messages and displays them in a custom view.
The interception part is easily implemented using the AccessibilityService
.
The tricky part is how to suppress the toast messages from appearing (or at least make them invisible). I know (to the best of my understanding) that this is not possible in normal circumstances.
But does anyone know any hacks that would allow me to suppress the toasts from appearing or make them invisible?
Would it be possible with root permission?
Note: I'm relatively new to programming. Nonetheless, I had a look at the android source code for Toast.java (link). Would it be possible to intercept the show()
method or any other relevant method to stop them from appearing (maybe with root permission)?