Skip to content

Commit 8f97acb

Browse files
committed
3.150
1 parent a210bf1 commit 8f97acb

File tree

6 files changed

+56
-25
lines changed

6 files changed

+56
-25
lines changed

CHANGELOG.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
3.150
2+
* 修改定时任务重载时的逻辑
3+
* 修复 scapy 路由的问题
4+
* 兼容部分小米设备
5+
* 修复安卓11接口兼容性问题(感谢 Kate Swan)
6+
* 支持连接 WIFI 的情况下使用 4G 作为代理
7+
* 新增部分界面控件
8+
19
3.138
210
* 修复 gRPC 依赖的问题
311
* 获取系统最后一个 toast
412

5-
613
3.135
714
* 修复远程桌面加载中的问题
815
* 彻底修复协议中的竞争条件问题
@@ -13,7 +20,6 @@
1320
* 远程桌面响应式布局
1421
* 预发 next 版本
1522

16-
1723
3.123
1824
* 修复获取最近活动不全的问题
1925

@@ -116,4 +122,4 @@
116122
-----------------------
117123
* 提高内置 ADB 性能
118124
* openvpn 服务支持 auth 参数 (默认为 SHA1)
119-
* 通过内置 ADB 使用 scrcpy 异常的问题
125+
* 通过内置 ADB 使用 scrcpy 异常的问题

README.en.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ Directly through code point and click, it can replace most manual operations.
7373

7474
## Interface layout review
7575

76-
You can instantly review the interface layout of your Android app for writing automation code from your remote desktop, by pressing `CTRL + I` from your remote desktop to enter the mode.
77-
Press `CTRL + R` to refresh the layout and `CTRL + I` again to exit.
76+
You can instantly review the interface layout of your Android application for writing automation code from the remote desktop. You can enter the mode by clicking on the eye icon in the top right corner of the remote desktop.
77+
Press `CTRL + R` to refresh the layout and click the eye icon again to exit.
7878

7979
![Interface layout view](image/inspect.gif)
8080

@@ -533,14 +533,20 @@ curl -x http://192.168.0.2:65000 https://httpbin.org/ip
533533
```
534534

535535
Custom Proxy Configuration
536-
If you want to use a mobile network (4G/5G) as a proxy outlet, it should be noted that rmnet mobile data may not be enabled when you are connected to a WIFI network, and that WIFI is usually not enabled when you are connected to mobile data. This means that when you are connected to WIFI, the default is to go out through WIFI, and when you are disconnected from WIFI, the default is to go out through data traffic, and there is a certain mutual exclusivity between them (which may vary between system versions). So configuring the iface parameter becomes an optional option and is only provided as an additional possibility, unless you make both the rmnet and wlan NICs active yourself. The following example only changes the login user information for the default agent.
536+
If you wish to use a mobile network (4G/5G) as a proxy outlet, it should be noted that native rmnet mobile data does not co-exist with WIFI.
537+
LAMDA requires your Android >= 9.0 in order to use 4G mobile data as a proxy outlet while connected to WIFI.
537538

538539
```ini
539540
# Append to properties.local configuration file
540541
tunnel2.login=lamda
541542
tunnel2.password=mypassword
542-
# It is not recommended to configure the iface parameter unless you know what you are doing
543-
# tunnel2.iface=wlan0
543+
#
544+
# There are two configurable values for iface, i.e. wlan, rmnet, when the iface value is wlan
545+
# will automatically detect the available wlan interfaces and select any one to make the request, when iface is rmnet
546+
# will try to enable mobile data (even if WIFI is enabled) and send the request from the mobile network interface.
547+
# When configured as rmnet/wlan but its interface has no network, the proxy will fail.
548+
# When not configured, requests are made using the default network.
549+
#tunnel2.iface=rmnet
544550
```
545551

546552
If you want to be able to use the device as a proxy from any location, see the `Making LAMDA connectable from any location` section.
@@ -881,7 +887,7 @@ Now, open the web console or a ssh/adb shell connected to your device and execut
881887
> Some example rules
882888
883889
```
884-
@reboot echo Executed when the framework is started/reloaded (reloaded)
890+
@reboot echo Executed when the framework is started
885891
0 */1 * * * echo Execute every hour
886892
* * * * * echo Execute every minute
887893
0 8 * * * echo Execute at eight o'clock every day
@@ -1468,9 +1474,8 @@ d.get_last_toast()
14681474

14691475
> Selector
14701476

1471-
For the interface layout review, first you need to open the device's web remote desktop. Afterwards, mouse click on the left screen to ensure that the focus falls on the cast screen (otherwise the focus may be captured by the terminal on the right).
1472-
Then press the shortcut `CTRL+I` (to start the layout view), you will no longer be able to swipe the left screen, you can click on the dotted box on the screen to see the information about the corresponding element, you can use some of its properties as parameters for the Selector.
1473-
Pressing `CTRL+I` again will close the layout view, which will not be refreshed as the page changes, it will always be the layout of the screen at the moment you press the shortcut key, if you need to refresh the layout press `CTRL+R` manually.
1477+
To view the layout of the interface, first you need to open the web remote desktop of the device. You can then click on the eye icon in the top right hand corner of the remote desktop to access it, you will no longer be able to swipe the left hand side of the screen, you can click on the dotted box on the screen to view information about the corresponding element, you can use some of these properties as parameters for the Selector.
1478+
Clicking on the eye icon again will close the layout view. The layout view will not be refreshed as the page changes, it will always be the layout of the screen at the moment you press the shortcut key, if you need to refresh the layout please press the shortcut key `CTRL+R` manually.
14741479

14751480
Normally we would only use `resourceId`, `clickable`, `text`, `description` as parameters.
14761481
If the element has a normal resourceId, it will be used as Selector in preference, i.e.: `Selector(resourceId="com.android.systemui:id/mobile_signal_single"`.

README.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ MOMO (vvb2060) 是我们认为目前最强的ROOT特征检测软件,如 MOMO
7979

8080
## 界面布局检视
8181

82-
可在远程桌面即时检视安卓应用的界面布局用以编写自动化代码,在远程桌面按下 `CTRL + I` 即可进入模式
83-
按下 `CTRL + R` 刷新布局,再次按下 `CTRL + I` 退出
82+
可在远程桌面即时检视安卓应用的界面布局用以编写自动化代码,点击远程桌面右上角的眼睛图标即可进入模式
83+
按下 `CTRL + R` 刷新布局,再次点击眼睛图标退出
8484

8585
![界面布局检视](image/inspect.gif)
8686

@@ -542,15 +542,22 @@ curl -x http://192.168.0.2:65000 https://httpbin.org/ip
542542
```
543543

544544
自定义代理配置
545-
如果你想使用移动网络(4G/5G)作为代理出口,需要说明的是,在已连接 WIFI 网络的情况下,rmnet 移动数据可能并不会启用,而在连接移动数据后,WIFI 通常又不会开启。也就是说,当你连接了 WIFI,默认就是通过WIFI出网,而当你断开了 WIFI,默认就是从数据流量出网,它们之间存在一定的互斥关系(不同系统版本可能表现也不一样)。所以配置 iface 参数就变成了一个可有可无的选项,提供此配置只是为了多一种可能,除非你自行让 rmnet 以及 wlan 网卡均处于活动状态此选项才变得符合本意。以下示例仅更改了默认代理的登录用户信息。
545+
如果你想使用移动网络(4G/5G)作为代理出口,需要说明的是,原生 rmnet 移动数据 与 WIFI 无法共存。
546+
LAMDA 需要你的安卓 >= 9.0的才能在连接WIFI的情况下使用4G移动数据作为代理出口。
546547

547548
```ini
548549
# 追加到 properties.local 配置文件
549550
tunnel2.login=lamda
550551
tunnel2.password=mypassword
551-
# 不建议配置 iface 参数除非你知道自己在做什么
552-
#tunnel2.iface=wlan0
552+
#
553+
# iface 存在两个可配置值,即 wlan、rmnet,当 iface 值为 wlan 时,
554+
# 将自动检测可用 wlan 接口并选择任意一个发出请求,当 iface 为 rmnet 时
555+
# 将尝试启用移动数据(即使 WIFI 已开启),并将请求从移动网络接口发出。
556+
# 当配置为 rmnet/wlan 但其接口无网络时,代理将失效。
557+
# 当未配置时,使用默认网络发出请求。
558+
#tunnel2.iface=rmnet
553559
```
560+
554561
如果希望从任何地点都可使用设备作为代理,请查看 `使 LAMDA 可被任意地点连接` 章节。
555562

556563
## 连接设备
@@ -889,7 +896,7 @@ print (res.status_code, res.json()["result"])
889896
> 一些规则示例
890897
891898
```
892-
@reboot echo 框架启动/重载(reload)时执行
899+
@reboot echo 框架启动时执行
893900
0 */1 * * * echo 每一小时执行
894901
* * * * * echo 每一分钟执行
895902
0 8 * * * echo 每天八点执行
@@ -1477,9 +1484,8 @@ d.get_last_toast()
14771484

14781485
> Selector
14791486

1480-
界面布局检视,首先你需要打开设备的 web 远程桌面。随后,鼠标点击左侧屏幕确保焦点落在投屏上(否则焦点可能会被右侧的终端捕获),
1481-
然后按下快捷键 `CTRL+I`(启动布局检视),此时你将不能再滑动左侧屏幕,你可以点击屏幕上的虚线框来查看对应元素的信息,你可以将其中的部分属性作为 Selector 的参数。
1482-
再次按下 `CTRL+I` 将关闭布局检视,布局检视并不会随着页面的改变而刷新,它始终是你按下快捷键那一刻的屏幕布局,如果需要刷新布局请手动按下快捷键 `CTRL+R`
1487+
界面布局检视,首先你需要打开设备的 web 远程桌面。随后,点击远程桌面右上角的眼睛图标进入,此时你将不能再滑动左侧屏幕,你可以点击屏幕上的虚线框来查看对应元素的信息,你可以将其中的部分属性作为 Selector 的参数。
1488+
再次点击眼睛图标将关闭布局检视,布局检视并不会随着页面的改变而刷新,它始终是你按下快捷键那一刻的屏幕布局,如果需要刷新布局请手动按下快捷键 `CTRL+R`
14831489

14841490
正常情况下,我们只会使用 `resourceId`, `clickable`, `text`, `description` 作为参数。
14851491
如果元素存在正常的 resourceId,优先使用其作为 Selector,即:`Selector(resourceId="com.android.systemui:id/mobile_signal_single")`

lamda/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#
33
# Distributed under MIT license.
44
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5-
__version__ = "3.138"
5+
__version__ = "3.150"

lamda/client.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def load_proto(name):
224224

225225

226226
def to_dict(prot):
227+
""" 将 proto 返回值转换为字典 """
227228
r = MessageToJson(prot, preserving_proto_field_name=True)
228229
return json.loads(r)
229230

@@ -1008,7 +1009,7 @@ def get_last_activities(self, count=3):
10081009
return list(map(to_dict, r))
10091010
def start_activity(self, **activity):
10101011
"""
1011-
启动 activity(任意, always return true
1012+
启动 activity(总是返回 True
10121013
"""
10131014
activity.setdefault("extras", {})
10141015
extras = activity.pop("extras")
@@ -1148,7 +1149,7 @@ def is_ida64_running(self):
11481149
return r.value
11491150
def start_android_debug_bridge(self):
11501151
"""
1151-
启动 adbd (默认随框架启动)
1152+
启动内置 adbd (默认随框架启动)
11521153
"""
11531154
r = self.stub.startAndroidDebugBridge(protos.Empty())
11541155
return r.value
@@ -1170,7 +1171,7 @@ def start_ida64(self, port=23964, **env):
11701171
return r.value
11711172
def stop_android_debug_bridge(self):
11721173
"""
1173-
停止 adb daemon (有可能无效)
1174+
停止内置 adb daemon
11741175
"""
11751176
r = self.stub.stopAndroidDebugBridge(protos.Empty())
11761177
return r.value
@@ -1438,22 +1439,34 @@ def _fd_streaming_recv(self, fd, iterator):
14381439
for chunk in iterator:
14391440
fd.write(chunk.payload)
14401441
def download_fd(self, fpath, fd):
1442+
"""
1443+
从设备下载文件到文件描述符
1444+
"""
14411445
req = protos.FileRequest(path=fpath)
14421446
iterator = self.stub.downloadFile(req)
14431447
self._fd_streaming_recv(fd, iterator)
14441448
st = self.file_stat(fpath)
14451449
return st
14461450
def upload_fd(self, fd, dest):
1451+
"""
1452+
上传文件描述符至设备
1453+
"""
14471454
chunksize = 1024*1024*1
14481455
streaming = self._fd_streaming_send(fd, dest,
14491456
chunksize)
14501457
self.stub.uploadFile(streaming)
14511458
st = self.file_stat(dest)
14521459
return st
14531460
def download_file(self, fpath, dest):
1461+
"""
1462+
从设备下载文件到本地
1463+
"""
14541464
with io.open(dest, mode="wb") as fd:
14551465
return self.download_fd(fpath, fd)
14561466
def upload_file(self, fpath, dest):
1467+
"""
1468+
上传本地文件至设备
1469+
"""
14571470
with io.open(fpath, mode="rb") as fd:
14581471
return self.upload_fd(fd, dest)
14591472
def delete_file(self, fpath):

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
classifiers = [
2929
"Environment :: Console",
3030
"Intended Audience :: Developers",
31+
"Development Status :: 5 - Production/Stable",
3132
"Intended Audience :: Information Technology",
3233
"Intended Audience :: Science/Research",
3334
"Programming Language :: Python :: 3",

0 commit comments

Comments
 (0)