--沐小天 --此UI为沐小天开源 --作者 沐小天 --Qq交流群1107219214 string.toMusic("欢迎使用艾莉全防,如有拉压,请反馈") draw.text('艾莉全防\n@ALQFNB777',120,140)draw. setColor('#1DF3EE') gg.loopKillGG() if type(getrlyunyz) ~= 'function' then gg.alert('请使用RLGG执行') return end baseDir = gg.FILES_DIR .. "/我真没想重生啊配置" zipPath = gg.FILES_DIR .. "/我真没想重生啊.zip" filesDir = gg.FILES_DIR .. "/" if io.open(baseDir .. "/5d0b465b6585a1561019995.bin") == nil then gg.toast("第一次打开,正在下载资源配置") gg.alert("第一次打开,正在下载资源配置") file.download("https://image.rlyun.fun/down.php/da782df80acadadfcdb8af1fcaaeec8a.zip", zipPath) gg.alert("资源下载完成正在解压") file.unzip(zipPath, filesDir) os.remove(zipPath) gg.alert("资源解压完成") end info = { example_version = '1.0.3', name = '沐小天2.0', appid = '41718', appkey = 'CvXcfmjUdxOGouTg', rc4key = '2gh6Gtgn6kKGMWYx', version = '1.0', mi_type = '3' } rlyunyz = getrlyunyz(info) gg.setVisible(false) luajava.setFloatingWindowHide(true) import "android.widget.LinearLayout" import "android.widget.TextView" import "android.widget.EditText" import "android.widget.FrameLayout" import "android.widget.ScrollView" import "android.widget.ImageView" import "android.graphics.drawable.GradientDrawable" import "android.view.WindowManager" import "android.graphics.PixelFormat" import "android.os.Build" import "android.view.View" import "android.view.Gravity" import "android.view.inputmethod.EditorInfo" import "android.view.animation.AccelerateInterpolator" import "android.view.animation.DecelerateInterpolator" import "android.graphics.Matrix" import "android.view.MotionEvent" window = context:getSystemService("window") density = context:getResources():getDisplayMetrics().density Typeface = luajava.bindClass("android.graphics.Typeface") defaultBold = Typeface.DEFAULT_BOLD ImageViewClass = luajava.bindClass("android.widget.ImageView") 宽度=400 高度=270 function getBg(corner, color) local gd = luajava.newInstance('android.graphics.drawable.GradientDrawable') gd:setShape(0) gd:setCornerRadius(corner * density) gd:setColor(color) return gd end function getRadiiBg(color, lt, rt, rb, lb) local gd = luajava.newInstance('android.graphics.drawable.GradientDrawable') gd:setShape(0) gd:setColor(color) local r = 5 * density local lt2 = lt and r or 0 local rt2 = rt and r or 0 local rb2 = rb and r or 0 local lb2 = lb and r or 0 gd:setCornerRadii({lt2, lt2, rt2, rt2, rb2, rb2, lb2, lb2}) return gd end function loadImg(v, path, mult) mult = mult or 1.2 local ok, d = pcall(function() return luajava.getBitmapDrawable(path) end) if not ok or not d then return end v:setImageDrawable(d) v:setScaleType(ImageViewClass.ScaleType.MATRIX) v:post(function() local dr = v:getDrawable() if not dr then return end local dw, dh = dr:getIntrinsicWidth(), dr:getIntrinsicHeight() local vw, vh = v:getWidth(), v:getHeight() if vw == 0 or vh == 0 or dw == 0 or dh == 0 then return end local s = math.max(vw / dw, vh / dh) * mult local m = luajava.newInstance("android.graphics.Matrix") m:setScale(s, s) m:postTranslate((vw - dw * s) / 2, (vh - dh * s) / 2) v:setImageMatrix(m) end) end local inputBorderBg = getBg(4, 0xFFFFFFFF) inputBorderBg:setStroke(1 * density, 0xFFD0D0D0) local noLineBg = getBg(0, 0x00FFFFFF) local labelBg = getBg(0, 0xFFFFFFFF) local cursorBg = getBg(50, 0xFF333333) local innerHeight, frameHeight = 38, 45 local labelMarginTop, labelMarginLeft = 16, 8 local floatTransY, floatTransX = -17, -5 local leftBg = getRadiiBg(0xFFFFFFFF, true, false, false, true) local rightBg = getRadiiBg(0xFFFFFFFF, false, true, true, false) hanshu = function(v, event) local Action = event:getAction() if Action == MotionEvent.ACTION_DOWN then RawX = event:getRawX() RawY = event:getRawY() x = mainLayoutParams.x y = mainLayoutParams.y elseif Action == MotionEvent.ACTION_MOVE then mainLayoutParams.x = x + (event:getRawX() - RawX) if mainLayoutParams.x < 0 then mainLayoutParams.x = 0 end mainLayoutParams.y = y + (event:getRawY() - RawY) if mainLayoutParams.y < 0 then mainLayoutParams.y = 0 end window:updateViewLayout(floatWindow, mainLayoutParams) end return false end iconTouch = function(v, event) local action = event:getAction() if action == MotionEvent.ACTION_DOWN then iconRawX = event:getRawX() iconRawY = event:getRawY() iconStartX = mainLayoutParams.x iconStartY = mainLayoutParams.y iconStartTime = os.clock() * 1000 iconIsDragging = false return true elseif action == MotionEvent.ACTION_MOVE then local dx = math.abs(event:getRawX() - iconRawX) local dy = math.abs(event:getRawY() - iconRawY) if not iconIsDragging and (dx > 8 * density or dy > 8 * density) then iconIsDragging = true end if iconIsDragging then mainLayoutParams.x = iconStartX + (event:getRawX() - iconRawX) mainLayoutParams.y = iconStartY + (event:getRawY() - iconRawY) if mainLayoutParams.x < 0 then mainLayoutParams.x = 0 end if mainLayoutParams.y < 0 then mainLayoutParams.y = 0 end window:updateViewLayout(floatWindow, mainLayoutParams) end return true elseif action == MotionEvent.ACTION_UP or action == MotionEvent.ACTION_CANCEL then if not iconIsDragging then local elapsed = os.clock() * 1000 - iconStartTime if elapsed < 250 then 隐藏() end end return true end return false end local view = luajava.loadlayout({ LinearLayout, layout_width = "match_parent", layout_height = "match_parent", orientation = "horizontal", { FrameLayout, id = "leftPanel", layout_width = "0dp", layout_height = "match_parent", layout_weight = 1, background = leftBg, { ImageView, id = "rightImage", layout_width = "match_parent", layout_height = "match_parent", alpha = 0, }, { LinearLayout, id = "loginForm", orientation = "vertical", layout_width = "match_parent", layout_height = "match_parent", paddingLeft = "20dp", paddingTop = "20dp", paddingBottom = "20dp", paddingRight = "8dp", { TextView, id = "titleText", text = "登录", textSize = "18sp", textColor = 0xFF333333, textStyle = "bold", shadowColor = 0x33000000, shadowDx = 1, shadowDy = 1, shadowRadius = 2, layout_width = "wrap_content", layout_height = "wrap_content", }, { TextView, id = "subText", text = "尊敬的用户您好", textSize = "12sp", textColor = 0xFF999999, textStyle = "bold", shadowColor = 0x33000000, shadowDx = 1, shadowDy = 1, shadowRadius = 2, layout_width = "wrap_content", layout_height = "wrap_content", layout_marginTop = "2dp", }, { FrameLayout, layout_width = "match_parent", layout_height = frameHeight .. "dp", layout_marginTop = "8dp", { LinearLayout, id = "inputContainer", layout_width = "match_parent", layout_height = innerHeight .. "dp", background = inputBorderBg, paddingLeft = "6dp", paddingRight = "6dp", { FrameLayout, layout_width = "match_parent", layout_height = "match_parent", { EditText, id = "inputBox", layout_width = "match_parent", layout_height = "match_parent", background = noLineBg, textSize = "14sp", textColor = 0xFF333333, textStyle = "bold", shadowColor = 0x33000000, shadowDx = 1, shadowDy = 1, shadowRadius = 2, singleLine = true, inputType = 0x00000001, paddingLeft = "8dp", }, { View, id = "cursorView", layout_width = "1.5dp", layout_height = "15dp", layout_marginLeft = "8dp", background = cursorBg, }, }, }, { TextView, id = "floatLabel", text = "请输入卡密", textSize = "14sp", textColor = 0xFF999999, textStyle = "bold", shadowColor = 0x33000000, shadowDx = 1, shadowDy = 1, shadowRadius = 2, layout_width = "wrap_content", layout_height = "wrap_content", layout_marginTop = labelMarginTop .. "dp", layout_marginLeft = labelMarginLeft .. "dp", background = labelBg, paddingLeft = "4dp", paddingRight = "4dp", }, }, { LinearLayout, layout_width = "match_parent", layout_height = "8dp", }, { TextView, id = "loginBtn", text = "登 录", textSize = "14sp", textColor = 0xFFFFFFFF, textStyle = "bold", shadowColor = 0x33000000, shadowDx = 1, shadowDy = 1, shadowRadius = 2, layout_width = "match_parent", layout_height = "36dp", background = luajava.newInstance('android.graphics.drawable.GradientDrawable'), }, }, { TextView, id = "errorText", text = "", textSize = "11sp", textColor = 0xFFFF4444, textStyle = "bold", layout_width = "wrap_content", layout_height = "wrap_content", layout_marginBottom = "8dp", alpha = 0, }, }, { FrameLayout, id = "rightPanel", layout_width = "0dp", layout_weight = 1, layout_height = "match_parent", background = rightBg, { ImageView, id = "finalImage", layout_width = "match_parent", layout_height = "match_parent", alpha = 0, }, { LinearLayout, id = "successView", orientation = "vertical", layout_width = "match_parent", layout_height = "match_parent", alpha = 0, { TextView, id = "successText", text = "卡密验证成功", textSize = "16sp", textColor = 0xFF333333, textStyle = "bold", shadowColor = 0x33000000, shadowDx = 1, shadowDy = 1, shadowRadius = 2, layout_width = "wrap_content", layout_height = "wrap_content", }, }, { ImageView, id = "leftImage", layout_width = "match_parent", layout_height = "match_parent", }, }, }) titleText:setGravity(3) subText:setGravity(3) local inputContainerLp = inputContainer:getLayoutParams() local inputContainerNewLp = luajava.newInstance("android.widget.FrameLayout$LayoutParams", inputContainerLp.width, inputContainerLp.height) inputContainerNewLp.gravity = 80 inputContainer:setLayoutParams(inputContainerNewLp) inputContainer:setGravity(16) inputBox:setGravity(16) local cursorLp = cursorView:getLayoutParams() local cursorNewLp = luajava.newInstance("android.widget.FrameLayout$LayoutParams", cursorLp.width, cursorLp.height) cursorNewLp.gravity = 19 cursorNewLp:setMargins(math.floor(8 * density + 0.5), 0, 0, 0) cursorView:setLayoutParams(cursorNewLp) local floatLabelLp = floatLabel:getLayoutParams() local floatLabelNewLp = luajava.newInstance("android.widget.FrameLayout$LayoutParams", floatLabelLp.width, floatLabelLp.height) floatLabelNewLp.gravity = 51 floatLabelNewLp:setMargins(math.floor(labelMarginLeft * density + 0.5), math.floor(labelMarginTop * density + 0.5), 0, 0) floatLabel:setLayoutParams(floatLabelNewLp) loginBtn:setGravity(17) local errorLp = errorText:getLayoutParams() local errorNewLp = luajava.newInstance("android.widget.FrameLayout$LayoutParams", errorLp.width, errorLp.height) errorNewLp.gravity = 81 errorNewLp:setMargins(0, 0, 0, math.floor(8 * density + 0.5)) errorText:setLayoutParams(errorNewLp) successView:setGravity(17) successText:setGravity(17) if Build.VERSION.SDK_INT >= 21 then leftPanel:setClipToOutline(true) rightPanel:setClipToOutline(true) end local loginBg = getBg(4, 0xFF007AFF) local loginBgDown = getBg(4, 0xFF0051D5) loginBtn:setBackground(loginBg) loginBtn:setOnTouchListener(luajava.createProxy("android.view.View$OnTouchListener", { onTouch = function(v, event) local a = event:getAction() if a == MotionEvent.ACTION_DOWN then v:setBackground(loginBgDown) v:setScaleX(0.97) v:setScaleY(0.97) elseif a == MotionEvent.ACTION_UP or a == MotionEvent.ACTION_CANCEL then v:setBackground(loginBg) v:setScaleX(1) v:setScaleY(1) end return false end })) loadImg(leftImage, baseDir .. "/萧容鱼向左", 1.2) loadImg(rightImage, baseDir .. "/萧容鱼向右", 1.2) inputBox:setCursorVisible(false) titleText:setTypeface(defaultBold) subText:setTypeface(defaultBold) inputBox:setTypeface(defaultBold) floatLabel:setTypeface(defaultBold) successText:setTypeface(defaultBold) local customTypeface = Typeface:createFromFile(baseDir .. "/5d0b465b6585a1561019995.bin") loginBtn:setTypeface(customTypeface) inputBox:setImeActionLabel("登录", EditorInfo.IME_ACTION_DONE) inputBox:setImeOptions(EditorInfo.IME_ACTION_DONE) local labelFloated = false function updateCursor() local text = inputBox:getText():toString() local w = inputBox:getPaint():measureText(text) cursorView:setTranslationX(w + 2 * density) cursorView:setTranslationY(-1 * density) end function doFloatLabel() if labelFloated then return end labelFloated = true floatLabel:animate() :translationY(density * floatTransY) :translationX(density * floatTransX) :scaleX(0.8) :scaleY(0.8) :setDuration(200) :start() floatLabel:setTextColor(0xFF666666) end function doSinkLabel() if not labelFloated then return end if inputBox:getText():toString() == "" then labelFloated = false floatLabel:animate() :translationY(0) :translationX(0) :scaleX(1) :scaleY(1) :setDuration(200) :start() floatLabel:setTextColor(0xFF999999) end end inputBox:setOnFocusChangeListener(luajava.createProxy("android.view.View$OnFocusChangeListener", { onFocusChange = function(v, hasFocus) if hasFocus then doFloatLabel() cursorView:setVisibility(View.VISIBLE) updateCursor() else doSinkLabel() cursorView:setVisibility(View.INVISIBLE) end end })) inputBox:addTextChangedListener(luajava.createProxy("android.text.TextWatcher", { beforeTextChanged = function(s, start, count, after) end, onTextChanged = function(s, start, before, count) if s and s:length() > 0 then doFloatLabel() end updateCursor() errorText:setAlpha(0) end, afterTextChanged = function(s) end })) local verified = false local lastClickTime = 0 function toRun(func) return luajava.createProxy("java.lang.Runnable", { run = func }) end function shake(v, onEnd) local ox = 0 local function s5() v:animate():translationX(ox):setDuration(60):withEndAction(toRun(function() if onEnd then onEnd() end end)):start() end local function s4() v:animate():translationX(ox - 5 * density):setDuration(60):withEndAction(toRun(s5)):start() end local function s3() v:animate():translationX(ox + 5 * density):setDuration(60):withEndAction(toRun(s4)):start() end local function s2() v:animate():translationX(ox - 8 * density):setDuration(60):withEndAction(toRun(s3)):start() end local function s1() v:animate():translationX(ox + 8 * density):setDuration(60):withEndAction(toRun(s2)):start() end s1() end function showError(msg) errorText:setText(msg) errorText:setAlpha(0) errorText:setTranslationX(0) errorText:animate() :alpha(1) :setDuration(300) :withEndAction(toRun(function() shake(errorText, function() errorText:animate():alpha(0):setDuration(200):start() end) end)) :start() end local navHtml = [=[ ]=] MXT = {} MXT._switchId = 0 MXT._callbacks = {} MXT._running = true function safeThread(func, tip) if type(func) ~= "function" then return end luajava.newThread(function() local ok, err = pcall(func) if not ok then local msg = (tip or "功能") .. " 执行出错:\n" .. tostring(err) pcall(function() gg.alert(msg) end) end end):start() end function MXT.card(...) return {type="card"} end function MXT.switch(name, onFunc, offFunc) MXT._switchId = MXT._switchId + 1 local id = MXT._switchId MXT._callbacks[id] = { on = onFunc or function() end, off = offFunc or function() end } return {type="switch", name=name or "开关", id=id} end function MXT.check(items) local result = {type="check", items={}} for _, it in ipairs(items) do MXT._switchId = MXT._switchId + 1 local id = MXT._switchId local name = it[1] or "选项" local onFunc = it[2] or function() end local offFunc = it[3] or function() end MXT._callbacks[id] = {on=onFunc, off=offFunc} table.insert(result.items, {name=name, id=id}) end return result end function MXT.box(title, items, onOpen, onClose) MXT._switchId = MXT._switchId + 1 local id = MXT._switchId MXT._callbacks[id] = { on = onOpen or function() end, off = onClose or function() end } return {type="box", title=title or "折叠面板", id=id, items=items or {}} end function MXT.button(name, func) MXT._switchId = MXT._switchId + 1 local id = MXT._switchId MXT._callbacks[id] = {on = func or function() end, off = function() end} return {type="button", name=name or "按钮", id=id} end function MXT._triggerButton(id) local cb = MXT._callbacks[tonumber(id)] if not cb then return end safeThread(cb.on, "按钮") end function MXT._triggerBox(id, state) local cb = MXT._callbacks[tonumber(id)] if not cb then return end if state == 1 then safeThread(cb.on, "折叠面板") else safeThread(cb.off, "折叠面板") end end function MXT._triggerSwitch(id, checked) local cb = MXT._callbacks[tonumber(id)] if not cb then return end if checked == 1 then safeThread(cb.on, "开关") else safeThread(cb.off, "开关") end end function generateSwitchRow(item) local name = item.name or "开关" local id = item.id return string.format([[
%s
]], name, id) end function generateCheckItem(sub) return string.format([[
%s
]], sub.id, sub.name) end function generateButtonHtml(item) return string.format([[
%s
]], item.id, item.name) end function generateBoxHtml(box) local bodyItems = {} local checkBuffer = {} local function flushChecks() if #checkBuffer > 0 then table.insert(bodyItems, string.format([[
%s
]], table.concat(checkBuffer, "\n"))) checkBuffer = {} end end for _, it in ipairs(box.items or {}) do if it.type == "switch" then flushChecks() table.insert(bodyItems, generateSwitchRow(it)) elseif it.type == "button" then flushChecks() table.insert(bodyItems, generateButtonHtml(it)) elseif it.type == "check" then for _, sub in ipairs(it.items or {}) do table.insert(checkBuffer, generateCheckItem(sub)) end end end flushChecks() return string.format([[
%s
%s
]], box.id, box.title, table.concat(bodyItems, "\n")) end function generateSide(items, pageId) local blocks = {} local hasCard = #items > 0 and items[1].type == "card" if hasCard then table.insert(blocks, string.format([[
]], pageId)) end local allSwitches = {} local allChecks = {} local allBoxes = {} local allButtons = {} for _, item in ipairs(items) do if item.type == "switch" then table.insert(allSwitches, item) elseif item.type == "check" then for _, sub in ipairs(item.items or {}) do table.insert(allChecks, sub) end elseif item.type == "box" then table.insert(allBoxes, item) elseif item.type == "button" then table.insert(allButtons, item) end end if #allSwitches > 0 then local swHtml = {} for _, sw in ipairs(allSwitches) do table.insert(swHtml, generateSwitchRow(sw)) end table.insert(blocks, string.format([[
%s
]], table.concat(swHtml, "\n"))) end if #allChecks > 0 then local checkHtml = {} for _, sub in ipairs(allChecks) do table.insert(checkHtml, generateCheckItem(sub)) end table.insert(blocks, string.format([[
%s
]], table.concat(checkHtml, "\n"))) end for _, box in ipairs(allBoxes) do table.insert(blocks, generateBoxHtml(box)) end for _, btn in ipairs(allButtons) do table.insert(blocks, generateButtonHtml(btn)) end return table.concat(blocks, "\n") end function generatePageContent(pageId, pageConfig) local leftItems = pageConfig["页面左侧"] or {} local rightItems = pageConfig["页面右侧"] or {} local leftHtml = generateSide(leftItems, pageId) local rightHtml = generateSide(rightItems, pageId) local displayStyle = "display:none" return string.format([[ ]], pageId, displayStyle, leftHtml, rightHtml) end function getPageOrder(key, pages) local cfg = pages[key] if cfg and cfg["页面索引"] then local n = tonumber(cfg["页面索引"]) if n then return n end end return 999 end function buildNavHtml(pages) local menuButtons = {} local contentDivs = {} local orderList = {} local idx = 0 local sortedKeys = {} for k, v in pairs(pages) do table.insert(sortedKeys, k) end table.sort(sortedKeys, function(a, b) return getPageOrder(a, pages) < getPageOrder(b, pages) end) for _, pageKey in ipairs(sortedKeys) do if idx >= 4 then break end local pageConfig = pages[pageKey] idx = idx + 1 local pageId = "page" .. idx table.insert(orderList, pageId) local pageName = pageConfig["页面名称"] or pageKey table.insert(menuButtons, string.format([[ ]], pageId, pageName)) table.insert(contentDivs, generatePageContent(pageId, pageConfig)) end local orderStr = '"' .. table.concat(orderList, '","') .. '"' local html = navHtml html = html:gsub("__MENUBUTTONS__", function() return table.concat(menuButtons, "\n") end) html = html:gsub("__CONTENTDIVS__", function() return table.concat(contentDivs, "\n") end) html = html:gsub("__ORDER__", function() return orderStr end) html = html:gsub("__BASE_DIR__", baseDir) return html end function showNavPage() luajava.webView(function(wv) wv:setBackgroundColor(0x00000000) wv:getSettings():setJavaScriptEnabled(true) wv:getSettings():setDomStorageEnabled(true) wv:getSettings():setAllowUniversalAccessFromFileURLs(true) wv:setVerticalScrollBarEnabled(false) wv:setHorizontalScrollBarEnabled(false) wv:setOnTouchListener(luajava.createProxy("android.view.View$OnTouchListener", { onTouch = (function() local touchDownX, touchDownY, touchMode = 0, 0, 0 return function(v, event) local action = event:getAction() if action == MotionEvent.ACTION_DOWN then touchDownX = event:getRawX() touchDownY = event:getRawY() touchMode = 0 elseif action == MotionEvent.ACTION_MOVE then if touchMode == 0 then local dx = math.abs(event:getRawX() - touchDownX) local dy = math.abs(event:getRawY() - touchDownY) if dy > dx and dy > 8 * density then touchMode = 1 elseif dx > 8 * density or dy > 8 * density then touchMode = 2 end end if touchMode == 1 then local parent = v:getParent() while parent do pcall(function() parent:requestDisallowInterceptTouchEvent(true) end) parent = parent:getParent() end end elseif action == MotionEvent.ACTION_UP or action == MotionEvent.ACTION_CANCEL then touchMode = 0 end return false end end)() })) local html = navHtml if MXT._pages then html = buildNavHtml(MXT._pages) end wv:loadDataWithBaseURL('https://api.s0o1.com/', html, 'text/html', 'UTF-8', nil) local scroll = luajava.newInstance('android.widget.ScrollView', context) scroll:setFillViewport(true) scroll:setVerticalScrollBarEnabled(true) local slp = luajava.newInstance("android.widget.FrameLayout$LayoutParams", -1, -2) scroll:addView(wv, slp) local clp = luajava.newInstance("android.widget.LinearLayout$LayoutParams", -1, -1) view:addView(scroll, clp) end) end function showSuccess(expireStr) if verified then return end verified = true local imm = context:getSystemService("input_method") imm:hideSoftInputFromWindow(inputBox:getWindowToken(), 0) local dist = 80 * density loginForm:animate() :translationX(dist) :alpha(0) :setDuration(400) :setInterpolator(luajava.newInstance("android.view.animation.AccelerateInterpolator")) :start() leftImage:animate() :translationX(-dist) :alpha(0) :setDuration(400) :setInterpolator(luajava.newInstance("android.view.animation.AccelerateInterpolator")) :start() rightImage:animate() :alpha(1) :setDuration(400) :setInterpolator(luajava.newInstance("android.view.animation.DecelerateInterpolator")) :start() successView:animate() :alpha(1) :setDuration(400) :setInterpolator(luajava.newInstance("android.view.animation.DecelerateInterpolator")) :withEndAction(toRun(function() loginForm:setVisibility(View.GONE) leftImage:setVisibility(View.GONE) local expireText = luajava.newInstance("android.widget.TextView", context) expireText:setText(expireStr) expireText:setTextSize(12) expireText:setTextColor(0xFF999999) expireText:setTypeface(defaultBold) expireText:setGravity(17) expireText:setAlpha(0) local lp = luajava.newInstance("android.widget.LinearLayout$LayoutParams", luajava.newInstance("android.view.ViewGroup$LayoutParams", -2, -2)) lp:setMargins(0, 8 * density, 0, 0) expireText:setLayoutParams(lp) successView:addView(expireText) expireText:animate() :alpha(1) :setDuration(300) :start() loadImg(finalImage, baseDir .. "/沈幼楚", 1.2) local Handler = luajava.bindClass("android.os.Handler") local Looper = luajava.bindClass("android.os.Looper") local handler = luajava.newInstance("android.os.Handler", Looper:getMainLooper()) handler:postDelayed(toRun(function() successView:animate():alpha(0):setDuration(300):start() finalImage:animate():alpha(1):setDuration(300):withEndAction(toRun(function() handler:postDelayed(toRun(function() local whiteBg = getBg(5, 0xFFFFFFFF) view:setBackground(whiteBg) if Build.VERSION.SDK_INT >= 21 then view:setClipToOutline(true) end leftPanel:animate():alpha(0):setDuration(600):start() rightPanel:animate():alpha(0):setDuration(600):withEndAction(toRun(function() view:removeAllViews() showNavPage() end)):start() end), 2000) end)):start() end), 1000) end)) :start() end function doLogin() local now = os.time() if now - lastClickTime < 2 then return end lastClickTime = now local kami = inputBox:getText():toString() if kami == "" then return end MXT._pendingKami = kami end loginBtn:setOnClickListener(luajava.createProxy("android.view.View$OnClickListener", { onClick = function(v) doLogin() end })) inputBox:setOnEditorActionListener(luajava.createProxy("android.widget.TextView$OnEditorActionListener", { onEditorAction = function(v, actionId, event) if actionId == EditorInfo.IME_ACTION_DONE or (event ~= nil and event:getKeyCode() == 66) then doLogin() return true end return false end })) xfqpic=baseDir .. "/陈楚生" ICON_SIZE = math.floor(45 * density + 0.5) EXPANDED_WIDTH = math.floor(宽度 * density + 0.5) EXPANDED_HEIGHT = math.floor(高度 * density + 0.5) lastExpandedWidth = EXPANDED_WIDTH lastExpandedHeight = EXPANDED_HEIGHT iconBgDrawable = luajava.newInstance('android.graphics.drawable.GradientDrawable') iconBgDrawable:setShape(1) iconBgDrawable:setColor(0xFF007AFF) iconLayer = luajava.loadlayout({ FrameLayout, id = "iconLayer", layout_width = "45dp", layout_height = "45dp", background = iconBgDrawable, visibility = View.GONE, { ImageView, layout_width = "match_parent", layout_height = "match_parent", src = xfqpic, scaleType = "centerCrop", onTouch = iconTouch, } }) if Build.VERSION.SDK_INT >= 21 then iconLayer:setClipToOutline(true) iconLayer:setElevation(6 * density) end morphRoot = luajava.loadlayout({ FrameLayout, id = "morphRoot", layout_width = "match_parent", layout_height = "match_parent", view, { FrameLayout, id = "dragBar", layout_width = "match_parent", layout_height = "24dp", onTouch = function(v, event) hanshu(v, event) return true end, background = getBg(0, 0x00000000), } }) floatWindow = luajava.loadlayout({ FrameLayout, id = "floatWindow", layout_width = "wrap_content", layout_height = "wrap_content", morphRoot, iconLayer, }) local LayoutParams = luajava.bindClass("android.view.WindowManager$LayoutParams") local params = luajava.new(LayoutParams) if Build.VERSION.SDK_INT >= 26 then params.type = LayoutParams.TYPE_APPLICATION_OVERLAY else params.type = LayoutParams.TYPE_PHONE end params.format = PixelFormat.RGBA_8888 params.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL params.gravity = Gravity.LEFT | Gravity.TOP local metrics = context:getResources():getDisplayMetrics() local screenW = metrics.widthPixels local screenH = metrics.heightPixels params.x = math.floor((screenW - EXPANDED_WIDTH) / 2 + 0.5) params.y = math.floor((screenH - EXPANDED_HEIGHT) / 2 + 0.5) params.width = EXPANDED_WIDTH params.height = EXPANDED_HEIGHT params.softInputMode = LayoutParams.SOFT_INPUT_ADJUST_RESIZE mainLayoutParams = params luajava.runOnUiThread(function() window:addView(floatWindow, mainLayoutParams) end) isExpanded = true isAnimating = false function 隐藏() if isAnimating then return end luajava.runOnUiThread(function() if not morphRoot then return end if isExpanded then isExpanded = false isAnimating = true lastExpandedWidth = mainLayoutParams.width lastExpandedHeight = mainLayoutParams.height view:animate() :alpha(0) :setDuration(180) :setInterpolator(luajava.newInstance("android.view.animation.AccelerateInterpolator")) :start() morphRoot:setPivotX(0) morphRoot:setPivotY(0) morphRoot:animate() :scaleX(0) :scaleY(0) :setDuration(220) :setInterpolator(luajava.newInstance("android.view.animation.AccelerateInterpolator", 1.5)) :withEndAction(toRun(function() view:setVisibility(View.GONE) view:setAlpha(1) mainLayoutParams.width = ICON_SIZE mainLayoutParams.height = ICON_SIZE mainLayoutParams.flags = LayoutParams.FLAG_NOT_FOCUSABLE window:updateViewLayout(floatWindow, mainLayoutParams) morphRoot:setScaleX(1) morphRoot:setScaleY(1) iconLayer:setVisibility(View.VISIBLE) iconLayer:setAlpha(0) iconLayer:animate() :alpha(1) :setDuration(100) :setInterpolator(luajava.newInstance("android.view.animation.DecelerateInterpolator")) :withEndAction(toRun(function() isAnimating = false end)) :start() end)) :start() else isExpanded = true isAnimating = true iconLayer:animate() :alpha(0) :setDuration(100) :setInterpolator(luajava.newInstance("android.view.animation.AccelerateInterpolator")) :withEndAction(toRun(function() iconLayer:setVisibility(View.GONE) iconLayer:setAlpha(1) mainLayoutParams.width = lastExpandedWidth mainLayoutParams.height = lastExpandedHeight mainLayoutParams.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL window:updateViewLayout(floatWindow, mainLayoutParams) morphRoot:setPivotX(0) morphRoot:setPivotY(0) morphRoot:setScaleX(ICON_SIZE / lastExpandedWidth) morphRoot:setScaleY(ICON_SIZE / lastExpandedHeight) morphRoot:animate() :scaleX(1) :scaleY(1) :setDuration(220) :setInterpolator(luajava.newInstance("android.view.animation.DecelerateInterpolator", 1.5)) :withEndAction(toRun(function() isAnimating = false end)) :start() view:setVisibility(View.VISIBLE) view:setAlpha(0) view:animate() :alpha(1) :setDuration(180) :setInterpolator(luajava.newInstance("android.view.animation.DecelerateInterpolator")) :start() end)) :start() end end) end function 退出UI() MXT._running = false end function MXT.menu(pages) MXT._pages = pages if verified then showNavPage() end while MXT._running do if MXT._pendingKami then local kami = MXT._pendingKami local kamiyz = rlyunyz.postApi('kmlogon', {kami = kami}) luajava.runOnUiThread(function() local success = false local expireTime = "到期时间未知" if type(kamiyz) == 'table' and kamiyz.code == 200 then success = true local msg = kamiyz.msg if type(msg) == 'table' and msg.vip then local n = tonumber(msg.vip) if n then expireTime = "到期时间:" .. os.date("%Y-%m-%d %H:%M", n) end end end if not success then local errMsg = "卡密验证失败" if type(kamiyz) == 'string' then if kamiyz:find("不存在") then errMsg = "卡密不存在" elseif kamiyz:find("到期") or kamiyz:find("过期") then errMsg = "卡密已到期" else errMsg = kamiyz end elseif type(kamiyz) == 'table' and type(kamiyz.msg) == 'string' then errMsg = kamiyz.msg end showError(errMsg) else showSuccess(expireTime) end end) end gg.sleep(100) end luajava.runOnUiThread(function() pcall(function() if floatWindow then window:removeView(floatWindow) floatWindow = nil end end) end) end MXT.menu({ 第一页=({ ["页面名称"]="首页", ["页面索引"]="1", ["页面左侧"]={ MXT.card() }, ["页面右侧"]={ MXT.switch("请选择游戏进程", function() gg.setProcessX() gg.toast("请选择游戏进程") end ), MXT.switch("每日语录", function() string.toMusic("你靠在我身边的那一刻,全宇宙都安静了。") gg.alert("你靠在我身边的那一刻,全宇宙都安静了。") end, function() gg.alert("关闭成功") end ), MXT.switch("无", function() gg.alert("开启成功") end, function() gg.alert("关闭成功") end ), MXT.switch("无", function() gg.alert("开启成功") end, function() gg.alert("关闭成功") end ), MXT.switch("无", function() gg.alert("开启成功") end, function() gg.alert("关闭成功") end ), MXT.switch("无", function() gg.alert("开启成功") end, function() gg.alert("关闭成功") end ) } }), 第二页=({ ["页面名称"]="防封", ["页面索引"]="2", ["页面左侧"]={ MXT.switch("logo第一套 9-19", function() gg.toast("第一套开启成功") end, function() gg.toast("无法关闭") end ), MXT.switch("logo第二套 9-19", function() gg.toast("第二套开启成功") end, function() gg.toast("无法关闭") end ), MXT.switch("完整性校验", function() ---case16防闪 if gg.getRangesList("libanogs.so")[1] then local t = {} t[1] = gg.getRangesList("libanogs.so")[1]["start"] + 0x23D418; -- 原地址:0x6F9386B418 gg.addListItems({ [1] = { address = t[1], flags = 4, value = 706675680, freeze = true } }) gg.toast("libanogs.so 恢复成功") end ---crc if gg.getRangesList("libanogs.so")[1] then local t = {} t[1] = gg.getRangesList("libanogs.so")[1]["start"] + 0x49AA00; -- 原地址:0x6F954BEA00 gg.addListItems({ [1] = { address = t[1], flags = 4, value = 335544333, freeze = true } }) gg.toast("libanogs.so 恢复成功") end ---text段校验 if gg.getRangesList("libanogs.so")[1] then local t = {} t[1] = gg.getRangesList("libanogs.so")[1]["start"] + 0x4B3548; -- 原地址:0x6F942D5548 gg.addListItems({ [1] = { address = t[1], flags = 4, value = -698416192, freeze = true } }) gg.toast("libanogs.so 恢复成功") end ---完整性 if gg.getRangesList("libanogs.so")[1] then local t = {} t[1] = gg.getRangesList("libanogs.so")[1]["start"] + 0x1C5B70; -- 原地址:0x6F93FE7B70 t[2] = gg.getRangesList("libanogs.so")[1]["start"] + 0x1C5B74; -- 原地址:0x6F93FE7B74 t[3] = gg.getRangesList("libanogs.so")[1]["start"] + 0x1C5BA0; -- 原地址:0x6F93FE7BA0 t[4] = gg.getRangesList("libanogs.so")[1]["start"] + 0x1C5BC4; -- 原地址:0x6F93FE7BC4 t[5] = gg.getRangesList("libanogs.so")[1]["start"] + 0x1C5BF0; -- 原地址:0x6F93FE7BF0 t[6] = gg.getRangesList("libanogs.so")[1]["start"] + 0x1C5BFC; -- 原地址:0x6F93FE7BFC gg.addListItems({ [1] = { address = t[1], flags = 4, value = -698416192, freeze = true }, [2] = { address = t[2], flags = 4, value = -698416192, freeze = true }, [3] = { address = t[3], flags = 4, value = -698416192, freeze = true }, [4] = { address = t[4], flags = 4, value = -721215457, freeze = true }, [5] = { address = t[5], flags = 4, value = -721215457, freeze = true }, [6] = { address = t[6], flags = 4, value = -698416192, freeze = true } }) gg.toast("libanogs.so 恢复成功") end gg.toast("完整性校验开启成功") end, function() gg.toast("无法关闭") end ) }, ["页面右侧"]={ MXT.switch("全杀67", function() gg.toast("全杀67开启成功") end, function() gg.toast("无法关闭") end ), MXT.switch("全局离线", function() gg.toast("全局离线开启成功") end, function() gg.toast("全局离线关闭成功") end ), MXT.switch("待更新", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.box("待更新", { MXT.switch("待更新", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.check({ {"无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end}, {"无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end} }), MXT.button("无", function() gg.alert("开启成功") end) }, function() end, function() end ), MXT.button("无", function() gg.alert("示例") end) } }), 第三页=({ ["页面名称"]="功能", ["页面索引"]="3", ["页面左侧"]={ MXT.box("无", { MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.button("无", function() gg.alert("开启成功") end) }, function() end, function() end ), }, ["页面右侧"]={ MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.button("无", function() gg.alert("无") end), MXT.button("无", function() gg.alert("无") end) } }), 第四页=({ ["页面名称"]="设置", ["页面索引"]="4", ["页面左侧"]={ MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ), MXT.switch("无", function() gg.toast("开启成功") end, function() gg.toast("关闭成功") end ) }, ["页面右侧"]={ MXT.button("退出", function() 退出UI()end) } }) })