无名商城论坛

搜索
查看: 464|回复: 0

[TSD/原创] GGlua第十二课判断包名,软件名那一块

[复制链接]

1万

主题

1万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
32464
发表于 2022-5-8 19:14:40 | 显示全部楼层 |阅读模式
你好!!我叫兔子--今天有别群里r智问包名以及版本的写法--我一寻思这么简单我群里人不会还不会吧--那今天就讲两个函数--gg.getTargetInfo()--获取目标信息--gg.getTargetPackage()--获取包名--版本简单写法,这里我用的是mt管理器进程local v = gg.getTargetInfo()if v.versionCode ~= 22012793 thenprint('当前版本为', v.versionCode, '请卸载重新安装')elsegg.alert("兔子最好看了")os.exit()end--延伸a=gg.getTargetInfo()b=a.versionCodec=a.labeld=a.taskAffinityprint("版本号为",b,"包名为",d,"/软件名为",c)--包名简单写法a=gg.getTargetPackage()b={"bin.mt.plus"}if a ~= b[1] thenprint("错的")elseprint("对的")end--合体后写法①(为了写帖子随手写的,只是为了便于理解,具体写法看具体)local v = gg.getTargetInfo()if v.versionCode ~= 22012793 thengg.toast('当前版本为' ..v.versionCode.. '请卸载重新安装')--这里可以用gg.alert,用if对条件1进行跳转链接elsegg.alert("兔子最好看了")enda=gg.getTargetPackage()b={"bin.mt.plus"}if a ~= b[1] then--在这里也可以直接结束进程.或跳转链接gg.alert("错的")else--这里其实不用写,也可以写直接去跳转下一步的条件gg.alert("对的")endos.exit()--[[脚本已结束::bin.mt.plus]]--②也可以只用获取信息v = gg.getTargetInfo()if v.versionCode ~= 22012793 thengg.toast('当前版本为' ..v.versionCode.. '请卸载重新安装')--这里可以用gg.alert,用if对条件1进行跳转链接elsegg.alert("兔子最好看了")enda={"bin.mt.plus"}if v.taskAffinity ~= a[1] then--在这里也可以直接结束进程.或跳转链接gg.alert("错的")else--这里其实不用写,也可以写直接去跳转下一步的条件gg.alert("对的")endos.exit()--[[脚本已结束::bin.mt.plus]]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表