content: package top.niunaijun.blackbox.fake.service;
  
  import android.os.IInterface;
  
  import java.lang.reflect.Method;
  
  import black.android.hardware.display.BRDisplayManagerGlobal;
  import top.niunaijun.blackbox.fake.hook.ClassInvocationStub;
  import top.niunaijun.blackbox.fake.hook.MethodHook;
  import top.niunaijun.blackbox.fake.hook.ProxyMethod;
  import top.niunaijun.blackbox.fake.service.base.PkgMethodProxy;
  import top.niunaijun.blackbox.utils.MethodParameterUtils;
  
  /**
   * updated by alex5402 on 4/16/21.
   * * ∧＿∧
   * (`･ω･∥
   * 丶　つ０
   * しーＪ
   * TFNQw5HgWUS33Ke1eNmSFTwoQySGU7XNsK (USDT TRC20)
   */
  public class IDisplayManagerProxy extends ClassInvocationStub {
  
      public IDisplayManagerProxy() {
      }
  
      @Override
      protected Object getWho() {
          return BRDisplayManagerGlobal.get(BRDisplayManagerGlobal.get().getInstance()).mDm();
      }
  
      @Override
      protected void inject(Object baseInvocation, Object proxyInvocation) {
          Object dmg = BRDisplayManagerGlobal.get().getInstance();
          BRDisplayManagerGlobal.get(dmg)._set_mDm(getProxyInvocation());
      }
  
      @Override
      public boolean isBadEnv() {
          Object dmg = BRDisplayManagerGlobal.get().getInstance();
          IInterface mDm = BRDisplayManagerGlobal.get(dmg).mDm();
          return mDm != getProxyInvocation();
      }
  
  
      @ProxyMethod("createVirtualDisplay")
      public static class CreateVirtualDisplay extends MethodHook {
  
          @Override
          protected String getMethodName() {
              return "createVirtualDisplay";
          }
  
          @Override
          protected Object hook(Object who, Method method, Object[] args) throws Throwable {
              MethodParameterUtils.replaceFirstAppPkg(args);
              return method.invoke(who, args);
          }
      }
  }
  