Skip to content

Commit

Permalink
Update Hook
Browse files Browse the repository at this point in the history
  • Loading branch information
HChenX committed Aug 24, 2023
1 parent fe6c99a commit db53ab8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/src/main/java/Com/HChen/Hook/SystemService/SystemService.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ protected void before(XC_MethodHook.MethodHookParam param) {
}
);//

/*禁用killPids*/
findAndHookMethod("com.android.server.am.ActivityManagerService",
/*禁用killPids_此方法牵扯过多且不适合Hook。方法可用于处理表面内存不足的情况,但这是合理的*/
/*findAndHookMethod("com.android.server.am.ActivityManagerService",
"killPids", int[].class, String.class, boolean.class,
new HookAction() {
@Override
Expand All @@ -31,7 +31,7 @@ protected void before(XC_MethodHook.MethodHookParam param) {
param.setResult(true);
}
}
);
);*/

/*禁止killProcessesBelowForeground*/
/*findAndHookMethod("com.android.server.am.ActivityManagerService",
Expand All @@ -57,8 +57,8 @@ protected void before(XC_MethodHook.MethodHookParam param) {
}
);

/*禁止清理空进程_待考虑*/
findAndHookMethod("com.android.server.am.ActivityManagerService",
/*禁止清理空进程_空进程不包含任何活动,清理是合理的*/
/*findAndHookMethod("com.android.server.am.ActivityManagerService",
"trimApplicationsLocked", boolean.class, String.class,
new HookAction() {
@Override
Expand All @@ -67,7 +67,7 @@ protected void before(XC_MethodHook.MethodHookParam param) {
param.setResult(null);
}
}
);
);*/

/*禁止空闲清理*/
findAndHookMethod("com.android.server.am.ActivityManagerService",
Expand All @@ -92,8 +92,8 @@ protected void before(XC_MethodHook.MethodHookParam param) {
}
);

/*禁止停止后台空闲服务*/
findAndHookMethod("com.android.server.am.ActiveServices",
/*禁止停止后台空闲服务_与getAppStartModeLOSP的Hook重复*/
/* findAndHookMethod("com.android.server.am.ActiveServices",
"stopInBackgroundLocked", int.class,
new HookAction() {
@Override
Expand All @@ -102,7 +102,7 @@ protected void before(XC_MethodHook.MethodHookParam param) {
param.setResult(null);
}
}
);//
);//*/

/*禁止停止后台受限和缓存的app*/
hookAllMethods("com.android.server.am.ProcessList",
Expand Down Expand Up @@ -317,7 +317,7 @@ protected void after(MethodHookParam param) {
}
);//*/

/*拒绝重新设置压力等*/
/*拒绝根据压力trim进程*/
findAndHookMethod("com.android.server.am.AppProfiler"
, "updateLowMemStateLSP", int.class, int.class, int.class,
new HookAction() {
Expand Down

0 comments on commit db53ab8

Please sign in to comment.