From 496e1e93c460fcdb4bad6d80f5447617dbfed9df Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Mon, 2 Jun 2025 18:00:50 +0200 Subject: [PATCH] show bytecode contant --- .../get_app_runtime_result_distribution.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/experiment/get_app_runtime_result_distribution.py b/experiment/get_app_runtime_result_distribution.py index 1a2bd13..7418e66 100644 --- a/experiment/get_app_runtime_result_distribution.py +++ b/experiment/get_app_runtime_result_distribution.py @@ -27,12 +27,19 @@ def run( nb_dload_goo = 0 nb_dlaod_fb_and_fb = 0 dload_hashes_occ = {} + dload_hashes_ty = {} for apk, apk_data in summary["apks"].items(): - for h in apk_data["dyn_loaded_files"].keys(): + for h, dload in apk_data["dyn_loaded_files"].items(): if h not in dload_hashes_occ: dload_hashes_occ[h] = 0 dload_hashes_occ[h] += 1 - for dload in apk_data["dyn_loaded_files"].values(): + if dload["facebook_ads"]: + dload_hashes_ty[h] = "fb ads" + elif dload["google_ads"]: + dload_hashes_ty[h] = "gg ads" + else: + dload_hashes_ty[h] = "other" + nb_dload += 1 if dload["facebook_ads"] and dload["google_ads"]: nb_dlaod_fb_and_fb += 1 @@ -75,15 +82,15 @@ def run( hashes.sort(key=lambda x: dload_hashes_occ[x], reverse=True) i = len(hashes) print( - f"bytecode hash | number of occurence" + f"bytecode hash | number of occurence | content" ) for h in hashes: occ = dload_hashes_occ[h] if occ <= 1: - print(f"{i} other uniq bytecode files") + print(f"{i} other unique bytecode files") break i -= 1 - print(f" {h} | {occ}") + print(f" {h} | {occ:3} | {dload_hashes_ty[h]} ") if show_distribution: print(