Codota Logo
ArrayUtils.indexOfFirst
Code IndexAdd Codota to your IDE (free)

How to use
indexOfFirst
method
in
com.lody.virtual.helper.utils.ArrayUtils

Best Java code snippets using com.lody.virtual.helper.utils.ArrayUtils.indexOfFirst (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: android-hacker/VirtualXposed

public static <T> T getFirstParam(Object[] args, Class<T> tClass) {
  if (args == null) {
    return null;
  }
  int index = ArrayUtils.indexOfFirst(args, tClass);
  if (index != -1) {
    return (T) args[index];
  }
  return null;
}
origin: android-hacker/VirtualXposed

@SuppressWarnings("unchecked")
public static <T> T getFirst(Object[] args, Class<?> clazz) {
  int index = indexOfFirst(args, clazz);
  if (index != -1) {
    return (T) args[index];
  }
  return null;
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int editorInfoIndex = ArrayUtils.indexOfFirst(args, EditorInfo.class);
    if (editorInfoIndex != -1) {
      EditorInfo attribute = (EditorInfo) args[editorInfoIndex];
      attribute.packageName = getHostPkg();
    }
    return method.invoke(who, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WindowManager.LayoutParams.class);
    if (index != -1) {
      WindowManager.LayoutParams attrs = (WindowManager.LayoutParams) args[index];
      if (attrs != null) {
        attrs.packageName = getHostPkg();
      }
    }
    return method.invoke(who, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public boolean beforeCall(Object who, Method method, Object... args) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && args[0] instanceof String) {
      args[0] = getHostPkg();
    }
    int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
    if (index >= 0) {
      args[index] = null;
    }
    return true;
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
    if (index >= 0) {
      args[index] = null;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

public static String replaceFirstAppPkg(Object[] args) {
  if (args == null) {
    return null;
  }
  int index = ArrayUtils.indexOfFirst(args, String.class);
  if (index != -1) {
    String pkg = (String) args[index];
    args[index] = VirtualCore.get().getHostPkg();
    return pkg;
  }
  return null;
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int enableIndex = ArrayUtils.indexOfFirst(args, Boolean.class);
    boolean enable = (boolean) args[enableIndex];
    VNotificationManager.get().setNotificationsEnabledForPackage(pkg, enable, getAppUserId());
    return 0;
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int notificationIndex = ArrayUtils.indexOfFirst(args, Notification.class);
    int idIndex = ArrayUtils.indexOfFirst(args, Integer.class);
    int id = (int) args[idIndex];
    id = VNotificationManager.get().dealNotificationId(id, pkg, null, getAppUserId());
    args[idIndex] = id;
    Notification notification = (Notification) args[notificationIndex];
    if (!VNotificationManager.get().dealNotification(id, notification, pkg)) {
      return 0;
    }
    VNotificationManager.get().addNotification(id, null, pkg, getAppUserId());
    args[0] = getHostPkg();
    return method.invoke(who, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int notificationIndex = ArrayUtils.indexOfFirst(args, Notification.class);
    int idIndex = ArrayUtils.indexOfFirst(args, Integer.class);
    int tagIndex = (Build.VERSION.SDK_INT >= 18 ? 2 : 1);
    int id = (int) args[idIndex];
    String tag = (String) args[tagIndex];
    id = VNotificationManager.get().dealNotificationId(id, pkg, tag, getAppUserId());
    tag = VNotificationManager.get().dealNotificationTag(id, pkg, tag, getAppUserId());
    args[idIndex] = id;
    args[tagIndex] = tag;
    //key(tag,id)
    Notification notification = (Notification) args[notificationIndex];
    if (!VNotificationManager.get().dealNotification(id, notification, pkg)) {
      return 0;
    }
    VNotificationManager.get().addNotification(id, tag, pkg, getAppUserId());
    args[0] = getHostPkg();
    if (Build.VERSION.SDK_INT >= 18 && args[1] instanceof String) {
      args[1] = getHostPkg();
    }
    return method.invoke(who, args);
  }
}
origin: bzsome/VirtualApp-x326

@SuppressWarnings("unchecked")
public static <T> T getFirst(Object[] args, Class<?> clazz) {
  int index = indexOfFirst(args, clazz);
  if (index != -1) {
    return (T) args[index];
  }
  return null;
}
origin: darkskygit/VirtualApp

public static <T> T getFirstParam(Object[] args, Class<T> tClass) {
  if (args == null) {
    return null;
  }
  int index = ArrayUtils.indexOfFirst(args, tClass);
  if (index != -1) {
    return (T) args[index];
  }
  return null;
}
origin: darkskygit/VirtualApp

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WindowManager.LayoutParams.class);
    if (index != -1) {
      WindowManager.LayoutParams attrs = (WindowManager.LayoutParams) args[index];
      if (attrs != null) {
        attrs.packageName = getHostPkg();
      }
    }
    return method.invoke(who, args);
  }
}
origin: darkskygit/VirtualApp

  @Override
  public boolean beforeCall(Object who, Method method, Object... args) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && args[0] instanceof String) {
      args[0] = getHostPkg();
    }
    int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
    if (index >= 0) {
      args[index] = null;
    }
    return true;
  }
}
origin: darkskygit/VirtualApp

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
    if (index >= 0) {
      args[index] = null;
    }
    return super.call(who, method, args);
  }
}
origin: darkskygit/VirtualApp

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int editorInfoIndex = ArrayUtils.indexOfFirst(args, EditorInfo.class);
    if (editorInfoIndex != -1) {
      EditorInfo attribute = (EditorInfo) args[editorInfoIndex];
      attribute.packageName = getHostPkg();
    }
    return method.invoke(who, args);
  }
}
origin: bzsome/VirtualApp-x326

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WindowManager.LayoutParams.class);
    if (index != -1) {
      WindowManager.LayoutParams attrs = (WindowManager.LayoutParams) args[index];
      if (attrs != null) {
        attrs.packageName = getHostPkg();
      }
    }
    return method.invoke(who, args);
  }
}
origin: bzsome/VirtualApp-x326

public static String replaceFirstAppPkg(Object[] args) {
  if (args == null) {
    return null;
  }
  int index = ArrayUtils.indexOfFirst(args, String.class);
  if (index != -1) {
    String pkg = (String) args[index];
    args[index] = VirtualCore.get().getHostPkg();
    return pkg;
  }
  return null;
}
origin: darkskygit/VirtualApp

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int enableIndex = ArrayUtils.indexOfFirst(args, Boolean.class);
    boolean enable = (boolean) args[enableIndex];
    VNotificationManager.get().setNotificationsEnabledForPackage(pkg, enable, getAppUserId());
    return 0;
  }
}
origin: bzsome/VirtualApp-x326

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int enableIndex = ArrayUtils.indexOfFirst(args, Boolean.class);
    boolean enable = (boolean) args[enableIndex];
    VNotificationManager.get().setNotificationsEnabledForPackage(pkg, enable, getAppUserId());
    return 0;
  }
}
com.lody.virtual.helper.utilsArrayUtilsindexOfFirst

Popular methods of ArrayUtils

  • checkOffsetAndCount
  • contains
  • getFirst
  • indexOf
    Return first index of value in array, or -1 if not found.
  • indexOfLast
  • indexOfObject
  • isEmpty
  • protoIndexOf

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • startActivity (Activity)
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now