在情景模式建立三个配置,写入如下策略:
#第一个策略
[
{
"name": "000 锁屏清理微信",
"description": "锁屏3s后,杀掉除com.tencent.mm和com.tencent.mm:push以外的无用进程。测试后台通话,ok",
"priority": 2,
"condition": "screenOff == true",
"delay": 3000,
"actions": [
"su.exe(\"ps | grep com.tencent.mm:|grep -v push|grep -v grep|awk '{print $2}'|xargs kill -9\")",
"ui.showShortToast('微信优能');"
]
}
]
#第二个策略
[
{
"name": "001 亮屏清理微信",
"description": "亮屏3s后,杀掉除com.tencent.mm和com.tencent.mm:push以外的无用进程。测试后台通话,ok",
"priority": 2,
"condition": "screenOn == true",
"delay": 3000,
"actions": [
"su.exe(\"ps | grep com.tencent.mm:|grep -v push|grep -v grep|awk '{print $2}'|xargs kill -9\")",
"ui.showShortToast('微信优能');"
]
}
]
#第三个策略
[
{
"name": "002 微信优能",
"description": "离开微信时,杀掉除com.tencent.mm和com.tencent.mm:push以外的无用进程。测试后台通话,ok",
"priority": 2,
"condition": "frontPkgChanged == true && from == 'com.tencent.mm'",
"delay": 3000,
"actions": [
"su.exe(\"ps | grep com.tencent.mm:|grep -v push|grep -v grep|awk '{print $2}'|xargs kill -9\")",
"ui.showShortToast('微信优能');"
]
}
]
thanox会在亮屏、锁屏、及离开微信的时候杀死微信除主进程和通知之外的所有进程。