Implement onSystemServerLoaded
This commit is contained in:
parent
2d0797973e
commit
1ef284f287
|
|
@ -22,12 +22,19 @@ package org.lsposed.lspd.hooker;
|
|||
|
||||
import static org.lsposed.lspd.util.Utils.logD;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.lsposed.lspd.impl.LSPosedContext;
|
||||
import org.lsposed.lspd.util.Hookers;
|
||||
|
||||
import de.robv.android.xposed.XC_MethodHook;
|
||||
import de.robv.android.xposed.XposedBridge;
|
||||
import de.robv.android.xposed.XposedInit;
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||
import io.github.libxposed.XposedModuleInterface;
|
||||
|
||||
public class StartBootstrapServicesHooker extends XC_MethodHook {
|
||||
|
||||
|
|
@ -45,6 +52,20 @@ public class StartBootstrapServicesHooker extends XC_MethodHook {
|
|||
lpparam.appInfo = null;
|
||||
lpparam.isFirstApplication = true;
|
||||
XC_LoadPackage.callAll(lpparam);
|
||||
|
||||
LSPosedContext.callOnSystemServerLoaded(new XposedModuleInterface.SystemServerLoadedParam() {
|
||||
@Override
|
||||
@NonNull
|
||||
public ClassLoader getClassLoader() {
|
||||
return HandleSystemServerProcessHooker.systemServerCL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Bundle getExtras() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
} catch (Throwable t) {
|
||||
Hookers.logE("error when hooking startBootstrapServices", t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,16 @@ public class LSPosedContext extends XposedContext {
|
|||
}
|
||||
}
|
||||
|
||||
public static void callOnSystemServerLoaded(XposedModuleInterface.SystemServerLoadedParam param) {
|
||||
for (XposedModule module : modules) {
|
||||
try {
|
||||
module.onSystemServerLoaded(param);
|
||||
} catch (Throwable t) {
|
||||
Log.e(TAG, "Error when calling onSystemServerLoaded of " + ((LSPosedContext) module.getBaseContext()).mPackageName, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean loadModule(ActivityThread at, Module module) {
|
||||
try {
|
||||
Log.d(TAG, "Loading module " + module.packageName);
|
||||
|
|
|
|||
Loading…
Reference in New Issue