cyxx/extract_android_ota_payload

Docker container to overcome Python verion and dependency issues

toastie89 opened this issue · 2 comments

Hi! I was running into issues with the Python version and dependencies which I finally fixed by using a Docker container. This might be helpful for others as well?

To unpack payload.bin we start from the Docker image continuumio/miniconda to install dependencies via Miniconda:

docker run --name payload.bin --rm -it \
   -v `pwd`"/data":/opt/data \
   continuumio/miniconda /bin/bash

In the container we install protobuf and clone the project:

conda install protobuf --yes
git clone --depth=1 https://github.com/cyxx/extract_android_ota_payload.git /opt/bin

Next download and unzip and OTA image, e.g. for Oneplus:

url=https://oxygenos.oneplus.net/OnePlus6Oxygen_22_OTA_034_all_1909112343_31f86cec5f8d4c7b.zip
wget --output-document=/opt/data/image.zip $url
python -m zipfile -e /opt/data/image.zip /opt/data/image

And finally unpack the payload.bin:

python /opt/bin/extract_android_ota_payload.py /opt/data/image/payload.bin /opt/data/payload

Just opened a pull request to add in documentation #11

cyxx commented

Thanks for this. I am leaving the pull request as that can indeed be useful to others.
Another option, that I use, are "virtual environments".