Skip to content

Commit

Permalink
Fixed bugs and new features
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitcoder committed Dec 5, 2023
1 parent 4d57320 commit 088a641
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
25 changes: 0 additions & 25 deletions hawk_scanner/internals/system.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from androguard.misc import AnalyzeAPK
from rich.console import Console
from rich.table import Table
import json, requests, argparse, yaml, re, datetime, os, subprocess, platform, hashlib
Expand Down Expand Up @@ -267,9 +266,6 @@ def read_match_strings(file_path, source):
# Check if the file is an archive (zip, rar, tar, tar.gz)
elif file_path.lower().endswith(('.zip', '.rar', '.tar', '.tar.gz')):
content = read_archive(file_path)
# Check if the file is an APK (Android application package)
elif file_path.lower().endswith('.apk'):
content = read_apk(file_path)
else:
# For other file types, read content normally
with open(file_path, 'rb') as file:
Expand All @@ -282,27 +278,6 @@ def read_match_strings(file_path, source):
matched_strings = match_strings(content)
return matched_strings

def read_apk(file_path):
try:
# Analyze the APK file using androguard
a, d, dx = AnalyzeAPK(file_path)

# Extract strings from the APK
strings = []
for method in dx.get_methods():
for _, _, _, string in method.get_strings():
strings.append(string)

# Combine all extracted strings into a single content string
content = ' '.join(strings)

except Exception as e:
print_debug(f"Error in read_apk: {e}")
content = ''

return content


def read_pdf(file_path):
content = ''
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "0.3.3"
VERSION = "0.3.4"

from setuptools import setup, find_packages

Expand Down

0 comments on commit 088a641

Please sign in to comment.