apt install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract rename
apt install liblzma-dev python-pip brotli lz4
pip install backports.lzma protobuf pycrypto twrpdtgen extract-dtb pycryptodome
brew install protobuf liblzma-dev brotli lz4
pip install backports.lzma protobuf pycrypto twrpdtgen extract-dtb
Also install mono
Install cygwin, and select
Latest python and pip packages, arj, brotli, cabextract, dos2unix, lz4, p7zip, renameutils, sharutils, unace, unzip and zip
If you get syntax errors run dos2unix on extractor.sh
git clone --recurse-submodules https://github.com/AndroidDumps/Firmware_extractor.git
Example: Extracting images from pixel 2 factory image:
cd Firmware_extractor
wget https://dl.google.com/dl/android/aosp/walleye-pq3a.190705.001-factory-cc471c8c.zip -o firmware.zip
./extractor.sh firmware.zip
output will be on "Firmware_extractor/out"
extractor.sh code is complicated, and preventing regressions whenever code is modified or added takes time and effort.
An idea to prevent this would be to add tests so that commits wouldn't be able to be merged unless a sample set of each supported firmware successfully outputs IMGs, and that their hashes match those previously version controlled in this repository.
For A-only OTA, https://otafsg1.h2os.com/patch/amazone2/GLO/OnePlus3TOxygen/OnePlus3TOxygen_28.A.86_GLO_086_1911042121/OnePlus3TOxygen_28_OTA_086_all_1911042121_9156030ead54e.zip can be used. For Oplus A-only OTA, https://oxygenos.oneplus.net/system_vendor.zip can be used For A/B OTAs, https://gauss-componentotacostmanual-sg.allawnofs.com/remove-60818dddbcc4ff1e05001dbecdd5a9b3/component-ota/22/03/27/d7a3625cd77440418671588fe07b4a6b.zip can be used.
I will edit content of this issue later to add MD5s of the extracted IMGs.
A problem though is I am unsure how to implement this idea in code, also maybe some of the supported firmware isn't available to download via an anonymous link. There would likely be a need to store it on the machine on which one tests will run to prevent issues such as firmware being unavailable, or downloading extremely slowly, thereby making CI tests run for a long amount of time or fail.
Normalizing the installation