-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextract-files.py
executable file
·60 lines (54 loc) · 2.36 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
#!/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,
lib_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
'hardware/mediatek',
'hardware/xiaomi',
'vendor/xiaomi/mt6895-common',
]
lib_fixups: lib_fixups_user_type = {
**lib_fixups,
}
blob_fixups: blob_fixups_user_type = {
'vendor/bin/hw/[email protected]': blob_fixup()
.replace_needed('android.hardware.security.keymint-V1-ndk_platform.so', 'android.hardware.security.keymint-V3-ndk.so')
.replace_needed('android.hardware.security.sharedsecret-V1-ndk_platform.so', 'android.hardware.security.sharedsecret-V1-ndk.so')
.replace_needed('android.hardware.security.secureclock-V1-ndk_platform.so', 'android.hardware.security.secureclock-V1-ndk.so')
.add_needed('android.hardware.security.rkp-V3-ndk.so'),
'vendor/etc/sensors/hals.conf': blob_fixup()
.regex_replace('[email protected]', '[email protected]')
.regex_replace('sensors.touch.detect.so', 'sensors.dynamic_sensor_hal.so'),
'vendor/lib64/hw/audio.primary.mediatek.so': blob_fixup()
.add_needed('libstagefright_foundation-v33.so')
.replace_needed('libalsautils.so', 'libalsautils-v31.so'),
('vendor/lib64/mt6895/libmtkcam_stdutils.so', 'vendor/lib64/hw/mt6895/[email protected]'): blob_fixup()
.replace_needed('libutils.so', 'libutils-v32.so'),
('vendor/lib64/lib3a.ae.pipe.so', 'vendor/lib64/libteei_daemon_vfs.so', 'vendor/lib64/mt6895/libaaa_toneutil.so', 'vendor/lib64/mt6895/lib3a.flash.so', 'vendor/lib64/mt6895/lib3a.sensors.color.so', 'vendor/lib64/mt6895/lib3a.sensors.flicker.so'): blob_fixup()
.add_needed('liblog.so')
} # fmt: skip
module = ExtractUtilsModule(
'xaga',
'xiaomi',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(
module, 'mt6895-common', module.vendor
)
utils.run()