Skip to content

Commit

Permalink
Deoptimize edxp manager classes
Browse files Browse the repository at this point in the history
  • Loading branch information
kotori2 committed Dec 14, 2020
1 parent 560682b commit 30fa70d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.view.View;

import com.elderdrivers.riru.edxp.config.ConfigManager;
import com.elderdrivers.riru.edxp.config.EdXpConfigGlobal;
import com.elderdrivers.riru.edxp.util.Utils;

import java.io.File;
Expand Down Expand Up @@ -81,7 +82,8 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
});
XposedHelpers.findAndHookMethod("org.meowcat.edxposed.manager.StatusInstallerFragment", classLoader, "getCanonicalFile", File.class, new XC_MethodHook() {
Class clazz = XposedHelpers.findClassIfExists("org.meowcat.edxposed.manager.StatusInstallerFragment", classLoader);
XposedHelpers.findAndHookMethod(clazz, "getCanonicalFile", File.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
File arg = (File)param.args[0];
Expand All @@ -90,6 +92,15 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
});

// deopt manager
Object method = EdXpConfigGlobal.getHookProvider().findMethodNative(
clazz, "onCreateView", "(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View;");
if (method != null) {
EdXpConfigGlobal.getHookProvider().deoptMethodNative(method);
} else {
Utils.logE("onCreateView not found");
}
} catch (Throwable t) {
Utils.logE("Could not hook Xposed Installer", t);
}
Expand Down
2 changes: 1 addition & 1 deletion edxp-core/src/main/cpp/external/yahfa/src/HookMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void *getArtMethod(JNIEnv *env, jobject jmethod) {
artMethod = (void *) (*env)->FromReflectedMethod(env, jmethod);
}

LOGI("ArtMethod: %p", artMethod);
LOGI("HookMain: getArtMethod: %p", artMethod);
return artMethod;

}
Expand Down

0 comments on commit 30fa70d

Please sign in to comment.