1
- from androguard .misc import AnalyzeAPK
2
1
from rich .console import Console
3
2
from rich .table import Table
4
3
import json , requests , argparse , yaml , re , datetime , os , subprocess , platform , hashlib
@@ -267,9 +266,6 @@ def read_match_strings(file_path, source):
267
266
# Check if the file is an archive (zip, rar, tar, tar.gz)
268
267
elif file_path .lower ().endswith (('.zip' , '.rar' , '.tar' , '.tar.gz' )):
269
268
content = read_archive (file_path )
270
- # Check if the file is an APK (Android application package)
271
- elif file_path .lower ().endswith ('.apk' ):
272
- content = read_apk (file_path )
273
269
else :
274
270
# For other file types, read content normally
275
271
with open (file_path , 'rb' ) as file :
@@ -282,27 +278,6 @@ def read_match_strings(file_path, source):
282
278
matched_strings = match_strings (content )
283
279
return matched_strings
284
280
285
- def read_apk (file_path ):
286
- try :
287
- # Analyze the APK file using androguard
288
- a , d , dx = AnalyzeAPK (file_path )
289
-
290
- # Extract strings from the APK
291
- strings = []
292
- for method in dx .get_methods ():
293
- for _ , _ , _ , string in method .get_strings ():
294
- strings .append (string )
295
-
296
- # Combine all extracted strings into a single content string
297
- content = ' ' .join (strings )
298
-
299
- except Exception as e :
300
- print_debug (f"Error in read_apk: { e } " )
301
- content = ''
302
-
303
- return content
304
-
305
-
306
281
def read_pdf (file_path ):
307
282
content = ''
308
283
try :
0 commit comments