#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3 # # SPDX-FileCopyrightText: 2024 The LineageOS Project # SPDX-License-Identifier: Apache-2.0 # from extract_utils.fixups_blob import ( blob_fixup, blob_fixups_user_type, ) from extract_utils.fixups_lib import ( lib_fixup_remove, lib_fixups, lib_fixups_user_type, ) from extract_utils.main import ( ExtractUtils, ExtractUtilsModule, ) from extract_utils.file import File namespace_imports = [ 'device/oneplus/sm8150-common', 'hardware/qcom/display', 'hardware/qcom/display/gralloc', 'hardware/qcom/display/libdebug', 'vendor/oneplus/sm8150-common', 'vendor/qcom/common/vendor/adreno-r', 'vendor/qcom/common/vendor/display/4.14', 'vendor/qcom/common/vendor/media-legacy', ] def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs): return f'{lib}_{partition}' if partition == 'vendor' else None lib_fixups: lib_fixups_user_type = { **lib_fixups, ( 'com.qualcomm.qti.dpm.api@1.0', 'com.qualcomm.qti.imscmservice@1.0', 'com.qualcomm.qti.imscmservice@2.0', 'com.qualcomm.qti.imscmservice@2.1', 'com.qualcomm.qti.imscmservice@2.2', 'com.qualcomm.qti.uceservice@2.0', 'com.qualcomm.qti.uceservice@2.1', 'com.qualcomm.qti.uceservice@2.2', 'com.qualcomm.qti.uceservice@2.3', 'libmmosal', 'liqtigef', 'vendor.qti.data.factory@2.0', 'vendor.qti.data.factory@2.1', 'vendor.qti.data.factory@2.2', 'vendor.qti.data.factory@2.3', 'vendor.qti.data.mwqem@1.0', 'vendor.qti.data.slm@1.0', 'vendor.qti.diaghal@1.0', 'vendor.qti.hardware.data.cne.internal.api@1.0', 'vendor.qti.hardware.data.cne.internal.constants@1.0', 'vendor.qti.hardware.data.cne.internal.server@1.0', 'vendor.qti.hardware.data.connection@1.0', 'vendor.qti.hardware.data.connection@1.1', 'vendor.qti.hardware.data.dynamicdds@1.0', 'vendor.qti.hardware.data.latency@1.0', 'vendor.qti.hardware.data.lce@1.0', 'vendor.qti.hardware.data.iwlan@1.0', 'vendor.qti.hardware.data.qmi@1.0', 'vendor.qti.hardware.embmssl@1.0-adapter-helper', 'vendor.qti.hardware.embmssl@1.0', 'vendor.qti.hardware.embmssl@1.1-adapter-helper', 'vendor.qti.hardware.embmssl@1.1', 'vendor.qti.hardware.mwqemadapter@1.0', 'vendor.qti.hardware.radio.am@1.0', 'vendor.qti.hardware.radio.atcmdfwd@1.0', 'vendor.qti.hardware.radio.ims@1.0', 'vendor.qti.hardware.radio.ims@1.1', 'vendor.qti.hardware.radio.ims@1.2', 'vendor.qti.hardware.radio.ims@1.3', 'vendor.qti.hardware.radio.ims@1.4', 'vendor.qti.hardware.radio.ims@1.5', 'vendor.qti.hardware.radio.ims@1.6', 'vendor.qti.hardware.radio.ims@1.7', 'vendor.qti.hardware.radio.internal.deviceinfo@1.0', 'vendor.qti.hardware.radio.lpa@1.0', 'vendor.qti.hardware.radio.lpa@1.1', 'vendor.qti.hardware.radio.lpa@1.2', 'vendor.qti.hardware.radio.qcrilhook@1.0', 'vendor.qti.hardware.radio.qtiradio@1.0', 'vendor.qti.hardware.radio.qtiradio@2.0', 'vendor.qti.hardware.radio.qtiradio@2.1', 'vendor.qti.hardware.radio.qtiradio@2.2', 'vendor.qti.hardware.radio.qtiradio@2.3', 'vendor.qti.hardware.radio.qtiradio@2.4', 'vendor.qti.hardware.radio.qtiradio@2.5', 'vendor.qti.hardware.radio.qtiradio@2.6', 'vendor.qti.hardware.radio.qtiradio@2.7', 'vendor.qti.hardware.radio.uim@1.0', 'vendor.qti.hardware.radio.uim@1.1', 'vendor.qti.hardware.radio.uim@1.2', 'vendor.qti.hardware.radio.uim_remote_client@1.0', 'vendor.qti.hardware.radio.uim_remote_client@1.1', 'vendor.qti.hardware.radio.uim_remote_client@1.2', 'vendor.qti.hardware.radio.uim_remote_server@1.0', 'vendor.qti.hardware.slmadapter@1.0', 'vendor.qti.hardware.qccsyshal@1.0', 'vendor.qti.hardware.qccvndhal@1.0', 'vendor.qti.hardware.wifidisplaysession@1.0', 'vendor.qti.imsrtpservice@3.0', 'vendor.qti.ims.callcapability@1.0', 'vendor.qti.ims.callinfo@1.0', 'vendor.qti.ims.factory@1.0', 'vendor.qti.ims.factory@1.1', 'vendor.qti.ims.rcsconfig@1.0', 'vendor.qti.ims.rcsconfig@1.1', 'vendor.qti.ims.rcsconfig@2.0', 'vendor.qti.ims.rcsconfig@2.1', 'vendor.qti.latency@2.0', 'vendor.qti.latency@2.1', ): lib_fixup_vendor_suffix, ( 'libOmxCore', 'libwpa_client', ): lib_fixup_remove, } blob_fixups: blob_fixups_user_type = { ( 'vendor/lib64/mediadrm/libwvdrmengine.so', 'vendor/lib64/libwvhidl.so', ): blob_fixup() .replace_needed('libcrypto.so', 'libcrypto-v33.so'), ( 'vendor/lib64/libarcsoft_dualcam_refocus_preview.so', 'vendor/lib64/libarcsoft_super_night_raw.so' ): blob_fixup() .clear_symbol_version('remote_handle_close') .clear_symbol_version('remote_handle_invoke') .clear_symbol_version('remote_handle_open') .clear_symbol_version('remote_register_buf_attr') .clear_symbol_version('remote_register_buf'), } # fmt: skip module = ExtractUtilsModule( 'sm8150-common', 'oneplus', blob_fixups=blob_fixups, lib_fixups=lib_fixups, namespace_imports=namespace_imports, ) if __name__ == '__main__': utils = ExtractUtils.device(module) utils.run()