Tabnine Logo
ReflectException
Code IndexAdd Tabnine to your IDE (free)

How to use
ReflectException
in
com.lody.virtual.helper.utils

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

origin: android-hacker/VirtualXposed

/**
 * 取得一个类,此操作会初始化类的static区域.
 *
 * @see Class#forName(String)
 */
private static Class<?> forName(String name) throws ReflectException {
  try {
    return Class.forName(name);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

  Reflect.on(dm).set("mService", boxBinder.getProxyInterface());
} catch (ReflectException e) {
  e.printStackTrace();
origin: darkskygit/VirtualApp

  Reflect.on(dm).set("mService", boxBinder.getProxyInterface());
} catch (ReflectException e) {
  e.printStackTrace();
origin: android-hacker/VirtualXposed

private static Class<?> forName(String name, ClassLoader classLoader) throws ReflectException {
  try {
    return Class.forName(name, true, classLoader);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: bzsome/VirtualApp-x326

  Reflect.on(dm).set("mService", boxBinder.getProxyInterface());
} catch (ReflectException e) {
  e.printStackTrace();
origin: android-hacker/VirtualXposed

/**
 * 取得指定名称的字段
 *
 * @param name name
 * @return reflect
 * @throws ReflectException
 */
public Reflect field(String name) throws ReflectException {
  try {
    Field field = field0(name);
    return on(field.get(object));
  } catch (Exception e) {
    throw new ReflectException(object.getClass().getName(), e);
  }
}
origin: android-hacker/VirtualXposed

private static Reflect on(Constructor<?> constructor, Object... args) throws ReflectException {
  try {
    return on(accessible(constructor).newInstance(args));
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

private Field field0(String name) throws ReflectException {
  Class<?> type = type();
  // 先尝试取得公有字段
  try {
    return type.getField(name);
  }
  // 此时尝试非公有字段
  catch (NoSuchFieldException e) {
    do {
      try {
        return accessible(type.getDeclaredField(name));
      } catch (NoSuchFieldException ignore) {
      }
      type = type.getSuperclass();
    } while (type != null);
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

private static Reflect on(Method method, Object object, Object... args) throws ReflectException {
  try {
    accessible(method);
    if (method.getReturnType() == void.class) {
      method.invoke(object, args);
      return on(object);
    } else {
      return on(method.invoke(object, args));
    }
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

/**
 * 设置指定字段为指定值
 *
 * @param name
 * @param value
 * @return
 * @throws ReflectException
 */
public Reflect set(String name, Object value) throws ReflectException {
  try {
    Field field = field0(name);
    field.setAccessible(true);
    field.set(object, unwrap(value));
    return this;
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

throw new ReflectException("no method found for " + name, new NoSuchMethodException("No best method " + name + " with params " + Arrays.toString(types)
    + " could be found on type " + type() + "."));
origin: android-hacker/VirtualXposed

/**
 * 创建一个实例根据传入的参数
 *
 * @param args 参数
 * @return Reflect
 * @throws ReflectException
 */
public Reflect create(Object... args) throws ReflectException {
  Class<?>[] types = types(args);
  try {
    Constructor<?> constructor = type().getDeclaredConstructor(types);
    return on(constructor, args);
  } catch (NoSuchMethodException e) {
    for (Constructor<?> constructor : type().getDeclaredConstructors()) {
      if (match(constructor.getParameterTypes(), types)) {
        return on(constructor, args);
      }
    }
    throw new ReflectException(e);
  }
}
origin: android-hacker/VirtualXposed

/**
 * 调用方法根据传入的参数
 *
 * @param name
 * @param args
 * @return
 * @throws ReflectException
 */
public Reflect call(String name, Object... args) throws ReflectException {
  Class<?>[] types = types(args);
  try {
    Method method = exactMethod(name, types);
    return on(method, object, args);
  } catch (NoSuchMethodException e) {
    try {
      Method method = similarMethod(name, types);
      return on(method, object, args);
    } catch (NoSuchMethodException e1) {
      throw new ReflectException(e1);
    }
  }
}
origin: darkskygit/VirtualApp

/**
 * 取得一个类,此操作会初始化类的static区域.
 *
 * @see Class#forName(String)
 */
private static Class<?> forName(String name) throws ReflectException {
  try {
    return Class.forName(name);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: bzsome/VirtualApp-x326

private static Class<?> forName(String name, ClassLoader classLoader) throws ReflectException {
  try {
    return Class.forName(name, true, classLoader);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: darkskygit/VirtualApp

private static Class<?> forName(String name, ClassLoader classLoader) throws ReflectException {
  try {
    return Class.forName(name, true, classLoader);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: bzsome/VirtualApp-x326

/**
 * 取得一个类,此操作会初始化类的static区域.
 *
 * @see Class#forName(String)
 */
private static Class<?> forName(String name) throws ReflectException {
  try {
    return Class.forName(name);
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: bzsome/VirtualApp-x326

private static Reflect on(Constructor<?> constructor, Object... args) throws ReflectException {
  try {
    return on(accessible(constructor).newInstance(args));
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: darkskygit/VirtualApp

private static Reflect on(Constructor<?> constructor, Object... args) throws ReflectException {
  try {
    return on(accessible(constructor).newInstance(args));
  } catch (Exception e) {
    throw new ReflectException(e);
  }
}
origin: darkskygit/VirtualApp

/**
 * 取得指定名称的字段
 *
 * @param name name
 * @return reflect
 * @throws ReflectException
 */
public Reflect field(String name) throws ReflectException {
  try {
    Field field = field0(name);
    return on(field.get(object));
  } catch (Exception e) {
    throw new ReflectException(object.getClass().getName(), e);
  }
}
com.lody.virtual.helper.utilsReflectException

Most used methods

  • <init>
  • printStackTrace

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Socket (java.net)
    Provides a client-side TCP socket.
  • JCheckBox (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now