---------------------------------------------------------- ---------------FRAMEWORK TO AUTOTOUCH -------------------- ---------------------------------------------------------- local http = require "socket.http" local ltn12 = require("ltn12") local json = require ("json") local lfs = require("lfs") --local sqlite3 = require('lsqlite3') local pattern=require ("pattern") ---------------------------------------------------------- local timeDefault=60 local failDefault=true debugF=true FailRs=false ---------------------------------------------------------- local function debugFramework(cmt) if debugF==true then end end function file_exists(file) local f = io.open(file, "rb") if f then f:close() end return f ~= nil end function lines_from(file) if not file_exists(file) then return {} end local lines = {} for line in io.lines(file) do lines[#lines + 1] = line end return lines end -- hàm tách chuỗi function split1(pString, pPattern) local Table = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat = "(.-)" .. pPattern local last_end = 1 if pString == nil then return 1 end local s, e, cap = pString:find(fpat, 1) if e == nil then return 1 end while s do if s ~= 1 or cap ~= "" then table.insert(Table,cap) end last_end = e+1 s, e, cap = pString:find(fpat, last_end) end if last_end <= #pString then cap = pString:sub(last_end) table.insert(Table, cap) end return Table end -- hàm xóa đầu dòng function removeDongDau(tenFile) myFile = rootDir() .. tenFile local lines = lines_from(myFile) local linesArray = {} for i = 1,#lines,1 do table.insert(linesArray, lines[i]) end local out = io.open(rootDir() .. "/datalua.tmp.lua", 'w') for i = 2,#lines,1 do out:write(lines[i], "\n") end for _, line in ipairs(lines) do end out:close() os.rename(rootDir() .. "/datalua.tmp.lua", myFile) end function remove(file) mythe = rootDir() .. "/"..file; local lines12 = lines_from(mythe) soDongThe = #lines12 if #lines12 < 1 then flashCheck = false mSleep(1000) return 10 end removeDongDau("/"..file) lines12 = lines_from(mythe) soDongThe2 = #lines12 while(soDongThe2 == soDongThe) do removeDongDau("/"..file) end end ------------------------------------------------------------------------------------------------------------ function TmProxy(Key) local http = require("socket.http") local ltn12 = require("ltn12") local json = require("json") -- The Request Bin test URL: http://requestb.in/12j0kaq1 local path = "https://tmproxy.com/api/proxy/get-new-proxy" local payload = '{"api_key":"'..Key..'","id_location":0}' local response_body = { } local res, code, response_headers, status = http.request { url = path, method = "POST", headers = { ["Authorization"] = "Maybe you need an Authorization header?", ["Content-Type"] = "application/json", ["Content-Length"] = payload:len() }, source = ltn12.source.string(payload), sink = ltn12.sink.table(response_body) } mai = table.concat(response_body) log(mai) json_string3 = json.decode(mai) code = json_string3["code"] message = json_string3["message"] data = json_string3["data"] https = data["https"] if https ~= "" then list=split(https,':') ip = list[1] port = list[2] io.popen('sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost proxytool 1 '..ip.." "..port) else end end ---------------------------------------------------------- function CreartNewfile(Newfile,NewValue) mythe = rootDir() .. "/"..Newfile..".lua"; local f = io.open(mythe) if f == nil then writeFileString(userPath()..Newfile..".lua",NewValue) return else f:close() end end ---------------------------------------------------------- function mSleep(time) if CheckFun==true then;goto endFund;end usleep(450*time); -- if isMultyColor({{681, 1103, 0xdadada },{693, 1093, 0xbfbfbf},{678, 102, 0x6e6e6e},{682, 1107, 0xdadada},{698, 906, 0xe4e4e4},{682, 1201, 0xdbdbdb},{242, 801, 0x007aff}}) then -- tap(x,y) -- usleep(1000000) -- end -- if isMultyColor({{493, 1135, 0xfcfcfc}}) then -- tap(682, 1107) -- usleep(1000000) -- end usleep(450*time); ::endFund:: end ---------------------------------------------------------------------------------------------------------------------------- function MoveDow(x1,y1,x2,y2) local buoc=y1-y2 buoc=math.floor(buoc/5) touchDown(4, x1, y1); usleep(200); for i=1,buoc do touchMove(4, x1, y1-5*i); usleep(10000); end touchUp(4, x2, y2); end function MoveDow1(x1,y1,x2,y2) local buoc=y1-y2 buoc=math.floor(buoc/5) touchDown(4, x1, y1); usleep(600); for i=1,buoc do touchMove(4, x1, y1-5*i); usleep(3000); end touchUp(4, x2, y2); end ---------------------------------------------------------- -- hàm tách 2 chuỗi function split2(pString, pPattern, pPattern1) local Table = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat = "(.-)" .. pPattern local last_end = 1 if pString == nil then return 1 end local s, e, cap = pString:find(fpat, 1) if e == nil then return 1 end while s do if s ~= 1 or cap ~= "" then table.insert(Table,cap) end last_end = e+1 s, e, cap = pString:find(fpat, last_end) end if last_end <= #pString then cap = pString:sub(last_end) table.insert(Table, cap) end giatritable = Table[2] local Table1 = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat1 = "(.-)" .. pPattern1 local last_end1 = 1 if giatritable == nil then return 1 end local s1, e1, cap1 = giatritable:find(fpat1, 1) if e1 == nil then return 1 end while s1 do if s1 ~= 1 or cap1 ~= "" then table.insert(Table1,cap1) end last_end1 = e1+1 s1, e1, cap1 = giatritable:find(fpat1, last_end1) end if last_end1 <= #giatritable then cap1 = giatritable:sub(last_end1) table.insert(Table1, cap1) end return Table1[1] end ---------------------------------------------------------- -- hàm tách 3 chuỗi function split3(pString, pPattern, pPattern1) local Table = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat = "(.-)" .. pPattern local last_end = 1 if pString == nil then return 1 end local s, e, cap = pString:find(fpat, 1) if e == nil then return 1 end while s do if s ~= 1 or cap ~= "" then table.insert(Table,cap) end last_end = e+1 s, e, cap = pString:find(fpat, last_end) end if last_end <= #pString then cap = pString:sub(last_end) table.insert(Table, cap) end giatritable = Table[2] if giatritable == nil then return 1 end local Table1 = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat1 = "(.-)" .. pPattern1 local last_end1 = 1 local s1, e1, cap1 = giatritable:find(fpat1, 1) if e1 == nil then return 1 end while s1 do if s1 ~= 1 or cap1 ~= "" then table.insert(Table1,cap1) end last_end1 = e1+1 s1, e1, cap1 = giatritable:find(fpat1, last_end1) end if last_end1 <= #giatritable then cap1 = giatritable:sub(last_end1) table.insert(Table1, cap1) end return Table1[1] end ---------------------------------------------------------- function userPathFile() local fullfile= string.gsub(debug.getinfo(1).short_src, "^(.+\\)[^\\]+$", "%1"); local filecut=split(fullfile,"Library") return "/private/var/mobile/Library"..filecut[2] end ---------------------------------------------------------- function RunTerminal(ex) if CheckFun==true then;goto endFund;end local cmdHere cmdHere=io.popen(ex) cmdHere:close() ::endFund:: end ---------------------------------------------------------- function split(s, delimiter) result = {}; for match in (s..delimiter):gmatch("(.-)"..delimiter) do table.insert(result, match); end return result; end ---------------------------------------------------------- function userPath() return("/private/var/mobile/Library/AutoTouch/Scripts/") end ------------------------------------------------------------- function delTempFile(inpath) if CheckFun==true then;goto endFund;end if inpath~=nil then RunTerminal("rm -rf "..inpath.."/tmp/*"); RunTerminal("rm -rf "..inpath.."/Library/Caches/*"); RunTerminal("rm -rf "..inpath.."/Documents/*"); RunTerminal("rm -rf "..inpath.."/Library/Cookies/*"); end ::endFund:: end -------------------------------------------------------------- function executeCommands(command) local process = io.popen(command) local lastline for line in process:lines() do lastline = line end end function decimalToHex(num) if num == 0 then return '0' end local neg = false if num < 0 then neg = true num = num * -1 end local hexstr = "0123456789abcdef" local result = "" while num > 0 do local n = math.fmod(num, 16) result = string.sub(hexstr, n + 1, n + 1) .. result num = math.floor(num / 16) end if neg then result = '-' .. result end return '0x'..result end -------------------------------------------------------------- -------------------- Cac Ham He Thong ------------------------ -------------------------------------------------------------- -------------------------------------------------------------- function writeFileString(file,str) pl=require "pl.file" pl.write(file,str) end -------------------------------------------------------------- function readFileString(path) pl=require "pl.file" return pl.read(path) end -------------------------------------------------------------- function isFileExist(name) if type(name)~="string" then return false end return os.rename(name, name) and true or false end -------------------------------------------------------------- function randomStr(str, num) math.randomseed(os.time()) local ret ='' for i = 1, num do local rchr = math.random(1, string.len(str)) ret = ret .. string.sub(str, rchr, rchr) end return ret end function random_daucau(number) s = randomStr("!@#$%^&*", number) return s; end function random_num_up(number) s = randomStr("1234567890QWERTYUOPASDFGHJKLZXCVBNM", number) return s; end function random_num_low(number) s = randomStr("1234567890qwertyuiopasdfghjkzxcvbnm", number) return s; end function random_num(number) s = randomStr("0123456789", number) return s; end function random_num2(number) math.randomseed(os.time()) s = randomStr("01232342392456789", number) return s; end function random_up(number) s = randomStr("QWERTYUOPASDFGHJKLZXCVBNM", number) return s; end function random_low(number) s = randomStr("qwertyuiopasdfghjkzxcvbnm", number) return s; end function random_low_up(number) s = randomStr("QWERTYUOPASDFGHJKLZXCVBNMqwertyuiopasdfghjkzxcvbnm", number) return s; end function random_low_up_num(number) s = randomStr("1234567890QWERTYUOPASDFGHJKLZXCVBNMqwertyuiopasdfghjkzxcvbnm", number) return s; end function randomaf(number) mSleep(1000) math.randomseed(os.time()) s = randomStr("1234567890abcdef", number) return s; end function randomupaf(number) s = randomStr("1234567890ABCDEF", number) return s; end function random_up1(number) s = randomStr("WERTYUOPASDFGHJKLZCVBNM", number) return s; end -------------------------------------------------------------- function UpdateCode(file) RunTerminal("rm -rf /private/var/mobile/Library/AutoTouch/Scripts/"..file..".lua") RunTerminal("cd /private/var/mobile/Library/AutoTouch/Scripts/;wget http://108.61.90.124/5S/"..file..".lua") end function UpdateImage(image) --toast(image) RunTerminal("rm -rf /private/var/mobile/Library/AutoTouch/Scripts/res/"..image) RunTerminal("cd /private/var/mobile/Library/AutoTouch/Scripts/res/;wget http://108.61.90.124/5S/res/"..image) end function UDT() io.popen('sshpass -p "alpine" ssh -o StrictHostKeyChecking=no root@localhost proxytool 0') --toast('Dang Update') UpdateCode('Update') require("Update") mSleep(1000); end ---------------------------------------------------------------------------------------------------------------------------- function HTTPGet4(InHeader,Link) local curl = require("cURL") local easy = curl.easy() easy:setopt(curl.OPT_URL, Link) easy:setopt(curl.OPT_SSL_VERIFYPEER, false) easy:setopt(curl.OPT_SSL_VERIFYHOST, 0) easy:setopt(curl.OPT_HTTPHEADER, InHeader) local response_code = easy:getinfo_response_code() local response = {} local success, error_message = pcall(function() easy:setopt(curl.OPT_WRITEFUNCTION, function(data) table.insert(response, data) return #data end) easy:perform() -- Perform the request end) easy:close() -- Close the easy handle if not success then return "Error : "..tostring(error_message) end local responseString = table.concat(response) return responseString end function hamdelay(a) delaya = true numberdelay = 0 i = a while(delaya and numberdelay < a + 1 and i) do if i == 0 then return end if trangthai == nil then toast(i) else toast(trangthai.." "..i) end usleep(1000000) delaya = true numberdelay = numberdelay + 1 i = i - 1 end end function hamdelay1(a) delaya = true numberdelay = 0 i = a while(delaya and numberdelay < a + 1 and i) do if i == 0 then return end toast(i) usleep(1000000) delaya = true numberdelay = numberdelay + 1 i = i - 1 end end function isColor(Color) if CheckFun==true then;goto endFund;end x=-1 y=-1 local result = getColor(Color[1],Color[2]); if string.format("%#x", Color[3])==decimalToHex(result) then x=Color[1] y=Color[2] return true else return false end ::endFund:: end function isColorm(Color) if CheckFun==true then;goto endFund;end x7=-1 y7=-1 local result = getColor(Color[1],Color[2]); if string.format("%#x", Color[3])==decimalToHex(result) then x7=Color[1] y7=Color[2] return true else return false end ::endFund:: end function waitColor(Color) countlai = 0 ::lai:: if isColor(Color) == true then return true else countlai = countlai + 1 if countlai > 20 then return false end mSleep(500) goto lai end end function wait2Color(Color,Color2) countlai = 0 ::lai:: if isColor(Color) == true or isColor(Color2) == true then return true else countlai = countlai + 1 if countlai > 20 then return false end mSleep(500) goto lai end end function wait2ColorCheck(Color,Color2,time) countlai = 0 ::lai:: if isColor(Color) then return 1 end if isColor(Color2) then return 2 end countlai = countlai + 1 if countlai > time then return false end mSleep(500) goto lai end function wait3ColorCheck(Color,Color2,Color3,time) countlai = 0 ::lai:: if isColor(Color) then return 1 end if isColor(Color2) then return 2 end if isColor(Color3) then return 3 end countlai = countlai + 1 if countlai > time then return false end mSleep(500) goto lai end function isImage(image) if CheckFun==true then;goto endFund;end x=-1 y=-1 if Number==nil then;Number=1;end local threshold=0.97 local method=1 local result = findImage(userPath().."Zalo/res/"..image[1], Number, threshold, {image[2],image[3],image[4],image[5]}, false,method) if #result==0 then x=-1 y=-1 else if #result>=Number then x=result[Number][1] y=result[Number][2] else x=result[#result][1] y=result[#result][2] end end if x==-1 then return false else return true end ::endFund:: end function isImage6(image) if CheckFun==true then;goto endFund;end x3=-1 y3=-1 if Number==nil then;Number=1;end local threshold=0.97 local method=1 local result = findImage(userPath().."Zalo/res/"..image[1], Number, threshold, {image[2],image[3],image[4],image[5]}, false,method) if #result==0 then x3=-1 y3=-1 else if #result>=Number then x3=result[Number][1] y3=result[Number][2] else x3=result[#result][1] y3=result[#result][2] end end if x3==-1 then return false else return true end ::endFund:: end function isImage5(image) if CheckFun==true then;goto endFund;end x2=-1 y2=-1 if Number==nil then;Number=1;end local threshold=0.95 local method=1 local result = findImage(userPath().."Zalo/res/"..image[1], Number, threshold, {image[2],image[3],image[4],image[5]}, false,method) if #result==0 then x2=-1 y2=-1 else if #result>=Number then x2=result[Number][1] y2=result[Number][2] else x2=result[#result][1] y2=result[#result][2] end end if x2==-1 then return false else return true end ::endFund:: end function isImage1(image) if CheckFun==true then;goto endFund;end x=-1 y=-1 if Number==nil then;Number=1;end local threshold=0.98 local method=1 local result = findImage(userPath().."Zalo/res/"..image[1], Number, threshold, {image[2],image[3],image[4],image[5]}, false,method) if #result==0 then x=-1 y=-1 else if #result>=Number then x=result[Number][1] y=result[Number][2] else x=result[#result][1] y=result[#result][2] end end if x==-1 then return false else return true end ::endFund:: end function isImage2(image) if CheckFun==true then;goto endFund;end x=-1 y=-1 if Number==nil then;Number=1;end local threshold=0.99 local method=1 local result = findImage(userPath().."Zalo/res/"..image[1], Number, threshold, {image[2],image[3],image[4],image[5]}, false,method) if #result==0 then x=-1 y=-1 else if #result>=Number then x=result[Number][1] y=result[Number][2] else x=result[#result][1] y=result[#result][2] end end if x==-1 then return false else return true end ::endFund:: end function isImage3(image) if CheckFun==true then;goto endFund;end x=-1 y=-1 if Number==nil then;Number=1;end local threshold=0.95 local method=1 local result = findImage(userPath().."Zalo/res/"..image[1], Number, threshold, {image[2],image[3],image[4],image[5]}, false,method) if #result==0 then x=-1 y=-1 else if #result>=Number then x=result[Number][1] y=result[Number][2] else x=result[#result][1] y=result[#result][2] end end if x==-1 then return false else return true end ::endFund:: end function isImage4(image) if CheckFun==true then;goto endFund;end x1=-1 y1=-1 if Number==nil then;Number=1;end local threshold=0.97 local method=1 local result = findImage(userPath().."Zalo/res/"..image[1], Number, threshold, {image[2],image[3],image[4],image[5]}, false,method) if #result==0 then x1=-1 y1=-1 else if #result>=Number then x1=result[Number][1] y1=result[Number][2] else x1=result[#result][1] y1=result[#result][2] end end if x1==-1 then return false else return true end ::endFund:: end function waitImage(image) countlai = 0 ::lai:: if isImage(image) == true then return true else countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end end function waitImageNhanh(image) countlai = 0 ::lai:: if isImage(image) == true then return true else countlai = countlai + 1 if countlai > 200 then return false end mSleep(20) goto lai end end function waitImageNhanh1(image) countlai = 0 ::lai:: if isImage2(image) == true then return true else countlai = countlai + 1 if countlai > 10 then return false end mSleep(100) goto lai end end function waitImage1(image) countlai = 0 ::lai:: if isImage4(image) == true then return true else countlai = countlai + 1 if countlai > 100 then return false end mSleep(200) goto lai end end function wait2Image(image,image2) countlai = 0 ::lai:: if isImage(image) == true or isImage(image2) == true then return true else countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end end function wait11Image(image,image2,image3,image4,image5,image6,image7,image8,image9,image10,image11) countlai = 0 ::lai:: if isImage(image) == true or isImage(image2) == true or isImage(image3) == true or isImage(image4) == true or isImage(image5) == true or isImage(image6) == true or isImage(image7) == true or isImage(image8) == true or isImage(image9) == true or isImage(image10) == true or isImage(image11) == true then return true else countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end end function wait2ImageNhanh(image,image2) countlai = 0 ::lai:: if isImage(image) == true or isImage(image2) == true then return true else countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end end function waitImageColor(image,image2) countlai = 0 ::lai:: if isImage(image) == true or isColor(image2) == true then return true else countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end end function wait3Image(image,image2,image3) countlai = 0 ::lai:: if isImage(image) == true or isImage(image2) == true or isImage(image3) == true then return true else countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end end function waitCheck2Image(image,image2) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end function waitCheck3Image(image,image2,image3) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end countlai = countlai + 1 if countlai > 30 then return false end mSleep(500) goto lai end function waitCheck33Image(image,image2,image3) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end function waitCheck33Image(image,image2,image3,image4) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end countlai = countlai + 1 if countlai > 100 then return false end mSleep(500) goto lai end function waitCheck4Image(image,image2,image3,image4) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end countlai = countlai + 1 if countlai > 60 then return false end mSleep(500) goto lai end function waitCheck5Image(image,image2,image3,image4,image5) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end countlai = countlai + 1 if countlai > 30 then return false end mSleep(500) goto lai end function waitCheck6Image(image,image2,image3,image4,image5,image6) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end countlai = countlai + 1 if countlai > 30 then return false end mSleep(500) goto lai end function waitCheck66Image(image,image2,image3,image4,image5,image6) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end countlai = countlai + 1 if countlai > 70 then return false end mSleep(500) goto lai end function waitCheck7Image(image,image2,image3,image4,image5,image6,image7) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end if isImage(image7) then return 7 end countlai = countlai + 1 if countlai > 30 then return false end mSleep(500) goto lai end function waitCheck8Image(image,image2,image3,image4,image5,image6,image7,image8) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end if isImage(image7) then return 7 end if isImage(image8) then return 8 end countlai = countlai + 1 if countlai > 30 then return false end mSleep(500) goto lai end function waitCheck9Image(image,image2,image3,image4,image5,image6,image7,image8,image9) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end if isImage(image7) then return 7 end if isImage(image8) then return 8 end if isImage(image9) then return 9 end countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end function waitCheck10Image(image,image2,image3,image4,image5,image6,image7,image8,image9,image10) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end if isImage(image7) then return 7 end if isImage(image8) then return 8 end if isImage(image9) then return 9 end if isImage(image10) then return 10 end countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end function waitCheck11Image(image,image2,image3,image4,image5,image6,image7,image8,image9,image10,image11) countlai = 0 ::lai:: if isImage(image) then return 1 end mSleep(50) if isImage(image2) then return 2 end mSleep(50) if isImage(image3) then return 3 end mSleep(50) if isImage(image4) then return 4 end mSleep(50) if isImage(image5) then return 5 end mSleep(50) if isImage(image6) then return 6 end mSleep(50) if isImage(image7) then return 7 end mSleep(50) if isImage(image8) then return 8 end mSleep(50) if isImage(image9) then return 9 end mSleep(50) if isImage(image10) then return 10 end mSleep(50) if isImage(image11) then return 11 end countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end function waitCheck14Image(image,image2,image3,image4,image5,image6,image7,image8,image9,image10,image11,image12,image13,image14) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end mSleep(50) if isImage(image7) then return 7 end if isImage(image8) then return 8 end if isImage(image9) then return 9 end if isImage(image10) then return 10 end if isImage(image11) then return 11 end if isImage(image12) then return 12 end if isImage(image13) then return 13 end if isImage(image14) then return 14 end countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end function waitCheck15Image(image,image2,image3,image4,image5,image6,image7,image8,image9,image10,image11,image12,image13,image14,image15) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end mSleep(50) if isImage(image7) then return 7 end if isImage(image8) then return 8 end if isImage(image9) then return 9 end if isImage(image10) then return 10 end if isImage(image11) then return 11 end if isImage(image12) then return 12 end if isImage(image13) then return 13 end if isImage(image14) then return 14 end if isImage(image15) then return 15 end countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end function waitCheck19Image(image,image2,image3,image4,image5,image6,image7,image8,image9,image10,image11,image12,image13,image14,image15,image16,image17,image18,image19) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end mSleep(50) if isImage(image7) then return 7 end if isImage(image8) then return 8 end if isImage(image9) then return 9 end if isImage(image10) then return 10 end if isImage(image11) then return 11 end if isImage(image12) then return 12 end if isImage(image13) then return 13 end if isImage(image14) then return 14 end if isImage(image15) then return 15 end if isImage(image16) then return 16 end if isImage(image17) then return 17 end if isImage(image18) then return 18 end if isImage(image19) then return 19 end countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end function waitCheck20Image(image,image2,image3,image4,image5,image6,image7,image8,image9,image10,image11,image12,image13,image14,image15,image16,image17,image18,image19,image20) countlai = 0 ::lai:: if isImage(image) then return 1 end if isImage(image2) then return 2 end if isImage(image3) then return 3 end if isImage(image4) then return 4 end if isImage(image5) then return 5 end if isImage(image6) then return 6 end mSleep(50) if isImage(image7) then return 7 end if isImage(image8) then return 8 end if isImage(image9) then return 9 end if isImage(image10) then return 10 end if isImage(image11) then return 11 end if isImage(image12) then return 12 end if isImage(image13) then return 13 end if isImage(image14) then return 14 end if isImage(image15) then return 15 end if isImage(image16) then return 16 end if isImage(image17) then return 17 end if isImage(image18) then return 18 end if isImage(image19) then return 19 end if isImage(image20) then return 20 end countlai = countlai + 1 if countlai > 50 then return false end mSleep(500) goto lai end function kiemtraappRun(app) local state = appState(app); tt = string.format(state) if tt == 'ACTIVATED' then return true else return false end end local function post_command(cmd) local url = "http://localhost:2801/spawn_command" local headers = { ["Content-Type"] = "application/json" } local body = json.encode({ cmd = cmd }) headers["content-length"] = tostring(#body) local response_body = {} local result, respcode, respheaders, respstatus = http.request { method = "POST", url = url, source = ltn12.source.string(body), headers = headers, sink = ltn12.sink.table(response_body) } response_body = table.concat(response_body) if result == 1 then print("Response status:", respstatus) print("Response code:", respcode) print("Response headers:", respheaders) print("Response body:", response_body) else print("HTTP request failed") return 2 end end function ChangerZalo() toast("Đang Fake") post_command("AppCloner wipe vn.com.vng.zingalo"); post_command("AppCloner setDevices 'iPhone 11 Pro'") -- set same device config -- @"iPhone 6s", @"iPhone 6s Plus", @"iPhone 7", @"iPhone 7 Plus", @"iPhone 8", @"iPhone 8 Plus", @"iPhone SE (GSM)", @"iPhone X Global", @"iPhone X GSM", @"iPhone XR", @"iPhone XS Max", @"iPhone XS Max Global", @"iPhone 11", @"iPhone 11 Pro" post_command("AppCloner generate") -- Generate fake data for device post_command("AppCloner fakeDevice 1 vn.com.vng.zingalo") -- Set application that need to be spoofed --post_command("AppCloner config_data isBlockedWebRTC NO") --post_command("AppCloner config_data preferredLanguages en-US en-US") end function fakeproxy(prx) post_command("AppCloner proxy "..prx.." 1") end function Offfakeproxy() post_command("AppCloner proxy : 0") end function executeCommands1(command) local process = io.popen(command) local lastline for line in process:lines() do lastline = line end process:close() -- Closing the process handle return lastline end function deleteJPGFiles(folderPath) -- Ensure the folderPath ends with a path separator if folderPath:sub(-1) ~= "/" then folderPath = folderPath .. "/" end -- Open the folder local p = io.popen('ls "' .. folderPath .. '"') if not p then print("Unable to open directory: " .. folderPath) return end -- Read the file list for file in p:lines() do if file:match("%.jpg$") or file:match("%.JPG$") then local filePath = folderPath .. file os.remove(filePath) -- Remove the file print("Deleted: " .. filePath) end end p:close() end function ConvertImage(image,image1) function os.execute1(cmd) local handle = io.popen(cmd) local result = handle:read("*a") handle:close() return result end local input_image = "/private/var/mobile/"..image..".jpg" local output_image = "/private/var/mobile/Media/"..image1..".jpg" local width = math.random(400, 1500) local height = math.random(400, 1500) local command = "convert " .. input_image .. " -resize " .. width .. "x" .. height .. " " .. output_image os.execute1(command) end function DownAnh() toast("Download Image") local randomNumeraAnh = math.random(1, 3329) anh = random_low_up_num(5) RunTerminal("cd /private/var/mobile/;wget http://108.61.90.124/Anh/"..randomNumeraAnh..".jpg") usleep(500000) ConvertImage(randomNumeraAnh,anh) end function downloaImage() DownAnh() usleep(500000) DownAnh() usleep(500000) DownAnh() usleep(500000) post_command("AppCloner loadMedias /private/var/mobile/Media") usleep(500000) deleteJPGFiles("/private/var/mobile") usleep(500000); deleteJPGFiles("/private/var/mobile/Media") end function WipeData(AppWipe) local command3 = 'curl --location --request POST "http://localhost:2801/spawn_command" ' .. '--header "Content-Type: application/json" ' .. '--data-raw \'{ "cmd": "/var/jb/usr/bin/AppCloner wipe '..AppWipe..'" }\'' post_command(command3) end -- backup -------------------------------------------------------------- function BackUp(filename,Duongdan,AppBackup) local command4 = 'curl --location --request POST "http://localhost:2801/spawn_command" ' .. '--header "Content-Type: application/json" ' .. '--data-raw \'{ "cmd": "/var/jb/usr/bin/AppCloner backup '..filename..' '..Duongdan..' '..AppBackup..'" }\'' executeCommands(command4) end --BackUp("mai1","/var/jb","com.zhiliaoapp.musically") -- restore -------------------------------------------------------------- function Restore(Duongdan) local command5 = 'curl --location --request POST "http://localhost:2801/spawn_command" ' .. '--header "Content-Type: application/json" ' .. '--data-raw \'{ "cmd": "/var/jb/usr/bin/AppCloner restore '..Duongdan..'" }\'' executeCommands(command5) end --Restore("/var/jb/mai1.tar") function PigIp() ::lai:: toast("Pig Lại Ip") local http = require("socket.http") local ltn12 = require("ltn12") local json = require("json") local url = "https://ipinfo.io/json" local response = {} local result, code, headers, status = http.request{ url = url, sink = ltn12.sink.table(response) } local responseBody = table.concat(response) if code == 200 then local data, pos, err = json.decode(responseBody, 1, nil) if err then print("Error decoding JSON: " .. err) else return string.format("%s|%s|%s|%s|%s|%s|%s|%s", data.ip, data.city, data.region, data.country, data.loc, data.org, data.postal, data.timezone):gsub('% ', "") end else print("Failed to get IP info. HTTP code: " .. code) goto lai end end function removeFilePrefix(url) local prefix = "file://" if url:sub(1, #prefix) == prefix then return url:sub(#prefix + 1) else return url end end function dayIP() local http = require("socket.http") daydata2 = "http://107.178.103.196:3001/HoanThanhMailChinh/"..result1 result1, statuscode, code = http.request(daydata2) end function loadProxy() toast("Đang Load Proxy") local http = require("socket.http") local json = require("json") daydata = "http://107.178.103.196:3001/GetMailChinhOk" data = string.format(daydata) result1, code = http.request(data) if result1 == 'Erro' then return 1 end if result1 == nil then return 1 end if result1 == "null" then return 1 else if code == 200 then proxyget = result1 dayIP() return proxyget end end end function Checkcapcha() local result = findImage("res/Capcha.png", 5, 0.995, {241,457,395,381}, false) if #result > 0 then for i, v in pairs(result) do log(string.format("Found rect at: x:%f, y:%f", v[1], v[2])); x = v[1] end return 1 else return 100 end end function Checkcapcha1() local result = findImage("res/Capcha1.png", 5, 0.995, {241,457,395,381}, false) if #result > 1 then local min_x = result[1][1] -- Initialize with the x value of the first point for i, v in pairs(result) do log(string.format("Found rect at: x:%f, y:%f", v[1], v[2])); if v[1] < min_x then min_x = v[1] -- Update min_x if a smaller x value is found end end log(string.format("Smallest x value: %f", min_x)) x = min_x return 1 else return 100 end end function Move(x) local toaDo_Y = 910; local toaDo_X0 = 153; local t1 = math.floor((x-toaDo_X0)/15); local t2 = x% 15; touchDown(5, toaDo_X0, toaDo_Y); usleep(50000); for i = 0,t1-1,1 do local x_temp = toaDo_X0 + (15 * i); log("Đang kéo đến"..x_temp); touchMove(5, x_temp, toaDo_Y); usleep(50000); end if(t2 > 0) then log("Đang kéo đến"..x); touchMove(5, x, toaDo_Y); usleep(50000); end touchUp(5, x, toaDo_Y); end function GiaiCapCha() if Checkcapcha() == 100 then if Checkcapcha1() == 100 then return 2 else Move(x+32) return 1 end else Move(x) return 0 end end function readFile(path) local file = io.open(path,"r"); if file then local _list = {}; for l in file:lines() do table.insert(_list,l) end file:close(); return _list end end function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function FakeProxy1(PRX) local command6 = 'curl --location --request POST "http://localhost:2801/spawn_command" ' .. '--header "Content-Type: application/json" ' .. '--data-raw \'{ "cmd": "/var/jb/usr/bin/AppCloner proxy '..PRX..' 1" }\'' executeCommands(command6) end function TMProxy() mythe = rootDir() .. "/Zalo/KeyTMProxy.lua"; local f = io.open(mythe) api_key = f:read() f:close() local http = require("socket.http") local ltn12 = require("ltn12") local json = require("json") ::laylai:: -- The Request Bin test URL: http://requestb.in/12j0kaq1 local id_location = 0 local path = "https://tmproxy.com/api/proxy/get-new-proxy" local payload = string.format([[{"api_key":"%s","id_location":%d}]], api_key, id_location) local response_body = { } local res, code, response_headers, status = http.request { url = path, method = "POST", headers = { ["Authorization"] = "Maybe you need an Authorization header?", ["Content-Type"] = "application/json", ["Content-Length"] = payload:len() }, source = ltn12.source.string(payload), sink = ltn12.sink.table(response_body) } mai = table.concat(response_body) json_string3 = json.decode(mai) log(mai) code = json_string3["code"] message = json_string3["message"] data = json_string3["data"] https = data["https"] log(https) nextrequest = tonumber(split3(message,'after ', ' sec')) if nextrequest ~= 1 then hamdelay(nextrequest) goto laylai end if https ~= "" then list=split(https,':') ip = list[1] port = list[2] proxy = ip..":"..port FakeProxy1(proxy) mSleep(100) FakeProxy1(proxy) else end end function Wproxy() mythe = rootDir() .. "/Zalo/KeyWProxy.lua"; local f = io.open(mythe) api_key = f:read() f:close() local http = require("socket.http") local ltn12 = require("ltn12") local json = require("json") ::lai:: daydata = "https://wwproxy.com/api/client/proxy/available?key="..api_key data = string.format(daydata) result, statuscode, code = http.request(data) print(result) local json_table = json.decode(result) local message = json_table.message if message == "success" then local proxy1 = json_table.data.proxy print(proxy1) proxy = proxy1 FakeProxy1(proxy) mSleep(100) FakeProxy1(proxy) else nextrequest = tonumber(split3(message,'thêm ', 's.')) hamdelay(nextrequest) goto lai end end function OffProxy() local command6 = 'curl --location --request POST "http://localhost:2801/spawn_command" ' .. '--header "Content-Type: application/json" ' .. '--data-raw \'{ "cmd": "/var/jb/usr/bin/AppCloner proxy '.."1:1"..' 0" }\'' executeCommands(command6) end function Xoaymproxy() ::lai:: local http = require("socket.http") local json = require("json") daydata = "https://mproxy.vn/capi/TBsd4tSm40cO24HsgqyEC0UXMK5HD9XynbMqsph-2Zs/key/yEPaLvi39mhWqe/resetIp" data1 = string.format(daydata) result, code = http.request(data1) log(result) local json_table = json.decode(result) local message = json_table.message print(message) if message == "Thất bại" then usleep(2000000) goto lai end if message == "Thành công" then local allow_ip = json_table.data.allow_ip print(allow_ip) else local remaining_time = json_table.data.remaining_time print(remaining_time) hamdelay(remaining_time) goto lai end end function TatProxy() post_command("AppCloner vpnbgd") end function BatProxy(proxyfake) post_command("AppCloner vpnbg "..proxyfake) end function SaveAcKhoa() local http = require("socket.http") local json = require("json") daydata = "http://107.178.103.196:3001/SaveErroMailPhu/"..SDT data = string.format(daydata) result, code = http.request(data) end