Easily extract the firmware and modem from stock OxygenOS images for use with other roms.
You can sideload the extracted firmware without needing to flash OxygenOS over your existing Lineage or MicroG Lineage OS.
Extract the official firmware by yourself, without relying on third parties or potentially untrustworthy hosting sites.
To run the extract script:
- Any operating system with bash; all Linux distros and MacOS. Not tested on Windows or WSL.
Device:
- For Oneplus 3, 3T, 5 and 5T devices
(should also work for others, providing the images' hierarchy is similar)
- Clone this repository
git clone --depth=1 https://github.com/angela-d/firmware_oneplus.git
(Use --depth=1 to avoid pulling in legacy objects from the original repo)
- Obtain the latest copy of OxygenOS from Oneplus as a .zip
- In your terminal, navigate to the directory where you cloned this repo:
cd firmware_oneplus && ls -l
- if you see the directory contents, you're ready to go
As of v2.0, the command-line options have been greatly simplified, using interactive prompts.
To trigger the tool, simply run:
./extract
or
/path/to/extract
That's it! The screen will prompt and guide you through the process.
Successful image generated:
Image mis-match (built-in error checking):
Pre-packaged zip ready to go (the screenshot is focused on the extracted image, showing that all of the OxygenOS stuff is gone and only the desired update remains):
Once extract completes, locate your flashable zip (the terminal will tell you the path!)
- Connect your device to your computer via USB and run
adb devices
from your terminal to initiate a connection - In TWRP Recovery (if you aren't in recovery yet: instructions to get there):
- Advanced
- Sideload
- TWRP will prompt sideloading has started; from your terminal, run:
adb sideload firmware-update-oneplus5T.zip
That's it.
Note: If you tried to update before flashing the firmware, you may get an "update failed" notification once Lineage boots back up. Simply go to Settings > Update > Install again and let it do it's thing. It should then finish the upgrade with the latest Oneplus firmware.
As of March 25, 2020 the latest firmware is 9.0.11
No responsibility to anyone but yourself if you brick your device!
Forked concept originally by Koenkk; his commits licensed under public domain (no license)
Code by Angela licensed under GPL2