Skip to content

Instantly share code, notes, and snippets.

  • Save ZenkaBestia/28d20b50d4ead96d1e9e6ee78afd756d to your computer and use it in GitHub Desktop.
Save ZenkaBestia/28d20b50d4ead96d1e9e6ee78afd756d to your computer and use it in GitHub Desktop.
Kang blobs from a section of your proprietary-files on LineageOS 17.1
Make sure the device's and/or commonized device proprietary-files are updated with the same blobs that you want in your proprietary vendor repo.
Next, to use the kang and section mode we need the switches "-k -s". -k tells extract-files to only kang/pull updated blobs without deleting any blobs. -s tells it to only update ones from a commented section of your proprietary-files.
for example, if i have this in my proprietary-files
# ADSP - from oneplus3t - OnePlus/OnePlus3/OnePlus3T:9/PKQ1.181203.001/1911042108 - OOS 9.0.6
vendor/lib/libadsp_hvx_callback_skel.so
vendor/lib/libadsp_hvx_stub.so
I could use...
./extract-files.sh -k -s oneplus3t ***insert location of new blobs*** | tee ~/Desktop/extractor.log
Check extractor.log to ensure it worked ok and there was no errors / not found.
or if I'm only updating certain oneplus3t device blobs or a certain section of blobs? I could change it to "ADSP" or a part of the version string like "1911042108".
Next, you would also need to update your pinned files if you have blobs from multiple sources in order to comply with the LineageOS charter for device support requirements for proprietary-files, so I HIGHLY recommend you cherry-pick the commits for this amazing update-sha1sums python script.
https://github.com/LineageOS/android_device_leeco_msm8996-common/commits/lineage-17.1/update-sha1sums.py
(NOTE! as you can see, the script looks for " - from" in your commented lines in order to know that it needs updated sha1sums, so you MUST make sure your proprietary-files has that in the sections you wish to update pinned sha1sums for)
Then you can run it like this...
python update-sha1sums.py
From the above example from the ADSP blobs? It would automatically fill in the sha1sums for it and result in this:
# ADSP - from oneplus3t - OnePlus/OnePlus3/OnePlus3T:9/PKQ1.181203.001/1911042108 - OOS 9.0.6
vendor/lib/libadsp_hvx_callback_skel.so|b7e47d8d0c011caea30daf974de81eb01bb90268
vendor/lib/libadsp_hvx_stub.so|5842e47b5929e15c8b63f1aa4795ca3432debebb
and it'll automatically update any hashes to what your vendor blobs folder contains since the kang command ignores any pinned blobs.
Now that you have your freshly kanged blobs and your proprietary-files is updated with any pinned blobs? It's time to regenerate your vendor blobs to ensure any discarded blobs are also removed and that your vendor blobs march your proprietary-files correctly.
In my example, I'll use the LeEco Le Max 2 (x2), so I would then copy the current LeEco msm8996-common and then x2 blobs (just to clarify, I mean the blobs themselves within the proprietary folder) to the desktop in a folder named system
Then open terminal in the device tree and...
./extract-files.sh ~/Desktop | tee ~/Desktop/extractor.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment