forked from tdoly/apk_parse
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
executable file
·51 lines (45 loc) · 1.38 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import binascii
from apk_parse.apk import APK
def test():
if len(sys.argv) == 1:
print('Usage: %s app.apk' % sys.argv[0])
sys.exit(1)
apk_path = sys.argv[1]
apkf = APK(apk_path)
print(apkf.cert_text)
print(apkf.cert_pem)
print(apkf.file_md5)
print(apkf.cert_md5)
print(apkf.file_size)
print(apkf.androidversion)
print(apkf.package)
print(apkf.get_android_manifest_xml())
print(apkf.get_android_manifest_axml())
print(apkf.is_valid_APK())
print(apkf.get_filename())
print(apkf.get_package())
print(apkf.get_androidversion_code())
print(apkf.get_androidversion_name())
print(apkf.get_max_sdk_version())
print(apkf.get_min_sdk_version())
print(apkf.get_target_sdk_version())
print(apkf.get_libraries())
print(apkf.get_files())
# pip install python-magic
print(apkf.get_files_types())
# print(apkf.get_dex())
print(apkf.get_main_activity())
print(apkf.get_activities())
print(apkf.get_services())
print(apkf.get_receivers())
print(apkf.get_providers())
print(apkf.get_permissions())
print(binascii.hexlify(apkf.get_signature()))
print(apkf.get_signature_name())
print apkf.show()
# apkf.parse_icon(icon_path='/tmp')
if __name__ == "__main__":
test()