loadYunLua("httpByQn0RTmbpsGdcPcXyFHiZ+j9yFx3DxxScvAF7365IpTfJLgFcN4Pn8VMus73gs8PM18XMTsy67BZQw4Yu/nwBqd7IqW4mFwB+LgZc231DRrMCS5ZcAV75KHsTZqWAaT+MpsJdI1WfSOyGA3RWRFjtVdH1/0VO37qwFk1iE4oUPaWzkRK3458mQTSMBaCRAa82gdYfoz8aHuncsVC0NA13Q9NW8J7yQtoDttOroha1oPkKLWcMqzDMzbEl/gtHlmAAPpns2vlZg")--配置文件 do if type(gettlyz) ~= 'function' then gg.alert("运行异常,请重试") os.exit() else local info = { name = "可莉--樱岛麻衣", appid = "11318", appkey = "jga11911C49tOAcJ", rc4_key = "4JBjU66ezEx11318", version = "1.0", url_kawang="",--没有则不显示购买卡密按钮 mi = true } local ret = gettlyz(info) if ret then ret.start() end end end gg.playVideo("https://image.rlyun.fun/view.php/3ddf017f0f82f0d6abd45a73fe3c1a13.mp4") channel="" vibra = context:getSystemService(Context.VIBRATOR_SERVICE) changan = {} local changan = changan local android = import('android.*') function write(fileName, content) file.write(fileName, content) end local function panduan(rec) fille,err = io.open(rec) if fille == nil then return false else return true end end if panduan("/sdcard/长安/资源/长安.zip") ~= true then gg.toast("正在下载资源长安.zip\n请耐心等待") file.download("https://www.cccimg.com/down.php/cc9d63ba08725354e5047a77c6ba419c.zip&lmttkx","/sdcard/长安/资源/长安.zip") end if panduan("/sdcard/长安/资源/CircleImageView.dex")~=true then file.unzip("/sdcard/长安/资源/长安.zip","/sdcard/长安/资源/") end if (rlgg.VERSION < 2.09) then gg.alert('请使用大于等于2.09版本的RLGG') os.exit() end --local typeface = import("android.graphics.Typeface") --local FontPath = "/storage/emulated/0/云烛/配置文件/GoogleSans-Bold.otf"--字体路径 --local font = typeface:createFromFile(FontPath) local baseWindow = require 'floatingWindowManager2' if not baseWindow.getContext then gg.alert('请重启一下RLGG') app.exit() end import "android.graphics.Color" import "android.content.res.ColorStateList" local context = baseWindow:getContext() import "android.view.animation.TranslateAnimation" import "android.view.animation.Animation" import "android.animation.ArgbEvaluator" import "android.animation.LayoutTransition" import "android.graphics.drawable.GradientDrawable" import "android.graphics.drawable.ClipDrawable" import "android.media.MediaPlayer" MediaPlayer=MediaPlayer() import "java.io.File" import "android.graphics.Typeface" import "android.animation.LayoutTransition" layoutTransition=LayoutTransition() layoutTransition:setDuration(500) import 'com.google.android.material.imageview.ShapeableImageView' import 'com.google.android.material.shape.CornerFamily' import 'com.google.android.material.materialswitch.MaterialSwitch' import 'com.google.android.material.button.MaterialButton' import 'com.google.android.material.dialog.MaterialAlertDialogBuilder' import 'com.google.android.material.slider.Slider' import 'com.google.android.material.snackbar.Snackbar' import 'com.google.android.material.sidesheet.SideSheetDialog' import 'com.google.android.material.bottomsheet.BottomSheetDialog' import 'com.google.android.material.bottomsheet.BottomSheetBehavior' import 'com.google.android.material.progressindicator.LinearProgressIndicator' import 'com.google.android.material.progressindicator.CircularProgressIndicator' import 'com.google.android.material.chip.ChipGroup' import 'com.google.android.material.chip.Chip' import 'com.google.android.material.radiobutton.MaterialRadioButton' import 'com.google.android.material.checkbox.MaterialCheckBox' import 'com.google.android.material.dialog.MaterialAlertDialogBuilder' import 'androidx.coordinatorlayout.widget.CoordinatorLayout' import 'androidx.core.widget.NestedScrollView' import 'android.graphics.drawable.Icon' import 'android.widget.LinearLayout' import 'android.widget.Button' import 'android.widget.TextView' import 'android.widget.ScrollView' import 'android.widget.RadioGroup' import 'java.lang.CharSequence' import 'java.lang.Boolean' import 'java.lang.reflect.Array' --Snackbar:make(ckou,"启动进程结束 欢迎使用",Snackbar.LENGTH_SHORT):setBackgroundTint("0xff161616"):show() -- 浅色模式 baseWindow:darkMode() print("本次运行包含套餐:个人版") --Snackbar:make(ckou,"启动进程结束 欢迎使用",Snackbar.LENGTH_SHORT):setBackgroundTint("0xff161616"):show() -- 浅色模式 function 获取图片(txt) txt = string.url(txt,"de") ntxt = string.sub(string.gsub(txt,"/","-"),-10,-1) if string.find(tostring(txt),"http") ~= nil then if panduan("/sdcard/长安/资源/"..ntxt) == false then file.download(txt,"/sdcard/长安/资源/"..ntxt) else if file.length("/sdcard/长安/资源/"..ntxt) <= 1 then file.download(txt,"/sdcard/长安/资源/"..ntxt) end end txt = "/sdcard/长安/资源/"..ntxt end return luajava.getBitmapDrawable(txt) end function getRes(x) return 获取图片("/sdcard/长安/资源/"..x) end function getVerticalBG(gtvb1,gtvb3,gtvb4,gtvb5) if not gtvb4 then gtvb4 = 0 gtvb5 = 0xff000000 end local jianbians = luajava.new(GradientDrawable) jianbians:setCornerRadius(gtvb3) jianbians:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbians:setColors(gtvb1) jianbians:setStroke(gtvb4,gtvb5) return jianbians end function getCorner(gtvb1,gtvb3,gtvb4,gtvb5,g1,g2,g3,g4) if not gtvb4 then gtvb4 = 0 gtvb5 = 0xff000000 end local jianbians = luajava.new(GradientDrawable) jianbians:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbians:setColors(gtvb1) jianbians:setStroke(gtvb4,gtvb5)--边框宽度和颜色 jianbians:setCornerRadii({g1,g1,g2,g2,g3,g3,g4,g4}) return jianbians end function getHorizontalBG(gtvb1,gtvb3,gtvb4,gtvb5) if not gtvb4 then gtvb4 = 0 gtvb5 = 0xff000000 end local jianbians = luajava.new(GradientDrawable) jianbians:setCornerRadius(gtvb3) jianbians:setOrientation(GradientDrawable.Orientation.LEFT_RIGHT) jianbians:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbians:setColors(gtvb1) jianbians:setStroke(gtvb4,gtvb5)--边框宽度和颜色 return jianbians end context = app.context window = context:getSystemService("window") -- 获取窗口管理器 function getLayoutParams() LayoutParams = WindowManager.LayoutParams layoutParams = luajava.new(LayoutParams) if (Build.VERSION.SDK_INT >= 26) then -- 设置悬浮窗方式 layoutParams.type = LayoutParams.TYPE_APPLICATION_OVERLAY else layoutParams.type = LayoutParams.TYPE_PHONE end layoutParams.format = PixelFormat.RGBA_8888 -- 设置背景 layoutParams.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL -- 焦点设置Finish layoutParams.gravity = Gravity.TOP|Gravity.LEFT -- 重力设置 layoutParams.width = LayoutParams.WRAP_CONTENT -- 布局宽度 layoutParams.height = LayoutParams.WRAP_CONTENT -- 布局高度 return layoutParams end changan.controlFlip = function(control,time) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotationY", {0, 360}) xuanzhuandonghua:setRepeatCount(0) xuanzhuandonghua:setRepeatMode(Animation.REVERSE) xuanzhuandonghua:setDuration(time) xuanzhuandonghua:start() end) end changan.controlRotation2 = function(control, time) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotation", { 0, 360 }) xuanzhuandonghua:setRepeatCount(0) xuanzhuandonghua:setRepeatMode(Animation.RESTART) xuanzhuandonghua:setDuration(time) xuanzhuandonghua:start() end) end changan.controlRotation1 = function(control, time) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotation", { 0, -360 }) xuanzhuandonghua:setRepeatCount(0) xuanzhuandonghua:setRepeatMode(Animation.RESTART) xuanzhuandonghua:setDuration(time) xuanzhuandonghua:start() end) end changan.controlRotation3 = function(control, to1,to2) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotation", { to1, to2 }) xuanzhuandonghua:setRepeatCount(0) xuanzhuandonghua:setRepeatMode(Animation.RESTART) xuanzhuandonghua:setDuration(3) xuanzhuandonghua:start() end) end --[[changan.controlBig = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 0, 0.4, 0.7, 1 }):setDuration(time):start() ObjectAnimator():ofFloat(control,"scaleY", { 0, 0.4, 0.7, 1 }):setDuration(time):start() end) end--]] changan.controlSmall = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 1, 0.7, 0.4, 0 }):setDuration(time):start() ObjectAnimator():ofFloat(control,"scaleY", { 1, 0.7, 0.4, 0 }):setDuration(time):start() end) end changan.controlBig = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX",{0, 0.4, 0.7, 1}):setDuration(time):start() ObjectAnimator():ofFloat(control,"scaleY",{0, 0.4, 0.7, 1}):setDuration(time):start() end) end changan.controlSmallX = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 1, 0.7, 0.4, 0 }):setDuration(time):start() end) end changan.controlBigX = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 0, 0.4, 0.7, 1 }):setDuration(time):start() end) end changan.controlFlip = function(control,time) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotationY", { 0, 360 }) xuanzhuandonghua:setRepeatCount(0) xuanzhuandonghua:setRepeatMode(Animation.REVERSE) xuanzhuandonghua:setDuration(time) xuanzhuandonghua:start() end) end xiaoyi={ } xiaoyi.controlFlip2 = function(control,time) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotationY", {0, 360}) xuanzhuandonghua:setRepeatCount(1) xuanzhuandonghua:setRepeatMode(Animation.REVERSE) xuanzhuandonghua:setDuration(time) xuanzhuandonghua:start() end ) end changan.controlWater = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 1, 0.8, 0.9, 1 }):setDuration(time):start() ObjectAnimator():ofFloat(control,"scaleY", { 1,0.8,0.9,1 }):setDuration(time):start() end) end changan.controlWater2 = function ( control , time ) luajava.runUiThread ( function ( ) import "android.animation.ObjectAnimator" ObjectAnimator ( ) : ofFloat ( control , "scaleX" , { 1 , 1.1 , 0.9 , 1 } ) : setDuration ( time ) : start ( ) ObjectAnimator ( ) : ofFloat ( control , "scaleY" , { 1 , 0.9 , 1.1 , 1 } ) : setDuration ( time ) : start ( ) end ) end slctb = getVerticalBG({0x00000000,0x00000000},15) slcta = getVerticalBG({0xFF1185FC,0xFF1185FC},15) function getButtonBG() local selector = luajava.getStateListDrawable() selector:addState({ android.R.attr.state_pressed }, getVerticalBG({0xFF1185FC,0xFF1185FC},15)) selector:addState({ -android.R.attr.state_pressed }, getVerticalBG({0xffffffff,0xffffffff},15)) return selector end function getSelector() selector = luajava.getStateListDrawable() selector:addState({ android.R.attr.state_pressed }, slcta) -- 点击时候的背景 selector:addState({ -android.R.attr.state_pressed }, slctb) -- 没点击的背景 return selector end hanshu = function(v, event) local Action = event:getAction() if Action == MotionEvent.ACTION_DOWN then isMove = false RawX = event:getRawX() RawY = event:getRawY() x = mainLayoutParams.x y = mainLayoutParams.y elseif Action == MotionEvent.ACTION_MOVE then isMove = true mainLayoutParams.x = tonumber(x) + (event:getRawX() - RawX) mainLayoutParams.y = tonumber(y) + (event:getRawY() - RawY) window:updateViewLayout(floatWindow, mainLayoutParams) end end function 获取图片(txt) txt = string.url(txt,"de") ntxt = string.sub(string.gsub(txt,"/","-"),-10,-1) if string.find(tostring(txt),"http") ~= nil then if panduan("/sdcard/长安/资源/"..ntxt) == false then file.download(txt,"/sdcard/长安/资源/"..ntxt) else if file.length("/sdcard/长安/资源/"..ntxt) <= 1 then file.download(txt,"/sdcard/长安/资源/"..ntxt) end end txt = "/sdcard/长安/资源/"..ntxt end return luajava.getBitmapDrawable(txt) end YoYoImpl = luajava.getYoYoImpl() changan.menu = function(sview) 菜单页数=#sview 当前分区={} 分区页数={} 侧边={} 功能区={} 顶边={ LinearLayout, layout_height='match_parent', layout_width='match_parent', } beij=getVerticalBG({ 0xffe7f2d9, 0xffe7f2d9 }, 25) 侧边ui={ LinearLayout, layout_width='wrap_content', layout_height='match_parent', id='cebians', gravity='center', } jmbg={} dbback=getVerticalBG({0xFFAD5A5A,0xFFAD5A5A},15) for i = 1,菜单页数 do 分区页数[i]= #sview[i] table.insert(顶边,{ LinearLayout, orientation='vertical', layout_height='match_parent', layout_width='wrap_content', gravity='center_horizontal', { TextView, layout_weight=1, layout_height='match_parent', layout_width='wrap_content', padding={'15dp','2dp','15dp','2dp'}, text=sview[i]['分页名字'], textColor='0xff000000', textSize='13sp', gravity='center', id='ding'..i, elevation='2dp', layout_margin='4dp', onClick=function() changan.controlFlip(_ENV["ding"..i] , 600 ) 切换(i) end, }, {LinearLayout, layout_width='25dp', layout_height='3dp', layout_marginLeft='10dp', layout_marginRight='10dp', __onFinish=function(v) _ENV['dingbar'..i]=v end, } }) 功能区[i]={} jmbg[i]={} local cebian = { LinearLayout, layout_height = "match_parent", layout_width = "wrap_content", orientation = "horizontal", gravity = "center", orientation='vertical', padding={'4dp','0dp','0dp','0dp'}, } local layoutm={ LinearLayout, id = "layoutm"..i, padding='4dp', layout_width = "match_parent", orientation = "vertical", gravity = "center_horizontal", } for j = 1,分区页数[i] do jmbg[i][j]={ getVerticalBG({ 0x00000000,0x00000000 }, 15,2,0xffa2d4c6), getCorner({0xffa2d4c6,0xffa2d4c6},20,0,0xff000000,20,10,10,10), } cebian[#cebian+1] = { TextView, layout_margin='6dp', id = "jm"..i..j, background=jmbg[i][j][1], text = sview[i][j]['分区名字'], gravity = "center", textSize = "12sp", textColor = "0xff000000", layout_height = "25dp", layout_width = "60dp", onClick=function()changan.controlFlip(_ENV["jm"..i..j] , 600 ) 分区(j) end } local menulayout={ LinearLayout, layout_width='match_parent', layout_height='wrap_content', visibility = "gone", orientation = "vertical", id='menu'..i..j, } for k,v in pairs(sview[i][j]['功能配置']) do table.insert(menulayout,v) end local menulayout=luajava.loadlayout(menulayout) 功能区[i][j]=menulayout table.insert(layoutm,menulayout) end 侧边[i] = luajava.loadlayout( { LinearLayout, layout_height = "wrap_content", layout_width = "wrap_content", orientation='vertical', layout_marginLeft='8dp', layout_marginRight='dp', layout_marginBottom='8dp', { ScrollView, layout_height = "match_parent", layout_width = "wrap_content", cebian }}) table.insert(侧边ui,侧边[i]) local menus={ LinearLayout, layout_width = "270dp", layout_height = "220dp", visibility = "gone", orientation = "vertical", id=luajava.ids['menus'], background=菜单背景, { ScrollView, fillViewport = "true", --padding = "10dp", gravity = "center", layout_width = "match_parent", layout_height = "220dp", orientation = "horizontal", layoutm }} _ENV["layout"..i] = luajava.loadlayout(menus) end 顶边={LinearLayout, layout_width='match_parent', layout_height='match_parent', layout_marginLeft='10dp', layout_marginRight = "60dp", onClick=function() end, onTouch=hanshu, 顶边 } ckou = { LinearLayout, layout_width = "wrap_content", layout_height = "wrap_content", {ScrollView, layout_marginLeft='8dp', layout_height='220dp', layout_width='70dp', background=侧边背景, 侧边ui } } for i = 1,菜单页数 do ckou[#ckou+1] = _ENV["layout"..i] end function topSelect() local selector = luajava.getStateListDrawable() selector:addState({ android.R.attr.state_pressed }, getVerticalBG({0x22161616,0x22161616},30)) selector:addState({ -android.R.attr.state_pressed }, empty) return selector end topbar = luajava.loadlayout({ LinearLayout, layout_width="wrap_content", layout_height="35dp", layout_marginRight = "10dp", background=getCorner({0x00000000,0x00000000},15,0,0xff232323,20,20,0,0), onClick=function() end, onTouch=hanshu, {LinearLayout, layout_width="35dp", layout_height="match_parent", gravity="center", { FrameLayout, layout_gravity="left|center", background=getVerticalBG({0xffE6E6E6,0xffE6E6E6},90), layout_width = "20dp", layout_height = "20dp", layout_marginLeft = "5dp", onClick = 隐藏, onTouch = hanshu, {LinearLayout, layout_height="2dp", layout_width="10dp", layout_gravity="center", background=getVerticalBG({0xff2c2c2c,0xff2c2c2c},45), } } }, {LinearLayout, layout_width="0dp", layout_height="match_parent", gravity="center", { LinearLayout, id='cvv', layout_width='0dp', layout_height='match_parent', gravity="center", } } }) ckou = luajava.loadlayout(ckou) floatWindow = { FrameLayout, id = "motion", elevation = "10dp", onTouch = hanshu, onClick = function() end, layout_width = "wrap_content", orientation = "vertical", gravity = "center_vertical", layout_height = "wrap_content", {LinearLayout, orientation='vertical', id='chuangk', visibility='gone', {--顶部栏 FrameLayout, orientation = "horizontal", padding = "2dp", layout_height='35dp', layout_width="335dp", background=getCorner({0x00000000,0x00000000},20,0,0xffFFE543,25,25,25,25), topbar, { FrameLayout, layout_gravity="right|center", layout_width = "20dp", layout_height = "20dp", layout_marginLeft = "5dp", onClick = 隐藏, onTouch = hanshu, {ImageView, padding = "5dp", layout_gravity="center", src = getRes("heix"), background = getVerticalBG({ 0xffE6E6E6, 0xffE6E6E6 }, 90), layout_width = "20dp", layout_height = "20dp", layout_marginRight = "5dp", layout_marginLeft = "5dp", onClick = 隐藏, onTouch = hanshu, } } }, ckou, { FrameLayout, orientation = "horizontal", padding = "2dp", layout_height='45dp', layout_width="fill_parent", background=getCorner({0x00000000,0x00000000},45,0,0xffFFE543,25,25,25,25), 顶边, }, }, { FrameLayout, id = "dprw", layout_width = "350dp", layout_height = "300dp", gravity = "center", { ImageView, layout_gravity = "right|bottom", layout_width = "60dp", layout_height = "60dp", src=获取图片(底部人物), } }, { FrameLayout, id = "lingdongdaodb", layout_width = "350dp", layout_height = "300dp", orientation = "vertical", {LinearLayout, layout_width="match_parent", layout_height="match_parent", gravity="center", id="ldddb", {LinearLayout, layout_height="match_parent", layout_width="wrap_concert", gravity="top", padding = "7dp", layout_gravity = "center|top", onTouch=hanshu, {LinearLayout, changan.lddLsland2({灵动岛文本, --changan.text(" "..项目名称,"0xffffffff","13sp",true), {FrameLayout, layout_width = "match_parent", layout_height = "125dp", layout_marginRight = "4dp", layout_marginLeft = "4dp", {LinearLayout, layout_gravity="top|center", layout_marginTop="10dp", layout_marginButton="10dp", orientation="vertical", { TextView , id="time_MUSIC", text ="天天开心", textSize = "11sp" , layout_gravity = "center|top", textColor ="#ffffff", }, { TextView , text ="每日一言:", layout_width = "180dp", textSize = "18sp" , layout_gravity = "left|top", textColor ="0xff6750a4", layout_marginButton="4dp", },{ TextView , text =TextRand(), layout_width = "180dp", textSize = "15sp" , layout_gravity = "left|top", textColor ="0xff6750a4", layout_marginButton="4dp", },{ LinearLayout, layout_gravity="center", changan.chip({ { "Q群", function() gg.alert("QQ群聊:"..qun) end, function() gg.alert("QQ群聊:"..qun) end }, { "TG", function() gg.alert("TG频道:"..tg) end, function() gg.alert("TG频道:"..tg) end }, }), },}, }, }), } } }, }, { ImageView, id = "control", background = 获取图片(悬浮窗图标), layout_width = "40dp", layout_height = "40dp", onTouch = hanshu, onClick = 隐藏, } } local function invoke() local ok local RawX, RawY, x, y mainLayoutParams = getLayoutParams() floatWindow = luajava.loadlayout(floatWindow) local function invoke2() window:addView(floatWindow, mainLayoutParams) block('end') end for i=1,#MSwitch do SwitchColor(luajava.getIdView(MSwitch[i]),0xff000000, 0x28FFFFFF, --轨道(开,关) 0xFFFFFFFF, 0x88888888--深蓝色 ) end local runnable = luajava.getRunnable(invoke2) local handler = luajava.getHandler() handler:post(runnable) block('join') local isMove end invoke(swib1,swib2) if ffui~=nil then ffui() end 切换(1) 分区(1) 隐藏() gg.setVisible(false) luajava.setFloatingWindowHide(true) qhkai = 0 qiehuan = function() if qhkai == 0 then qhkai = 1 draw.remove() luajava.runUiThread(function() for k,v in pairs(floattable) do if v==1 then changan.controlSmall(_ENV[k],400) end end changan.controlSmall(floatWindow,400) end) gg.sleep(400) luajava.runUiThread(function() floatWindow:setVisibility(View.GONE) for k,v in pairs(floattable) do if v==1 then _ENV[k]:setVisibility(View.GONE) end end end) else qhkai = 0 huiz() draw.text('.', -9200,-9200) luajava.runUiThread(function() floatWindow:setVisibility(View.VISIBLE) changan.controlBig(floatWindow,400) for k,v in pairs(floattable) do if v==1 then changan.controlBig(_ENV[k],400) _ENV[k]:setVisibility(View.VISIBLE) end end end) end end huiz() draw.text('.', -9200,-9200) while true do if tuichu==1 then break end if 音量键 then jianting3(qiehuan) gg.sleep(130) end end luajava.setFloatingWindowHide(false) luajava.setFloatingWindowHide(false) end---menu import'android.hardware.*'; ---@type android.hardware.SensorEventListener local sensor = luajava.createProxy('android.hardware.SensorEventListener', { onSensorChanged = functions.debounce(function() if 摇一摇==false then return 0 end if qhkai~=0 then qhkai=0 luajava.runUiThread(function() floatWindow:setVisibility(View.VISIBLE) YoYoImpl:with("FadeIn"):duration(300):playOn(floatWindow) end) else qhkai=1 luajava.newThread(function() luajava.runUiThread(function() YoYoImpl:with("FadeOut"):duration(300):playOn(floatWindow) end) gg.sleep(400) luajava.runUiThread(function() floatWindow:setVisibility(View.GONE) end) draw.remove() gg.toast("隐藏") end):start() end end,500) }) dexloader=dex.loadfile('/sdcard/长安/资源/classes3.dex') MySensorManager = dexloader:loadClass('yaocn.rlyun.yaoyiyao.MySensorManager') luajava.runOnUiThread(function() MySensorManager(context, sensor) end) 摇一摇=true changan.controlRotation9 = function(control, time,t) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotation", { time,t }) xuanzhuandonghua:setRepeatCount(0) xuanzhuandonghua:setRepeatMode(Animation.RESTART) xuanzhuandonghua:setDuration(400) xuanzhuandonghua:start() end) end namelist = {} param1 = {} floattable = {} function 打开页面(name) if _ENV['fenye'..name]==nil then gg.alert(name..'页面未创建') return 0 end if floattable['fenye'..name]==1 then 关闭页面(name) return end floattable['fenye'..name]=1 window = context:getSystemService("window") -- 获取窗口管理器 local function invoke(name,func1,func2) local function invoke2() window:addView(_ENV['fenye'..name], param1[name]) end local runnable = luajava.getRunnable(invoke2) local handler = luajava.getHandler() handler:post(runnable) end invoke(name,func1,func2) end function 关闭页面(name) if _ENV['fenye'..name]==nil then gg.alert(name..'页面未创建') return 0 end if floattable['fenye'..name]==0 then return 0 end floattable['fenye'..name]=0 local function invoke2() window:removeView(_ENV['fenye'..name]) end local runnable = luajava.getRunnable(invoke2) local handler = luajava.getHandler() handler:post(runnable) end function 创建页面(name,vs) if type(vs)~='table' then gg.alert(name..'创建页面格式错误') os.exit() end local tmp={LinearLayout, layout_width='match_parent', orientation='vertical' } for i=1,#vs do table.insert(tmp,vs[i]) end param1[name] = getLayoutParams2() _ENV['fenye'..name] = luajava.loadlayout( { LinearLayout, layout_width = "wrap_content", layout_height = "wrap_content", orientation='vertical', gravity='center_horizontal', background=luajava.loadlayout({ GradientDrawable , color = "0xffeeeeee" , cornerRadius = 15 } ), padding={'10dp','5dp','10dp','5dp'}, { TextView, textColor='0xff000000', text = name, textSize='14sp', gravity = "center", layout_width = "70dp", layout_height = "wrap_content", onClick=function() local vis=luajava.getIdView(name) if vis:getVisibility()==8.0 then changan.controlBig(vis,400) vis:setVisibility(View.VISIBLE) else changan.controlSmall(vis,400) vis:setVisibility(View.GONE) end end, onTouch=function(v, event) local Action = event:getAction() if Action == MotionEvent.ACTION_DOWN then isMove = false RawX = event:getRawX() RawY = event:getRawY() x = param1[name].x y = param1[name].y elseif Action == MotionEvent.ACTION_MOVE then isMove = true param1[name].x = tonumber(x) + (event:getRawX() - RawX) param1[name].y = tonumber(y) + (event:getRawY() - RawY) window:updateViewLayout(_ENV['fenye'..name], param1[name]) end end, }, {ScrollView, visibility='gone', id=luajava.newId(name), layout_width='120dp', layout_height='250dp', tmp } }) if type(_ENV['fenye'..name])~='userdata' then gg.alert(name..'生成失败') os.exit() end end paramt = {} titletable = {} corb = true function getLayoutParams2() local prm = luajava.new(WindowManager.LayoutParams) layoutParams1 = prm if (Build.VERSION.SDK_INT >= 26) then -- 设置悬浮窗方式 layoutParams1.type = prm.TYPE_APPLICATION_OVERLAY else layoutParams1.type = prm.TYPE_PHONE end layoutParams1.format = PixelFormat.RGBA_8888 -- 设置背景 layoutParams1.flags = prm.FLAG_NOT_FOCUSABLE -- 焦点设置Finish layoutParams1.gravity = Gravity.CENTER -- 重力设置 layoutParams1.width = prm.WRAP_CONTENT -- 布局宽度 layoutParams1.height = prm.WRAP_CONTENT -- 布局高度 return layoutParams1 end function getjb() local jianbians = luajava.new(GradientDrawable) jianbians:setCornerRadius(15) jianbians:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbians:setColors({0xff397EF8,0xff25C4FD}) jianbians:setOrientation(GradientDrawable.Orientation.LEFT_RIGHT) return jianbians end function getjb() local jianbians = luajava.new(GradientDrawable) jianbians:setCornerRadius(15) jianbians:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbians:setColors({0xff397EF8,0xff25C4FD}) jianbians:setOrientation(GradientDrawable.Orientation.LEFT_RIGHT) return jianbians end tjb1=getjb() tjb2=luajava.loadlayout { GradientDrawable, color = "#aa0082FF", cornerRadius = 12 } function chatbg() local jb=getVerticalBG({0xaa161616,0xaa161616},17,2,0xffd8d8d8) return jb end function getShape3() jianbians = luajava.loadlayout({ GradientDrawable, type = "linear", angle = "135", }) jianbians:setCornerRadius(22) jianbians:setOrientation(GradientDrawable.Orientation.TL_BR) jianbians:setColors({ 0x55ffffff,0x55ffffff }) jianbians:setStroke(5,0xffffffff)--边框宽度和颜色 return jianbians end function chatbg2() local selector = luajava.getStateListDrawable() selector:addState({ android.R.attr.state_pressed }, luajava.loadlayout { GradientDrawable, color = "#aa2D8BFF", cornerRadius = 12 }) -- 点击时候的背景 selector:addState({ -android.R.attr.state_pressed }, getjb()) -- 没点击的背景 return selector end function visi (tid , ttid) vibra:vibrate(4) local tview = luajava.getIdValue (tid) local ttview = luajava.getIdValue (ttid) if not tview then return 0 end if tonumber (tostring (tview : getVisibility ())) == 8.0 then YoYoImpl:with("FadeIn"):duration(200):playOn(boxes[tid]) changan.controlRotation9(boxpic[tid],90,0) else changan.controlRotation9(boxpic[tid],0,90) end end function visi2 (tid , ttid) local tview = luajava.getIdValue (tid) local ttview = luajava.getIdValue (ttid) if not tview then return 0 end if tonumber (tostring (tview : getVisibility ())) == 8.0 then tview : setVisibility (View.VISIBLE) else tview : setVisibility (View.GONE) end end function jybg(color,jiao) return luajava.loadlayout{GradientDrawable,color=color, cornerRadius=jiao} end boxes = {} boxpic = {} function changan.box (views) local tid = "box"..guid () boxpic[tid] = luajava.loadlayout { ImageView , background = getRes("right"), layout_width = "24dp" , layout_height = "24dp" , } local ttid = tid.."6" local t1id = guid () firadio = { LinearLayout , layout_width = 'fill_parent' , layout_height = "wrap_content" , layout_marginTop = "4dp" , layout_marginBottom = "3dp" , gravity = "center" , background=luajava.loadlayout { GradientDrawable , color = 0xffffffff , cornerRadius = 15 } ,padding = { "0dp","0dp","6dp","0dp" }, orientation = "vertical" , onTouch = function() visi2 (tid , ttid) visi(tid,ttid) end, LayoutTransition=layoutTransition, } if type (views [1]) == "string" or type (views [1]) == "number" then firadio [# firadio + 1] = { LinearLayout , layout_width = 'fill_parent' , layout_height = "40dp" , gravity = "center_vertical" , layout_marginTop = "2dp" , layout_marginLeft='2dp', layout_marginRight='2dp', elevation='2dp', layout_marginBottom = "2dp" , LayoutTransition=layoutTransition, onClick = function () visi2 (tid , ttid) visi (tid , ttid) end , background = luajava.loadlayout { GradientDrawable , color = 0xffffffff , cornerRadius = 15 } ,padding = { "0dp","0dp","6dp","0dp" }, { TextView , text = views [1] , textSize = "13sp" , layout_marginLeft = "10dp" , layout_width = "match_parent" , layout_weight=1, textColor = "#333333" , gravity = "left" , Typeface=font, },{ LinearLayout , padding={"0dp","0dp","10dp","0dp"}, layout_width = "30dp" , layout_height = "30dp" , gravity = "center", boxpic[tid], } } else gg.alert ("changan.box的table内第一个元素必须是string") os.exit () end radios = { LinearLayout , layout_marginLeft = "0dp" , layout_marginRight = "0dp" , orientation = "vertical" , visibility = "gone" , id = luajava.newId (tid) , padding = "0dp" , layout_width = 'fill_parent' , LayoutTransition=layoutTransition, } for i = 2 , # views do radios [# radios + 1] = views [i] end boxes[tid] = luajava.loadlayout(radios) firadio [# firadio + 1] = boxes[tid] _ENV [t1id] = luajava.loadlayout (firadio) return _ENV [t1id] end corbk = true 当前ui = 1 function 分区(x) 当前分区[当前ui]=x luajava.runUiThread(function() for i=1,分区页数[当前ui] do _ENV['menu'..当前ui..i]:setVisibility(View.GONE) _ENV['jm'..当前ui..i]:setTextColor(0xff000000) _ENV['jm'..当前ui..i]:setBackground(jmbg[当前ui][i][1]) end _ENV['menu'..当前ui..当前分区[当前ui]]:setVisibility(View.VISIBLE) _ENV['jm'..当前ui..当前分区[当前ui]]:setTextColor(0xffffffff) _ENV['jm'..当前ui..当前分区[当前ui]]:setBackground(getVerticalBG({ 0xffa2d4c6, 0xffa2d4c6 }, 15)) changan.controlBigY(_ENV['jm'..当前ui..当前分区[当前ui]],600) end) end function 切换(x) 当前ui = x luajava.runUiThread(function() if 当前分区[当前ui]==nil then 分区(1) end for i = 1,菜单页数 do _ENV["ding"..i]:setTextColor(0xff000000) _ENV["ding"..i]:setBackground(getVerticalBG({ 0xffffffff, 0xffffffff }, 15)) _ENV['dingbar'..i]:setBackground(empty) _ENV["layout"..i]:setVisibility(View.GONE) 侧边[i]:setVisibility(View.GONE) end _ENV["ding"..当前ui]:setTextColor(0xffffffff) _ENV["ding"..当前ui]:setBackground(getVerticalBG({ 0xffa2d4c6, 0xffa2d4c6 }, 15)) _ENV["layout"..当前ui]:setVisibility(View.VISIBLE) _ENV['dingbar'..当前ui]:setBackground(empty) changan.controlBigY(_ENV['dingbar'..当前ui],600) 侧边[当前ui]:setVisibility(View.VISIBLE) end) end 显示 = 0 beij2 = luajava.loadlayout({ GradientDrawable, color = "#001E1C27", cornerRadius = 10 }) function changan.text(txt,color,size) if not txt then txt = "未设置文字" end if not color then color = "#545454" end if not size then size = "12sp" end return luajava.loadlayout( { TextView, text = txt, textSize = size, textColor = color, layout_width = "match_parent", padding={'10dp','0dp','0dp','0dp'} }) end 显示 = 0 function 隐藏() already=true luajava.runUiThread(function() if tonumber(tostring(chuangk:getVisibility())) == 8.0 then control:setVisibility(View.GONE) 显示 = 1 chuangk:setVisibility(View.VISIBLE) _ENV["layout"..当前ui]:setVisibility(View.VISIBLE) dprw:setVisibility(View.VISIBLE) lingdongdaodb:setVisibility(View.VISIBLE) YoYoImpl:with("FadeIn"):duration(500):playOn(floatWindow) floatWindow:setBackground(beij) mainLayoutParams.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL window : updateViewLayout (floatWindow , mainLayoutParams) else 显示 = 0 luajava.startThread(function() luajava.runUiThread(function() YoYoImpl:with("FadeOut"):duration(500):playOn(floatWindow) end) gg.sleep(500) luajava.runUiThread(function() chuangk:setVisibility(View.GONE) floatWindow:setBackground(beij2) control:setVisibility(View.VISIBLE) _ENV["layout"..当前ui]:setVisibility(View.GONE) dprw:setVisibility(View.GONE) lingdongdaodb:setVisibility(View.GONE) mainLayoutParams.flags = LayoutParams.FLAG_NOT_FOCUSABLE window : updateViewLayout (floatWindow , mainLayoutParams) YoYoImpl:with("FadeIn"):duration(400):playOn(floatWindow) end) end) end end) end import("android.media.AudioManager") audi = context:getSystemService("audio") audiotype = { AudioManager.STREAM_ALARM, --手机闹铃的声音 AudioManager.STREAM_MUSIC, --手机音乐的声音 AudioManager.STREAM_NOTIFICATION, --系统提示的通知 AudioManager.STREAM_RING, --电话铃声的声音 AudioManager.STREAM_SYSTEM, --手机系统的声音 AudioManager.STREAM_VOICE_CALL, --语音电话的声音 AudioManager.STREAM_DTMF, --DTMF音调的声音 } yinl = {} for i = 1,#audiotype do yinl[i] = {} yinl[i].type = audiotype[i] yinl[i].min = audi:getStreamMinVolume(audiotype[i]) yinl[i].max = audi:getStreamMaxVolume(audiotype[i]) yinl[i].now = audi:getStreamVolume(audiotype[i]) end function jianting2() yinln = {} for i = 1,#audiotype do yinln[i] = {} yinln[i].type = audiotype[i] yinln[i].min = audi:getStreamMinVolume(audiotype[i]) yinln[i].max = audi:getStreamMaxVolume(audiotype[i]) yinln[i].now = audi:getStreamVolume(audiotype[i]) if yinln[i].now > yinl[i].now then audi:adjustStreamVolume(yinln[i].type,AudioManager.ADJUST_LOWER,0) gg.alert("up") elseif yinln[i].now < yinl[i].now then audi:adjustStreamVolume(yinln[i].type,AudioManager.ADJUST_RAISE,0) gg.alert("down\n"..yinln[i].now.."\n"..yinl[i].now) end end end yltype = 0 function jianting3(func) yinln = {} for i = 1,#audiotype do yinln[i] = {} yinln[i].type = audiotype[i] yinln[i].now = audi:getStreamVolume(audiotype[i]) if yinln[i].now > yinl[i].now then yinl[i].now = yinln[i].now if yltype == 1 then yltype = 0 func() end elseif yinln[i].now < yinl[i].now then yinl[i].now = yinln[i].now if yltype == 0 then yltype = 1 func() end end end end function jianting(func) yinln = {} for i = 1,#audiotype do yinln[i] = {} yinln[i].type = audiotype[i] yinln[i].now = audi:getStreamVolume(audiotype[i]) if yinln[i].now >= yinl[i].max then audi:adjustStreamVolume(yinln[i].type,AudioManager.ADJUST_LOWER,0) end if yinln[i].now > yinl[i].now then audi:setStreamVolume(yinln[i].type,yinl[i].now,0) func() end end end function guid() seed = { 'e','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' } tb = {} for i = 1,32 do table.insert(tb,seed[math.random(1,16)]) end sid = table.concat(tb) return string.format('%s%s%s%s%s', string.sub(sid,1,8), string.sub(sid,10,12), string.sub(sid,21,22)) ..string.format('%s%s%s%s%s', string.sub(sid,1,6), string.sub(sid,21,25) ) end local function exit() tuichu = 1 luajava.setFloatingWindowHide(false) luajava.post(function() window:removeView(floatWindow) for k,v in pairs(floattable) do if v==1 then window:removeView(_ENV[k]) end end end) end setExitEvent(exit) changan.controlWater = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 1, 0.8, 0.9, 1 }):setDuration(time):start() ObjectAnimator():ofFloat(control,"scaleY", { 1,0.8,0.9,1 }):setDuration(time):start() end) end changan.controlSmall = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 1, 0.7, 0.4, 0 }):setDuration(time):start() ObjectAnimator():ofFloat(control,"scaleY", { 1, 0.7, 0.4, 0 }):setDuration(time):start() end) end changan.controlBig = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 0, 0.4, 0.7, 1 }):setDuration(time):start() ObjectAnimator():ofFloat(control,"scaleY", { 0, 0.4, 0.7, 1 }):setDuration(time):start() end) end changan.controlBigY = function(control,time) luajava.runUiThread(function() import "android.animation.ObjectAnimator" ObjectAnimator():ofFloat(control,"scaleX", { 0, 0.4, 0.7, 1 }):setDuration(time):start() end) end function Island开关(name,func1,func2,nid) name = name..guid() _ENV[name] = "关" if func1 == nil then func1 = function() end end if func2 == nil then func2 = function() end end if type(func1) == "function" then return function() namers = _ENV[name] if namers ~= "开" then luajava.runUiThread(function() luajava.getIdValue(nid.."k"):setBackground(getHorizontalBG({0x00C24C38,0x00F78F5C},5)) luajava.getIdValue(nid.."g"):setBackground(getHorizontalBG({"0xffff0000","0xffff0000","0xffff0000"},5,3,"0xffff0000")) end) _ENV[name] = "开" vibra:vibrate(6) pcall(func1) else luajava.runUiThread(function() luajava.getIdValue(nid.."g"):setBackground(getHorizontalBG({0x00C24C38,0x00F78F5C},5)) luajava.getIdValue(nid.."k"):setBackground(getHorizontalBG({"0xffff0000","0xffff0000","0xffff0000"},5,3,"0xffff0000")) end) _ENV[name] = "关" vibra:vibrate(6) pcall(func2) end end end end function visi3(tid, ttid) local tview = luajava.getIdValue(tid) local ttview = luajava.getIdValue(ttid) if not tview then return 0 end if tonumber(tostring(tview:getVisibility())) == 8.0 then tview:setVisibility(View.VISIBLE) -- 设置文本视图不可见 top_music:setVisibility(View.GONE) else tview:setVisibility(View.GONE) -- 设置文本视图可见 top_music:setVisibility(View.VISIBLE) end end boxes = {} boxpic = {} function changan.lddLsland2(views) local tid = "LDDS"..guid () local ttid = tid.."6" local t1id = guid () kgid = views[1].."关" id = views[1].."id" local func = Island开关(views[1],func1,func2) ID = views[1].."id"..guid() boxpic[tid] = luajava.loadlayout { ImageView , } firadio = { LinearLayout, layout_width="match_parent", layout_height = "wrap_content" , gravity = "center", orientation = "vertical", LayoutTransition=layoutTransition, onTouch = function() visi3 (tid , ttid) end } if type (views [1]) == "string" or type (views [1]) == "number" then firadio [# firadio + 1] = { LinearLayout, layout_width = 'match_parent', layout_height = "25dp", gravity = "center", elevation = "2dp", layout_marginRight = "4dp", layout_marginLeft = "4dp", gravity = "center_vertical", LayoutTransition=layoutTransition, { LinearLayout , layout_width = 'fill_parent' , layout_height = "60dp", gravity = "center_vertical" , background =灵动岛, { TextView , id="top_music", text =views[1], textSize = "9sp" , layout_width = "90dp" , layout_weight=1, textColor = "#ffffff" , Typeface=font, gravity = "center" , }, } }else os.exit () end radios = { LinearLayout , orientation = "vertical" , visibility = "gone" , id = luajava.newId (tid) , layout_width = 'fill_parent' , elevation = "3dp", } for i = 2 , # views do radios [# radios + 1] = views [i] end boxes[tid] = luajava.loadlayout(radios) firadio [# firadio + 1] = boxes[tid] _ENV [t1id] = luajava.loadlayout ({ LinearLayout, layout_width="match_parent", layout_height = "wrap_content", gravity = "center", { LinearLayout, layout_width = 'match_parent', layout_height = "wrap_content", gravity = "center", elevation = "2dp", layout_marginRight = "4dp", layout_marginLeft = "4dp", background = luajava.loadlayout{GradientDrawable,color=灵动岛,cornerRadius=40}, firadio } }) return _ENV [t1id] end MSwitch = {} function changan.switch(name,func1,func2) ID = name..guid() MSwitch[#MSwitch+1] = ID Checked = false if name=="音量键隐藏UI" then 音量键 = true Checked = true end if name=="摇一摇隐藏UI" then 摇一摇 = true Checked = true end rest = luajava.loadlayout({ LinearLayout, layout_width="fill_parent", layout_height = "47dp", gravity = "center", { LinearLayout, layout_width = 'fill_parent', layout_height = "40dp", gravity = "center", elevation = "2dp", layout_marginRight = "4dp", layout_marginLeft = "4dp", background = luajava.loadlayout { GradientDrawable , color = 0xffffffff , cornerRadius = 15 } ,padding = { "0dp","0dp","6dp","0dp" }, { TextView, Typeface=font, gravity = "top", text = name, textColor = "0xff000000", textSize = "13sp", layout_weight = 1, layout_width = 'fill_parent', layout_marginLeft = "10dp", layout_marginRight = "20dp", }, { MaterialSwitch, id = luajava.newId(ID), layout_weight = 1, checked = Checked, layout_width = 'fill_parent', layout_height = 'wrap_content', onCheckedChange = function(compoundButton, isChecked) luajava.newThread(function() if isChecked then pcall(func1) else pcall(func2) end end):start() end } } }) return rest end import "android.graphics.Color" import "android.content.res.ColorStateList" function SliderColor(id,color1,color2,color3) id:setTrackActiveTintList(ColorStateList({{}},{color1})) id:setTrackInactiveTintList(ColorStateList({{}},{color2})) id:setThumbTintList(ColorStateList({{}},{color3})) end function SwitchColor(id,color1,color2,color3,color4) id:setTrackTintList(ColorStateList({{android.R.attr.state_checked},{}},{color1,color2})) id:setThumbTintList(ColorStateList({{android.R.attr.state_checked},{-android.R.attr.state_checked}},{color3,color4})) end changan.controlRotation9 = function(control, time,t) luajava.runUiThread(function() import "android.view.animation.Animation" import "android.animation.ObjectAnimator" xuanzhuandonghua = ObjectAnimator:ofFloat(control, "rotation", { time,t }) xuanzhuandonghua:setRepeatCount(0) xuanzhuandonghua:setRepeatMode(Animation.RESTART) xuanzhuandonghua:setDuration(400) xuanzhuandonghua:start() end) end buts={} function changan.button(txt,func,txtc) if not txt then txt = "未设置" end if not txtc then txtc="0xff000000" end local tid="Cbutton"..guid() buts[tid]=luajava.loadlayout({ LinearLayout, layout_width = 'match_parent', layout_height = "40dp", gravity = "center", { LinearLayout, layout_width = 'match_parent', layout_height = "35dp", gravity = "center", elevation = "2dp", layout_marginRight = "4dp", layout_marginLeft = "4dp", background = getButtonBG(), padding = { "0dp","0dp","6dp","0dp" }, onClick = function() changan.controlWater(buts[tid],300) luajava.newThread(func):start() end, { TextView, Typeface=font, gravity = "top", text = txt, textColor = txtc, textSize = "13sp", layout_weight = 1, layout_width = 'fill_parent', layout_marginLeft = "10dp", layout_marginRight = "20dp", }, { ImageView, layout_weight = 1, src=getRes("heir"), ColorFilter = "0xffeeeeee", layout_marginRight = "4dp", layout_height="30dp", layout_gravity = "center", layout_width="30dp", } } }) return buts[tid] end function getButtonBG() local selector = luajava.getStateListDrawable() selector:addState({ android.R.attr.state_pressed }, getVerticalBG({0x34000400,0x34000400},17)) selector:addState({ -android.R.attr.state_pressed }, getVerticalBG({0xffffffff,0xffffffff},17)) return selector end function changan.intcheck(name,func1,func2) nid = name..guid() swits[nid]={ getVerticalBG({0xff0091FF,0xff4F82FF},18), getVerticalBG({0x88161616,0x88161616},18), false, } local func = 开关5(name,func1,func2,nid) if not name then name = "未设置" end _ENV[nid.."k"]=luajava.loadlayout({ TextView, id = luajava.newId(nid.."k"), background = swits[nid][2], layout_width = 'wrap_content', layout_height = 'wrap_content', padding={"13dp","3dp","13dp","3dp"}, gravity="center", text="关", textColor="#ffffff", textSize="13sp", }) _ENV[nid.."g"]=luajava.loadlayout({LinearLayout, { TextView, layout_marginLeft="7dp", id = luajava.newId(nid.."g"), background = empty, layout_width = 'wrap_content', layout_height = 'wrap_content', padding={"13dp","3dp","13dp","3dp"}, gravity="center", text="开", textColor="#ffffff", textSize="13sp", }}) local rest = luajava.loadlayout({ FrameLayout, layout_width = 'wrap_content', layout_height = "wrap_content", layout_marginTop = "1dp", layout_marginBottom = "1dp", padding={"0dp","0dp","0dp","0dp"}, { LinearLayout, layout_marginLeft="8dp", layout_marginTop="3dp", layout_marginBottom="3dp", layout_marginRight="6dp", onClick = function() luajava.newThread(function() func() end):start() end, layout_width = 'fill_parent', layout_height = "wrap_content", gravity = "center_vertical", layout_gravity="center", --background = randbg2(), orientation="vertical", { TextView, gravity = "left", text = name, textColor="#000000", textSize = "11sp", layout_height="wrap_content", layout_width = '100dp', }, { LinearLayout, id = luajava.newId(nid), background = getVerticalBG({0xe84B7CFF,0x88974BFF},18,4,0xff69C2FF), layout_width = 'wrap_content', layout_height = 'wrap_content', padding = "5dp", _ENV[nid.."k"], _ENV[nid.."g"] }}, {LinearLayout, layout_height="15dp", layout_width="15dp", layout_marginLeft="4dp", layout_marginTop="14dp", },{LinearLayout, layout_height="20dp", layout_width="30dp", layout_gravity="right|bottom" } }) return rest end function 开关5(name,func1,func2,nid) local sname = nid local localname=name name = nid..guid() _ENV[name] = "关" if func1 == nil then func1 = "" end if func2 == nil then func2 = "" end if type(func1) == "function" then return function() namers = _ENV[name] if namers ~= "开" then swits[sname][3]=true vibra:vibrate(14) luajava.runUiThread(function() luajava.getIdValue(sname.."k"):setBackground(empty) luajava.getIdValue(sname.."g"):setBackground(swits[sname][1]) YoYoImpl:with("FadeInLeft"):duration(400):playOn(_ENV[nid.."g"]) end) _ENV[name] = "开" pcall(func1) else swits[sname][3]=false vibra:vibrate(14) luajava.runUiThread(function() luajava.getIdValue(sname.."k"):setBackground(swits[sname][2]) luajava.getIdValue(sname.."g"):setBackground(empty) YoYoImpl:with("FadeInRight"):duration(400):playOn(_ENV[nid.."k"]) end) _ENV[name] = "关" pcall(func2) end end end end import "android.graphics.Color" import "android.content.res.ColorStateList" function changan.check(cklist) if #cklist==0 then return nil end local rest = { LinearLayout, layout_width = 'match_parent', layout_height = "wrap_content", gravity = "center", orientation="vertical", } for i = 1, #cklist,2 do local tempTable = {LinearLayout, layout_width = 'match_parent', layout_height = "wrap_content", gravity = "left", orientation="horizontal" } for j = 0, 1 do if cklist[i + j] ~= nil then local name = cklist[i + j][1] local func1 = cklist[i + j][2] local func2 = cklist[i + j][3] if not name then name = "未设置" end rstt = changan.intcheck(name,func1,func2) table.insert(tempTable, rstt) else table.insert(tempTable, {LinearLayout, layout_width = 'match_parent', layout_weight=1,}) end end table.insert(rest, tempTable) end return luajava.loadlayout(rest) end function 开关(name,func1,func2) local localname=name if func1 == nil then func1 = function() end end if func2 == nil then func2 = function() end end if type(func1) == "function" then return function() namers = _ENV[name] if namers ~= "开" then _ENV[name] = "开" pcall(func1) else _ENV[name] = "关" pcall(func2) end end end end function changan.intcheck(name,func1,func2,size) nid = name..guid() lname=name local func = 开关(nid,func1,func2,lname) if not name then name = "未设置" end ID = name..guid() local rest = { LinearLayout, layout_width = 'match_parent', layout_weight=1, layout_height = "42dp", layout_marginTop = "1dp", layout_marginBottom = "1dp", padding = "1dp", { LinearLayout, padding="3dp", layout_width = 'fill_parent', layout_height = "wrap_content", gravity = "center_vertical", { CheckBox, id = luajava.newId(ID), layout_height = "32dp", layout_width = "32dp", checkedState="indeterminate", buttonTintList=ColorStateList({{android.R.attr.state_checked},{-android.R.attr.state_checked}},{0xFf000000,0xff000000},{0xff000000,0xff000000}), onClick=function() luajava.newThread(function() pcall(func) end):start() end }, { TextView, text=name, textSize = "13sp", textColor="0xff000000", layout_width = "match_parent", --layout_weight=1, } } } return rest end radiog={} function changan.radio (cklist) if not radoff then radon=getVerticalBG({0xffffffff,0xffffffff},360,20,0xFF000000) radoff=getVerticalBG({0x00ffffff,0x00ffffff},360,8,0xffaaaaaa) end local rid=guid() radiog[rid]={} rest = { LinearLayout , layout_width = 'match_parent' , layout_height = "wrap_content" , layout_marginTop = "10dp" , gravity = "top" , orientation = "vertical" , } if type (cklist [1]) == "string" then rds=2 rest [# rest + 1] = { TextView , gravity = "left" , padding="5dp", text = cklist [1] , textSize = "13sp" , textColor = "#000000" , layout_width = 'fill_parent' , layout_height = 'wrap_content' , layout_marginLeft = "10dp" , layout_marginRight = "5dp" , layout_marginTop = "0dp" , layout_marginBottom = "0dp" , } else rds=1 end local restt={ LinearLayout , layout_width = 'match_parent' , layout_height = "wrap_content" , layout_marginTop = "10dp" , gravity = "top" , orientation = "vertical" , background = getButtonBG(), padding = { "0dp","0dp","6dp","0dp" },} for i = rds , # cklist do local name = cklist [i] [1] local func = cklist [i] [2] if not name then name = "未设置" end nid = name..guid () radiog[rid][nid]=false local func = radin(rid,nid,func) local tid = nid..guid () _ENV [tid] = luajava.loadlayout ( { LinearLayout , layout_width = '250dp' , layout_height = "30dp" , layout_marginTop = "5dp" , layout_marginBottom = "15dp" , layout_marginLeft = "4dp" , layout_marginRight = "10dp" , gravity = "center_vertical" , onClick = function () changan.controlWater (_ENV [tid] , 200) func() end , { ImageView , id = luajava.newId (nid) , layout_width = '20dp' , layout_height = "20dp" , layout_marginLeft = "5dp" , layout_marginRight = "0dp" , background =radoff , } , { TextView , gravity = "top" , text = name , textSize="13sp", textColor = "#000000" , layout_width = 'wrap_content' , layout_height = 'wrap_content' , layout_marginLeft = "10dp" , layout_marginRight = "5dp" , } }) restt [# restt + 1] = _ENV [tid] end rest [# rest + 1] = restt return luajava.loadlayout (rest) end function radin(rid,nid,func) return function() for k,v in pairs(radiog[rid]) do colorvs[k]={false,"rad"} luajava.getIdValue(k):setBackground(radoff) if k==nid and v~=true then luajava.getIdValue(k):setBackground(radon) colorvs[k]={true,"rad"} v=true luajava.newThread(func):start() end end end end colorvs={} 当前ui=1 function changeColor(co) 控件颜色=co luajava.runUiThread(function() _ENV["jm"..当前ui.."t"]:setTextColor(控件颜色) _ENV["jm"..当前ui.."p"]:setColorFilter(控件颜色) luajava.getIdView("backv"):setColorFilter(控件颜色) checkbg = getShape2(45,{控件颜色,控件颜色},4,控件颜色) radon=getVerticalBG({0xffffffff,0xffffffff},360,20,控件颜色) for k,v in pairs(colorvs) do if v[1]==true then if v[2]=="switch" then luajava.getIdValue(k):setBackground(checkbg) elseif v[2]=="box" then boxpic[k]:setColorFilter(控件颜色) elseif v[2]=="txt" then luajava.getIdValue(k):setTextColor(控件颜色) elseif v[2]=="img" then luajava.getIdValue(k):setColorFilter(控件颜色) elseif v[2]=="rad" then luajava.getIdValue(k):setBackground(radon) elseif v[2]=="seek" then luajava.getIdView(k):setProgressDrawable( getVerticalBG({控件颜色,控件颜色},45)) end end end end) end currentIndex = 1 -- 定义一个函数来打印当前遍历到的table项,并更新索引位置 function 预置颜色() -- 获取当前遍历到的项 local currentItem = 颜色表[currentIndex] -- 打印当前项 changeColor(currentItem) -- 更新索引位置 currentIndex = currentIndex + 1 -- 如果索引已经达到最大值,则重置为1,回到第一项 if currentIndex > #颜色表 then currentIndex = 1 end end function changan.image(img,height,width,pad,func) if not func then func=function() end end if not pad then pad="0dp" end if not height then height="80dp" end if not width then width="80dp" end return luajava.loadlayout({ LinearLayout, layout_height="wrap_content", layout_width="fill_parent", gravity="center", { ImageView, layout_height=height, layout_width=width, padding=pad, src=获取图片(img), onClick=function() luajava.newThread(func):start() end, }}) end function changan.edit (name , hint) _ENV [name] = name..guid () if not hint then hint = name end rest = luajava.loadlayout ( { LinearLayout , layout_width = 'fill_parent' , { LinearLayout , layout_width = 'fill_parent' , layout_height = "40dp" , layout_marginTop = "5dp" , layout_marginBottom = "5dp" , layout_marginLeft = "0dp" , layout_marginRight = "0dp" , gravity = "center_vertical" , { EditText , background = luajava.loadlayout { GradientDrawable , color = 0xffffffff , cornerRadius = 15 } ,padding = { "0dp","0dp","6dp","0dp" }, gravity = "center" , hint = hint , textColor=0xff000000, textSize = "13sp", layout_height = "40dp" , layout_marginBottom = "-2dp", id=luajava.newId(_ENV [name]), layout_width = 'fill' , } } }) luajava.getIdValue(_ENV [name]):setHintTextColor(0xff545454) return rest end function changan.getedit (name) edit = tostring (luajava.getIdValue (_ENV [name]) : getText ()) return edit end function changan.setedit (name , txt) txt = tostring (txt) luajava.runUiThread (function () luajava.getIdValue (_ENV [name]) : setText (txt) end ) end chazhi={} chajv={} function changan.seek(name,bian,smin,smax,nows) _ENV[bian] =nows smin=tonumber(smin) smax=tonumber(smax) if _ENV[bian] == nil then _ENV[bian] = 1.0 end if not name then name = "未设置" end local names = name..guid() kid=guid().."sk" rest = luajava.loadlayout({ LinearLayout, layout_width = 'match_parent', layout_hight = "match_parent", { LinearLayout, id=luajava.newId(kid), layout_width = 'match_parent', layout_hight = "match_parent", layout_marginTop = "3dp", layout_marginBottom = "3dp", layout_marginLeft = "5dp" , layout_marginRight = "5dp" , gravity = "center_vertical", elevation='3dp', background = luajava.loadlayout { GradientDrawable , color = 0xffffffff , cornerRadius = 15 } ,padding = { "0dp","0dp","6dp","0dp" }, { TextView, padding={"5dp","10dp","0dp","10dp",}, gravity = "top", textColor='0xff000000', text = name, id = luajava.newId(names), layout_width = '100dp', --layout_marginLeft = "5dp", layout_marginRight = "0dp", }, { Slider, thumbHeight='23dp', trackHeight='15dp', trackStopIndicatorSize='0dp', tickVisible=false, __onFinish=function(v) v:setTrackActiveTintList(ColorStateList({{},},{0xff000000})) v:setTrackInactiveTintList(ColorStateList({{},},{0xff000000})) v:setThumbTintList(ColorStateList({{},},{0xff000000})) luajava.setInterface(v, 'addOnChangeListener', function(SeekBar, var2, var3) _ENV[bian] = var2 end) end, layout_width = 'match_parent', id=luajava.newId(name.."seekbar"), valueFrom=smin, valueTo=smax, value=nows, stepSize=1.0, } }}) luajava.getIdView(name..'seekbar'):setHaloRadius(10)--拖动时背景阴影大小 return rest end import('android.content.res.ColorStateList') local swfuncs={} swcDraw=ColorStateList({ {android.R.attr.state_checked}, {-android.R.attr.state_checked}, }, { 0xff0062ff, 0x33d7d7d7, }) swcThumb=ColorStateList({ {android.R.attr.state_checked}, {android.R.attr.state_pressed}, {-android.R.attr.state_pressed}, }, { 0xffffffff, 0xff000000, 0xff000000 }) swfuncs={} function changan.text(text,color,size,isjz) if not color then color="#161616" end if isjz then return luajava.loadlayout( { TextView, text=text, textColor=color, textSize=size, gravity="center", layout_height="wrap_content", layout_width="match_parent", autoSizeTextType="uniform", }) else return luajava.loadlayout({ TextView, text=text, textColor=color, textSize=size, layout_height="wrap_content", layout_width="match_parent", autoSizeTextType="uniform", }) end end function getShape8() jianbians = luajava.new(GradientDrawable) jianbians:setCornerRadius(10) jianbians:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbians:setColors({ 0xff000000,0xffffffff, }) jianbians:setOrientation(GradientDrawable.Orientation.BL_TR) return jianbians end pe0 = getShape8() function changan.line() return luajava.loadlayout({ LinearLayout, layout_width = "fill_parent", layout_height = "2dp", background = pe0, }) end function huoqu(txt) return table.json(gg.makeRequest(wyyget .. "song/url/v1?id=" .. txt .. "&level=standard").content) end function souyy(txt) return table.json( gg.makeRequest("http://music.163.com/api/search/get?s=" .. txt .. "&type=1&offset=0&total=true&limit=10").content ) end function develo(tabb) gg.alert(tostring(tabb)) end function develo2(tabb) gg.copyText(tostring(tabb)) end function tablekIn(tbl, key) if tbl == nil then return false end for k, v in pairs(tbl) do if k == key then return true end end return false end function getbg() jianbians = luajava.new(GradientDrawable) jianbians:setCornerRadius(5) jianbians:setGradientType(GradientDrawable.LINEAR_GRADIENT) jianbians:setColors({ 0xFFFFFFFF, 0xFFFFFFFF }) jianbians:setStroke(2, "0x11000000") --边框宽度和颜色 --elevation='3dp', selector = luajava.getStateListDrawable() selector:addState( { android.R.attr.state_pressed, }, luajava.loadlayout({ GradientDrawable, color = "#0x11000000", cornerRadius = 10, }) ) -- 点击时候的背景 selector:addState({ -android.R.attr.state_pressed, }, jianbians) -- 没点击的背景 return selector end function searchmusic() if not lasttm then lasttm = os.time() else if os.time() - lasttm <= 5 then gg.alert("请在" .. (5 - (os.time() - lasttm)) .. "秒冷却后搜索") return 0 end end if not wryt then else runnable = luajava.getRunnable(function() luajava.getIdView("搜索列表"):removeView(wyr) end) handler = luajava.getHandler() handler:post(runnable) end mustxt = luajava.getIdView("搜索"):getText() if string.len(tostring(mustxt)) <= 2 or tostring(mustxt) == nil then gg.alert("至少输入2个字符") return 0 end mustxt = tostring(mustxt) luajava.runUiThread(function() luajava.getIdView("jzz"):setVisibility(View.VISIBLE) luajava.getIdView("stxt"):setVisibility(View.GONE) end) lasttm = os.time() mustable = souyy(mustxt) mustable = mustable.result.songs -- print(mustable) musnames = {} musids = {} musarts = {} musictable = {} for k, v in pairs(mustable) do musictable[#musictable + 1] = v end -- gg.alert(tostring(mustable)) -- gg.alert(tostring(musictable)) -- gg.copyText(tostring(mustable)) -- gg.alert(#musictable) wrfun = {} wryt = { LinearLayout, id = luajava.newId("搜索结果"), layout_marginTop = "5dp", layout_width = "match_parent", layout_marginBottom = "5dp", orientation = "vertical", } for i = 1, #musictable do musid = musictable[i].id musids[#musids + 1] = musid musname = musictable[i].name if tablekIn(musictable[i], "transNames") ~= false then musname = musname .. "\n(" .. musictable[i].transNames[0] .. ")" end musnames[#musnames + 1] = musname musart = musictable[i].artists[0].name musarts[#musarts + 1] = musart wryt[#wryt + 1] = { LinearLayout, orientation = "vertical", layout_marginTop = "2dp", layout_marginBottom = "2dp", layout_marginLeft = "5dp", layout_marginRight = "5dp", layout_width = "match_parent", background = getbg(), id = luajava.newId("音" .. musid), onClick = function() thread = luajava.getThread(function() bofang(musname, musid) end) thread:start() end, { TextView, layout_marginTop = "5dp", textSize = "13sp", textColor = "#5C6BC0", layout_marginBottom = "0dp", text = musname, layout_hight = "10dp", layout_width = "match_parent", gravity = "center", }, { TextView, layout_marginTop = "0dp", textColor = "#FF7F7F7F", textSize = "11sp", layout_marginBottom = "5dp", text = musart, layout_hight = "10dp", layout_width = "match_parent", gravity = "center", }, } wryt[#wryt].onClick = function() -- (function() -- bofang(musnames[i] .. musarts[i], musids[i]) -- end):start() luajava.startThread(function() bofang(musnames[i] .. musarts[i], musids[i]) time_MUSIC:setText(musnames[i]) top_music:setText(musnames[i]) end) end end wyr = luajava.loadlayout(wryt) wyr = luajava.loadlayout(wryt) runnable = luajava.getRunnable(function() luajava.getIdView("搜索列表"):addView(wyr) end) handler = luajava.getHandler() handler:post(runnable) luajava.runUiThread(function() luajava.getIdView("jzz"):setVisibility(View.GONE) luajava.getIdView("stxt"):setVisibility(View.VISIBLE) end) end function bofang(gqmz, gdmn) luajava.runUiThread(function() luajava.getIdView("搜索结果"):setVisibility(View.GONE) luajava.getIdView("加载"):setVisibility(View.VISIBLE) end) gg.playMusic("http://music.163.com/song/media/outer/url?id=" .. gdmn .. ".mp3" or huoqu(gdmn).data[0].url) gg.sleep(2000) luajava.runUiThread(function() luajava.getIdView("加载"):setVisibility(View.GONE) luajava.getIdView("搜索结果"):setVisibility(View.VISIBLE) end) end stxt = { TextView, text = "搜索", textColor = "#FF000000", background = getbg(), layout_height = "match_parent", visibility = "visible", gravity = "center", layout_marginRight = "5dp", id = luajava.newId("stxt"), layout_marginLeft = "3dp", textSize = "13sp", padding = { "13.5dp", "0dp", "13.5dp", "0dp" }, onClick = function() thread = luajava.getThread(function() searchmusic() end) thread:start() end, } jzz = { TextView, text = "加载中", visibility = "gone", id = luajava.newId("jzz"), layout_marginLeft = "10dp", textSize = "12sp", textColor = "#000000", } jiaz = { LinearLayout, orientation = "vertical", visibility = "gone", id = luajava.newId("加载"), { TextView, text = "正在加载歌曲资源", textSize = "15sp", gravity = "center", textColor = "#000000", }, } wyylog = luajava.loadlayout({ LinearLayout, orientation = "vertical", layout_width = "match_parent", { ScrollView, layout_hight = "match_parent", gravity = "center_horizontal", layout_width = "match_parent", { LinearLayout, layout_width = "match_parent", { LinearLayout, padding = "4dp", gravity = "center", orientation = "vertical", id = luajava.newId("固定音乐"), }, id = luajava.newId("搜索列表"), orientation = "vertical", layout_width = "match_parent", gravity = "center_horizontal", { LinearLayout, orientation = "horizontal", layout_width = "match_parent", { EditText, hint = "搜索歌曲名称", textColor = "#000000", id = luajava.newId("搜索"), background = getbg(), layout_marginLeft = "5dp", focusable = true, focusableInTouchMode = true, textSize = "13sp", singleLine = "true", layout_weight = 1, gravity = "center", layout_width = "match_parent", __onFinish = function(v) v:setHintTextColor(0xff646464) v:requestFocus() end, }, stxt, jzz, }, jiaz, }, }, }) function changan.chip(cklist) if #cklist==0 then return nil end local rest = { LinearLayout, layout_width = 'fill_parent', layout_height = "wrap_content", gravity = "center", orientation="vertical", } for i = 1, #cklist,2 do local tempTable = {LinearLayout, layout_width = 'fill_parent', layout_height = "wrap_content", gravity = "left", orientation="horizontal" } for j = 0, 1 do if cklist[i + j] ~= nil then local name = cklist[i + j][1] local func1 = cklist[i + j][2] local func2 = cklist[i + j][3] if not name then name = "未设置" end rstt = changan.intchip(name,func1,func2) table.insert(tempTable, rstt) else table.insert(tempTable, {LinearLayout, layout_width = 'match_parent', layout_weight=1,}) end end table.insert(rest, tempTable) end return luajava.loadlayout(rest) end function 开关(name,func1,func2) local localname=name if func1 == nil then func1 = function() end end if func2 == nil then func2 = function() end end if type(func1) == "function" then return function() namers = _ENV[name] if namers ~= "开" then _ENV[name] = "开" pcall(func1) else _ENV[name] = "关" pcall(func2) end end end end chips={} function changan.intchip(name,func1,func2,size) nid = name..guid() lname=name local func = 开关(nid,func1,func2,lname) if not name then name = "未设置" end ID = name..guid() local rest = { LinearLayout, layout_width = 'match_parent', layout_weight=1, layout_height = "42dp", layout_marginTop = "1dp", layout_marginBottom = "1dp", padding = "1dp", { ChipGroup, padding="3dp", layout_width = 'fill_parent', layout_height = "wrap_content", gravity = "center_vertical", { Chip, layout_width = 'wrap_content', layout_height = '40dp', checked="true", text=name, setCheckable = true, setChipIconVisible = true, --显示icon setChipIcon = luajava.getBitmapDrawable(chip图片), onClick=function() luajava.newThread(function() pcall(func) end):start() end } }} return rest end function changan.tup(sview) local layout={ GridLayout, columnCount='4', layout_width='match_parent', layout_height="wrap_content", } for i=1,#sview do local nid=sview[i]["名字"]..string.randomUUID(true) layout[#layout+1]={ LinearLayout, layout_width='85dp', layout_height="85dp", onClick=function() luajava.newThread(function() if _ENV["状态"..nid] ~= true then luajava.runOnUiThread(function() luajava.getIdView(nid.."1"):setVisibility(View.GONE) luajava.getIdView(nid.."2"):setVisibility(View.VISIBLE) end) pcall(sview[i]["功能开"]) _ENV["状态"..nid]=true else luajava.runOnUiThread(function() luajava.getIdView(nid.."1"):setVisibility(View.VISIBLE) luajava.getIdView(nid.."2"):setVisibility(View.GONE) end) pcall(sview[i]["功能关"]) _ENV["状态"..nid]=false end end):start() end, { FrameLayout, layout_width='match_parent', layout_height="match_parent", layout_margin="7dp", elevation="3dp", background={GradientDrawable,color=0xffffffff,cornerRadius=20}, { ImageView, padding="10dp", layout_margin="2dp", layout_width='match_parent', layout_height="match_parent", src=sview[i]["图片"], }, { TextView, textSize="11sp", textColor="#161616", text=sview[i]["名字"], layout_marginRight="2dp", layout_marginBottom="2dp", layout_gravity="right|bottom", }, { LinearLayout, id=luajava.newId(nid.."1"), layout_margin="10dp", layout_width='7dp', layout_height="7dp", background={GradientDrawable,color=0xffFFC0CB,cornerRadius=90}, }, { ImageView, id=luajava.newId(nid.."2"), visibility="gone", gravity="center|bottom", layout_margin="2dp", layout_width='20dp', layout_height="20dp", src="https://www.cccimg.com/down.php/d56c283c98b3e594658424e0165438b0.", }, } } end return layout end local _Text = {} local text=[=[ [七月初七 淮水竹亭.] [若能转世续缘 是妖又如何?] [愿人间白首 与你共同偕老.] [满庭的芬芳 不及你一人.] [我的意中人啊 本就是个盖世英雄.] [王权无暮,再无暮年.] [我可以怀着剑心来找你了.] [天各一方 不可葬一地.] [再次戴上面具 又仿佛回到了那时.] [我最幸运的是 上天让我遇见了你.] [鞘笛相依 却无续缘.] [痴情的妖怪啊 请再等一世吧.] [苦情巨树啊 你听见了吗.] [万水千山 你愿意陪我去看吗.] [竹亭换院亭,君在心不在.] [世界就一个你 我当然要好好珍惜.] [每次有人问我幸福是什么 我脑海里总是第一个想到你.] [好想抱抱你 而不是对着手机说想你.] [心里温柔是你 目光所至是你.] [我不要很久 我要一生一世.] [或许我一个人走 更浪漫些.] [睡在梦里 醒在梦境.] [天在将黑未黑时最美 情在欲语未语时最真.] [你的出现 早就胜过了所有人 你能不能一直陪着我.] [我曾亲自埋葬我的梦想.] [是花自然香 是爱自然长.] [你若是珍惜我 这条路再累我都陪你走.] [祝好 在数不尽的明天.] [上言长相思 下言久离别.] [本是清灯不归客 却因浊酒恋红尘.] [我是木纳的树 你是自由的风.] [人生本过客 何必千千结.] [你不是他们所谓的枯枝败叶 你是我永远的春.] [花在风中摇摆不定 就像我对你的爱一样波荡起伏.] [我不是胡图图 但我只图你在我身边.] [我特别希望 和我走到最后的是你.] [讲真的 我太想和你有以后了.] [没人能代替你 即使我们好久不见.] [你走后 我的世界只有我了.] [在无数个睡不着的夜里 我都反复问自己 我真的不好吗.] [我也想往前走 但是回忆压的我频繁回头.] [不要因为遇见不对的人 而否定自己.] [或许我真的不好 就像你说的那样.] [我始终猜不透你 又或许你从未在乎过我.] [一句备注 你我的故事开始.] [有你的地方 我停留了好久.] [命好 遇见了你 谢谢你包容我的不完美.] [世界情情爱爱 何必苦苦思念.] [送妻茉莉 愿妻莫离.] [妻若不离 何需茉莉.] [我有个朋友很开朗 可她爱起人来总流泪.] [如果阴雨绵绵 那我做你的晴天.] [向来缘浅 奈何情深.] [择人先择路 爱人先爱己.] [比起失去 我更害怕别人拥有你] [爱是独特的滤镜 你在我心里最好] [那些我不肯忘的回忆 你说忘就忘.] [迷途未远 循蝴蝶之踪可抵春天.] [观我往旧 同我仰春.] [永恒的春 不朽的诗.] [最美好的年华 与你携手共度.] [愿你像晴天一样明媚 然后 好好吃饭.] [如果是你 一万遍也回头.] [喜欢晴天 喜欢今天 也喜欢有你的每一天.] [我要你风光旖旎 向春山不计苦难.] [枯木逢春 我逢你.] [你在的每一个瞬间 我都想说有你真好.] [愿多年以后感情不变 你也常在身边.] [相逢如骤雨初晴 离别恰乌云埋天.] [花落下瞬间是我和你的开始.] [即使天各一方 依然爱你如初.] [雨里的海棠真的好绝 该用什么理由分享给你.] [思恋诉予海棠 情丝化作微雨.] [海棠花开春意浓 思念随风入梦中.] [海棠无香 意为暗恋.] [你逢人就炫耀的玫瑰 枯菱时该怎么收场.] [迟早要分开的话 那相遇的意义又是什么.] [我要你风光旖旎 向春山不计苦难.] [在杂草中生长美丽的花 连杂草都是陪衬.] [ 把玫瑰藏于盛夏 把海棠藏于深秋.] [海棠花开的热烈 爱恨情仇也终于有了归属.] [海棠花未眠 城南花已开 故人已不在.] [凌晨四点我看见海棠花未眠 总觉得这时你应该在我身边.] [折枝念晚宁 海棠赠微雨.] [晚夜微雨问海棠暗香蚀骨话离殇.] [海棠不惜胭脂色 独立蒙蒙细雨中.] [与其让孤木逢春 不如成为春天让孤木永恒.] [我心永远偏向你 从你我相识那天起.] [不希望你心存烦恼 希望你天天开心.] ]=] for x in string.gmatch(text,'%[(.-)%]') do _Text[#_Text+1]=x end function TextRand() return _Text[math.random(1,#_Text)] end 灵动岛文本="祝宝宝们天天开心" tg="@MT7777NB" qun="712751351" 灵动岛=0xff000000 chip图片="/sdcard/长安/资源/1df543.png" 底部人物="https://image.rlyun.fun/view.php/2474a2261ef02c08e7e639ec26eddba3.png" 侧边背景=getVerticalBG({0xffffffff,0xffffffff},15,2,0xffa2d4c6) 菜单背景=getVerticalBG({0xffffffff,0xffffffff},0) 悬浮窗图标 = "https://image.rlyun.fun/view.php/dcf5c4b8901e6182e36fc79ab914a24a.png" function huiz()---绘制必须放在这里面 end 创建页面('防封', { changan.switch( "还jb想要防封", function() end), changan.switch( "还真jb想要", function() end), changan.switch( "小学生配要吗", function() end), changan.switch( "fvv小学生", function() end), }) 第一页 = {--创建分页,结尾调用 ['分页名字']="首页", [1]={--第一分区 ['分区名字']="防封", ['功能配置']={ changan.line(), changan.button("选择进程", function() gg.setProcessX() end), changan.switch( "防封菜单", function() 打开页面('防封') end, function() 关闭页面('防封') end), changan.text("更新内容","#A11322","20sp"), changan.text("适配最新版本","#545454","10sp"), changan.text("作者;可莉-代理;无","#A11322","20sp"), }}, [2]={--第二分区 ['分区名字']="功能", ['功能配置']={ changan.box({ "功能", changan.check({ { "人物广角", function() if gg.getRangesList("libunity.so")[1] then local t = {} t[1] = gg.getRangesList("libunity.so")[1]["start"] + 0x12E6C28; -- 数值地址:0x7556FD2C28 gg.setValues({ [1] = { address = t[1], flags = 16, value = 180, }, }) gg.toast("开启成功") end if gg.getRangesList("libunity.so")[1] then local t = {} t[1] = gg.getRangesList("libunity.so")[1]["start"] + 0x12E6C28; -- 数值地址:0x7556FD2C28 gg.setValues({ [1] = { address = t[1], flags = 16, value = 360, }, }) gg.toast("开启成功") end end }, { "人物自瞄", function() lde,mnsj={},{Dj="0.01",dv={},lz="/sdcard/.zbb",r={}}lde.gre,lde.sbr,lde.srg,lde.crs=gg.getResults,gg.searchNumber,gg.setRanges,gg.clearResults function lde.qb()table.remove(bc,#bc)table.remove(bc,#bc)end function bv(a,b)if not b then b=","end if not tostring(a):find(b)then return{a}end local tab={}local i=0 while true do j=string.find(a,b,i+1)if not j then table.insert(tab,a:sub(i+1,#a))break end table.insert(tab,a:sub(i+1,j-1)) i=j end return tab end function So(a,b,c)lde,mnsj={},{Dj="0.01",dv={},lz="/sdcard/.zbb",r={}}lde.gre,lde.sbr,lde.srg,lde.crs=gg.getResults,gg.searchNumber,gg.setRanges,gg.clearResults local csn=gg.getRanges()gg.setVisible(false)lde.srg(a[3])lde.crs()lde.sbr(a[2],a[4])local js=gg.getResultCount()local count=lde.gre(js)lde.crs()if #count~=0 then local lode,lope,lobe={},{},{}for p=1,#b do lode[p]={}for i=1,#count do lode[p][i]={}lode[p][i].address=count[i].address+b[p][2]if not b[p][3]then b[p][3]=a[4]end lode[p][i].flags=b[p][3]end lode[p]=gg.getValues(lode[p])db=bv(b[p][1],"~")if not db[2]then db[2]=db[1]end for i=1,#lode[p]do if tonumber(lode[p][i].value)>=tonumber(db[1])and tonumber(lode[p][i].value)<=tonumber(db[2])then lope[#lope+1]={}lope[#lope]=count[i]end end if #lope==0 then lde.srg(csn)if p>11 then p=11 end return"开启失败"end count=lope lope={}end for i=1,#c do for n=1,#count do lope[#lope+1]={}lope[#lope].address=count[n].address+c[i][2]if not c[i][3]then c[i][3]=a[4]end lope[#lope].flags=c[i][3]if c[i][1]then lope[#lope].value=c[i][1]else lope[#lope].value=gg.getValues(lope)[#lope].value end if c[i][4]then lobe[#lobe+1]={}lobe[#lobe]=lope[#lope]table.remove(lope,#lope)end if c[i][4]==1 then lobe[#lobe].freeze=true elseif c[i][4]==2 then lobe[#lobe].freeze=false end if c[i][5]then lobe[#lobe].name=c[i][5]end end end gg.setValues(lope)gg.addListItems(lobe)lde.srg(csn)return a[1].."开启成功!!!"else lde.srg(csn)return a[1].."开启失败!!!"end end So({"锁定瞄准",200,32,16}, {{2,-4,16},{45,-8,16},{2,-12,16},{1.25,4,16}}, {{25.0,4,16,1},{2,-20,16,1}}) end }, { "人物加速", function() if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x2327960; -- 数值地址:0x7491F47960 gg.setValues({ [1] = { address = t[1], flags = 4, value = -698416192, }, }) gg.toast("开启成功") end if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x2327960; -- 数值地址:0x7491F47960 gg.setValues({ [1] = { address = t[1], flags = 4, value = 1841112041, }, }) gg.toast("开启成功") end end }, { "近战距离", function() if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1FF140C; -- 数值地址:0x749320040C gg.setValues({ [1] = { address = t[1], flags = 4, value = 840712168, }, }) gg.toast("开启成功") end if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1FF140C; -- 数值地址:0x749320040C gg.setValues({ [1] = { address = t[1], flags = 4, value = -1186980824, }, }) gg.toast("开启成功") end end }, }), changan.switch( "近战范围", function() if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x57CF8A4; -- 数值地址:0x74953EF8A4 gg.setValues({ [1] = { address = t[1], flags = 16, value = 99999, }, }) gg.toast("开启成功") end if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x57CF8A4; -- 数值地址:0x74953EF8A4 gg.setValues({ [1] = { address = t[1], flags = 16, value = 0.6000000238418579, }, }) gg.toast("开启成功") end end ), changan.switch( "蹲下飞天", function() if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1B90A08; -- 数值地址:0x7492D9FA08 gg.setValues({ [1] = { address = t[1], flags = 4, value = 505933832, }, }) gg.toast("开启成功") end if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1B90A08; -- 数值地址:0x7492D9FA08 gg.setValues({ [1] = { address = t[1], flags = 4, value = -1119874424, }, }) gg.toast("开启成功") end end ), changan.switch( "子弹穿墙", function() if gg.getRangesList("libunity.so")[1] then local t = {} t[1] = gg.getRangesList("libunity.so")[1]["start"] + 0x1058A90; -- 数值地址:0x7A92669A90 gg.setValues({ [1] = { address = t[1], flags = 16, value = -9010873892864.0, }, }) gg.toast("开启成功") end if gg.getRangesList("libunity.so")[1] then local t = {} t[1] = gg.getRangesList("libunity.so")[1]["start"] + 0x1058A90; -- 数值地址:0x7A92669A90 gg.setValues({ [1] = { address = t[1], flags = 16, value = 9.214794447221429E-21, }, }) gg.toast("开启成功") end end ), changan.switch( "玩你妈", function() if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1C9B05C; -- 数值地址:0x7A416B005C t[2] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1C9B060; -- 数值地址:0x7A416B0060 gg.setValues({ [1] = { address = t[1], flags = 16, value = -274878955520.0, }, [2] = { address = t[2], flags = 16, value = -61301799780352.0, }, }) gg.toast("开启成功") end if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1C9B05C; -- 数值地址:0x7A416B005C t[2] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1C9B060; -- 数值地址:0x7A416B0060 gg.setValues({ [1] = { address = t[1], flags = 16, value = -8.503612446359235E-14, }, [2] = { address = t[2], flags = 16, value = -1.0098648570874713E-28, }, }) gg.toast("开启成功") end end ), changan.switch( "919191", function() if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x258FD84; -- 数值地址:0x7A41FA4D84 gg.setValues({ [1] = { address = t[1], flags = 16, value = 1.412338534968402E-13, }, }) gg.toast("开启成功") end if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x258FD84; -- 数值地址:0x7A41FA4D84 gg.setValues({ [1] = { address = t[1], flags = 16, value = -1.8317443027626723E-4, }, }) gg.toast("开启成功") end end ), changan.switch( "虚拟定人", function() if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1CE9BC0; -- 数值地址:0x7A416FEBC0 gg.setValues({ [1] = { address = t[1], flags = 16, value = 6.463059588905996E-27, }, }) gg.toast("开启成功") end if gg.getRangesList("libil2cpp.so")[1] then local t = {} t[1] = gg.getRangesList("libil2cpp.so")[1]["start"] + 0x1CE9BC0; -- 数值地址:0x7A416FEBC0 gg.setValues({ [1] = { address = t[1], flags = 16, value = -61301799780352.0, }, }) gg.toast("开启成功") end end ), }), }}, [3]={--第三分区 ['分区名字']="一群傻掉", ['功能配置']={ changan.line(), changan.radio({ { "未添加", function() end, function() end, }, }) }}, [6]={--第六分区 ['分区名字']="未设置", ['功能配置']={ },} } 第二页 = { ['分页名字']="音乐", [1]={--第一分区 ['分区名字']="搜索音乐", ['功能配置']={ changan.button("暂停", function() toMusic("已暂停") end), wyylog, },}, [2]={--第二分区 ['分区名字']="推荐音乐", ['功能配置']={ changan.switch("jing wei", function() gg.playMusic("https://c2.cloud887325.com/1755296031196/147351/5e64eb78fff553d3e082677baf56400d.mp3") end ), changan.switch("你看到的我", function() gg.playMusic("https://pan.axxpan.com/api/v3/file/get/40531/18.mp3?sign=mavg32UV9qF0CfhxzXnTKsfIcfnVgZ7Ij6mFTX6Oyuo%3D%3A0") end ), changan.switch("恋爱吗弟弟", function() gg.playMusic("https://image.rlyun.fun/view.php/87a7bcc3fdf4253be662c36532c52367.mp3") end ), changan.switch("我讨厌坏天气", function() gg.playMusic("https://image.rlyun.fun/view.php/32254110b7957af9f90c785e0d22fb21.mp3") end ), changan.switch("花海DJ", function() gg.playMusic("https://image.rlyun.fun/view.php/20ec4124157eb0d3f4e81a3146c66a4f.mp3") end ), changan.switch("囊😡囊😡囊", function() gg.playMusic("https://image.rlyun.fun/view.php/05fa0f9d6bba0f55a1011aa1984ab927.mp3") end ), changan.switch("法修散打", function() gg.playMusic("https://image.rlyun.fun/view.php/e04553fc5b654b385f7f408575d48dfd.mp3") end ), changan.switch("心要让你听见", function() gg.playMusic("https://image.rlyun.fun/view.php/2aa62a8b71f6aa992effd28d1dd46e7b.mp3") end ), changan.switch("给老婆的保证书", function() gg.playMusic("https://image.rlyun.fun/view.php/bfa7be481a6afe5ec2ac190685093711.mp3") end ), changan.switch("以下是给你们看视频的", function() gg.playMusic("") end ), changan.switch("视频1", function() gg.playVideo("https://image.rlyun.fun/view.php/f078d4459997356ab8f7d78849ba33d7.mp4") end ), changan.switch("视频2", function() gg.playVideo("https://image.rlyun.fun/view.php/d06a802ce6dad04f7ce9ebafccd21a63.mp4") end ), changan.switch("视频3", function() gg.playVideo("https://image.rlyun.fun/view.php/b4fba22805be34d576a6166361b1bb3e.mp4") end ), changan.switch("视频4", function() gg.playVideo("https://image.rlyun.fun/view.php/a453fb23d38bd18bc4c83cd7103aeabf.mp4") end ), changan.switch("视频5", function() gg.playVideo("https://image.rlyun.fun/view.php/ee3803eb9c1c1b1b2c0e2572d1f4d4fd.mp4") end ), changan.switch("视频6", function() gg.playVideo("https://image.rlyun.fun/view.php/3c4e5ccdcfe4647dd8c4ea9b78f7347f.mp4") end ), changan.switch("视频7", function() gg.playVideo("https://image.rlyun.fun/view.php/0759de0886dd3c604fe16bb12a3d3be3.mp4") end ), changan.switch("波奇酱", function() gg.playVideo("https://image.rlyun.fun/view.php/61451b8a16f2f6d053421a16c9e74cf4.mp4") end ), changan.switch("伊蕾娜", function() gg.playVideo("https://image.rlyun.fun/view.php/59c7d29ebe7c4353ac8a566221c119d0.mp4") end ), changan.switch("二乃", function() gg.playVideo("https://image.rlyun.fun/view.php/78913b08e53564ba2d04c10c741305ed.mp4") end ), changan.switch("三玖", function() gg.playVideo("https://image.rlyun.fun/view.php/0f08bd69171fb598bec0ecab08ae5027.mp4") end ), changan.switch("艾莉", function() gg.playVideo("https://image.rlyun.fun/view.php/00172c1ce8c5ccc7943a36f4ed179168.mp4") end ), changan.switch("等查吧😈", function() gg.playVideo("https://image.rlyun.fun/view.php/20760130a8d97dcc748699c26819c241.mp4") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end ), changan.switch("未添加", function() gg.playVideo("") end), },} } 第三页={ ['分页名字']="反馈", [1]={ ['分区名字']="反馈", ['功能配置']={ changan.button("加入反馈群聊", function() gg.QQgroup("操你妈了个逼的小学生") end), },} } 第四78页 = { ['分页名字']="设置", [1]={--第一分区 ['分区名字']="UI设置", ['功能配置']={ changan.switch("音量键隐藏UI", function() 音量键=true end, function() 音量键=false end), changan.switch("摇一摇隐藏UI", function() 摇一摇=true end, function() 摇一摇=false end), changan.button( "跑马灯", function() loca78l rgb_time = 0 -- 定义一个函数来生成动态 RGB 颜色 function get_dynamic_rgb() rgb_time = rgb_time + 0.016 -- 假设每帧时间间隔为 16ms (60 FPS) local r = (math.sin(rgb_time * 2.0) + 1.0) / 2.0 local g = (math.sin(rgb_time * 2.0 + 2.0 * math.pi / 3.0) + 1.0) / 2.0 local b = (math.sin(rgb_time * 2.0 + 4.0 * math.pi / 3.0) + 1.0) / 2.0 return r, g, b end -- 将 RGB 分量转换为十六进制颜色值 function rgb_to_hex(r, g, b) return string.format("0xff%02x%02x%02x", math.floor(r * 255), math.floor(g * 255), math.floor(b * 255)) end -- 主循环 while true do -- 获取动态 RGB 颜色 local r, g, b = get_dynamic_rgb() -- 将 RGB 分量转换为十六进制颜色值 local hex_color = rgb_to_hex(r, g, b) -- 将动态颜色设置到对象上 time_MUSIC:setTextColor(hex_color) top_music:setTextColor(hex_color) -- 等待一段时间 gg.sleep(16) -- 假设每帧时间间隔为 16ms (60 FPS) end end), changan.button("加入总群", function() gg.QQgroup("712751351") end), changan.button( "退出", function() tuichu=1 end), },} } changan.menu({ 第一页,--调用上边的分页配置 第二页, 第三页, 第四页 })