File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -499,6 +499,28 @@ def checkinit(self):
499499 time .sleep (2 )
500500 os ._exit (1 )
501501
502+ def changeUsername (self , username ):
503+ self .checkinit ()
504+ init_iv = SHA256 .new (str (uuid4 ())[:8 ].encode ()).hexdigest ()
505+ post_data = {
506+ "type" : binascii .hexlify ("changeUsername" .encode ()),
507+ "newUsername" : username ,
508+ "sessionid" : binascii .hexlify (self .sessionid .encode ()),
509+ "name" : binascii .hexlify (self .name .encode ()),
510+ "ownerid" : binascii .hexlify (self .ownerid .encode ()),
511+ "init_iv" : init_iv
512+ }
513+
514+ response = self .__do_request (post_data )
515+ response = encryption .decrypt (response , self .enckey , init_iv )
516+ json = jsond .loads (response )
517+
518+ if json ["success" ]:
519+ print ("successfully Changed Username" )
520+ else :
521+ print (json ["message" ])
522+ os ._exit (1 )
523+
502524 def __do_request (self , post_data ):
503525 try :
504526 rq_out = s .post (
You can’t perform that action at this time.
0 commit comments