From faf3b8087127709bb5f8eefcc7da2ef30ed6eca7 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Tue, 5 Nov 2024 16:27:03 +0100 Subject: [PATCH] fix --- android_class_shadowing_scanner/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/android_class_shadowing_scanner/__init__.py b/android_class_shadowing_scanner/__init__.py index d0d935e..3bc9c3b 100644 --- a/android_class_shadowing_scanner/__init__.py +++ b/android_class_shadowing_scanner/__init__.py @@ -248,6 +248,12 @@ def check_smali(): type=Path, required=True, ) + parser.add_argument( + "--out", + help="Path to the file where to store the results", + type=Path, + required=True, + ) key_parser = parser.add_mutually_exclusive_group(required=False) key_parser.add_argument( "--api-key-file", @@ -335,4 +341,12 @@ def check_smali(): elif smali != smali_new: dist_dup_classes.add(cl) data[sha256]["redef_classes"] = list(dist_dup_classes) - print(json.dumps(data)) + if data[sha256]["redef_classes"]: + print(f"{sha256}:") + for c in data[sha256]["redef_classes"]: + print(f" {c}") + else: + print(f"{sha256}: No true redefinition") + + with args.out.open("w") as f: + json.dump(data, f)