-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathextract-files.py
executable file
·46 lines (39 loc) · 1.26 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
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
import extract_utils.tools
extract_utils.tools.DEFAULT_PATCHELF_VERSION = '0_17_2'
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
from extract_utils.fixups_blob import (
blob_fixup,
blob_fixups_user_type,
)
namespace_imports = [
'hardware/xiaomi',
'vendor/xiaomi/msm8998-common',
]
blob_fixups: blob_fixups_user_type = {
'vendor/lib/libmmcamera_chiron_imx386_semco_eeprom.so': blob_fixup()
.binary_regex_replace(b'/data/misc/camera/camera_lsc_caldata.txt', b'/data/vendor/camera/camera_lsc_calib.txt'),
'vendor/lib64/libgf_hal.so': blob_fixup()
.remove_needed('libpowermanager.so'),
'vendor/lib64/sensors.elliptic.so': blob_fixup()
.binary_regex_replace(b'/etc/elliptic_sensor.xml', b'/vendor/etc/elliptic.xml')
.remove_needed('libandroid.so'),
} # fmt: skip
module = ExtractUtilsModule(
'chiron',
'xiaomi',
blob_fixups=blob_fixups,
namespace_imports=namespace_imports,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(
module, 'msm8998-common', module.vendor
)
utils.run()