简体   繁体   English

在Android中阅读其他应用程序WindowManager(System Alert)Alert?

[英]Read other application WindowManager(System Alert) Alert in android?

I am building an android application where I want to read WindowManager(System Alert) Alert Text that is trigger from some other application. 我正在构建一个Android应用程序,我想在其中读取其他应用程序触发的WindowManager(System Alert)Alert Text。

Suppose there is some application like true caller and after the end of each call this application display some information of that particular phone number in WindowManager(System Alert) of android and I want to read all this information related to that phone number which is displayed in WindowManger(System Alert) using my application. 假设有某个应用程序,例如真正的呼叫者,并且在每次通话结束后,此应用程序在android的WindowManager(System Alert)中显示该特定电话号码的某些信息,而我想读取与该电话号码相关的所有信息使用我的应用程序的WindowManger(System Alert)。

Is there any way to read or to get view child of WindowManger(System Alert) Alert dialog trigger by other application. 是否有任何方法可以读取或获取其他应用程序触发的WindowManger(System Alert)Alert对话框的子视图。

Think one way would be to write an accessibility service ( https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html ) and hook to some accessibility events. 想办法之一是编写一个可访问性服务( https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html )并挂钩一些可访问性事件。 Maybe TYPE_WINDOW_STATE_CHANGED? 也许是TYPE_WINDOW_STATE_CHANGED?

You can try setting AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS in the accessibility service and listen for events like 您可以尝试在可访问性服务中设置AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS并侦听类似事件

    case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED: {
                AccessibilityNodeInfo nodes = getRootInActiveWindow();
                String nodeText = nodes.getText();
                String nodeContentText nodes.getContentDescription();

                // Also you could cycle through the children repeating the same
                // As an example only taking the first child, you could 
                // loop through or use recursion

                AccessibilityNodeInfo firstNode = nodes.getChild(0)
                String nodeTextFirstChild = firstNode.getText();
                String nodeContentTextFirstChild = firstNode.getContentDescription();
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android WindowManager TYPE_SYSTEM_ALERT触摸布局 - Android WindowManager TYPE_SYSTEM_ALERT Layout on touch WindowManager.addView 是否需要 android.permission.SYSTEM_ALERT_WINDOW,或者仅在使用 TYPE_APPLICATION_OVERLAY 时? - Is WindowManager.addView required android.permission.SYSTEM_ALERT_WINDOW regardless, or only when using TYPE_APPLICATION_OVERLAY? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY需要android.permission.SYSTEM_ALERT_WINDOW吗? - Do i need android.permission.SYSTEM_ALERT_WINDOW for WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY? 有没有办法在系统警报视图前面显示Toast(或添加到WindowManager中的东西)? - Is there a way to display a Toast in front of a System Alert view (or something added to a WindowManager)? 在应用程序崩溃时删除WindowManager.LayoutParams.TYPE_SYSTEM_ALERT视图 - Remove WindowManager.LayoutParams.TYPE_SYSTEM_ALERT view on app crash 使用WindowManager的TYPE_SYSTEM_ALERT时无效的显示分辨率 - Invalid display resolution while using TYPE_SYSTEM_ALERT of WindowManager TYPE_SYSTEM_ALERT会干扰其他应用的输入〜Android - TYPE_SYSTEM_ALERT interfere input to other apps ~Android android 6 系统警报权限..! - android 6 system alert permission..! WindowManager.LayoutParams组合,可以将事件传递给TYPE_SYSTEM_ALERT或smilar下的图层 - WindowManager.LayoutParams combination that can pass events to layers under TYPE_SYSTEM_ALERT or smilar Android系统警报窗口会定期关闭和打开 - Android System Alert Window turns off and on periodically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM