forked from jean-voila/FeurStagram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal_redirect.py
More file actions
24 lines (22 loc) · 788 Bytes
/
global_redirect.py
File metadata and controls
24 lines (22 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import sys
def global_redirect(directory):
target = '"fragment_clips"'
replacement = '"fragment_direct_tab"'
count = 0
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(".smali"):
path = os.path.join(root, file)
with open(path, 'r') as f:
content = f.read()
if target in content:
new_content = content.replace(target, replacement)
with open(path, 'w') as f:
f.write(new_content)
count += 1
print(f"Patched {count} files with global redirection.")
if __name__ == "__main__":
if len(sys.argv) < 2:
sys.exit(1)
global_redirect(sys.argv[1])