类 XposedInterfaceWrapper

java.lang.Object
io.github.libxposed.api.XposedInterfaceWrapper
所有已实现的接口:
XposedInterface
直接已知子类:
XposedModule

public class XposedInterfaceWrapper extends Object implements XposedInterface
Wrapper of XposedInterface used by modules to shield framework implementation details.
  • 构造器详细资料

    • XposedInterfaceWrapper

      public XposedInterfaceWrapper()
  • 方法详细资料

    • attachFramework

      public final void attachFramework(@NonNull XposedInterface base)
      Attaches the framework interface to the module. Modules should never call this method.
      参数:
      base - The framework interface
    • getApiVersion

      public final int getApiVersion()
      从接口复制的说明: XposedInterface
      Gets the runtime Xposed API version. Framework implementations must not override this method.
      指定者:
      getApiVersion 在接口中 XposedInterface
    • getFrameworkName

      @NonNull public final String getFrameworkName()
      从接口复制的说明: XposedInterface
      Gets the Xposed framework name of current implementation.
      指定者:
      getFrameworkName 在接口中 XposedInterface
    • getFrameworkVersion

      @NonNull public final String getFrameworkVersion()
      从接口复制的说明: XposedInterface
      Gets the Xposed framework version of current implementation.
      指定者:
      getFrameworkVersion 在接口中 XposedInterface
    • getFrameworkVersionCode

      public final long getFrameworkVersionCode()
      从接口复制的说明: XposedInterface
      Gets the Xposed framework version code of current implementation.
      指定者:
      getFrameworkVersionCode 在接口中 XposedInterface
    • getFrameworkProperties

      public final long getFrameworkProperties()
      从接口复制的说明: XposedInterface
      Gets the Xposed framework properties. Properties with prefix PROP_RT_ may change among launches.
      指定者:
      getFrameworkProperties 在接口中 XposedInterface
    • hook

      @NonNull public final XposedInterface.HookBuilder hook(@NonNull Executable origin)
      从接口复制的说明: XposedInterface
      Hook a method / constructor.
      指定者:
      hook 在接口中 XposedInterface
      参数:
      origin - The executable to be hooked
      返回:
      The builder for the hook
    • hookClassInitializer

      @NonNull public final XposedInterface.HookBuilder hookClassInitializer(@NonNull Class<?> origin)
      从接口复制的说明: XposedInterface
      Hook the static initializer (<clinit>) of a class.

      The static initializer is treated as a regular static void() method with no parameters. Accordingly, in the XposedInterface.Chain passed to the hooker:

      Note: If the class is already initialized, the hook will never be called.

      指定者:
      hookClassInitializer 在接口中 XposedInterface
      参数:
      origin - The class whose static initializer is to be hooked
      返回:
      The builder for the hook
    • deoptimize

      public final boolean deoptimize(@NonNull Executable executable)
      从接口复制的说明: XposedInterface
      Deoptimizes a method / constructor in case hooked callee is not called because of inline.

      By deoptimizing the method, the runtime will fall back to calling all callees without inlining. For example, when a short hooked method B is invoked by method A, the callback to B is not invoked after hooking, which may mean A has inlined B inside its method body. To force A to call the hooked B, you can deoptimize A and then your hook can take effect.

      Generally, you need to find all the callers of your hooked callee, and that can hardly be achieved (but you can still search all callers by using DexKit). Use this method if you are sure the deoptimized callers are all you need. Otherwise, it would be better to change the hook point or to deoptimize the whole app manually (by simply reinstalling the app without uninstall).

      指定者:
      deoptimize 在接口中 XposedInterface
      参数:
      executable - The method / constructor to deoptimize
      返回:
      Indicate whether the deoptimizing succeed or not
    • getInvoker

      @NonNull public final XposedInterface.Invoker<?,Method> getInvoker(@NonNull Method method)
      从接口复制的说明: XposedInterface
      Get a method invoker for the given method. Invocations through invokers will bypass access checks. The default type of the invoker is XposedInterface.Invoker.Type.Chain.FULL.
      指定者:
      getInvoker 在接口中 XposedInterface
      参数:
      method - The method to get the invoker for
      返回:
      The method invoker
    • getInvoker

      @NonNull public final <T> XposedInterface.CtorInvoker<T> getInvoker(@NonNull Constructor<T> constructor)
      从接口复制的说明: XposedInterface
      Get a constructor invoker for the given constructor. Invocations through invokers will bypass access checks. The default type of the invoker is XposedInterface.Invoker.Type.Chain.FULL.
      指定者:
      getInvoker 在接口中 XposedInterface
      类型参数:
      T - The type of the constructor
      参数:
      constructor - The constructor to get the invoker for
      返回:
      The constructor invoker
    • log

      public final void log(int priority, @Nullable String tag, @NonNull String msg)
      从接口复制的说明: XposedInterface
      Writes a message to the Xposed log.
      指定者:
      log 在接口中 XposedInterface
      参数:
      priority - The log priority, see Log
      tag - The log tag
      msg - The log message
    • log

      public final void log(int priority, @Nullable String tag, @NonNull String msg, @Nullable Throwable tr)
      从接口复制的说明: XposedInterface
      Writes a message to the Xposed log.
      指定者:
      log 在接口中 XposedInterface
      参数:
      priority - The log priority, see Log
      tag - The log tag
      msg - The log message
      tr - An exception to log
    • getRemotePreferences

      @NonNull public final SharedPreferences getRemotePreferences(@NonNull String name)
      从接口复制的说明: XposedInterface
      Gets remote preferences stored in Xposed framework. Note that those are read-only in hooked apps.
      指定者:
      getRemotePreferences 在接口中 XposedInterface
      参数:
      name - Group name
      返回:
      The preferences
    • getModuleApplicationInfo

      @NonNull public final ApplicationInfo getModuleApplicationInfo()
      从接口复制的说明: XposedInterface
      Gets the application info of the module.
      指定者:
      getModuleApplicationInfo 在接口中 XposedInterface
    • listRemoteFiles

      @NonNull public final String[] listRemoteFiles()
      从接口复制的说明: XposedInterface
      List all files in the module's shared data directory.
      指定者:
      listRemoteFiles 在接口中 XposedInterface
      返回:
      The file list
    • openRemoteFile

      @NonNull public final ParcelFileDescriptor openRemoteFile(@NonNull String name) throws FileNotFoundException
      从接口复制的说明: XposedInterface
      Open a file in the module's shared data directory. The file is opened in read-only mode.
      指定者:
      openRemoteFile 在接口中 XposedInterface
      参数:
      name - File name, must not contain path separators and . or ..
      返回:
      The file descriptor
      抛出:
      FileNotFoundException - If the file does not exist or the path is forbidden