This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextract-files.py
More file actions
executable file
·81 lines (76 loc) · 2.79 KB
/
Copy pathextract-files.py
File metadata and controls
executable file
·81 lines (76 loc) · 2.79 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/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 = [
'device/xiaomi/sm8450-common',
'hardware/qcom-caf/sm8450',
'hardware/xiaomi',
'vendor/qcom/opensource/commonsys-intf/display',
'vendor/xiaomi/sm8450-common',
]
blob_fixups: blob_fixups_user_type = {
(
'vendor/etc/camera/zeus_enhance_motiontuning.xml',
'vendor/etc/camera/zeus_motiontuning.xml',
): blob_fixup().regex_replace('xml=version', 'xml version'),
(
'vendor/etc/camera/pureShot_parameter.xml',
'vendor/etc/camera/pureView_parameter.xml',
): blob_fixup().regex_replace(r'=([0-9]+)>', r'="\1">'),
(
'vendor/lib64/hw/com.qti.chi.override.so',
'vendor/lib64/libcamxcommonutils.so',
'vendor/lib64/libmialgoengine.so',
): blob_fixup().add_needed('libprocessgroup_shim.so'),
(
'vendor/lib64/libTrueSight.so',
'vendor/lib64/libmorpho_ubwc.so',
): blob_fixup()
.clear_symbol_version('AHardwareBuffer_allocate')
.clear_symbol_version('AHardwareBuffer_describe')
.clear_symbol_version('AHardwareBuffer_isSupported')
.clear_symbol_version('AHardwareBuffer_lock')
.clear_symbol_version('AHardwareBuffer_lockPlanes')
.clear_symbol_version('AHardwareBuffer_release')
.clear_symbol_version('AHardwareBuffer_unlock'),
'vendor/lib64/libcamximageformatutils.so': blob_fixup().replace_needed(
'vendor.qti.hardware.display.config-V2-ndk_platform.so',
'vendor.qti.hardware.display.config-V2-ndk.so',
),
'vendor/lib64/libmialgo_pureShot.so': blob_fixup()
.clear_symbol_version('remote_handle64_close')
.clear_symbol_version('remote_handle64_invoke')
.clear_symbol_version('remote_handle64_open')
.clear_symbol_version('remote_register_buf_attr'),
('vendor/lib64/hw/camera.qcom.so', 'vendor/lib64/libFaceDetectpp-0.5.2.so', 'vendor/lib64/libfacedet.so'): blob_fixup()
.binary_regex_replace(b'libmegface.so', b'libfacedet.so')
.binary_regex_replace(b'libMegviiFacepp-0.5.2.so', b'libFaceDetectpp-0.5.2.so')
.binary_regex_replace(b'megviifacepp_0_5_2_model', b'facedetectpp_0_5_2_model'),
}
module = ExtractUtilsModule(
'zeus',
'xiaomi',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
check_elf=True,
add_firmware_proprietary_file=True,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(
module, 'sm8450-common', module.vendor
)
utils.run()