android - How to open system activity and click button there? -


how app greenify, open system activity , click button there? activity "app info", automatically clicked "force stop" button. , app can click button in activity without root.

code open activity "app info" this:

    intent intent = new intent();     intent.setaction(settings.action_application_details_settings);     uri uri = uri.fromparts("package", "com.package.sendinput", null);     intent.setdata(uri);     startactivityforresult(intent, 0); 

then activity opened. click button there, have tried execute adb shell input tap 200 340 (using same uid running app), "killed" system. using root can click button.

is there other way?

thanks in advance

edit: (guess work, because haven't done myself)

greenify automation done running accessiblity service. in nutshell, retrieves current content of window , sends accessibilityevents specified views like: touch, focus.

content window described accessibilitywindowinfo can type_application, type_input_method, type_system.

for sending events window uses accessibilitymanager send accessibilityevent child view have retrieved in accessibilitywindowinfo

reading: uiautomation

accessibility package


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -