forked from jdanceze/cg_parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathella_location.py
36 lines (29 loc) · 1.02 KB
/
ella_location.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
import os
import sys
def read_mapping_file(mapping_file):
mapping = {}
with open(mapping_file, 'r') as file:
for line in file:
apk_location, name = line.strip().split(',')
mapping[name] = apk_location
return mapping
def lookup_apk_location(mapping, name):
return mapping.get(name, None)
def get_apk_name(apk_location):
return apk_location.split('/')[-1]
def create_directory(apk_name):
directory_name = apk_name.split('.apk')[0] # Remove the ".apk" extension
#os.makedirs(directory_name, exist_ok=True)
return directory_name
def process_data(data_file, mapping_file):
mapping = read_mapping_file(mapping_file)
with open(data_file, 'r') as file:
for line in file:
parts = line.strip().split(',')
name = parts[1]
print(f"{name}")
# Define the paths to the data file and mapping file
data_file_path = sys.argv[1]
mapping_file_path = './ella_name_map.txt'
# Process the data
process_data(data_file_path, mapping_file_path)