-
Notifications
You must be signed in to change notification settings - Fork 2
/
extract-files.py
executable file
·79 lines (71 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/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,
)
import extract_utils.tools
extract_utils.tools.DEFAULT_PATCHELF_VERSION = '0_9'
namespace_imports = [
'device/nokia/msm8998-common',
'hardware/qcom-caf/common/libqti-perfd-client',
'hardware/qcom-caf/msm8998',
'hardware/qcom-caf/wlan',
'vendor/qcom/opensource/dataservices',
'vendor/qcom/opensource/data-ipa-cfg-mgr-legacy-um',
]
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,
(
): lib_fixup_vendor_suffix,
(
'libdrmutils',
'libmmcamera_dbg',
'libmm-omxcore',
'libOmxCore',
'libsdmutils',
'libwpa_client',
): lib_fixup_remove,
}
blob_fixups: blob_fixups_user_type = {
('product/etc/permissions/vendor.qti.hardware.data.connection-V1.0-java.xml', 'product/etc/permissions/vendor.qti.hardware.data.connection-V1.1-java.xml'): blob_fixup()
.regex_replace(r'version="2.0"', r'version="1.0"'),
('vendor/lib64/mediadrm/libwvdrmengine.so','vendor/lib64/libwvhidl.so'): blob_fixup()
.add_needed('libcrypto_shim.so'),
'vendor/bin/pm-service': blob_fixup()
.add_needed('libutils-v33.so'),
'system_ext/lib64/lib-imscamera.so': blob_fixup()
.add_needed('libgui_shim.so'),
'system_ext/lib64/lib-imsvideocodec.so': blob_fixup()
.add_needed('libgui_shim.so')
.replace_needed('libqdMetaData.so', 'libqdMetaData.system.so'),
} # fmt: skip
module = ExtractUtilsModule(
'msm8998-common',
'nokia',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
)
if __name__ == '__main__':
utils = ExtractUtils.device(module)
utils.run()