Skip to content

基于WEB接口的开发指南

木木的木头 edited this page Aug 20, 2020 · 3 revisions

准备工作:

1、手机安装好xposed框架

2、安装RobotHelper.apk

3、xposed mannager中启用robothelper,重启手机

4、打开手机设置->系统设置->无障碍->RobotHelper 选择启用

5、打开RobotHelper->开始->开启HTTPSERVER(在手机下拉栏)

可用接口:

一、获取页面DOM

接口地址:http://手机IP:1082/dom

接口参数 必填 说明 请求方式
id id为空将从根路径开始返回屏幕全部DOM数据,否则将从指定ID开始返回DOM数据 GET

请求示例: http://10.220.107.33:1082/dom

这个接口会返回手机当前页面的DOM,我这个示例是在手机的系统设置->无障碍页面执行的,下面就是无障碍页面的DOM

返回示例:
{
    "children": [
        {
            "name": "向上导航",
            "payload": {
                "visible": true,
                "zOrders": {
                    "global": 0,
                    "local": 2
                },
                "package": "com.android.settings",
                "anchorPoint": [
                    0.5,
                    0.5
                ],
                "dismissable": false,
                "checkable": false,
                "scale": [
                    1,
                    1
                ],
                "boundsInParent": [
                    0.11666666666666667,
                    0.05384615384615385
                ],
                "focusable": true,
                "type": "android.widget.ImageButton",
                "touchable": true,
                "enabled": true,
                "longClickable": false,
                "size": [
                    0.11666666666666667,
                    0.05384615384615385
                ],
                "pos": [
                    0.07291666666666667,
                    0.09358974358974359
                ],
                "name": "向上导航",
                "focused": false,
                "checked": false,
                "editalbe": false,
                "selected": false,
                "scrollable": false,
                "desc": "向上导航"
            }
        },
        {
            "name": "android.widget.TextView",
            "payload": {
                "visible": true,
                "zOrders": {
                    "global": 0,
                    "local": 1
                },
                "package": "com.android.settings",
                "anchorPoint": [
                    0.5,
                    0.5
                ],
                "dismissable": false,
                "checkable": false,
                "scale": [
                    1,
                    1
                ],
                "boundsInParent": [
                    0.125,
                    0.025961538461538463
                ],
                "focusable": false,
                "type": "android.widget.TextView",
                "touchable": false,
                "enabled": true,
                "longClickable": false,
                "size": [
                    0.125,
                    0.025961538461538463
                ],
                "pos": [
                    0.21805555555555556,
                    0.09358974358974359
                ],
                "name": "android.widget.TextView",
                "focused": false,
                "checked": false,
                "text": "无障碍",
                "editalbe": false,
                "selected": false,
                "scrollable": false
            }
        },
        {
            "name": "搜索设置",
            "payload": {
                "visible": true,
                "zOrders": {
                    "global": 0,
                    "local": 3
                },
                "package": "com.android.settings",
                "anchorPoint": [
                    0.5,
                    0.5
                ],
                "dismissable": false,
                "checkable": false,
                "scale": [
                    1,
                    1
                ],
                "boundsInParent": [
                    0.11666666666666667,
                    0.05384615384615385
                ],
                "focusable": true,
                "type": "android.widget.TextView",
                "touchable": true,
                "enabled": true,
                "longClickable": false,
                "size": [
                    0.11666666666666667,
                    0.05384615384615385
                ],
                "pos": [
                    0.9270833333333334,
                    0.09358974358974359
                ],
                "name": "搜索设置",
                "focused": false,
                "checked": false,
                "editalbe": false,
                "selected": false,
                "scrollable": false,
                "desc": "搜索设置"
            }
        },
        {
            "children": [
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.2722222222222222,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.2722222222222222,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.28958333333333336,
                                    0.1608974358974359
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "音量键快捷方式",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.13819444444444445,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.13819444444444445,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.2222222222222222,
                                    0.18365384615384617
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "TalkBack",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 1
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.07692307692307693
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.07692307692307693
                        ],
                        "pos": [
                            0.5,
                            0.17147435897435898
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.8444444444444444,
                                    0.01826923076923077
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.8444444444444444,
                                    0.01826923076923077
                                ],
                                "pos": [
                                    0.5777777777777777,
                                    0.24583333333333332
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "已下载的服务",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.FrameLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 2
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            0.9805555555555555,
                            0.03621794871794872
                        ],
                        "focusable": false,
                        "type": "android.widget.FrameLayout",
                        "touchable": false,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            0.9805555555555555,
                            0.03621794871794872
                        ],
                        "pos": [
                            0.5097222222222222,
                            0.23685897435897435
                        ],
                        "name": "android.widget.FrameLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.1736111111111111,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.1736111111111111,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.24027777777777778,
                                    0.29423076923076924
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "Bitwarden",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.8465277777777778,
                                    0.046474358974358976
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.8465277777777778,
                                    0.046474358974358976
                                ],
                                "pos": [
                                    0.5763888888888888,
                                    0.3294871794871795
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭/Assist with filling username and password fields in other apps and on the web.",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 3
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.10673076923076923
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.10673076923076923
                        ],
                        "pos": [
                            0.5,
                            0.3173076923076923
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.25972222222222224,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.25972222222222224,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.2833333333333333,
                                    0.4009615384615385
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "Nova Launcher",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.1875,
                                    0.4237179487179487
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 4
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.08141025641025641
                        ],
                        "pos": [
                            0.5,
                            0.4115384615384615
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.21666666666666667,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.21666666666666667,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.26180555555555557,
                                    0.4823717948717949
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "RobotHelper",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.1875,
                                    0.5051282051282051
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "开启",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 5
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.08141025641025641
                        ],
                        "pos": [
                            0.5,
                            0.492948717948718
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.15555555555555556,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.15555555555555556,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.23125,
                                    0.5637820512820513
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "TalkBack",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.3541666666666667,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.3541666666666667,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.33055555555555555,
                                    0.5865384615384616
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭/读出屏幕上的内容",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 6
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.08141025641025641
                        ],
                        "pos": [
                            0.5,
                            0.5743589743589743
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.2861111111111111,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.2861111111111111,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.2965277777777778,
                                    0.6451923076923077
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "Yosemite Helper",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.1875,
                                    0.6679487179487179
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 7
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.08141025641025641
                        ],
                        "pos": [
                            0.5,
                            0.6557692307692308
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.15555555555555556,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.15555555555555556,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.23125,
                                    0.7266025641025641
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "开关控制",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.3541666666666667,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.3541666666666667,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.33055555555555555,
                                    0.7493589743589744
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭/利用开关控制设备",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 8
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.08141025641025641
                        ],
                        "pos": [
                            0.5,
                            0.7371794871794872
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.19444444444444445,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.19444444444444445,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.25069444444444444,
                                    0.8080128205128205
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "搜狗输入法",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.1875,
                                    0.8307692307692308
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 9
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.08141025641025641
                        ],
                        "pos": [
                            0.5,
                            0.8185897435897436
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.35,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.35,
                                    0.02435897435897436
                                ],
                                "pos": [
                                    0.3284722222222222,
                                    0.8894230769230769
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "支付宝语音权限助手",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.06805555555555555,
                                    0.021153846153846155
                                ],
                                "pos": [
                                    0.1875,
                                    0.9121794871794872
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 10
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.08141025641025641
                        ],
                        "pos": [
                            0.5,
                            0.9
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                },
                {
                    "children": [
                        {
                            "name": "android:id/title",
                            "payload": {
                                "resourceId": "android:id/title",
                                "visible": true,
                                "zOrders": {
                                    "global": 0,
                                    "local": 1
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.2722222222222222,
                                    0.02435897435897436
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.2722222222222222,
                                    0.023397435897435898
                                ],
                                "pos": [
                                    0.28958333333333336,
                                    0.9701923076923077
                                ],
                                "name": "android:id/title",
                                "focused": false,
                                "checked": false,
                                "text": "无障碍功能菜单",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        },
                        {
                            "name": "android:id/summary",
                            "payload": {
                                "resourceId": "android:id/summary",
                                "visible": false,
                                "zOrders": {
                                    "global": 0,
                                    "local": 2
                                },
                                "package": "com.android.settings",
                                "anchorPoint": [
                                    0.5,
                                    0.5
                                ],
                                "dismissable": false,
                                "checkable": false,
                                "scale": [
                                    1,
                                    1
                                ],
                                "boundsInParent": [
                                    0.4222222222222222,
                                    0.021153846153846155
                                ],
                                "focusable": false,
                                "type": "android.widget.TextView",
                                "touchable": false,
                                "enabled": true,
                                "longClickable": false,
                                "size": [
                                    0.4222222222222222,
                                    -9.615384615384616E-4
                                ],
                                "pos": [
                                    0.3645833333333333,
                                    0.9823717948717948
                                ],
                                "name": "android:id/summary",
                                "focused": false,
                                "checked": false,
                                "text": "关闭/通过大型菜单控制手机",
                                "editalbe": false,
                                "selected": false,
                                "scrollable": false
                            }
                        }
                    ],
                    "name": "android.widget.LinearLayout",
                    "payload": {
                        "visible": true,
                        "zOrders": {
                            "global": 0,
                            "local": 11
                        },
                        "package": "com.android.settings",
                        "anchorPoint": [
                            0.5,
                            0.5
                        ],
                        "dismissable": false,
                        "checkable": false,
                        "scale": [
                            1,
                            1
                        ],
                        "boundsInParent": [
                            1,
                            0.08141025641025641
                        ],
                        "focusable": true,
                        "type": "android.widget.LinearLayout",
                        "touchable": true,
                        "enabled": true,
                        "longClickable": false,
                        "size": [
                            1,
                            0.041346153846153845
                        ],
                        "pos": [
                            0.5,
                            0.9612179487179487
                        ],
                        "name": "android.widget.LinearLayout",
                        "focused": false,
                        "checked": false,
                        "editalbe": false,
                        "selected": false,
                        "scrollable": false
                    }
                }
            ],
            "name": "com.android.settings:id/recycler_view",
            "payload": {
                "resourceId": "com.android.settings:id/recycler_view",
                "visible": true,
                "zOrders": {
                    "global": 0,
                    "local": 6
                },
                "package": "com.android.settings",
                "anchorPoint": [
                    0.5,
                    0.5
                ],
                "dismissable": false,
                "checkable": false,
                "scale": [
                    1,
                    1
                ],
                "boundsInParent": [
                    1,
                    0.8490384615384615
                ],
                "focusable": true,
                "type": "androidx.recyclerview.widget.RecyclerView",
                "touchable": false,
                "enabled": true,
                "longClickable": false,
                "size": [
                    1,
                    0.8490384615384615
                ],
                "pos": [
                    0.5,
                    0.5573717948717949
                ],
                "name": "com.android.settings:id/recycler_view",
                "focused": false,
                "checked": false,
                "editalbe": false,
                "selected": false,
                "scrollable": true
            }
        }
    ],
    "name": "android.widget.FrameLayout",
    "payload": {
        "visible": true,
        "zOrders": {
            "global": 0,
            "local": 0
        },
        "package": "com.android.settings",
        "anchorPoint": [
            0.5,
            0.5
        ],
        "dismissable": false,
        "checkable": false,
        "scale": [
            1,
            1
        ],
        "boundsInParent": [
            1,
            1
        ],
        "focusable": false,
        "type": "android.widget.FrameLayout",
        "touchable": false,
        "enabled": true,
        "longClickable": false,
        "size": [
            1,
            1
        ],
        "pos": [
            0.5,
            0.5
        ],
        "name": "android.widget.FrameLayout",
        "focused": false,
        "checked": false,
        "editalbe": false,
        "selected": false,
        "scrollable": false
    }
}

二、获取手机屏幕尺寸

接口地址:http://手机IP:1082/sceenSize

接口参数 必填 说明 请求方式
返回手机屏幕尺寸 GET

请求示例: http://10.220.107.33:1082/sceenSize

返回示例:

{"w": 3120 , "h":1440  }

三、拖动

接口地址:http://手机IP:1082/swipe

接口参数 必填 说明 请求方式
start_x 起始点X坐标 GET
start_y 起始点Y坐标 GET
end_x 终点X坐标 GET
end_y 终点Y坐标 GET
duration 整个操作的时间(即:时间越短,拖动越快),单位秒 GET

请求示例: http://10.220.107.33:1082/swipe?start_x=500&start_y=2000&end_x=500&end_y=1000&duration=0.2

返回示例:

{
    "code": 200,
    "msg": "success"
}

四、点击

接口地址:http://手机IP:1082/tap

接口参数 必填 说明 请求方式
x X坐标 GET
y Y坐标 GET
y Y坐标 GET
delay 按下时间,单位秒 GET
请求示例: http://10.220.107.33:1082/tap?x=600&y=600&delay=0.1
返回示例:

{
    "code": 200,
    "msg": "success"
}

五、剪切板

接口地址:http://手机IP:1082/clipboard

接口参数 必填 说明 请求方式
str 需要写入剪切板的文字 GET

请求示例: http://10.220.107.33:1082/clipboard?str=这段文字将被写入剪切板

返回示例:

{
    "code": 200,
    "msg": "success"
}

其他

通过WEB接口,你可以不用编写任何Android代码而达到控制手机并且读取手机全部显示数据的目的。你可以通过这种方式快速的开发Android APP爬虫,或者是开发游戏、应用辅助脚本。

Web接口的优势是完全封装了Android开发的工作量,并且,你可以使用任何你喜欢的语言/技术进行开发,just enjoy!