-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathForceIdle.jsons
82 lines (81 loc) · 4.77 KB
/
ForceIdle.jsons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[
{
"name": "ForceIdle: continue App",
"description": "切回前台,取消压制",
"priority": 1,
"condition": "frontPkgChanged == true && globalVarOf$pause.contains(to)",
"actions": [
"su.exe(\"pgrep -f \"+ to+ \" | while read pid; do echo 0 > /sys/fs/cgroup/uid_\"+thanos.getPkgManager().getUidForPkgName(to)+\"/pid_$pid/cgroup.freeze; done\");",
"if(thanos.getActivityManager().isPkgSmartStandByEnabled(to)==true){thanos.getActivityManager().setPkgSmartStandByEnabled(to,false)};",
"thanos.getActivityManager().deleteStartRule(\"DENY * \"+to);",
"su.exe(\"appops set \" +to + \" RUN_ANY_IN_BACKGROUND default\");",
"su.exe(\"appops set \" +to + \" RUN_IN_BACKGROUND default\");",
"su.exe(\"appops set \" +to + \" WAKE_LOCK default\");",
"su.exe(\"appops set \" +to + \" BLUETOOTH_SCAN default\");",
"su.exe(\"appops set \" +to + \" BLUETOOTH_CONNECT default\");"
]
}
]
[
{
"name": "ForceIdle: pause App",
"description": "切到后台,自动压制",
"priority": 1,
"condition": "frontPkgChanged == true && globalVarOf$pause.contains(from)",
"actions": [
"if(thanos.getActivityManager().isStartRuleEnabled==false){thanos.getActivityManager().setStartRuleEnabled(true)};",
"thanos.getActivityManager().addStartRule(\"DENY * \"+from)",
"su.exe(\"appops set \" +from + \" RUN_ANY_IN_BACKGROUND ignore\");",
"su.exe(\"appops set \" +from + \" RUN_IN_BACKGROUND ignore\");",
"su.exe(\"appops set \" +from + \" WAKE_LOCK ignore\");",
"su.exe(\"appops set \" +from + \" BLUETOOTH_SCAN deny\");",
"su.exe(\"appops set \" +from + \" BLUETOOTH_CONNECT deny\");",
"su.exe(\"am set-standby-bucket \" +from +\" restricted\");",
"if(activity.isInactive(from)==false){activity.setInactive(from)};",
"do{thanos.getActivityManager().idlePackage(from)}until(thanos.getActivityManager().isPackageIdle(from)==true || activity.getFrontAppPackage()==from);",
"actor.delayed(5000,\"if(activity.getFrontAppPackage()!=from){su.exe(\\\"pgrep -f \\\"+ from+ \\\" | while read pid; do echo 1 > /sys/fs/cgroup/uid_\\\"+thanos.getPkgManager().getUidForPkgName(from)+\\\"/pid_$pid/cgroup.freeze; done\\\")}\");"
]
}
]
[
{
"name": "ForceIdle: pause App",
"description": "切到后台,自动压制",
"priority": 1,
"condition": "frontPkgChanged == true && globalVarOf$pause.contains(from)",
"actions": [
"if(thanos.getActivityManager().isStartRuleEnabled==false){thanos.getActivityManager().setStartRuleEnabled(true)};",
"thanos.getActivityManager().addStartRule(\"DENY * \"+from)",
"su.exe(\"appops set \" +from + \" RUN_ANY_IN_BACKGROUND ignore\");",
"su.exe(\"appops set \" +from + \" RUN_IN_BACKGROUND ignore\");",
"su.exe(\"appops set \" +from + \" WAKE_LOCK ignore\");",
"su.exe(\"appops set \" +from + \" BLUETOOTH_SCAN deny\");",
"su.exe(\"appops set \" +from + \" BLUETOOTH_CONNECT deny\");",
"su.exe(\"am set-standby-bucket \" +from +\" restricted\");",
"if(activity.isInactive(from)==false){activity.setInactive(from)};",
"do{thanos.getActivityManager().idlePackage(from)}until(thanos.getActivityManager().isPackageIdle(from)==true || activity.getFrontAppPackage()==from);",
"actor.delayed(5000,\"if(activity.getFrontAppPackage()!=from){su.exe(\\\"pgrep -f \\\"+ from+ \\\" | while read pid; do echo 1 > /sys/fs/cgroup/uid_\\\"+thanos.getPkgManager().getUidForPkgName(from)+\\\"/pid_$pid/cgroup.freeze; done\\\")}\");"
]
}
]
[
{
"name": "ForceIdle: pause App",
"description": "切到后台,自动压制",
"priority": 1,
"condition": "frontPkgChanged == true && globalVarOf$pause.contains(from)",
"actions": [
"if(thanos.getActivityManager().isStartRuleEnabled==false){thanos.getActivityManager().setStartRuleEnabled(true)};",
"thanos.getActivityManager().addStartRule(\"DENY * \"+from)",
"su.exe(\"appops set \" +from + \" RUN_ANY_IN_BACKGROUND ignore\");",
"su.exe(\"appops set \" +from + \" RUN_IN_BACKGROUND ignore\");",
"su.exe(\"appops set \" +from + \" WAKE_LOCK ignore\");",
"su.exe(\"appops set \" +from + \" BLUETOOTH_SCAN deny\");",
"su.exe(\"appops set \" +from + \" BLUETOOTH_CONNECT deny\");",
"su.exe(\"am set-standby-bucket \" +from +\" restricted\");",
"if(activity.isInactive(from)==false){activity.setInactive(from)};",
"do{thanos.getActivityManager().idlePackage(from)}until(thanos.getActivityManager().isPackageIdle(from)==true || activity.getFrontAppPackage()==from);",
"actor.delayed(5000,\"if(activity.getFrontAppPackage()!=from){su.exe(\\\"pgrep -f \\\"+ from+ \\\" | while read pid; do echo 1 > /sys/fs/cgroup/uid_\\\"+thanos.getPkgManager().getUidForPkgName(from)+\\\"/pid_$pid/cgroup.freeze; done\\\")}\");"
]
}
]