Skip to Content
OSAndroidThanox 情景模式

Thanox 情景模式

记录一些自己写的模式,方便自己使用,尽量避开使用 su API,使用 MVEL 表达式语法 调用 Andrid SDK API。

GPS开关

[ { "name": "GPS开关", "description": "打开应用开启GPS,关闭应用关闭GPS,使用全局变量GPS,需要在全局变量添加GPS", "priority": 2, "condition": "if(frontPkgChanged && globalVarOf$GPS.contains(to)) { hw.enableLocation() } else if (pkgKilled) { for (app : globalVarOf$GPS) { if (thanos.activityManager.isPackageRunning(app)) return false; }; hw.disableLocation() }", "actions": [ "" ] } ]

常用的 GPS 应用,这里没添加微信,因为微信可能会聊天,导致打开微信聊天也有GPS。

[ "com.sankuai.meituan", "com.eg.android.AlipayGphone", "com.mcdonalds.gma.cn", "com.sankuai.meituan.takeoutnew", "me.ele", "com.yek.android.kfc.activitys", "com.autonavi.minimap" ]

监听wifi变化,打开或者关闭移动流量

[ { "name": "keepOnline", "description": "监听wifi变化,打开或者关闭移动流量", "priority": 2, "condition": "wifiStateChanged", "actions": ["if (wifiState.ssid == null) { data.setDataEnabled(true) } else { data.setDataEnabled(false) }"] } ]

使用快捷方式启动 Lsposed manager

新增一个快捷方式,名字自定义,值为 Open Lsposed manager

[ { "name": "Open Lsposed", "description": "启动 Lsposed manager", "priority": 2, "condition": "shortcutLaunched == true && shortcutValue == \"Open Lsposed manager\"", "actions": [ "context.sendBroadcast(new android.content.Intent(android.os.Build.VERSION.SDK_INT >= 29 ? \"android.telephony.action.SECRET_CODE\" : \"android.provider.Telephony.SECRET_CODE\").setData(android.net.Uri.parse(\"android_secret_code://5776733\")));" ] } ]

QQ音乐进程优化

[ { "name": "QQ音乐进程优化", "description": "优化保留QQPlayerService,杀死其他进程", "priority": 1, "condition": "frontPkgChanged == true && from == \"com.tencent.qqmusic\"", "delay": 10000, "actions": [ "if (activity.getFrontAppPackage() != \"com.tencent.qqmusic\") { for (process : thanos.activityManager.getRunningAppProcessForPackage(\"com.tencent.qqmusic\")) { if (!process.processName.contains(\"QQPlayerService\")) { thanos.activityManager.killProcessByName(process.processName); } } }" ] } ]

QQ后台进程优化

[ { "name": "QQ后台进程优化", "description": "利用Thanos自动清理QQ后台进程,保留通话和小程序,可自行更改 delay 来选择何时判定执行。", "priority": 1, "condition": "frontPkgChanged && \"com.tencent.mobileqq\".equals(from)", "delay": 10000, "actions": [ "if(activity.getFrontAppPackage()!=\"com.tencent.mobileqq\"){var allowedProcesses = [\"com.tencent.mobileqq\", \"com.tencent.mobileqq:video\", \"com.tencent.mobileqq:mini\"]; for (process : thanos.activityManager.getRunningAppProcessForPackage(\"com.tencent.mobileqq\")) { if (!allowedProcesses.contains(process.processName)) { thanos.activityManager.killProcessByName(process.processName); } };}" ] } ]

微信进程优化

[ { "name": "微信进程优化", "description": "前台应用切换时,60s杀掉微信其他进程,仅保留push进程, 但60s内回到微信啥也不杀,可自行更改 delay 来选择何时判定执行。", "priority": 2, "condition": "frontPkgChanged == true && from == \"com.tencent.mm\"", "delay": 60000, "actions": [ "if(activity.getFrontAppPackage()!=\"com.tencent.mm\"){for (process : thanos.activityManager.getRunningAppProcessForPackage(\"com.tencent.mm\")) { if (!process.processName.endsWith(\":push\")) { thanos.activityManager.killProcessByName(process.processName); } };}" ] } ]
Last updated on