Skip to content

Commit f367392

Browse files
committed
smth
1 parent f6ac823 commit f367392

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

root-module-manual/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
uploads
22
*.zip
3-
*.json
3+
*.json

root-module-manual/main.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,18 @@ def copy_file_to_src(file_path, library_name):
109109
shutil.copy(file_path, dest_path)
110110
logging.info(f"Copied {file_path} to {dest_path}")
111111

112-
def remove_library_from_src(library_name):
113-
"""
114-
Removes the specified library file from the 'src/' directory.
115-
116-
Args:
117-
library_name (str): The name of the library file to remove.
118-
"""
119-
file_path = os.path.join('src', library_name)
120-
if os.path.exists(file_path):
121-
os.remove(file_path)
122-
logging.info(f"Removed {file_path} from src/")
123-
124112
def zip_src_files():
125113
"""
126114
Zips all files in the 'src/' directory into 'btl2capfix.zip', preserving symlinks.
127115
"""
116+
117+
if os.path.exists('btl2capfix.zip'):
118+
os.remove('btl2capfix.zip')
119+
if os.path.exists('src/libbluetooth_jni.so'):
120+
os.remove('src/libbluetooth_jni.so')
121+
if os.path.exists('src/libbluetooth_qti.so'):
122+
os.remove('src/libbluetooth_qti.so')
123+
128124
with zipfile.ZipFile('btl2capfix.zip', 'w', zipfile.ZIP_DEFLATED, allowZip64=True) as zipf:
129125
for root, dirs, files in os.walk('src/'):
130126
for file in files:
@@ -145,7 +141,6 @@ def main():
145141
Main function to execute the script. It performs the following steps:
146142
1. Copies the input file to the 'src/' directory.
147143
2. Patches specific addresses in the binary file.
148-
3. Removes the specified library file from the 'src/' directory.
149144
4. Zips the files in the 'src/' directory into 'btl2capfix.zip'.
150145
"""
151146
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@@ -171,9 +166,6 @@ def main():
171166
# Copy file to src/
172167
copy_file_to_src(file_path, library_name)
173168

174-
# Remove the specified library file from src/
175-
remove_library_from_src(library_name)
176-
177169
# Zip files under src/
178170
zip_src_files()
179171

0 commit comments

Comments
 (0)