From 26c53824243669beab8b1933ceb3915ed4fe784c Mon Sep 17 00:00:00 2001 From: toastie89 Date: Fri, 11 Oct 2019 23:44:20 +0200 Subject: [PATCH] Instructions for running in docker 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? --- README-docker.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README-docker.md diff --git a/README-docker.md b/README-docker.md new file mode 100644 index 0000000..fbbeb0b --- /dev/null +++ b/README-docker.md @@ -0,0 +1,26 @@ +Run in Docker +--- +To unpack payload.bin we start from the Docker image [continuumio/miniconda](https://hub.docker.com/r/continuumio/miniconda/) to install dependencies via [Miniconda](https://docs.conda.io/en/latest/miniconda.html): +``` +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](https://www.oneplus.com/de/support/softwareupgrade/): +``` +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 +```