Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/fosslight_android/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
class AndroidBinary:
bin_name = ""
bin_name_with_installed_path = ""
bin_name_with_path = ""
binary_name_without_path = ""
source_code_path = ""
module_name = ""
Expand All @@ -38,6 +39,7 @@ class AndroidBinary:

def __init__(self, value):
self.bin_name = value
self.bin_name_with_path = value # Needed for FL Binary Scanner
self.binary_name_without_path = ""
self.bin_name_with_installed_path = ""
self.source_code_path = CONST_NULL
Expand Down
10 changes: 4 additions & 6 deletions src/fosslight_android/android_binary_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def find_binaries_from_out_dir():
tmp_files = []
for file_rel_path in return_list:
if any(re.search(re_except_path, file_rel_path) for re_except_path in EXCEPTIONAL_PATH):
logger.debug(f"REMOVE (Exceptional Path):{file_rel_path}")
#logger.debug(f"REMOVE (Exceptional Path):{file_rel_path}")
continue
else:
bin_item = AndroidBinary(os.path.abspath(file_rel_path))
Expand Down Expand Up @@ -437,8 +437,7 @@ def search_binaries_by_bin_name_and_checksum(bin_name_to_search, bin_checksum_to
result = False
bin_name_without_path = os.path.basename(bin_name_to_search)
for item in final_bin_info:
bin_name_with_path = item.bin_name
bin_name = os.path.basename(bin_name_with_path)
bin_name = os.path.basename(item.bin_name)
checksum = item.checksum
if bin_name == bin_name_without_path and checksum == bin_checksum_to_search:
bin_list_same_names.append(item)
Expand Down Expand Up @@ -623,8 +622,7 @@ def remove_duplicated_binaries_by_checking_checksum(remove_list_file):
remove_list, remove_tlsh_list = remove_from_the_list(remove_list_file)

for item in final_bin_info[:]:
bin_name_with_path = item.bin_name
bin_name_to_search = os.path.basename(bin_name_with_path)
bin_name_to_search = os.path.basename(item.bin_name)
bin_checksum = item.checksum
search_key = bin_checksum + bin_name_to_search

Expand All @@ -645,7 +643,7 @@ def remove_duplicated_binaries_by_checking_checksum(remove_list_file):
str_bin_removed += f"{row_removed}\n"
continue
elif search_key not in checked_file_name:
find_result, same_name_binaries = search_binaries_by_bin_name_and_checksum(bin_name_with_path,
find_result, same_name_binaries = search_binaries_by_bin_name_and_checksum(item.bin_name,
bin_checksum)
checked_file_name[search_key] = find_result

Expand Down
Loading