-- 制作: 神仙 -- 官方群 694700750 -- 此UI为RLGG使用 local wm = require('windowManager') local ui, web, params local cfg = { example_version = '1.0.3', name = '测试心跳', appid = '100329', appkey = 'gXx87zHEh78hAk1s', rc4key = 'lodhldDdWhlhmPsM', version = '1.0', mi_type = '3' } local root = '/storage/emulated/0/rlgg/' local idPath, autoPath = root .. cfg.appid, root .. cfg.name local auth = getrlyunyz(cfg) function closeAll() if ui then ui:exit() end end function focusIn() params.flags = params.flags & ~0x00000008 wm:updateViewLayout(web, params) end function focusOut() params.flags = params.flags | 0x00000008 wm:updateViewLayout(web, params) end function tryLogin(k, auto) luajava.startThread(function() local r = auth.postApi('kmlogon', { kami = k }) if not r.code then gg.alert(r); return end if math.abs(r.time - os.time()) > 5 then gg.alert('时间误差过大'); closeAll(); return end file.write(idPath, r.msg.kami) if auto == 'true' then file.checkFile(autoPath) else file.delete(autoPath) end luajava.post(function() wm:setVisibility(web, 8) end) gg.alert('登录成功\n到期:' .. os.date('%Y-%m-%d %H:%M:%S', r.msg.vip)) runMain() luajava.post(closeAll) end) end function unbind(k) luajava.startThread(function() local r = auth.postApi('kmunmachine', { kami = k }) gg.alert(r.msg or r) end) end function signOut() file.delete(autoPath); gg.alert('已退出登录') end function quit() closeAll() end function runMain() gg.alert('进入了脚本') --这里存放你的脚本 end function loadNotice() luajava.startThread(function() local r = auth.postApi('notice') local t = r.msg.app_gg or '' pcall(function() rlgg.load("document.getElementById('tip').innerText='" .. t:gsub("'", "\\'") .. "'") end) end) end local H = [[ 卡密

卡密验证

卡密
自动登录
]] local function tryAuto() if not io.open(autoPath) then return false end local k = file.read(idPath) or '' local r = auth.postApi('kmlogon', { kami = k }) if not r.code then file.delete(autoPath); return false end if math.abs(r.time - os.time()) > 5 then gg.alert('时间误差过大'); return false end if gg.alert('自动登录成功\n到期:' .. os.date('%Y-%m-%d %H:%M:%S', r.msg.vip), '进入脚本', '取消自动登录') == 2 then file.delete(autoPath); return false end runMain(); return true end gg.setVisible(false) if tryAuto() then return end web = luajava.webView(function(wv) wv:setBackgroundColor(0x00000000) local h = H local isAuto = io.open(autoPath) and true or false h = h:gsub('__CHECKED__', isAuto and 'checked' or '') h = h:gsub('__KAMI__', file.read(idPath) or '') wv:loadData(h, 'text/html', 'UTF-8') end) ui = wm:bindView(web) ui:addView({ width = -2, height = -2, gravity = 17, flags = 0x00000008, format = 1 }) params = wm:getLayoutParams(web) loadNotice() ui:wait()