Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TLSH, SHA1 column at report #10

Merged
merged 1 commit into from
Apr 3, 2024
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: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fosslight_util>=1.4.25
fosslight_util>=1.4.39
fosslight_source>=1.6.16
fosslight_binary>=4.1.3
beautifulsoup4
Expand Down
5 changes: 3 additions & 2 deletions src/fosslight_android/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,16 @@ def get_print_items(self):
f"{oss_name}\t{self.oss_version}\t{self.license}\t{need_check}\t{comment}\t{self.tlsh}\t{self.checksum}")
repo_link = self.download_location if self.is_new_bin else ""
print_items_excel.append([self.bin_name, source_path, self.notice, oss_name,
self.oss_version, self.license, repo_link, repo_link, '', '', '', comment, need_check])
self.oss_version, self.license, repo_link, repo_link, '', '', '', comment,
need_check, self.tlsh, self.checksum])

if self.additional_oss_items is not None:
for item in self.additional_oss_items:
print_items_txt.append(f"{self.bin_name}\t{source_path}\t{self.notice}\t{item}"
f"\t{need_check}\t{comment}\t{self.tlsh}\t{self.checksum}")
excel_item = [self.bin_name, source_path, self.notice]
excel_item.extend(item.split('\t'))
excel_item.extend(['', '', '', '', '', comment, need_check])
excel_item.extend(['', '', '', '', '', comment, need_check, self.tlsh, self.checksum])
bjk7119 marked this conversation as resolved.
Show resolved Hide resolved
print_items_excel.append(excel_item)
return print_items_txt, print_items_excel

Expand Down
5 changes: 4 additions & 1 deletion src/fosslight_android/_write_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@
import logging
from fosslight_util.write_txt import write_txt_file
from fosslight_util.constant import LOGGER_NAME
from fosslight_util.write_excel import hide_column

logger = logging.getLogger(LOGGER_NAME)
HIDDEN_HEADER = ['TLSH', 'SHA1']


def write_result_to_excel(out_file_name, row_list):
header_row = ['ID', 'Binary Name', 'Source Code Path', 'NOTICE.html', 'OSS Name', 'OSS Version', 'License',
'Download Location', 'Homepage',
'Copyright Text',
'License Text', 'Exclude', 'Comment', 'Need Check']
'License Text', 'Exclude', 'Comment', 'Need Check', 'TLSH', 'SHA1']
sheet_name = "BIN (Android)"
try:
workbook = xlsxwriter.Workbook(out_file_name)
worksheet = create_worksheet(workbook, sheet_name, header_row)
write_result_to_sheet(worksheet, row_list)
hide_column(worksheet, header_row, HIDDEN_HEADER)
workbook.close()
except Exception as ex:
print('* Error :' + str(ex))
Expand Down
Loading