File: androsign.py

package info (click to toggle)
androguard 3.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 62,444 kB
  • sloc: python: 24,366; xml: 3,187; java: 1,837; makefile: 228; sh: 12
file content (23 lines) | stat: -rwxr-xr-x 917 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
from __future__ import print_function
from argparse import ArgumentParser

from androguard.cli import androsign_main


def get_parser():
    parser = ArgumentParser(description="Return the fingerprint(s) of all certificates inside an APK")

    parser.add_argument("apk", nargs="+", help="APK(s) to extract the Fingerprint of Certificates from")
    parser.add_argument("--hash", default="sha1", help="Fingerprint Hash algorithm, default SHA1")
    parser.add_argument("--all", "-a", default=False, action="store_true", help="Print all supported hashes")
    parser.add_argument("--show", "-s", default=False, action="store_true",
            help="Additionally of printing the fingerprints, show more certificate information")

    return parser


if __name__ == "__main__":
    parser = get_parser()
    args = parser.parse_args()
    androsign_main(args.apk, args.hash, args.all, args.show)