Skip to content

Commit

Permalink
put deopt before hook to prevent reset
Browse files Browse the repository at this point in the history
  • Loading branch information
kotori2 committed Jan 16, 2021
1 parent 1e8a94e commit c75907b
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public class XposedInstallerHooker {
private static final String LEGACY_INSTALLER_PACKAGE_NAME = "de.robv.android.xposed.installer";

public static void hookXposedInstaller(final ClassLoader classLoader) {
// Deopt manager. It will not throw exception.
deoptMethod(classLoader, "org.meowcat.edxposed.manager.ModulesFragment", "onActivityCreated", Bundle.class);
deoptMethod(classLoader, "org.meowcat.edxposed.manager.ModulesFragment", "showMenu", Context.class, View.class, ApplicationInfo.class);
deoptMethod(classLoader, "org.meowcat.edxposed.manager.StatusInstallerFragment", "onCreateView", LayoutInflater.class, ViewGroup.class, Bundle.class);
deoptMethod(classLoader, "org.meowcat.edxposed.manager.util.ModuleUtil", "updateModulesList", boolean.class, View.class);

try {
final String xposedAppClass = LEGACY_INSTALLER_PACKAGE_NAME + ".XposedApp";
final Class InstallZipUtil = XposedHelpers.findClass(LEGACY_INSTALLER_PACKAGE_NAME
Expand Down Expand Up @@ -97,13 +103,6 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
});

// deopt manager
deoptMethod(classLoader, "org.meowcat.edxposed.manager.ModulesFragment", "onActivityCreated", Bundle.class);
deoptMethod(classLoader, "org.meowcat.edxposed.manager.ModulesFragment", "showMenu", Context.class, View.class, ApplicationInfo.class);
deoptMethod(classLoader, "org.meowcat.edxposed.manager.StatusInstallerFragment", "onCreateView", LayoutInflater.class, ViewGroup.class, Bundle.class);
deoptMethod(classLoader, "org.meowcat.edxposed.manager.util.ModuleUtil", "updateModulesList", boolean.class, View.class);

} catch (Throwable t) {
Utils.logE("Could not hook Xposed Installer", t);
}
Expand Down

0 comments on commit c75907b

Please sign in to comment.