miuiv13-redmi-note11TPro-root
好多年不关注这些了,搜索发现多了ab分区、卡刷/OTA包payload.bin等变化。现在再看源码、搜资料自己解包payload.bin等是来不及了。所以还是先看看网上的一些教程吧。
payload.bin解包
- 更新MIUIV13.0.13的OTA包时保存了一份,结构如下:
payload_dumper
- 根据:https://zhuanlan.zhihu.com/p/424625779、https://blog.csdn.net/weixin_43890033/article/details/119457211,使用https://github.com/vm03/payload_dumper,git clone下来。
- 把payload.bin放在payload_dumper目录,使用Win10子系统Ubuntu18.04LTS执行:
python3 payload_dumper.py payload.bin
Traceback (most recent call last):
File "payload_dumper.py", line 7, in <module>
import bsdiff4
ModuleNotFoundError: No module named 'bsdiff4'
缺少库,根据requirements.txt安装
pip3 install bsdiff4>=1.1.5
安装protobuf报错。
python3 payload_dumper.py payload.bin
Traceback (most recent call last):
File "payload_dumper.py", line 15, in <module>
import update_metadata_pb2 as um
File "/mnt/d/payload_dumper/update_metadata_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'
pip3 install protobuf>=3.19.3
protobuf requires Python '>=3.7' but the running Python is 3.6.9
直接读取requirements.txt安装也是报错:protobuf requires Python ‘>=3.7’ but the running Python is 3.6.9。不想升级python。
pip3 install -r requirements.txt
Collecting protobuf>=3.19.3 (from -r requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/6c/be/4e32d02bf08b8f76bf6e59f2a531690c1e4264530404501f3489ca975d9a/protobuf-4.21.0-py2.py3-none-any.whl
protobuf requires Python '>=3.7' but the running Python is 3.6.9
因为不了解python,仔细看是大于等于的关系,安装的是protobuf-4.21.0版本,尝试安装protobuf-3.19.3版本成功:(six>=1.16.0通过requirements.txt安装了)
pip3 install protobuf==3.19.3
Collecting protobuf==3.19.3
Installing collect