Skip to content

Commit 6f6df35

Browse files
committed
Updated checker algorithm (credit : KimmyXYC))
Thank you for the update KimmyXYC!
1 parent 6703587 commit 6f6df35

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
venv/
22
keyboxs/
3-
beta_v2/
3+
beta_v2/
4+
debugger.py

main.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from cryptography.hazmat.primitives import hashes, serialization
2525
from cryptography.hazmat.primitives.asymmetric import padding, ec
2626
init(autoreset=True)
27-
current_version = "v1.2"
27+
current_version = "v1.3"
2828

2929
# ==== This code is to check update
3030

@@ -275,9 +275,17 @@ async def keybox_check_cli(keybox_path):
275275
print("Failed to fetch Google's revoked keybox list")
276276
with open("res/json/status.json", 'r', encoding='utf-8') as file:
277277
status_json = json.load(file)
278-
reply += "\nUsing local revoked keybox list"
279-
status = status_json['entries'].get(serial_number_string, None)
280-
if status is None:
278+
print("Using local revoked list.. (DO NOT TRUST 100%)")
279+
280+
status = None
281+
for i in range(pem_number):
282+
certificate = x509.load_pem_x509_certificate(pem_certificates[i].encode(), default_backend())
283+
serial_number = certificate.serial_number
284+
serial_number_string = hex(serial_number)[2:].lower()
285+
if status_json['entries'].get(serial_number_string, None):
286+
status = status_json['entries'][serial_number_string]
287+
break
288+
if not status:
281289
google_status = "null"
282290
else:
283291
google_status = (f"{status['reason']}")

0 commit comments

Comments
 (0)