类 Refine

java.lang.Object
dev.rikka.tools.refine.Refine

public final class Refine extends Object
Util class for using HiddenApiRefine plugin.
  • 构造器详细资料

    • Refine

      public Refine()
  • 方法详细资料

    • unsafeCast

      public static <T> T unsafeCast(Object obj)
      Cast an object to Refine.

      A typical usage is cast a "Hidden" class to its real type.
      For example, android.os.UserHandle is a public class, but some of its methods are hidden. Therefore, you can create a android.os.UserHandleHidden class annotated with @RefineAs(android.os.UserHandle.class)) to access them.
      When you have an instance of android.os.UserHandle and you need to access its hidden methods, at this time you can use this method to cast it to android.os.UserHandleHidden.

      类型参数:
      T - Target type
      参数:
      obj - Object
      返回:
      Object with target type
      抛出:
      ClassCastException - If HiddenApiRefine plugin is not correctly set or not working