免su插件版(无需Thanox后台,部分系统无效,如果无效可以将代码中的19改成20再试试,如果再不行就换su版)
[
{
"name": "NoActive",
"description": "应用进入后台冻结进程",
"priority": -1,
"condition": "frontPkgChanged",
"actions": [
"if(thanos.getActivityManager().isPkgSmartStandByEnabled(to)){foreach (proc:thanos.getActivityManager().getRunningAppProcess()){if (proc.packageName==to){android.os.Process.sendSignal(proc.pid,18);}};context.getSystemService(context.APP_OPS_SERVICE).setMode(android.app.AppOpsManager.OP_WAKE_LOCK, thanos.getPkgManager().getUidForPkgName(to), to, android.app.AppOpsManager.MODE_DEFAULT);}",
"if(!thanos.getActivityManager().isPkgSmartStandByEnabled(from)){break}",
"foreach (rule : thanos.getActivityManager().getAllStandbyRules()){if(rule.startsWith(\"KEEP\") && rule.contains(from + \"/\")){break}}",
"context.getSystemService(context.APP_OPS_SERVICE).setMode(android.app.AppOpsManager.OP_WAKE_LOCK, thanos.getPkgManager().getUidForPkgName(from), from, android.app.AppOpsManager.MODE_IGNORED);",
"Thread.sleep(2000);",
"if(activity.getFrontAppPackage()!=from && !thanos.windowManager.hasVisibleWindows(from) && !thanos.getActivityManager().hasTopVisibleActivities(from)){foreach (proc:thanos.getActivityManager().getRunningAppProcess()){if (proc.packageName==from){android.os.Process.sendSignal(proc.pid,19);}}};"
]
}
]
su插件版(兼容性好)
[
{
"name": "NoActive",
"description": "应用进入后台冻结进程",
"priority": -1,
"condition": "frontPkgChanged",
"actions": [
"if(thanos.getActivityManager().isPkgSmartStandByEnabled(to)){su.exe(\"kill -CONT `pgrep -f \"+ to + \"`\");su.exe(\"appops set \" +to + \" WAKE_LOCK default\")}",
"if(!thanos.getActivityManager().isPkgSmartStandByEnabled(from)){break}",
"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) && !thanos.getActivityManager().hasTopVisibleActivities(from)){su.exe(\"kill -STOP `pgrep -f \"+ from +\"`\")};"
]
}
]
MIUI13普通版
[
{
"name": "NoActive",
"description": "应用进入后台冻结进程",
"priority": -1,
"condition": "frontPkgChanged",
"actions": [
"if(thanos.getActivityManager().isPkgSmartStandByEnabled(to)){foreach (proc:thanos.getActivityManager().getRunningAppProcess()){if (proc.packageName==to){com.miui.server.greeze.FreezeUtils.thawPid(proc.pid);}};context.getSystemService(context.APP_OPS_SERVICE).setMode(android.app.AppOpsManager.OP_WAKE_LOCK, thanos.getPkgManager().getUidForPkgName(to), to, android.app.AppOpsManager.MODE_DEFAULT);}",
"if(!thanos.getActivityManager().isPkgSmartStandByEnabled(from)){break}",
"foreach (rule : thanos.getActivityManager().getAllStandbyRules()){if(rule.startsWith(\"KEEP\") && rule.contains(from + \"/\")){break}}",
"context.getSystemService(context.APP_OPS_SERVICE).setMode(android.app.AppOpsManager.OP_WAKE_LOCK, thanos.getPkgManager().getUidForPkgName(from), from, android.app.AppOpsManager.MODE_IGNORED);",
"Thread.sleep(2000);",
"if(activity.getFrontAppPackage()!=from && !thanos.windowManager.hasVisibleWindows(from) && !thanos.getActivityManager().hasTopVisibleActivities(from)){foreach (proc:thanos.getActivityManager().getRunningAppProcess()){if (proc.packageName==from){com.miui.server.greeze.FreezeUtils.freezePid(proc.pid);}}};"
]
}
]
免su音频焦点版
[
{
"name": "NoActive",
"description": "应用进入后台冻结进程",
"priority": -1,
"condition": "frontPkgChanged",
"actions": [
"if(thanos.getActivityManager().isPkgSmartStandByEnabled(to)){foreach (proc:thanos.getActivityManager().getRunningAppProcess()){if (proc.packageName==to){android.os.Process.sendSignal(proc.pid,18);}};context.getSystemService(context.APP_OPS_SERVICE).setMode(android.app.AppOpsManager.OP_WAKE_LOCK, thanos.getPkgManager().getUidForPkgName(to), to, android.app.AppOpsManager.MODE_DEFAULT);}",
"if(!thanos.getActivityManager().isPkgSmartStandByEnabled(from)){break}",
"foreach (rule : thanos.getActivityManager().getAllStandbyRules()){if(rule.startsWith(\"KEEP\") && rule.contains(from + \"/\")){break}}",
"if(thanos.getAudioManager().hasAudioFocus(from) && thanos.getNotificationManager().hasShowingNotificationRecordsForPackage(from)){break}",
"context.getSystemService(context.APP_OPS_SERVICE).setMode(android.app.AppOpsManager.OP_WAKE_LOCK, thanos.getPkgManager().getUidForPkgName(from), from, android.app.AppOpsManager.MODE_IGNORED);",
"Thread.sleep(2000);",
"if(activity.getFrontAppPackage()!=from && !thanos.windowManager.hasVisibleWindows(from) && !thanos.getActivityManager().hasTopVisibleActivities(from)){foreach (proc:thanos.getActivityManager().getRunningAppProcess()){if (proc.packageName==from){android.os.Process.sendSignal(proc.pid,20);}}};"
]
}
]
测就完事了
大佬有扣扣群吗
我得怎么看我成功墓碑了呢
我知道了,太傻了,找个app先打开墓碑,再去关闭情景模式就知道了
能再出一个全套教程吗,目前看下来还是比较乱的
大佬请教个问题, context
.getSystemService(context.APP_OPS_SERVICE)
.setMode(
android.app.AppOpsManager.OP_WAKE_LOCK,
thanos.getPkgManager().getUidForPkgName(to),
to,
android.app.AppOpsManager.MODE_DEFAULT
);
还有
context
.getSystemService(context.APP_OPS_SERVICE)
.setMode(
android.app.AppOpsManager.OP_WAKE_LOCK,
thanos.getPkgManager().getUidForPkgName(from),
from,
android.app.AppOpsManager.MODE_IGNORED
);
这两句代码是什么意思,能帮忙解读下吗
设置appops,搭配NoANR的