-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtek_list.py
executable file
·29 lines (26 loc) · 997 Bytes
/
tek_list.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
#!/usr/bin/python3
import sys
import binascii
import TemporaryExposureKeyExport_pb2
f = open("export.bin", "rb")
g = TemporaryExposureKeyExport_pb2.TemporaryExposureKeyExport()
header = f.read(16)
#print("header:"+str(header))
try:
g.ParseFromString(f.read())
except:
sys.exit(-1)
f.close()
#print("file timestamps: start "+str(g.start_timestamp)+", end "+str(g.end_timestamp))
#print("batch_num: "+str(g.batch_num)+", batch_size: "+str(g.batch_size))
#print("region: "+str(g.region))
#print("signature info:")
#print(str(g.signature_infos))
for key in g.keys:
#print(str(binascii.hexlify(key.key_data))+
#str(key.rolling_start_interval_number)+", period:"+str(key.rolling_period)+
#str(key.transmission_risk_level))
print(binascii.hexlify(key.key_data).decode())
#print("start interval: "+str(key.rolling_start_interval_number)+", period:"+str(key.rolling_period))
#print("transmission risk level: "+str(key.transmission_risk_level))
sys.exit(len(g.keys))