Skip to content

Commit 3948cfd

Browse files
authored
Update to support in-app custom responses & show how to support wmic as a get_hwid option
1 parent eca4723 commit 3948cfd

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

keyauth.py

+19-4
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def register(self, user, password, license, hwid=None):
121121
json = jsond.loads(response)
122122

123123
if json["success"]:
124-
print("Successfully registered")
124+
print(json["message"])
125125
self.__load_user_data(json["info"])
126126
else:
127127
print(json["message"])
@@ -145,7 +145,7 @@ def upgrade(self, user, license):
145145
json = jsond.loads(response)
146146

147147
if json["success"]:
148-
print("Successfully upgraded user")
148+
print(json["message"])
149149
print("Please restart program and login")
150150
time.sleep(3)
151151
os._exit(1)
@@ -175,7 +175,7 @@ def login(self, user, password, hwid=None):
175175

176176
if json["success"]:
177177
self.__load_user_data(json["info"])
178-
print("Successfully logged in")
178+
print(json["message"])
179179
else:
180180
print(json["message"])
181181
time.sleep(3)
@@ -201,7 +201,7 @@ def license(self, key, hwid=None):
201201

202202
if json["success"]:
203203
self.__load_user_data(json["info"])
204-
print("Successfully logged in with license")
204+
print(json["message"])
205205
else:
206206
print(json["message"])
207207
time.sleep(3)
@@ -582,6 +582,21 @@ def get_hwid():
582582
sid = win32security.LookupAccountName(None, winuser)[0] # You can also use WMIC (better than SID, some users had problems with WMIC)
583583
hwid = win32security.ConvertSidToStringSid(sid)
584584
return hwid
585+
'''
586+
cmd = subprocess.Popen(
587+
"wmic useraccount where name='%username%' get sid",
588+
stdout=subprocess.PIPE,
589+
shell=True,
590+
)
591+
592+
(suppost_sid, error) = cmd.communicate()
593+
594+
suppost_sid = suppost_sid.split(b"\n")[1].strip()
595+
596+
return suppost_sid.decode()
597+
598+
^^ HOW TO DO IT USING WMIC
599+
'''
585600
elif platform.system() == 'Darwin':
586601
output = subprocess.Popen("ioreg -l | grep IOPlatformSerialNumber", stdout=subprocess.PIPE, shell=True).communicate()[0]
587602
serial = output.decode().split('=', 1)[1].replace(' ', '')

0 commit comments

Comments
 (0)