Fix parasitic manager hooker in 8.1 (#1724)
This commit is contained in:
parent
3fdc4e51c9
commit
bc8b4c69a5
|
|
@ -116,6 +116,7 @@ public class ParasiticManagerHooker {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var activityClientRecordClass = XposedHelpers.findClass("android.app.ActivityThread$ActivityClientRecord", ActivityThread.class.getClassLoader());
|
||||||
var activityHooker = new XC_MethodHook() {
|
var activityHooker = new XC_MethodHook() {
|
||||||
@Override
|
@Override
|
||||||
protected void beforeHookedMethod(MethodHookParam param) {
|
protected void beforeHookedMethod(MethodHookParam param) {
|
||||||
|
|
@ -141,19 +142,20 @@ public class ParasiticManagerHooker {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void afterHookedMethod(MethodHookParam param) {
|
protected void afterHookedMethod(MethodHookParam param) {
|
||||||
var aInfo = (ActivityInfo) XposedHelpers.getObjectField(param.thisObject, "activityInfo");
|
if (activityClientRecordClass.isInstance(param.thisObject)) {
|
||||||
Hookers.logD("loading state of " + aInfo.name);
|
var aInfo = (ActivityInfo) XposedHelpers.getObjectField(param.thisObject, "activityInfo");
|
||||||
states.computeIfPresent(aInfo.name, (k, v) -> {
|
Hookers.logD("loading state of " + aInfo.name);
|
||||||
XposedHelpers.setObjectField(param.thisObject, "state", v);
|
states.computeIfPresent(aInfo.name, (k, v) -> {
|
||||||
return v;
|
XposedHelpers.setObjectField(param.thisObject, "state", v);
|
||||||
});
|
return v;
|
||||||
persistentStates.computeIfPresent(aInfo.name, (k, v) -> {
|
});
|
||||||
XposedHelpers.setObjectField(param.thisObject, "persistentState", v);
|
persistentStates.computeIfPresent(aInfo.name, (k, v) -> {
|
||||||
return v;
|
XposedHelpers.setObjectField(param.thisObject, "persistentState", v);
|
||||||
});
|
return v;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var activityClientRecordClass = XposedHelpers.findClass("android.app.ActivityThread$ActivityClientRecord", ActivityThread.class.getClassLoader());
|
|
||||||
XposedBridge.hookAllConstructors(activityClientRecordClass, activityHooker);
|
XposedBridge.hookAllConstructors(activityClientRecordClass, activityHooker);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O_MR1) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O_MR1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue