-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextract-files.py
More file actions
executable file
·67 lines (57 loc) · 1.9 KB
/
extract-files.py
File metadata and controls
executable file
·67 lines (57 loc) · 1.9 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
#!/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,
)
namespace_imports = [
'device/samsung/universal9830-common',
'hardware/samsung',
'hardware/samsung_slsi-linaro/exynos',
'hardware/samsung_slsi-linaro/exynos/gralloc/gralloc3',
'hardware/samsung_slsi-linaro/graphics',
'hardware/samsung_slsi-linaro/interfaces',
'vendor/samsung/universal9830-common'
]
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,
(
'libuuid',
): lib_fixup_vendor_suffix,
}
blob_fixups: blob_fixups_user_type = {
'vendor/lib64/libexynoscamera3.so': blob_fixup()
.sig_replace('14 00 00 94 0A', '1F 20 03 D5 0A')
.sig_replace('A8 FF FF 97', '1F 20 03 D5')
.sig_replace('AB 02 20 36', '1F 20 03 D5'),
'vendor/lib64/sensors.sensorhub.so': blob_fixup()
.add_needed('libutils-v32.so')
.binary_regex_replace(b'_ZN7android6Thread3runEPKcim', b'_ZN7utils326Thread3runEPKcim'),
'vendor/firmware/wlan/qcom_cfg.ini': blob_fixup()
.regex_replace('swlan0', 'wlan1')
.regex_replace('gChannelBondingMode24GHz=0', 'gChannelBondingMode24GHz=1'),
} # fmt: skip
module = ExtractUtilsModule(
'r8s',
'samsung',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(module, 'universal9830-common', module.vendor)
utils.run()