#Fantasy Dial python version#by 1414641776Account=' xxxxxx@96301'Password=' xxxxx'#Router ScriptdefSendtoroute (Account,password):Importurllib.request,base64 IP='192.168.1.1'Login_user='Admin'LOGIN_PW=' admin'URL="http://192.168.1.1/userRpm/PPPoECfgRpm.htm?wan=0&wantype=2&acc="+account+"&psw="+password+"&confirm="+password+"&specialdial=0§ype=0&sta_ip=0.0.0.0&sta_mask=0.0.0.0&linktype=1&waittime=15 &connect=%c1%ac+%bd%d3"Auth=str (Base64.b64encode (login_user+':'+LOGIN_PW). Encode ('Utf-8')) Auth='Basic'+ Auth[2:len (auth)-1] Heads= {'Referer':'/ http'+ IP +'/userrpm/sysrebootrpm.htm', 'Authorization': Auth#' Basic ywrtaw46emhpzglhbnpozw5h '} request=urllib.request.Request (URL, None, heads) Response=Urllib.request.urlopen (Request)Print(Response.read ())#Sl4a's Android API call#Clipboard copy functiondefSetClipboard (String):Importsl4a Droid=sl4a. Android () Droid.setclipboard (string)#MD5 Cryptographic FunctionsdefMD5 (string):Importhashlib M=hashlib.md5 () m.update (String.encode ('Utf-8')) #The argument must be of type Byte, otherwise unicode-objects must be encoded before hashing errormd5=m.hexdigest ()returnMd5.upper ()#Day Wing old version encryption functiondefGetaccount (Account,password):Import Time Now=time.localtime () time_string= str (now[3]) +str (now[4]) +str (now[5]) encryptStr1= MD5 (time_string) [0:8] ENCRYPTSTR2= MD5 ("Jepyid"+account.upper () +encryptstr1+password.upper ()) [0:20] EncryptAccount="~GHCA"+encryptstr1+" -"+encryptstr2+ AccountreturnEncryptaccountaccount=Getaccount (Account,password) SetClipboard (account)Print(account+'\ r \ n Encrypted account has been copied to clipboard') Sendtoroute (Account,password)
Using Qpython3 to make the old version of the sky-wing TP router dialing script