function md5(code) local code = tostring(code) local HexTable = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"} local A = 0x67452301 local B = 0xefcdab89 local C = 0x98badcfe local D = 0x10325476 local S11 = 7 local S12 = 12 local S13 = 17 local S14 = 22 local S21 = 5 local S22 = 9 local S23 = 14 local S24 = 20 local S31 = 4 local S32 = 11 local S33 = 16 local S34 = 23 local S41 = 6 local S42 = 10 local S43 = 15 local S44 = 21 local function F(x,y,z) return (x & y) | ((~x) & z) end local function G(x,y,z) return (x & z) | (y & (~z)) end local function H(x,y,z) return x ~ y ~ z end local function I(x,y,z) return y ~ (x | (~z)) end local function FF(a,b,c,d,x,s,ac) a = a + F(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function GG(a,b,c,d,x,s,ac) a = a + G(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function HH(a,b,c,d,x,s,ac) a = a + H(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function II(a,b,c,d,x,s,ac) a = a + I(b,c,d) + x + ac a = (((a & 0xffffffff) << s) | ((a & 0xffffffff) >> 32 - s)) + b return a & 0xffffffff end local function MD5StringFill(s) local len = s:len() local mod512 = len * 8 % 512 local fillSize = (448 - mod512) // 8 if mod512 > 448 then fillSize = (960 - mod512) // 8 end local rTab = {} local byteIndex = 1 for i = 1,len do local index = (i - 1) // 4 + 1 rTab[index] = rTab[index] or 0 rTab[index] = rTab[index] | (s:byte(i) << (byteIndex - 1) * 8) byteIndex = byteIndex + 1 if byteIndex == 5 then byteIndex = 1 end end local b0x80 = false local tLen = #rTab if byteIndex ~= 1 then rTab[tLen] = rTab[tLen] | 0x80 << (byteIndex - 1) * 8 b0x80 = true end for i = 1,fillSize // 4 do if not b0x80 and i == 1 then rTab[tLen + i] = 0x80 else rTab[tLen + i] = 0x0 end end local bitLen = math.floor(len * 8) tLen = #rTab rTab[tLen + 1] = bitLen & 0xffffffff rTab[tLen + 2] = bitLen >> 32 return rTab end function getmd5(s) local fillTab = MD5StringFill(s) local result = {A,B,C,D} for i = 1,#fillTab // 16 do local a = result[1] local b = result[2] local c = result[3] local d = result[4] local offset = (i - 1) * 16 + 1 a = FF(a, b, c, d, fillTab[offset + 0], S11, 0xd76aa478) d = FF(d, a, b, c, fillTab[offset + 1], S12, 0xe8c7b756) c = FF(c, d, a, b, fillTab[offset + 2], S13, 0x242070db) b = FF(b, c, d, a, fillTab[offset + 3], S14, 0xc1bdceee) a = FF(a, b, c, d, fillTab[offset + 4], S11, 0xf57c0faf) d = FF(d, a, b, c, fillTab[offset + 5], S12, 0x4787c62a) c = FF(c, d, a, b, fillTab[offset + 6], S13, 0xa8304613) b = FF(b, c, d, a, fillTab[offset + 7], S14, 0xfd469501) a = FF(a, b, c, d, fillTab[offset + 8], S11, 0x698098d8) d = FF(d, a, b, c, fillTab[offset + 9], S12, 0x8b44f7af) c = FF(c, d, a, b, fillTab[offset + 10], S13, 0xffff5bb1) b = FF(b, c, d, a, fillTab[offset + 11], S14, 0x895cd7be) a = FF(a, b, c, d, fillTab[offset + 12], S11, 0x6b901122) d = FF(d, a, b, c, fillTab[offset + 13], S12, 0xfd987193) c = FF(c, d, a, b, fillTab[offset + 14], S13, 0xa679438e) b = FF(b, c, d, a, fillTab[offset + 15], S14, 0x49b40821) a = GG(a, b, c, d, fillTab[offset + 1], S21, 0xf61e2562) d = GG(d, a, b, c, fillTab[offset + 6], S22, 0xc040b340) c = GG(c, d, a, b, fillTab[offset + 11], S23, 0x265e5a51) b = GG(b, c, d, a, fillTab[offset + 0], S24, 0xe9b6c7aa) a = GG(a, b, c, d, fillTab[offset + 5], S21, 0xd62f105d) d = GG(d, a, b, c, fillTab[offset + 10], S22, 0x2441453) c = GG(c, d, a, b, fillTab[offset + 15], S23, 0xd8a1e681) b = GG(b, c, d, a, fillTab[offset + 4], S24, 0xe7d3fbc8) a = GG(a, b, c, d, fillTab[offset + 9], S21, 0x21e1cde6) d = GG(d, a, b, c, fillTab[offset + 14], S22, 0xc33707d6) c = GG(c, d, a, b, fillTab[offset + 3], S23, 0xf4d50d87) b = GG(b, c, d, a, fillTab[offset + 8], S24, 0x455a14ed) a = GG(a, b, c, d, fillTab[offset + 13], S21, 0xa9e3e905) d = GG(d, a, b, c, fillTab[offset + 2], S22, 0xfcefa3f8) c = GG(c, d, a, b, fillTab[offset + 7], S23, 0x676f02d9) b = GG(b, c, d, a, fillTab[offset + 12], S24, 0x8d2a4c8a) a = HH(a, b, c, d, fillTab[offset + 5], S31, 0xfffa3942) d = HH(d, a, b, c, fillTab[offset + 8], S32, 0x8771f681) c = HH(c, d, a, b, fillTab[offset + 11], S33, 0x6d9d6122) b = HH(b, c, d, a, fillTab[offset + 14], S34, 0xfde5380c) a = HH(a, b, c, d, fillTab[offset + 1], S31, 0xa4beea44) d = HH(d, a, b, c, fillTab[offset + 4], S32, 0x4bdecfa9) c = HH(c, d, a, b, fillTab[offset + 7], S33, 0xf6bb4b60) b = HH(b, c, d, a, fillTab[offset + 10], S34, 0xbebfbc70) a = HH(a, b, c, d, fillTab[offset + 13], S31, 0x289b7ec6) d = HH(d, a, b, c, fillTab[offset + 0], S32, 0xeaa127fa) c = HH(c, d, a, b, fillTab[offset + 3], S33, 0xd4ef3085) b = HH(b, c, d, a, fillTab[offset + 6], S34, 0x4881d05) a = HH(a, b, c, d, fillTab[offset + 9], S31, 0xd9d4d039) d = HH(d, a, b, c, fillTab[offset + 12], S32, 0xe6db99e5) c = HH(c, d, a, b, fillTab[offset + 15], S33, 0x1fa27cf8) b = HH(b, c, d, a, fillTab[offset + 2], S34, 0xc4ac5665) a = II(a, b, c, d, fillTab[offset + 0], S41, 0xf4292244) d = II(d, a, b, c, fillTab[offset + 7], S42, 0x432aff97) c = II(c, d, a, b, fillTab[offset + 14], S43, 0xab9423a7) b = II(b, c, d, a, fillTab[offset + 5], S44, 0xfc93a039) a = II(a, b, c, d, fillTab[offset + 12], S41, 0x655b59c3) d = II(d, a, b, c, fillTab[offset + 3], S42, 0x8f0ccc92) c = II(c, d, a, b, fillTab[offset + 10], S43, 0xffeff47d) b = II(b, c, d, a, fillTab[offset + 1], S44, 0x85845dd1) a = II(a, b, c, d, fillTab[offset + 8], S41, 0x6fa87e4f) d = II(d, a, b, c, fillTab[offset + 15], S42, 0xfe2ce6e0) c = II(c, d, a, b, fillTab[offset + 6], S43, 0xa3014314) b = II(b, c, d, a, fillTab[offset + 13], S44, 0x4e0811a1) a = II(a, b, c, d, fillTab[offset + 4], S41, 0xf7537e82) d = II(d, a, b, c, fillTab[offset + 11], S42, 0xbd3af235) c = II(c, d, a, b, fillTab[offset + 2], S43, 0x2ad7d2bb) b = II(b, c, d, a, fillTab[offset + 9], S44, 0xeb86d391) result[1] = result[1] + a result[2] = result[2] + b result[3] = result[3] + c result[4] = result[4] + d result[1] = result[1] & 0xffffffff result[2] = result[2] & 0xffffffff result[3] = result[3] & 0xffffffff result[4] = result[4] & 0xffffffff end local retStr = '' for i = 1,4 do for _ = 1,4 do local temp = result[i] & 0x0F local str = HexTable[temp + 1] result[i] = result[i] >> 4 temp = result[i] & 0x0F retStr = retStr .. HexTable[temp + 1] .. str result[i] = result[i] >> 4 end end return string.lower(retStr) end return getmd5(code) end
--md5加密 md5("加密内容")
----------------------------------------------------------------------------------------------------------------------
ZZRc4 = {}
ZZMathBit = {}
function ZZMathBit.__xorBit(left, right) return (left + right) == 1 and 1 or 0 end function ZZMathBit.__base(left, right, op) if left < right then left, right = right, left end local res = 0 local shift = 1 while left ~= 0 do local ra = left % 2 local rb = right % 2 res = shift * op(ra,rb) + res shift = shift * 2 left = math.modf( left / 2) right = math.modf( right / 2) end return res end function ZZMathBit.xorOp(left, right) return ZZMathBit.__base(left, right, ZZMathBit.__xorBit) end function RC4(text,key,kasi)
  if kasi==false then str = text str=str:gsub("[%s%p]",""):upper() local index=1 local ret="" for index=1,str:len(),2 do ret=ret..string.char(tonumber(str:sub(index,index+1),16)) end text=ret end local function KSA(key) local keyLen = string.len(key) local schedule = {} local keyByte = {} for i = 0, 255 do schedule[i] = i end for i = 1, keyLen do keyByte[i - 1] = string.byte(key, i, i) end local j = 0 for i = 0, 255 do j = (j + schedule[i] + keyByte[ i % keyLen]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] end return schedule end local function PRGA(schedule, textLen) local i = 0 local j = 0 local k = {} for n = 1, textLen do i = (i + 1) % 256 j = (j + schedule[i]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] k[n] = schedule[(schedule[i] + schedule[j]) % 256] end return k end local function output(schedule, text) local len = string.len(text) local c = nil local res = {} for i = 1, len do c = string.byte(text, i,i) res[i] = string.char(ZZMathBit.xorOp(schedule[i], c)) end return table.concat(res) end local textLen = string.len(text) local schedule = KSA(key) local k = PRGA(schedule, textLen) str=output(k, text) if kasi==true then str = tostring(str) local index=1 local ret="" for index=1,str:len() do ret=ret..string.format("%02X",str:sub(index):byte()) end return string.lower(ret) else return str end end
--极简云RC42加密和解密配置     RC4("加密内容","密码",false=解密_true=加密)
----------------------------------------------------------------------------------------------------------------------
require "import"
import "android.app.*"
import "android.os.*"
import "android.widget.*"
import "android.view.*"
import "jijianyun"
import "AndLua"
import "http"

----------------------------------------------------------------------------------------------------------------------
activity.setTheme(R.Theme_Light_Gray)
activity.setContentView(loadlayout(jijianyun))
隐藏标题栏()
----------------------------------------------------------------------------------------------------------------------

function 默认提示(内容)
  MD提示(内容,0xFF2196F3,0xFFFFFFFF,5,10)
  --自己配置全部提示/**
end

----------------------------------------------------------------------------------------------------------------------
function 载入新页面()



--content



end
----------------------------------------------------------------------------------------------------------------------

local YiXiURL="https://cute521.cn"
--云验证地址

local YiXiAPPID="APPID" --这里写后台APPID

local YiXiAPPKEY="APPKEY" --这里写后台APPKEY

local YiXiRC4KEY="RC4KEY" --这里写后台RC4KEY

local RC4TUI="开"
--是否开启 RC4-2加密  开就是开 关就是关

local Ver="Ver"--当前1.0 后台更新1.0后会提示软件更新


local aaqun="123456"--QQ群号


底部显示.text="Copyright © 2021 我是软件名字.All Rights Reserved."


----------------------------------------------------------------------------------------------------------------------


if YiXiAPPID=="" or YiXiAPPKEY=="" or YiXiRC4KEY=="" then
  默认提示("对接数据没有填写，咋运行？")--对话框
end

----------------------------------------------------------------------------------------------------------------------

local 卡密存放路径="/sdcard/km"

local 设备码存放路径="/sdcard/imei"


import "android.provider.Settings$Secure"
android_id = Secure.getString(activity.getContentResolver(), Secure.ANDROID_ID)
设备码=android_id
--设备码
io.open(设备码存放路径,"w"):write(设备码):close()
--直接写出设备码



--获取公告---[=[   ]=]-------------------------------------------------------------------------------------------------------------------
Http.get(YiXiURL.."/api.php?api=notice&app="..YiXiAPPID,function(a,用户数据)

  if RC4TUI=="开" then--解密
    用户数据=RC4(用户数据,YiXiRC4KEY,false)
  end

  cjson=import'cjson'
  --使用cjson库将获取到的json数据table化
  json = cjson.decode(用户数据)
  判定整数=json["code"]
  获取更新内容=json["msg"]["app_gg"]

  if 判定整数==200 then--判定等于属于正常
   else--不对就报错
    默认提示(json["msg"])
  end

end)

--获取公告


----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------

--应用配置获取
Http.get(YiXiURL.."/api.php?api=ini&app="..YiXiAPPID,function(a,用户数据)

  if RC4TUI=="开" then
    用户数据=RC4(用户数据,YiXiRC4KEY,false)
  end

  cjson=import'cjson'
  --使用cjson库将获取到的json数据table化
  json = cjson.decode(用户数据)

  判定整数=json["code"]
  获取版本=json["msg"]["version"]
  应用版本信息=json["msg"]["version_info"]
  更新内容=json["msg"]["app_update_show"]
  获取更新直链接=json["msg"]["app_update_url"]
  --没获取到就是nil
  是否强制更新=json["msg"]["app_update_must"]
  --判断 y 是强制更新  n 不是强制更新
  获取启动次数=json["msg"]["api_total"]
  --方法是每次获取 应用配置获取 就+1


  if 判定整数==200 then--判定等于属于正常
    --   文本.Text=文本.Text.."\n\n版本号:"..获取版本.."\n应用版本信息:"..应用版本信息.."\n更新内容:"..更新内容.."\n更新直链接:"..获取更新直链接.."\n启动次数:"..获取启动次数
    if 获取版本~=Ver then
      弹窗()--有更新
     else
      默认提示("最新版")
      if 获取更新内容=="" then--判定是否有公告
       else
        公告框(获取更新内容,获取启动次数)
      end
    end
   else--不对就报错
    默认提示(json["msg"])
  end

end)
--应用配置获取
---[=[   ]=]-------------------------------------------------------------------------------------------------------------------

function 公告框(获取更新内容,获取启动次数)
  更新弹窗={
    LinearLayout;
    layout_height="fill";
    gravity="bottom";
    layout_width="fill";
    {
      CardView;
      layout_height="315dp";
      radius="50";
      elevation="1";
      layout_marginRight="20dp";
      layout_marginLeft="20dp";
      backgroundColor="#f4f7f7";
      layout_marginBottom="20dp";
      layout_width="match_parent";
      {
        LinearLayout;
        layout_height="50dp";
        gravity="center";
        backgroundColor="0x28FFFFFF";
        layout_width="match_parent";
        {
          LinearLayout;
          layout_gravity="center";
          orientation="vertical";
          {
            TextView;
            textSize="18sp";
            textColor="#000000";
            text="公告提示";
            layout_gravity="center";
          };

        };
      };
      {
        LinearLayout;
        layout_height="0.6dp";
        backgroundColor="#E0E3DA";
        layout_marginTop="50dp";
        layout_width="match_parent";
      };
      {
        LinearLayout;
        layout_height="170dp";
        orientation="vertical";
        backgroundColor="0x28FFFFFF";
        layout_marginTop="70dp";
        layout_width="match_parent";
        {
          TextView;
          text="内容:";
          textSize="13sp";
          layout_marginLeft="20dp";
        };
        {
          TextView;
          text=获取更新内容;
          textSize="15sp";
          layout_marginTop="5dp";
          layout_marginLeft="20dp";
        };

        {
          TextView;
          text="全网启动次数："..获取启动次数;
          textSize="10sp";
          layout_marginTop="80dp";
          layout_marginLeft="20dp";
        };

      };
      {
        LinearLayout;
        layout_height="match_parent";
        backgroundColor="#FFFFFFFF";
        gravity="center";
        layout_marginTop="271dp";
        onClick="确定";
        layout_width="match_parent";

        {
          TextView;
          textSize="17sp";
          textColor="#000000";
          text="确定";

          id="文字";
          layout_marginLeft="match_parent";
        };
      };
    };
  };
  dialog= AlertDialog.Builder(this)
  import "android.text.Spannable"
  import "android.text.SpannableString"
  import "android.text.style.ForegroundColorSpan"
  dialog1=dialog.show()
  dialog1.getWindow().setContentView(loadlayout(更新弹窗));
  import "android.graphics.drawable.ColorDrawable"
  dialog1.getWindow().setBackgroundDrawable(ColorDrawable(0x00000000));

end

function 确定()
  dialog1.dismiss()
end

function 弹窗()
  更新弹窗={
    LinearLayout;
    layout_height="fill";
    gravity="bottom";
    layout_width="fill";
    {
      CardView;
      layout_height="320dp";
      radius="50";
      elevation="1";
      layout_marginRight="20dp";
      layout_marginLeft="20dp";
      backgroundColor="#f4f7f7";
      layout_marginBottom="20dp";
      layout_width="match_parent";
      {
        LinearLayout;
        layout_height="80dp";
        gravity="center";
        backgroundColor="0x28FFFFFF";
        layout_width="match_parent";
        {
          LinearLayout;
          layout_gravity="center";
          orientation="vertical";
          {
            TextView;
            textSize="18sp";
            textColor="#000000";
            text="发现新版本";
            layout_gravity="center";
          };
          {
            TextView;

            text="        V "..获取版本..".0";
            textSize="12sp";
          };
        };
      };
      {
        LinearLayout;
        layout_height="0.6dp";
        backgroundColor="#E0E3DA";
        layout_marginTop="80dp";
        layout_width="match_parent";
      };
      {
        LinearLayout;
        layout_height="190dp";
        orientation="vertical";
        backgroundColor="0x28FFFFFF";
        layout_marginTop="81dp";
        layout_width="match_parent";

        {
          TextView;
          text=更新内容;
          textSize="13sp";
          layout_marginTop="20dp";
          layout_marginLeft="20dp";
        };
      };
      {
        LinearLayout;
        layout_height="match_parent";
        backgroundColor="#FFFFFFFF";
        gravity="center";
        layout_marginTop="271dp";
        layout_width="match_parent";
        {
          TextView;
          textSize="17sp";
          textColor="#000000";
          text="忽略本次";
          onClick="忽略";
          layout_marginRight="40dp";
        };
        {
          LinearLayout;
          layout_height="20dp";
          backgroundColor="#000000";
          layout_width="1";
        };
        {
          TextView;
          textSize="17sp";
          textColor="#000000";
          text="立即更新";
          onClick="更新";
          id="文字";
          layout_marginLeft="40dp";
        };
      };
    };
  };
  dialog= AlertDialog.Builder(this)
  import "android.text.Spannable"
  import "android.text.SpannableString"
  import "android.text.style.ForegroundColorSpan"
  dialog1=dialog.show()
  dialog1.getWindow().setContentView(loadlayout(更新弹窗));
  dialog1.setCanceledOnTouchOutside(false)
  dialog1.setCancelable(false)
  import "android.graphics.drawable.ColorDrawable"
  dialog1.getWindow().setBackgroundDrawable(ColorDrawable(0x00000000));
  function down(url,path)
    local tt=Ticker()
    tt.start()
    Http.download(url,path,function(code,data,cookie,header)
      tt.stop()
      文字.Text="更新完成"
      新提示("下载完成")
      activity.installApk("/storage/emulated/0/更新包.apk")
    end)
    function tt.onTick()
      local f=io.open(path,"r")
      if f~=nil then
        local len=f:read("a")
        local s=#len/lens
      end
    end
  end

  function big(url,path)
    import "java.net.URL"
    realUrl = URL(url)
    con = realUrl.openConnection();
    con.setRequestProperty("accept", "*/*");
    con.setRequestProperty("connection", "Keep-Alive");
    con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    lens=con.getContentLength()
    down(url,path)
  end

  function 更新()
    if 获取更新直链接=="未提交URL" then
      默认提示("木有搜索到更新链接..")
      dialog1.dismiss()
     else
      文字.Text="正在更新"
      默认提示("请保持网络畅通")
      local url=""..获取更新直链接..""
      local path="/storage/emulated/0/更新包.apk"--下载到xx路径
      big(url,path)
    end
  end

  function 忽略()
    if 是否强制更新=="y" then
      默认提示("已开启强制更新，无法关闭")
     else
      dialog1.dismiss()
      默认提示("请及时更新软件！")
    end
  end

end

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------







----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------




jiaqun.onClick=function()
  import "android.net.Uri"
  import "android.content.Intent"
  --加群
  url="mqqapi://card/show_pslcard?src_type=internal&version=1&uin="..aaqun.."&card_type=group&source=qrcode"
  activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
end



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------





解绑卡密.onClick=function()
  import "android.provider.Settings$Secure"
  imei = Secure.getString(activity.getContentResolver(), Secure.ANDROID_ID)

  Time=os.time()
  卡密=km.Text

  if 卡密=="" then
    默认提示("请输入卡密")
   else

    Time=os.time()
    local YiXiSign=md5("kami="..卡密.."&markcode="..imei.."&t="..Time.."&"..YiXiAPPKEY)
    local YiXiData=RC4("kami="..卡密.."&markcode="..imei.."&t="..Time.."&sign="..YiXiSign,YiXiRC4KEY,true)
    Http.get(YiXiURL.."/api.php?api=kmunmachine&app="..YiXiAPPID.."&data="..YiXiData,function(a,用户数据)
      if RC4TUI=="开" then
        用户数据=RC4(用户数据,YiXiRC4KEY,false)
      end
      解绑状态=用户数据:match('"code":(.-),"')
      解绑信息=用户数据:match('"msg":"(.-)",')
      解绑卡密.text="解绑卡密"
      if 解绑状态=="200" then
        默认提示("设备解绑成功")
       else
        默认提示(解绑信息)
      end
    end)
  end
end

----------------------------------------------------------------------------------------------------------------------

import "android.content.Intent"
import "android.net.Uri"
卡密查询.onClick=function()---[=[ 查卡密  ]=]-------------------------------------------------------------------------------------------------------------------
  url=YiXiURL..'/km.php'
  viewIntent = Intent("android.intent.action.VIEW",Uri.parse(url))
  activity.startActivity(viewIntent)
end

----------------------------------------------------------------------------------------------------------------------





----------------------------------------------------------------------------------------------------------------------    local 卡密=io.open(卡密存放路径,"r")

卡密=io.open(卡密存放路径,"r")
if 卡密==nil then
 else
  卡密=卡密:read("*a")
  km.Text=卡密
end
--卡密路径 获取卡密
--卡密登入

登入.onClick=function()
  卡密=km.Text

  import "java.sql.Time"
  import "android.text.format.Time"

  时间搓=os.time()

  local value=math.random(1000,99999)..os.time()

  local YiXiSign=md5("kami="..卡密.."&markcode="..设备码.."&t="..时间搓.."&"..YiXiAPPKEY)
  --合成的签名
  local YiXiData="kami="..卡密.."&markcode="..设备码.."&t="..时间搓.."&sign="..YiXiSign.."&value="..value

  if RC4TUI=="开" then
    YiXiData="data="..RC4(YiXiData,YiXiRC4KEY,true)
  end

  Http.get(YiXiURL.."/api.php?api=kmlogon&app="..YiXiAPPID.."&"..YiXiData,function(a,用户数据)

    if RC4TUI=="开" then
      用户数据=RC4(用户数据,YiXiRC4KEY,false)
    end

    cjson=import'cjson'
    --使用cjson库将获取到的json数据table化
    json = cjson.decode(用户数据)
    判定整数=json["code"]

    if 判定整数==200 then--判定等于属于正常

      获取卡密=json["msg"]["kami"]
      获取到期时间=math.modf(json["msg"]["vip"])
      获取验证时间搓=math.modf(json["time"])
      获取验证随机值=json["check"]
      计算验证随机值=md5(获取验证时间搓..YiXiAPPKEY..value)

      if (获取验证时间搓-时间搓)>30 or (获取验证时间搓-时间搓)<-30 then
        --判定服务器发送时间和本地时间搓对比
        默认提示("软件:数据超时")
       else
        if 获取验证随机值~=计算验证随机值 then
          --验证随机值
          默认提示("检测到非法操作")
         else
          if 获取到期时间==nil then
            --获取是否有到期时间
            默认提示("检测到非法操作，请立即终止！")
           else
            默认提示("到期时间:"..os.date("%Y-%m-%d %H:%M:%S",获取到期时间))
            io.open(卡密存放路径,"w"):write(卡密):close()
            --登入成功后跳转
            载入新页面()
          end
        end
      end
     else--不对就报错
      默认提示(json["msg"])
    end
  end)
end




