From e39140e113bea27e4e1519c45d76e5037d3df8a9 Mon Sep 17 00:00:00 2001 From: eybisi Date: Fri, 29 Dec 2023 11:07:14 +0300 Subject: [PATCH] check if main activity is in dex. add new method to find out if sample is packed --- src/kavanoz/unpack_plugin.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/kavanoz/unpack_plugin.py b/src/kavanoz/unpack_plugin.py index 831bf2f..74a85a3 100644 --- a/src/kavanoz/unpack_plugin.py +++ b/src/kavanoz/unpack_plugin.py @@ -69,9 +69,23 @@ def is_packed(self) -> bool: if len(act_serv_recv) == 0: return False score = not_found_counter / len(act_serv_recv) + self.logger.info(f"Packed : Score : {score}") if score > 0.80: - self.logger.info(f"Packed : Score : {score}") ispacked = True + else: + # Lets check if MainActivity is present + res = self.apk_object.get_main_activity() + if res: + for dex in self.dvms: + try: + dex_classes = dex.get_classes_names() + except Exception as e: + continue + clas_name = "L" + res.replace(".", "/") + ";" + if clas_name in dex_classes: + break + else: + ispacked = True return ispacked def is_really_unpacked(self) -> bool: