lua-project/manalua对接验证示例.lua

97 lines
24 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--验证官网地址:http://47.115.218.71
--开发者交流群:816661760
--require "import"
--import "layout"
require "import"
import "manalua"
import "layout.main"
import "http"
import "json"
import "android.widget.*"
import "android.view.*"
activity.setTitle("阿尔法验证对接示例")
activity.setTheme(android.R.style.Theme_Material_Light)
local v0 = {
appCode = '应用id',
appKey = '应用key',
url = 'http://47.115.218.71/'
}
function show(v28) Toast.makeText(activity, v28, Toast.LENGTH_SHORT).show(); end local v1 = { [200] = "成功", [201] = "该项目不存在", [202] = "卡密不存在", [203] = "卡密已过期", [204] = "卡密已被使用,请解绑使用", [205] = "卡密已被禁用", [206] = "该项目已暂停使用", [207] = "卡密不允许解绑", [208] = "卡密超出解绑次数", [209] = "该卡密未绑定其他设备", [210] = "卡密解绑间隔未到设定时间" }; if ((#v0.appKey < 2) or (4593 <= 2672)) then return show("请配置appKey"); end if (#v0.appCode < 2) then return show("请配置APPID"); end local function v2(v29) local v30 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}; local v31 = 1732584193; local v32 = 4023233417; local v33 = 2562383102; local v34 = 271733878; local v35 = 7; local v36 = 12; local v37 = 17; local v38 = 22; local v39 = 5; local v40 = 9; local v41 = 14; local v42 = 20; local v43 = 4; local v44 = 11; local v45 = 16; local v46 = 23; local v47 = 6; local v48 = 10; local v49 = 15; local v50 = 21; local function v51(v140, v141, v142) return (v140 & v141) | (~v140 & v142); end local function v52(v143, v144, v145) return (v143 & v145) | (v144 & ~v145); end local function v53(v146, v147, v148) return (v146 ~ v147) ~ v148; end local function v54(v149, v150, v151) return v150 ~ (v149 | ~v151); end local function v55(v152, v153, v154, v155, v156, v157, v158) local FlatIdent_10BCC = 0; while true do if ((0 == FlatIdent_10BCC) or (1168 > 3156)) then v152 = v152 + v51(v153, v154, v155) + v156 + v158; v152 = (((v152 & 4294967295) << v157) | ((v152 & 4294967295) >> (32 - v157))) + v153; FlatIdent_10BCC = 1; end if ((FlatIdent_10BCC == 1) or (572 > 4486)) then return v152 & 4294967295; end end end local function v56(v159, v160, v161, v162, v163, v164, v165) v159 = v159 + v52(v160, v161, v162) + v163 + v165; v159 = (((v159 & 4294967295) << v164) | ((v159 & 4294967295) >> (32 - v164))) + v160; return v159 & 4294967295; end local function v57(v166, v167, v168, v169, v170, v171, v172) local FlatIdent_2BD95 = 0; while true do if (FlatIdent_2BD95 == 1) then return v166 & 4294967295; end if (FlatIdent_2BD95 == 0) then v166 = v166 + v53(v167, v168, v169) + v170 + v172; v166 = (((v166 & 4294967295) << v171) | ((v166 & 4294967295) >> (32 - v171))) + v167; FlatIdent_2BD95 = 1; end end end local function v58(v173, v174, v175, v176, v177, v178, v179) v173 = v173 + v54(v174, v175, v176) + v177 + v179; v173 = (((v173 & 4294967295) << v178) | ((v173 & 4294967295) >> (32 - v178))) + v174; return v173 & 4294967295; end local function v59(v180) local v181 = v180:len(); local v182 = (v181 * 8) % 512; local v183 = (448 - v182) // 8; if ((1404 == 1404) and (v182 > 448)) then v183 = (960 - v182) // 8; end local v184 = {}; local v185 = 1; for v241 = 1, v181 do local v242 = ((v241 - 1) // 4) + 1; v184[v242] = v184[v242] or 0; v184[v242] = v184[v242] | (v180:byte(v241) << ((v185 - 1) * 8)); v185 = v185 + 1; if ((v185 == 5) or (3748 < 2212)) then v185 = 1; end end local v186 = false; local v187 = #v184; if ((v185 ~= 1) or (1180 == 2180)) then local FlatIdent_60EA1 = 0; while true do if ((4090 < 4653) and (FlatIdent_60EA1 == 0)) then v184[v187] = v184[v187] | (128 << ((v185 - 1) * 8)); v186 = true; break end end end for v244 = 1, v183 // 4 do if (not v186 and (v244 == 1)) then v184[v187 + v244] = 128; else v184[v187 + v244] = 0; end end local v188 = math.floor(v181 * 8); v187 = #v184; v184[v187 + 1] = v188 & 4294967295; v184[v187 + 2] = v188 >> 32; return v184; end local v60 = v59(v29); local v61 = {v31, v32, v33, v34}; for v191 = 1, #v60 // 16 do local v192 = v61[1]; local v193 = v61[2]; local v194 = v61[3]; local v195 = v61[4]; local v196 = ((v191 - 1) * 16) + 1; v192 = v55(v192, v193, v194, v195, v60[v196 + 0], v35, 3614090360); v195 = v55(v195, v192, v193, v194, v60[v196 + 1], v36, 3905402710); v194 = v55(v194, v195, v192, v193, v60[v196 + 2], v37, 606105819); v193 = v55(v193, v194, v195, v192, v60[v196 + 3], v38, 3250441966); v192 = v55(v192, v193, v194, v195, v60[v196 + 4], v35, 4118548399); v195 = v55(v195, v192, v193, v194, v60[v196 + 5], v36, 1200080426); v194 = v55(v194, v195, v192, v193, v60[v196 + 6], v37, 2821735955); v193 = v55(v193, v194, v195, v192, v60[v196 + 7], v38, 4249261313); v192 = v55(v192, v193, v194, v195, v60[v196 + 8], v35, 1770035416); v195 = v55(v195, v192, v193, v194, v60[v196 + 9], v36, 2336552879); v194 = v55(v194, v195, v192, v193, v60[v196 + 10], v37, 4294925233); v193 = v55(v193, v194, v195, v192, v60[v196 + 11], v38, 2304563134); v192 = v55(v192, v193, v194, v195, v60[v196 + 12], v35, 1804603682); v195 = v55(v195, v192, v193, v194, v60[v196 + 13], v36, 4254626195); v194 = v55(v194, v195, v192, v193, v60[v196 + 14], v37, 2792965006); v193 = v55(v193, v194, v195, v192, v60[v196 + 15], v38, 1236535329); v192 = v56(v192, v193, v194, v195, v60[v196 + 1], v39, 4129170786); v195 = v56(v195, v192, v193, v194, v60[v196 + 6], v40, 3225465664); v194 = v56(v194, v195, v192, v193, v60[v196 + 11], v41, 643717713); v193 = v56(v193, v194, v195, v192, v60[v196 + 0], v42, 3921069994); v192 = v56(v192, v193, v194, v195, v60[v196 + 5], v39, 3593408605); v195 = v56(v195, v192, v193, v194, v60[v196 + 10], v40, 38016083); v194 = v56(v194, v195, v192, v193, v60[v196 + 15], v41, 3634488961); v193 = v56(v193, v194, v195, v192, v60[v196 + 4], v42, 3889429448); v192 = v56(v192, v193, v194, v195, v60[v196 + 9], v39, 568446438); v195 = v56(v195, v192, v193, v194, v60[v196 + 14], v40, 3275163606); v194 = v56(v194, v195, v192, v193, v60[v196 + 3], v41, 4107603335); v193 = v56(v193, v194, v195, v192, v60[v196 + 8], v42, 1163531501); v192 = v56(v192, v193, v194, v195, v60[v196 + 13], v39, 2850285829); v195 = v56(v195, v192, v193, v194, v60[v196 + 2], v40, 4243563512); v194 = v56(v194, v195, v192, v193, v60[v196 + 7], v41, 1735328473); v193 = v56(v193, v194, v195, v192, v60[v196 + 12], v42, 2368359562); v192 = v57(v192, v193, v194, v195, v60[v196 + 5], v43, 4294588738); v195 = v57(v195, v192, v193, v194, v60[v196 + 8], v44, 2272392833); v194 = v57(v194, v195, v192, v193, v60[v196 + 11], v45, 1839030562); v193 = v57(v193, v194, v195, v192, v60[v196 + 14], v46, 4259657740); v192 = v57(v192, v193, v194, v195, v60[v196 + 1], v43, 2763975236); v195 = v57(v195, v192, v193, v194, v60[v196 + 4], v44, 1272893353); v194 = v57(v194, v195, v192, v193, v60[v196 + 7], v45, 4139469664); v193 = v57(v193, v194, v195, v192, v60[v196 + 10], v46, 3200236656); v192 = v57(v192, v193, v194, v195, v60[v196 + 13], v43, 681279174); v195 = v57(v195, v192, v193, v194, v60[v196 + 0], v44, 3936430074); v194 = v57(v194, v195, v192, v193, v60[v196 + 3], v45, 3572445317); v193 = v57(v193, v194, v195, v192, v60[v196 + 6], v46, 76029189); v192 = v57(v192, v193, v194, v195, v60[v196 + 9], v43, 3654602809); v195 = v57(v195, v192, v193, v194, v60[v196 + 12], v44, 3873151461); v194 = v57(v194, v195, v192, v193, v60[v196 + 15], v45, 530742520); v193 = v57(v193, v194, v195, v192, v60[v196 + 2], v46, 3299628645); v192 = v58(v192, v193, v194, v195, v60[v196 + 0], v47, 4096336452); v195 = v58(v195, v192, v193, v194, v60[v196 + 7], v48, 1126891415); v194 = v58(v194, v195, v192, v193, v60[v196 + 14], v49, 2878612391); v193 = v58(v193, v194, v195, v192, v60[v196 + 5], v50, 4237533241); v192 = v58(v192, v193, v194, v195, v60[v196 + 12], v47, 1700485571); v195 = v58(v195, v192, v193, v194, v60[v196 + 3], v48, 2399980690); v194 = v58(v194, v195, v192, v193, v60[v196 + 10], v49, 4293915773); v193 = v58(v193, v194, v195, v192, v60[v196 + 1], v50, 2240044497); v192 = v58(v192, v193, v194, v195, v60[v196 + 8], v47, 1873313359); v195 = v58(v195, v192, v193, v194, v60[v196 + 15], v48, 4264355552); v194 = v58(v194, v195, v192, v193, v60[v196 + 6], v49, 2734768916); v193 = v58(v193, v194, v195, v192, v60[v196 + 13], v50, 1309151649); v192 = v58(v192, v193, v194, v195, v60[v196 + 4], v47, 4149444226); v195 = v58(v195, v192, v193, v194, v60[v196 + 11], v48, 3174756917); v194 = v58(v194, v195, v192, v193, v60[v196 + 2], v49, 718787259); v193 = v58(v193, v194, v195, v192, v60[v196 + 9], v50, 3951481745); v61[1] = v61[1] + v192; v61[2] = v61[2] + v193; v61[3] = v61[3] + v194; v61[4] = v61[4] + v195; v61[1] = v61[1] & 4294967295; v61[2] = v61[2] & 4294967295; v61[3] = v61[3] & 4294967295; v61[4] = v61[4] & 4294967295; end local v62 = ""; for v201 = 1, 4 do for v245 = 1, 4 do local v246 = v61[v201] & 15; local v247 = v30[v246 + 1]; v61[v201] = v61[v201] >> 4; v246 = v61[v201] & 15; v62 = v62 .. v30[v246 + 1] .. v247; v61[v201] = v61[v201] >> 4; end end return v62; end local function v3(v63) local FlatIdent_31A5A = 0; local v64; local v65; while true do if ((FlatIdent_31A5A == 2) or (2652 < 196)) then return string.lower(v65); end if ((4135 < 4817) and (FlatIdent_31A5A == 1)) then v65 = ""; for v202 = 1, v63:len() do v65 = v65 .. string.format("%02X", v63:sub(v202):byte()); end FlatIdent_31A5A = 2; end if ((272 == 272) and (FlatIdent_31A5A == 0)) then v63 = tostring(v63); v64 = 1; FlatIdent_31A5A = 1; end end end local function v4(v66) local FlatIdent_6FA1 = 0; local v67; while true do if ((100 <= 3123) and (FlatIdent_6FA1 == 1)) then return v67; end if ((0 == FlatIdent_6FA1) or (1369 > 4987)) then v67 = ""; for v203 = 1, v66:len(), 2 do local v204 = tonumber(v66:sub(v203, v203 + 1), 16); v67 = v67 .. string.char(v204); end FlatIdent_6FA1 = 1; end end end local function v5(v68) local FlatIdent_940A0 = 0; while true do if (FlatIdent_940A0 == 0) then v68 = string.gsub(v68, "\\u(%w%w%w%w)", function(v205) return utf8.char(tonumber(v205, 16)); end); return v68; end end end local v6 = '"'; local function v7(v69, v70, v71) return true, v70 + 3; end local function v8(v72, v73, v74) return false, v73 + 4; end local function v9(v75, v76, v77) return nil, v76 + 3; end local function v10(v78, v79, v80) return nul, v79 + 2; end local v11 = { ["-"] = true, ["+"] = true, ["."] = true, ["0"] = true, ["1"] = true, ["2"] = true, ["3"] = true, ["4"] = true, ["5"] = true, ["6"] = true, ["7"] = true, ["8"] = true, ["9"] = true }; local function v12(v81, v82, v83) local v84 = v82 + 1; while v84 <= v83 do local v206 = string.sub(v81, v84, v84); if not v11[v206] then break end v84 = v84 + 1; end local v85 = tonumber(string.sub(v81, v82, v84 - 1)); if (not v85 or (863 >= 4584)) then error(_format("json格式错误不正确的数字, 错误位置:{from}", v82)); end return v85, v84 - 1; end local function v13(v86, v87, v88) local FlatIdent_27957 = 0; local v89; while true do if (FlatIdent_27957 == 1) then error(_format("json格式错误字符串没有找到结尾, 错误位置:{from}", v87)); break end if ((0 == FlatIdent_27957) or (724 >= 1668)) then v89 = false; for v207 = v87 + 1, v88 do local v208 = string.sub(v86, v207, v207); if not v89 then if ((428 < 1804) and (v208 == v6)) then return string.sub(v86, v87 + 1, v207 - 1), v207; elseif (v208 == "\\") then v89 = true; end else v89 = false; end end FlatIdent_27957 = 1; end end end local function v14(v90, v91, v92) local FlatIdent_8F59B = 0; local v93; local v94; local v92; while true do if (FlatIdent_8F59B == 1) then v94 = v91 + 1; v92 = v92 or string.len(v90); FlatIdent_8F59B = 2; end if ((FlatIdent_8F59B == 0) or (3325 > 4613)) then v93 = {}; v91 = v91 or 1; FlatIdent_8F59B = 1; end if (FlatIdent_8F59B == 2) then while v94 <= v92 do local FlatIdent_7A75F = 0; local v209; while true do if (FlatIdent_7A75F == 1) then v94 = v94 + 1; break end if (FlatIdent_7A75F == 0) then v209 = string.sub(v90, v94, v94); if ((v209 == v6) or (4950 <= 4553)) then v93[#v93 + 1], v94 = v13(v90, v94, v92); elseif ((2665 <= 3933) and (v209 == "[")) then v93[#v93 + 1], v94 = v14(v90, v94, v92); elseif ((3273 == 3273) and (v209 == "{")) then v93[#v93 + 1], v94 = json2table(v90, v94, v92); elseif ((3824 > 409) and (v209 == "]")) then return v93, v94; elseif ((2087 == 2087) and ((v209 == "f") or (v209 == "F"))) then v93[#v93 + 1], v94 = v8(v90, v94, v92); elseif ((v209 == "t") or (v209 == "T")) then v93[#v93 + 1], v94 = v7(v90, v94, v92); elseif (v209 == "n") then v93[#v93 + 1], v94 = v9(v90, v94, v92); elseif ((v209 == "N") or (3404 > 4503)) then v93[#v93 + 1], v94 = v10(v90, v94, v92); elseif v11[v209] then v93[#v93 + 1], v94 = v12(v90, v94, v92); end FlatIdent_7A75F = 1; end end end break end end end local function v15(v95, v96, v97) local FlatIdent_E0D0 = 0; local v98; local v99; local v97; local v100; while true do if (FlatIdent_E0D0 == 2) then v100 = nil; while v99 <= v97 do local FlatIdent_759F1 = 0; local v210; while true do if ((FlatIdent_759F1 == 1) or (3506 <= 1309)) then v99 = v99 + 1; break end if ((2955 == 2955) and (0 == FlatIdent_759F1)) then v210 = string.sub(v95, v99, v99); if ((v210 == v6) or (2903 == 1495)) then if not v100 then v100, v99 = v13(v95, v99, v97); else v98[v100], v99 = v13(v95, v99, v97); v100 = nil; end elseif ((4546 >= 2275) and (v210 == "[")) then if ((819 >= 22) and not v100) then v100, v99 = v14(v95, v99, v97); else v98[v100], v99 = v14(v95, v99, v97); v100 = nil; end elseif (v210 == "{") then if not v100 then v100, v99 = v15(v95, v99, v97); else local FlatIdent_6B983 = 0; while true do if ((3162 == 3162) and (FlatIdent_6B983 == 0)) then v98[v100], v99 = v15(v95, v99, v97); v100 = nil; break end end end elseif (v210 == "}") then return v98, v99; elseif ((v210 == "f") or (v210 == "F") or (2369 > 4429)) then v98[v100], v99 = v8(v95, v99, v97); v100 = nil; elseif ((v210 == "t") or (v210 == "T")) then local FlatIdent_7909D = 0; while true do if ((4095 >= 3183) and (FlatIdent_7909D == 0)) then v98[v100], v99 = v7(v95, v99, v97); v100 = nil; break end end elseif ((v210 == "n") or (3711 < 1008)) then v98[v100], v99 = v9(v95, v99, v97); v100 = nil; elseif ((v210 == "N") or (1049 <= 906)) then v98[v100], v99 = v10(v95, v99, v97); v100 = nil; elseif v11[v210] then if ((4513 > 2726) and not v100) then v100, v99 = v12(v95, v99, v97); else v98[v100], v99 = v12(v95, v99, v97); v100 = nil; end end FlatIdent_759F1 = 1; end end end break end if (FlatIdent_E0D0 == 0) then v98 = {}; v96 = v96 or 1; FlatIdent_E0D0 = 1; end if (FlatIdent_E0D0 == 1) then v99 = v96 + 1; v97 = v97 or string.len(v95); FlatIdent_E0D0 = 2; end end end local v16 = { [v6] = v13, ["["] = v14, ["{"] = v15, f = v8, F = v8, t = v7, T = v7 }; local function v17(v101) if ((v101 == nil) or (1481 >= 2658)) then show("to Json error"); else local FlatIdent_64E40 = 0; local v249; local v250; while true do if (FlatIdent_64E40 == 0) then v249 = string.sub(v101, 1, 1); v250 = v16[v249]; FlatIdent_64E40 = 1; end if (FlatIdent_64E40 == 1) then if (v250 or (3220 == 1364)) then return v250(v101, 1, string.len(v101)); end if (v11[v249] or (1054 > 3392)) then return v12(v101, 1, string.len(v101)); end break end end end end local function v18(v102, v103) local v102 = tostring(v102); local v103 = tostring(v103); local v104 = {}; v104.__andBit = function(v211, v212) return ((v211 == 1) and (v212 == 1) and 1) or 0; end; v104.__orBit = function(v213, v214) return (((v213 == 1) or (v214 == 1)) and 1) or 0; end; v104.__xorBit = function(v215, v216) return (((v215 + v216) == 1) and 1) or 0; end; v104.__base = function(v217, v218, v219) if (v217 < v218) then v217, v218 = v218, v217; end local v220 = 0; local v221 = 1; while v217 ~= 0 do local FlatIdent_207CC = 0; local v251; local v252; while true do if ((FlatIdent_207CC == 1) or (676 >= 1642)) then v220 = (v221 * v219(v251, v252)) + v220; v221 = v221 * 2; FlatIdent_207CC = 2; end if ((4136 > 2397) and (2 == FlatIdent_207CC)) then v217 = math.modf(v217 / 2); v218 = math.modf(v218 / 2); break end if (FlatIdent_207CC == 0) then v251 = v217 % 2; v252 = v218 % 2; FlatIdent_207CC = 1; end end end return v220; end; v104.andOp = function(v222, v223) return v104.__base(v222, v223, v104.__andBit); end; v104.xorOp = function(v224, v225) return v104.__base(v224, v225, v104.__xorBit); end; v104.orOp = function(v226, v227) return v104.__base(v226, v227, v104.__orBit); end; v104.notOp = function(v228) return ((v228 > 0) and -(v228 + 1)) or (-v228 - 1); end; v104.lShiftOp = function(v229, v230) return v229 * (2 ^ v230); end; v104.rShiftOp = function(v231, v232) return math.floor(v231 / (2 ^ v232)); end; local function v115(v233, v234) local FlatIdent_8A742 = 0; local v235; local v236; local v237; local v238; local v239; local v240; while true do if ((FlatIdent_8A742 == 1) or (4334 == 4245)) then v236 = nil; function v236(v258, v259) local v260 = 0; local v261 = 0; local v262 = {}; for v283 = 1, v259 do v260 = (v260 + 1) % 256; v261 = (v261 + v258[v260]) % 256; v258[v260], v258[v261] = v258[v261], v258[v260]; v262[v283] = v258[(v258[v260] + v258[v261]) % 256]; end return v262; end FlatIdent_8A742 = 2; end if (FlatIdent_8A742 == 3) then v238 = string.len(v233); v239 = v235(v234); FlatIdent_8A742 = 4; end if ((0 == FlatIdent_8A742) or (4276 <= 3031)) then v235 = nil; function v235(v253) local FlatIdent_2388 = 0; local v254; local v255; local v256; local v257; while true do if ((FlatIdent_2388 == 3) or (4782 <= 1199)) then for v280 = 0, 255 do v257 = (v257 + v255[v280] + v256[v280 % v254]) % 256; v255[v280], v255[v257] = v255[v257], v255[v280]; end return v255; end if ((FlatIdent_2388 == 2) or (4864 < 1902)) then for v278 = 1, v254 do v256[v278 - 1] = string.byte(v253, v278, v278); end v257 = 0; FlatIdent_2388 = 3; end if ((4839 >= 3700) and (1 == FlatIdent_2388)) then v256 = {}; for v276 = 0, 255 do v255[v276] = v276; end FlatIdent_2388 = 2; end if (FlatIdent_2388 == 0) then v254 = string.len(v253); v255 = {}; FlatIdent_2388 = 1; end end end FlatIdent_8A742 = 1; end if ((FlatIdent_8A742 == 2) or (1075 > 1918)) then v237 = nil; function v237(v263, v264) local v265 = string.len(v264); local v266 = nil; local v267 = {}; for v288 = 1, v265 do local FlatIdent_61800 = 0; while true do if ((396 <= 3804) and (FlatIdent_61800 == 0)) then v266 = string.byte(v264, v288, v288); v267[v288] = string.char(v104.xorOp(v263[v288], v266)); break end end end return table.concat(v267); end FlatIdent_8A742 = 3; end if (FlatIdent_8A742 == 4) then v240 = v236(v239, v238); return v237(v240, v233); end end end return v115(v102, v103); end local v19, v20 = "阿尔法验证:", Visible; local function v21(v116) local FlatIdent_90A41 = 0; local v117; local v116; local v118; local v119; while true do if (FlatIdent_90A41 == 0) then v117 = "AlphaV2"; v116 = v116 or ("/storage/emulated/0/Android/" .. v117); FlatIdent_90A41 = 1; end if ((FlatIdent_90A41 == 1) or (4169 == 2187)) then v118 = io.open(v116, "r"); v119 = nil; FlatIdent_90A41 = 2; end if ((1406 == 1406) and (FlatIdent_90A41 == 2)) then if v118 then v119 = v118:read("*a"); else local FlatIdent_1B881 = 0; while true do if ((1531 < 4271) and (FlatIdent_1B881 == 0)) then v119 = v2(math.random(10000000, 999999999999) .. os.time()); io.open(v116, "w"):write(v119):close(); break end end end return v119; end end end local function v22() local v120 = http.get("http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp"); if v120 then return json.decode(v120).data.t:sub(1, 10); else while true do os.exit(show(v19 .. "请检查网络状态")); end end end local function v23(v121) io.open(activity.getLuaDir() .. "/AlphaCard", "w"):write(v121):close(); end local function v24() local FlatIdent_25A9F = 0; local v122; while true do if ((635 == 635) and (FlatIdent_25A9F == 0)) then v122 = activity.getLuaDir() .. "/AlphaCard"; if ((3373 <= 3556) and io.open(v122, "r")) then return io.open(v122, "r"):read("*a"); end break end end end local function v25(v123) if not v123 then return; end local v124 = v22(); local v125 = "{\034timestamp\034:\034" .. v124 .. "\034,\034km\034:\034" .. v123 .. "\034,\034imei\034:\034" .. v21() .. "\034}"; local v126 = v2(v125); local v127 = "appCode=" .. v0.appCode .. "&data=" .. v3(v18(v125, v0.appKey)) .. "&sign=" .. v126; local v128 = http.post(v0.url .. "api/v2/Card", v127); if (v128 == nil) then while true do os.exit(show("网络异常")); end end if ((#v128 < 50) or (3291 < 3280)) then local FlatIdent_72421 = 0; while true do if ((4386 >= 873) and (FlatIdent_72421 == 0)) then show(v1[v17(v128)['code']]); return; end end end local v129, v130; v129 = v128:sub(1, #v128 - 32); sign1 = v128:sub(-32); v129 = v4(v129); if (sign1 ~= v2(v129)) then while true do os.exit(show(v1[202])); end end v130 = v18(v129, v0.appKey); v130 = v17(v130); if ((921 <= 1102) and (v130 == nil)) then while true do os.exit(show(v1[202])); end end if (v130.code ~= 200) then local FlatIdent_4508F = 0; while true do if (FlatIdent_4508F == 0) then show(v1[v130.code]); return; end end end if ((4706 >= 963) and (v130['timestamp'] == nil)) then while true do os.exit(); end end if (((v130.timestamp - v124) > 5) or ((v130.timestamp - v124) < 0) or (960 <= 876)) then while true do os.exit(); end end local v131 = v130.sign; local v132 = v18(v4(v130.data), v0.appKey); local v133 = v2(v132); local v132 = v17(v132); if (type(v132) == "table") then local FlatIdent_284EA = 0; local v268; local v269; local v270; local v271; local v272; local v273; while true do if (FlatIdent_284EA == 0) then v268 = v132.sign; v269 = v132.msg; FlatIdent_284EA = 1; end if ((FlatIdent_284EA == 3) or (2066 == 932)) then if ((v268 == v2(v0.appCode .. v0.appKey)) and v273) then if (v131 == v133) then local FlatIdent_86900 = 0; while true do if (1 == FlatIdent_86900) then show("使用卡密:" .. v269 .. "\n到期时间:" .. v271);
-------------------脚本建议放下面---------------------
-- 脚本内容
-------------------脚本建议放上面---------------------
break end if ((4825 < 4843) and (FlatIdent_86900 == 0)) then v23(v123); if (#v270 > 0) then show("公告:" .. v270); end FlatIdent_86900 = 1; end end else while true do os.exit(show(v19 .. "异常请重新运行")); end end else local FlatIdent_91B54 = 0; while true do if (FlatIdent_91B54 == 0) then os.remove(activity.getLuaDir() .. "/AlphaCard"); while true do os.exit(show(v19 .. v269)); end break end end end break end if ((FlatIdent_284EA == 2) or (3877 >= 4537)) then v272 = v132.timestamp; v273 = ((v272 - v124) <= 5) and ((v272 - v124) >= 0); FlatIdent_284EA = 3; end if (FlatIdent_284EA == 1) then v270 = v132.Notice; v271 = v132.outTime; FlatIdent_284EA = 2; end end else local FlatIdent_6679B = 0; while true do if ((FlatIdent_6679B == 0) or (4315 < 1726)) then os.remove(activity.getLuaDir() .. "/AlphaCard"); show(v19 .. "卡密不存在"); break end end end end local function v26(v134) local FlatIdent_63AE4 = 0; local v135; local v136; while true do if (1 == FlatIdent_63AE4) then if (v136 == nil) then show("解绑失败"); return false; end if (v136.code == 200) then show(v1[v136.code]); return true; else local FlatIdent_31ECC = 0; while true do if (FlatIdent_31ECC == 0) then show(v1[v136.code]); return false; end end end break end if (FlatIdent_63AE4 == 0) then v135 = "appCode=" .. v0.appCode .. "&km=" .. v134; v136 = v17(http.post(v0.url .. "api/v2/UnCard", v135)); FlatIdent_63AE4 = 1; end end end
uiMain = {
LinearLayout,
layout_height = "fill",
layout_width = "fill",
orientation = "vertical",
gravity = "center",
{
EditText,
padding = "50px",
layout_width = "match_parent",
hint = "请输入卡密",
id = "InputKm"
},
{
CheckBox,
id = "Unkm",
text = "是否解绑"
},
{
Button,
layout_width = "500px",
id = "Start",
text = "确定"
}
};
activity.setContentView(loadlayout(uiMain));
ChooseUnkm = false
-- 监听解绑事件
Unkm.setOnCheckedChangeListener {
onCheckedChanged = function(g, c)
if c then
ChooseUnkm = true
else
ChooseUnkm = false
end
end
}
-- ui比较简陋自己拿到一下接口可以自行更换ui
-- 登录事件
Start.onClick = function()
local InputKm = InputKm.getText().toString()
if #InputKm < 5 or #InputKm > 50 then
show("卡密错误")
return
end
if ChooseUnkm then
-- 解绑接口
return v26(InputKm)
end
-- 卡密登录接口
v25(InputKm)
end