[LineageOS News & Discussion] maklador:
Dear friends,

Some time ago there were report about a serious vulnerability in the Snapdragon devices firmware, which have affected multiple users.

As a user of a Lineage OS I can not install the vendor updates, because in this case I will need to re flash all the device twice (once with Oxygen OS and second time back with Lineage OS). To fix this problem I used to extract the individual BLOBS and flash them to the phone.

I have downloaded the latest version of the Oxygen OS and extracted the payload.bin. This file contains all the BLOBs and meta data used to flash the original operation system. The blobs can be easily recovered by using the extract_android_ota_payload from cyxx script and instructions from the corresponding readme file.

Create the virtual environment with the only dependency of extract_android_ota_payload - protobuf:

pip3 install virtualenv --user
virtualenv proto_env
source proto_env/bin/activate
pip install -U protobuf

Then extract BLOBS:

python /path/to/extract_android_ota_payload.py path/to/payload.bin output_dir

Create the script to flash all the BLOBs to the phone and save it to flasher.sh

#!/bin/bash
fastboot flash abl_a abl.img
fastboot flash abl_b abl.img
fastboot flash aop_a aop.img
fastboot flash aop_b aop.img
fastboot flash bluetooth_a bluetooth.img
fastboot flash bluetooth_b bluetooth.img
fastboot flash cmnlib64_a cmnlib64.img
fastboot flash cmnlib64_b cmnlib64.img
fastboot flash cmnlib_a cmnlib.img
fastboot flash cmnlib_b cmnlib.img
fastboot flash devcfg_a devcfg.img
fastboot flash devcfg_b devcfg.img
fastboot flash dsp_a dsp.img
fastboot flash dsp_b dsp.img
fastboot flash fw_4j1ed_a fw_4j1ed.img
fastboot flash fw_4j1ed_b fw_4j1ed.img
fastboot flash fw_4u1ea_a fw_4u1ea.img
fastboot flash fw_4u1ea_b fw_4u1ea.img
fastboot flash hyp_a hyp.img
fastboot flash hyp_b hyp.img
fastboot flash india_a india.img
fastboot flash india_b india.img
fastboot flash keymaster_a keymaster.img
fastboot flash keymaster_b keymaster.img
fastboot flash LOGO_a LOGO.img
fastboot flash LOGO_b LOGO.img
fastboot flash modem_a modem.img
fastboot flash modem_b modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw_a qupfw.img
fastboot flash qupfw_b qupfw.img
fastboot flash reserve_a reserve.img
fastboot flash reserve_b reserve.img
fastboot flash storsec_a storsec.img
fastboot flash storsec_b storsec.img
echo "\"Invalid sparse file format at header magic\" is not an error you need only to wait"
fastboot flash tz_a tz.img
fastboot flash tz_b tz.img
fastboot flash vendor_a vendor.img
fastboot flash vendor_b vendor.img
fastboot flash xbl_config_a xbl_config.img
fastboot flash xbl_config_b xbl_config.img
fastboot flash xbl_a xbl.img
fastboot flash xbl_b xbl.img
exit 0

Reboot the phone to fastboot mode and flash:

# Check that we see the device:
flastboot devices
./flasher.sh

This script has successfully updated all the non lineage OS partitions (which are boot.img, dtbo.img, system.img and vbmeta.img).

Though the Trust utility is happy, saying that all the updates were applied successfully, I still have seen several errors, updating the critical sections: keymaster, tz, xbl_config and xbl. I think that Trust only check the vendor partition and does not check others.

Did anybody encountered this kind of problems? Is it critical to update ALL the partitions?