-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathextract-files.py
More file actions
executable file
·72 lines (56 loc) · 2.06 KB
/
Copy pathextract-files.py
File metadata and controls
executable file
·72 lines (56 loc) · 2.06 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
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
from extract_utils.file import File
from extract_utils.fixups_blob import (
BlobFixupCtx,
blob_fixup,
blob_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
def blob_fixup_test_flag(
ctx: BlobFixupCtx,
file: File,
file_path: str,
*args,
**kargs,
):
with open(file_path, 'rb+') as f:
f.seek(1337)
f.write(b'\x01')
blob_fixups: blob_fixups_user_type = {
'vendor/bin/STFlashTool': blob_fixup()
.add_needed('libbase_shim.so'),
('vendor/etc/libnfc-nci.conf' ,'vendor/etc/libnfc-hal-st.conf'): blob_fixup()
.regex_replace('/data/nfc', '/data/vendor/nfc'),
'vendor/etc/init/android.hardware.gnss-aidl-service-qti.rc': blob_fixup()
.regex_replace(' vendor_ssgtzd', ''),
'vendor/lib64/hw/audio.primary.bengal.so': blob_fixup()
.add_needed('libstagefright_foundation-v33.so'),
'vendor/bin/hw/android.hardware.security.keymint-service-qti': blob_fixup()
.add_needed('android.hardware.security.rkp-V3-ndk.so'),
('vendor/lib64/libqcrilNr.so', 'vendor/lib64/libril-db.so', 'vendor/etc/qcril_database/upgrade/config/6.0_config.sql'): blob_fixup()
.binary_regex_replace(rb'persist\.vendor\.radio\.poweron_opt', rb'persist.vendor.radio.poweron_ign'),
'vendor/lib64/vendor.libdpmframework.so': blob_fixup()
.add_needed('libhidlbase_shim.so'),
'vendor/etc/seccomp_policy/c2audio.vendor.ext-arm64.policy': blob_fixup()
.add_line_if_missing('setsockopt: 1'),
'vendor/etc/seccomp_policy/atfwd@2.0.policy': blob_fixup()
.add_line_if_missing('gettid: 1'),
'vendor/etc/seccomp_policy/qms.policy': blob_fixup()
.add_line_if_missing('gettid: 1'),
}
module = ExtractUtilsModule(
'tapas',
'xiaomi',
blob_fixups=blob_fixups,
check_elf=False,
)
if __name__ == '__main__':
utils = ExtractUtils.device(module)
utils.run()