Skip to content

Commit

Permalink
Add a QLabel to display the count of APK's found
Browse files Browse the repository at this point in the history
  • Loading branch information
shmu1i authored Feb 9, 2024
1 parent bc61646 commit c493759
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apk_package_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
QPushButton, QFileDialog, QProgressBar, QMenu, QAction, QHBoxLayout, QLabel, QLineEdit, QComboBox
)
from PyQt5.QtCore import QSettings, Qt, QTimer
from PyQt5.QtGui import QFont
from androguard import util
from androguard.core.apk import get_apkid
import os
Expand Down Expand Up @@ -42,14 +43,17 @@ def load_files_progress(folder_path, progress_bar):
total_files = len(package_dict)
progress_bar.setMaximum(total_files)
progress_bar.setValue(0)


count_label.setText(f"APK's Found: 0") # Reset count label

item = tree.invisibleRootItem()
for index, (filepath, packagename) in enumerate(package_dict.items(), 1):
filename = os.path.basename(filepath)
child_item = QTreeWidgetItem([filename, packagename, filepath])
item.addChild(child_item)

progress_bar.setValue(index)
count_label.setText(f"APK's Found: {index}") # Update count label
QApplication.processEvents()

progress_bar.setValue(total_files)
Expand Down Expand Up @@ -181,6 +185,8 @@ def open_file(item):
# Connect the custom context menu function to the customContextMenu signal
tree.customContextMenuRequested.connect(show_context_menu)



search_layout = QHBoxLayout()
search_label = QLabel("Search:")
search_layout.addWidget(search_label)
Expand Down Expand Up @@ -248,6 +254,11 @@ def search_files():
layout.addWidget(progress_bar)
window.show()

count_label = QLabel("APK's Found: 0")
font = QFont()
font.setBold(True)
layout.addWidget(count_label)

tree.itemDoubleClicked.connect(on_item_double_click)

sys.exit(app.exec_())

0 comments on commit c493759

Please sign in to comment.