Skip to content

Commit

Permalink
check if main activity is in dex.
Browse files Browse the repository at this point in the history
add new method to find out if sample is packed
  • Loading branch information
eybisi committed Dec 29, 2023
1 parent c3d6d99 commit e39140e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/kavanoz/unpack_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e39140e

Please sign in to comment.