Skip to content

Instantly share code, notes, and snippets.

@bastionkid
Last active June 15, 2023 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastionkid/88620c5de802a2db82e05c4aa69555e2 to your computer and use it in GitHub Desktop.
Save bastionkid/88620c5de802a2db82e05c4aa69555e2 to your computer and use it in GitHub Desktop.
compare_apks.py - Setup phase
# read arguments passed to this script
apk_1_sha = sys.argv[1]
apk_2_sha = sys.argv[2]
apk_1_name = f"{apk_1_sha}.apk"
apk_2_name = f"{apk_2_sha}.apk"
# apk_analyzer_path location will change based on the GHA runner that you're using i.e. mac/windows/ubuntu etc
apk_analyzer_path = "/usr/local/lib/android/sdk/cmdline-tools/latest/bin/apkanalyzer"
kb_in_bytes = 1024
mb_in_bytes = 1024 * 1024
# generate dictionaries for the apk components size
components_1 = get_apk_components(apk_1_name, 'download-size')
components_2 = get_apk_components(apk_2_name, 'download-size')
generate_size_diff_html()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment