Skip to content

Commit

Permalink
3.138
Browse files Browse the repository at this point in the history
  • Loading branch information
rev1si0n committed Mar 20, 2023
1 parent 2fcaea0 commit a210bf1
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.138
* 修复 gRPC 依赖的问题
* 获取系统最后一个 toast


3.135
* 修复远程桌面加载中的问题
* 彻底修复协议中的竞争条件问题
Expand Down
6 changes: 6 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,12 @@ d.dump_window_hierarchy().getvalue()
d.wait_for_idle(5*1000)
```

> get last toast

```python
d.get_last_toast()
```

## Advanced UI Operations

> Selector
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,12 @@ d.dump_window_hierarchy().getvalue()
d.wait_for_idle(5*1000)
```

> 获取最近的 toast

```python
d.get_last_toast()
```

## 进阶UI操作

> Selector
Expand Down
2 changes: 1 addition & 1 deletion lamda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Distributed under MIT license.
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
__version__ = "3.135"
__version__ = "3.138"
8 changes: 8 additions & 0 deletions lamda/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,12 @@ def get_watcher_enabled(self, name):
获取此 watcher 是否启用
"""
return self.watchers.get(name, {}).get("enable")
def get_last_toast(self):
"""
获取系统中最后一个 toast 消息
"""
r = self.stub.getLastToast(protos.Empty())
return r
def remove_watcher(self, name):
"""
移除一个 watcher
Expand Down Expand Up @@ -1758,6 +1764,8 @@ def dump_window_hierarchy(self):
return self.stub("UiAutomator").dump_window_hierarchy()
def wait_for_idle(self, timeout):
return self.stub("UiAutomator").wait_for_idle(timeout)
def get_last_toast(self):
return self.stub("UiAutomator").get_last_toast()
# watcher
def remove_all_watchers(self):
return self.stub("UiAutomator").remove_all_watchers()
Expand Down
1 change: 1 addition & 0 deletions lamda/rpc/services.proto
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ service UiAutomator {
rpc selectorLongClick(SelectorClickRequest) returns (Boolean) {}

rpc selectorExists(SelectorOnlyRequest) returns (Boolean) {}
rpc getLastToast(google.protobuf.Empty) returns (ToastInfo) {}

rpc selectorObjInfo(SelectorOnlyRequest) returns (ObjInfo) {}
rpc selectorObjInfoOfAllInstances(SelectorOnlyRequest) returns (ObjInfoList) {}
Expand Down
6 changes: 6 additions & 0 deletions lamda/rpc/uiautomator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ message ObjInfo {
Bound visibleBounds = 17;
}

message ToastInfo {
uint64 timestamp = 1;
string package = 2;
string message = 3;
}

message ObjInfoList {
repeated ObjInfo objects = 1;
}
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
],
},
install_requires= [
"grpcio-tools>=1.35.0,<=1.50.0",
"grpc-interceptor>=0.13.0,<0.14.2",
"grpcio>=1.35.0,<=1.50.0",
"grpcio-tools>=1.35.0,<1.49.0",
"grpc-interceptor>=0.13.0,<0.15.0",
"grpcio>=1.35.0,<1.49.0",
"asn1crypto>=1.0.0,<2",
],
classifiers = [
Expand Down

0 comments on commit a210bf1

Please sign in to comment.