合并前
冻结
[
{
"name": "冻结进程",
"description": "当应用进入后台时冻结进程",
"priority": -1,
"condition": "frontPkgChanged && thanos.getActivityManager().isPkgSmartStandByEnabled(from)",
"actions": [
"foreach (rule : thanos.getActivityManager().getAllStandbyRules()){if(rule.startsWith(\"KEEP\") && rule.contains(from + \"/\")){break}}",
"su.exe(\"appops set \" + from + \" WAKE_LOCK ignore\");",
"Thread.sleep(2000);",
"if(activity.getFrontAppPackage()!=from && !thanos.windowManager.hasVisibleWindows(from)){su.exe(\"kill -STOP `pgrep -f \"+ from +\"`\")};"
]
}
]
解冻
[
{
"name": "解冻进程",
"description": "当应用进入前台时解冻进程",
"priority": 1,
"condition": "frontPkgChanged && thanos.getActivityManager().isPkgSmartStandByEnabled(to)",
"actions": [
"su.exe(\"kill -CONT `pgrep -f \"+ to + \"`\");",
"su.exe(\"appops set \" +to + \" WAKE_LOCK default\");"
]
}
]