Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no exit code as counter #44

Merged
merged 4 commits into from
May 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions exodus_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_ignore_list(ignore_arg):
return ignored, ''


def analyze_apk(apk, json_mode, output_file, ignore_list):
def analyze_apk(apk, json_mode, output_file, no_counter, ignore_list):
analysis = AnalysisHelper(apk)
analysis.load_trackers_signatures()
if json_mode:
Expand All @@ -72,6 +72,8 @@ def analyze_apk(apk, json_mode, output_file, ignore_list):
analysis.print_apk_infos()
analysis.print_embedded_trackers()

if no_counter:
return
trackers_not_ignored = [t for t in analysis.detect_trackers() if t.id not in ignore_list]
sys.exit(len(trackers_not_ignored))

Expand Down Expand Up @@ -105,6 +107,13 @@ def main():
default=None,
help='comma-separated ids of trackers to ignore'
)
parser.add_argument(
'--no-exit-counter',
DMyachin marked this conversation as resolved.
Show resolved Hide resolved
DMyachin marked this conversation as resolved.
Show resolved Hide resolved
dest='no_counter',
action='store_true',
default=False,
help='do not use exit code as trackers counter'
)

args = parser.parse_args()
args_error = validate_arguments(args)
Expand All @@ -117,7 +126,7 @@ def main():
if ignore_error:
raise_error(parser, ignore_error)

analyze_apk(args.apk, args.json_mode, args.output_file, ignore_list)
analyze_apk(args.apk, args.json_mode, args.output_file, args.no_counter, ignore_list)


if __name__ == '__main__':
Expand Down