Object Patcher

  • All Implemented Interfaces:

    
    public class Patcher
    
                        

    Helper for applying Xposed method hooks.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static Patcher INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static XC_MethodHook.Unhook addPatch(Member member, XC_MethodHook hook) Hook the given reflective member (method or constructor) with the provided hook.
      final static XC_MethodHook.Unhook addPatch(Class<?> clazz, String methodName, Array<Class<?>> paramTypes, XC_MethodHook hook) Hook the method with the given name on the specified class.
      final static XC_MethodHook.Unhook addPatch(Class<?> clazz, String methodName, XC_MethodHook hook) Hook the method with the given name on the specified class.
      final static XC_MethodHook.Unhook addPatch(String forClass, String methodName, Array<Class<?>> paramTypes, XC_MethodHook hook) Load the class by name and hook the specified method.
      final static XC_MethodHook.Unhook addPatch(String forClass, String methodName, XC_MethodHook hook) Load the class by name and hook the specified method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • addPatch

         final static XC_MethodHook.Unhook addPatch(Member member, XC_MethodHook hook)

        Hook the given reflective member (method or constructor) with the provided hook.

        Parameters:
        member - the method or constructor to hook
        hook - the XC_MethodHook to apply
        Returns:

        an Unhook that can remove the applied hook

      • addPatch

        @JvmOverloads() final static XC_MethodHook.Unhook addPatch(Class<?> clazz, String methodName, Array<Class<?>> paramTypes, XC_MethodHook hook)

        Hook the method with the given name on the specified class.

        Parameters:
        clazz - the class containing the method
        methodName - the name of the method to hook
        paramTypes - the parameter types (defaults to none)
        hook - the XC_MethodHook to apply
        Returns:

        an Unhook that can remove the applied hook, or null on failure

      • addPatch

        @JvmOverloads() final static XC_MethodHook.Unhook addPatch(Class<?> clazz, String methodName, XC_MethodHook hook)

        Hook the method with the given name on the specified class.

        Parameters:
        clazz - the class containing the method
        methodName - the name of the method to hook
        hook - the XC_MethodHook to apply
        Returns:

        an Unhook that can remove the applied hook, or null on failure

      • addPatch

        @JvmOverloads() final static XC_MethodHook.Unhook addPatch(String forClass, String methodName, Array<Class<?>> paramTypes, XC_MethodHook hook)

        Load the class by name and hook the specified method.

        Parameters:
        forClass - the full name of the class to load (e.g.
        methodName - the name of the method to hook
        paramTypes - the parameter types (defaults to none)
        hook - the XC_MethodHook to apply
        Returns:

        an Unhook that can remove the applied hook, or null on failure

      • addPatch

        @JvmOverloads() final static XC_MethodHook.Unhook addPatch(String forClass, String methodName, XC_MethodHook hook)

        Load the class by name and hook the specified method.

        Parameters:
        forClass - the full name of the class to load (e.g.
        methodName - the name of the method to hook
        hook - the XC_MethodHook to apply
        Returns:

        an Unhook that can remove the applied hook, or null on failure