-
Notifications
You must be signed in to change notification settings - Fork 18
/
extract-files.py
executable file
·59 lines (54 loc) · 2.3 KB
/
extract-files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/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_fixups,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
'hardware/oplus',
'vendor/oneplus/sm8350-common',
'vendor/qcom/opensource/display',
]
blob_fixups: blob_fixups_user_type = {
'odm/etc/camera/CameraHWConfiguration.config': blob_fixup()
.regex_replace('SystemCamera = 0; 0; 1; 1; 1', 'SystemCamera = 0; 0; 0; 0; 1'),
('odm/lib/liblvimfs_wrapper.so', 'odm/lib64/libCOppLceTonemapAPI.so', 'odm/lib64/libaps_frame_registration.so', 'vendor/lib64/libalsc.so'): blob_fixup()
.replace_needed('libstdc++.so', 'libstdc++_vendor.so'),
'odm/lib64/libAlgoProcess.so': blob_fixup()
.replace_needed('android.hardware.graphics.common-V1-ndk_platform.so', 'android.hardware.graphics.common-V5-ndk.so'),
'vendor/etc/libnfc-hal-st.conf': blob_fixup()
.regex_replace('NFC_DEBUG_ENABLED=1', 'NFC_DEBUG_ENABLED=0')
.regex_replace('STNFC_FW_PATH_STORAGE="/data/vendor/nfc/"', 'STNFC_FW_PATH_STORAGE="/vendor/firmware/"')
.regex_replace('STNFC_FW_CONF_NAME="/data/vendor/nfc/libnfc-st21h_conf.txt"', 'STNFC_FW_CONF_NAME="libnfc-st21h_conf.txt"'),
'vendor/etc/libnfc-nci.conf': blob_fixup()
.regex_replace('NFC_DEBUG_ENABLED=1', 'NFC_DEBUG_ENABLED=0'),
'vendor/lib/hw/audio.primary.lahaina.so': blob_fixup()
.replace_needed('/vendor/lib/liba2dpoffload.so', '/odm/lib/liba2dpoffload.so')
.replace_needed('/vendor/lib/libssrec.so', '/odm/lib/libssrec.so')
.replace_needed('libgui1_vendor.so', 'libgui_vendor.so'),
'vendor/lib/libextcamera_client.so': blob_fixup()
.replace_needed('libgui1_vendor.so', 'libgui_vendor.so'),
} # fmt: skip
module = ExtractUtilsModule(
'lunaa',
'realme',
namespace_imports=namespace_imports,
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
add_firmware_proprietary_file=True,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(
module, '../oneplus/sm8350-common', module.vendor
)
utils.run()