content: package top.niunaijun.blackbox.fake.service;
  
  import android.content.ComponentName;
  
  import java.lang.reflect.Method;
  
  import black.android.os.BRServiceManager;
  import black.android.view.BRIAutoFillManagerStub;
  import top.niunaijun.blackbox.BlackBoxCore;
  import top.niunaijun.blackbox.app.BActivityThread;
  import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
  import top.niunaijun.blackbox.fake.hook.MethodHook;
  import top.niunaijun.blackbox.fake.hook.ProxyMethod;
  import top.niunaijun.blackbox.proxy.ProxyManifest;
  
  /**
   * updated by alex5402 on 4/8/21.
   * * ∧＿∧
   * (`･ω･∥
   * 丶　つ０
   * しーＪ
   * TFNQw5HgWUS33Ke1eNmSFTwoQySGU7XNsK (USDT TRC20)
   */
  public class IAutofillManagerProxy extends BinderInvocationStub {
      public static final String TAG = "AutofillManagerStub";
  
      public IAutofillManagerProxy() {
          super(BRServiceManager.get().getService("autofill"));
      }
  
      @Override
      protected Object getWho() {
          return BRIAutoFillManagerStub.get().asInterface(BRServiceManager.get().getService("autofill"));
      }
  
      @Override
      protected void inject(Object baseInvocation, Object proxyInvocation) {
          replaceSystemService("autofill");
      }
  
      @Override
      public boolean isBadEnv() {
          return false;
      }
  
      @ProxyMethod("startSession")
      public static class StartSession extends MethodHook {
  
          @Override
          protected Object hook(Object who, Method method, Object[] args) throws Throwable {
              if (args != null) {
                  for (int i = 0; i < args.length; i++) {
                      if (args[i] == null)
                          continue;
                      if (args[i] instanceof ComponentName) {
                          args[i] = new ComponentName(BlackBoxCore.getHostPkg(), ProxyManifest.getProxyActivity(BlackBoxCore.getAppPid()));
                      }
                  }
              }
              return method.invoke(who, args);
          }
      }
  }
  