Skip to content

Commit 09e6492

Browse files
authored
Improvements
better "getchecksum" function, changed cls and title to 1 line, typo fix
1 parent dab58c3 commit 09e6492

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

main.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
from keyauth import api
24
import time
35
import os
@@ -9,19 +11,15 @@
911
# ^^ only for auto login/json writing/reading
1012

1113
# watch setup video if you need help https://www.youtube.com/watch?v=L2eAQOmuUiA
12-
os.system("cls")
13-
os.system("title Python Example")
14+
15+
os.system("cls & title Python Example")
1416
print("Initializing")
1517

1618

1719
def getchecksum():
18-
path = os.path.basename(__file__)
19-
if not os.path.exists(path):
20-
path = path[:-2] + "exe"
2120
md5_hash = hashlib.md5()
22-
a_file = open(path, "rb")
23-
content = a_file.read()
24-
md5_hash.update(content)
21+
file = open(''.join(sys.argv), "rb")
22+
md5_hash.update(file.read())
2523
digest = md5_hash.hexdigest()
2624
return digest
2725

@@ -34,7 +32,7 @@ def getchecksum():
3432
hash_to_check = getchecksum()
3533
)
3634

37-
print(f"""
35+
print(f"""1
3836
App data:
3937
Number of users: {keyauthapp.app_data.numUsers}
4038
Number of online users: {keyauthapp.app_data.onlineUsers}
@@ -137,7 +135,7 @@ def answer():
137135
# * Auto-Login Example (THIS IS JUST AN EXAMPLE --> YOU WILL HAVE TO EDIT THE CODE PROBABLY)
138136
# 1. Checking and Reading JSON
139137

140-
#### Note: Remove the ''' on line 136 and 195
138+
#### Note: Remove the ''' on line 140 and 199
141139

142140
'''try:
143141
if os.path.isfile('auth.json'): #Checking if the auth file exist
@@ -202,7 +200,7 @@ def answer():
202200

203201
# Writing user data on login:
204202
# Check Keyauth.py file --> Line 158
205-
# Replace the whole login function with this login function (This has auto user data dumping, so the user only have to login once), dont forget to remove the ''' on line 202,239
203+
# Replace the whole login function with this login function (This has auto user data dumping, so the user only have to log in once), don't forget to remove the ''' on line 206,243
206204
# Note: The auto login function above is needed for this bc it creates the auth file, if the auth file is missing this won't work
207205

208206
'''def login(self, user, password, hwid=None):

0 commit comments

Comments
 (0)