Fix SystemServer hook not working

This commit is contained in:
solohsu 2019-06-05 02:07:58 +08:00
parent 54f5c435c5
commit 692d43cc57
4 changed files with 9 additions and 10 deletions

View File

@ -3,7 +3,7 @@ package com.elderdrivers.riru.edxp._hooker.yahfa;
import android.app.ActivityThread;
import com.elderdrivers.riru.common.KeepMembers;
import com.elderdrivers.riru.edxp._hooker.impl.OneplusWorkaround;
import com.elderdrivers.riru.edxp._hooker.impl.SystemMain;
import de.robv.android.xposed.XC_MethodHook;
@ -13,10 +13,8 @@ public class SystemMainHooker implements KeepMembers {
public static String methodName = "systemMain";
public static String methodSig = "()Landroid/app/ActivityThread;";
public static ClassLoader systemServerCL;
public static ActivityThread hook() throws Throwable {
final XC_MethodHook methodHook = new OneplusWorkaround();
final XC_MethodHook methodHook = new SystemMain();
final XC_MethodHook.MethodHookParam param = new XC_MethodHook.MethodHookParam();
param.thisObject = null;
param.args = new Object[]{};

View File

@ -16,6 +16,7 @@ import com.elderdrivers.riru.edxp._hooker.yahfa.SystemMainHooker;
import com.elderdrivers.riru.edxp.core.yahfa.HookMain;
import com.elderdrivers.riru.edxp.entry.yahfa.AppBootstrapHookInfo;
import com.elderdrivers.riru.edxp.entry.yahfa.SysBootstrapHookInfo;
import com.elderdrivers.riru.edxp.entry.yahfa.SysInnerHookInfo;
import com.elderdrivers.riru.edxp.entry.yahfa.WorkAroundHookInfo;
import com.elderdrivers.riru.edxp.util.Utils;
@ -125,13 +126,13 @@ public abstract class BaseRouter implements Router {
ClassLoader classLoader = BaseRouter.class.getClassLoader();
if (useXposedApi) {
XposedHelpers.findAndHookMethod(StartBootstrapServicesHooker.className,
SystemMainHooker.systemServerCL,
SystemMain.systemServerCL,
StartBootstrapServicesHooker.methodName, new StartBootstrapServices());
} else {
HookMain.doHookDefault(
classLoader,
SystemMainHooker.systemServerCL,
SystemMainHooker.class.getName());
SystemMain.systemServerCL,
SysInnerHookInfo.class.getName());
}
}

View File

@ -3,10 +3,10 @@ import org.gradle.internal.os.OperatingSystem
apply plugin: 'com.android.library'
version "v0.4.3.3_alpha"
version "v0.4.3.4_alpha"
ext {
versionCode = "4330"
versionCode = "4340"
module_name = "EdXposed"
jar_dest_dir = "${projectDir}/template_override/system/framework/"
is_windows = OperatingSystem.current().isWindows()

View File

@ -1,6 +1,6 @@
#!/system/bin/sh
EDXP_VERSION="0.4.3.3_alpha (4330)"
EDXP_VERSION="0.4.3.4_alpha (4340)"
ANDROID_SDK=`getprop ro.build.version.sdk`
BUILD_DESC=`getprop ro.build.description`
PRODUCT=`getprop ro.build.product`