org.jf.dexlib2.iface.Method.getDefiningClass()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中org.jf.dexlib2.iface.Method.getDefiningClass()方法的一些代码示例,展示了Method.getDefiningClass()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Method.getDefiningClass()方法的具体详情如下:
包路径:org.jf.dexlib2.iface.Method
类名称:Method
方法名:getDefiningClass

Method.getDefiningClass介绍

[英]Gets the type of the class that defines this method.
[中]获取定义此方法的类的类型。

代码示例

代码示例来源:origin: JesusFreke/smali

/**
 * Checks if the interface method overrides the virtual or interface method2
 * @param method A Method from an interface
 * @param method2 A Method from an interface or a class
 * @return true if the interface method overrides the virtual or interface method2
 */
private boolean interfaceMethodOverrides(@Nonnull Method method, @Nonnull Method method2) {
  ClassProto classProto = (ClassProto)classPath.getClass(method2.getDefiningClass());
  if (classProto.isInterface()) {
    ClassProto targetClassProto = (ClassProto)classPath.getClass(method.getDefiningClass());
    return targetClassProto.implementsInterface(method2.getDefiningClass());
  } else {
    return false;
  }
}

代码示例来源:origin: JesusFreke/smali

private boolean isOverridableByDefaultMethod(@Nonnull Method method) {
  ClassProto classProto = (ClassProto)classPath.getClass(method.getDefiningClass());
  return classProto.isInterface();
}

代码示例来源:origin: JesusFreke/smali

if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
  ClassProto existingInterface = (ClassProto)classPath.getClass(
      defaultMethods.get(defaultMethodIndex).getDefiningClass());
  if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) {
    Method removedMethod = defaultMethods.remove(defaultMethodIndex);
    defaultConflictMethods.add(removedMethod);
      mirandaMethods.get(mirandaMethodIndex).getDefiningClass());
  if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) {
    Method oldMethod = mirandaMethods.remove(mirandaMethodIndex);
    int methodOrderValue = methodOrder.get(oldMethod);

代码示例来源:origin: JesusFreke/smali

if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
  ClassProto existingInterface = (ClassProto)classPath.getClass(
      defaultMethods.get(defaultMethodIndex).getDefiningClass());
  if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) {
    Method removedMethod = defaultMethods.remove(defaultMethodIndex);
    defaultConflictMethods.add(removedMethod);
      mirandaMethods.get(mirandaMethodIndex).getDefiningClass());
  if (!existingInterface.implementsInterface(interfaceMethod.getDefiningClass())) {
    Method oldMethod = mirandaMethods.remove(mirandaMethodIndex);
    int methodOrderValue = methodOrder.get(oldMethod);

代码示例来源:origin: JesusFreke/smali

ClassProto thisClass = (ClassProto)classPath.getClass(method.getDefiningClass());

代码示例来源:origin: Tencent/tinker

method.getDefiningClass(),
method.getName(),
method.getParameters(),

代码示例来源:origin: JesusFreke/smali

setPostRegisterTypeAndPropagateChanges(startOfMethod, thisRegister,
      RegisterType.getRegisterType(RegisterType.UNINIT_THIS,
          classPath.getClass(method.getDefiningClass())));
} else {
  setPostRegisterTypeAndPropagateChanges(startOfMethod, thisRegister,
      RegisterType.getRegisterType(RegisterType.REFERENCE,
          classPath.getClass(method.getDefiningClass())));

代码示例来源:origin: JesusFreke/smali

containingClass = method.getDefiningClass();

代码示例来源:origin: JesusFreke/smali

public static void writeEmptyMethodTo(IndentingWriter writer, Method method,
                   BaksmaliOptions options) throws IOException {
  writer.write(".method ");
  writeAccessFlags(writer, method.getAccessFlags());
  writer.write(method.getName());
  writer.write("(");
  ImmutableList<MethodParameter> methodParameters = ImmutableList.copyOf(method.getParameters());
  for (MethodParameter parameter: methodParameters) {
    writer.write(parameter.getType());
  }
  writer.write(")");
  writer.write(method.getReturnType());
  writer.write('\n');
  writer.indent(4);
  writeParameters(writer, method, methodParameters, options);
  String containingClass = null;
  if (options.implicitReferences) {
    containingClass = method.getDefiningClass();
  }
  AnnotationFormatter.writeTo(writer, method.getAnnotations(), containingClass);
  writer.deindent(4);
  writer.write(".end method\n");
}

代码示例来源:origin: JesusFreke/smali

if (isSuper) {
  TypeProto typeProto = classPath.getClass(method.getDefiningClass());
  TypeProto superType;
ClassDef thisClass = classPath.getClassDef(method.getDefiningClass());

代码示例来源:origin: JesusFreke/smali

ClassDef thisClass = classPath.getClassDef(method.getDefiningClass());

代码示例来源:origin: JesusFreke/smali

containingClass = method.getDefiningClass();

代码示例来源:origin: org.smali/dexlib2

@Override @Nonnull public String getDefiningClass() {
  return method.getDefiningClass();
}

代码示例来源:origin: org.smali/dexlib2

private boolean isOverridableByDefaultMethod(@Nonnull Method method) {
  ClassProto classProto = (ClassProto)classPath.getClass(method.getDefiningClass());
  return classProto.isInterface();
}

代码示例来源:origin: TACIXAT/CFGScanDroid

public ControlFlowGraph(Method method) {
  this(getFlatMethod(method));
  String definingClass = method.getDefiningClass();
  this.identifier = definingClass + "." + method.getName() + "()" + method.getReturnType();
  // this.identifier = definingClass.substring(definingClass.lastIndexOf("/")+1) + method.getName() + "(" + method.getReturnType() + ")";
  this.identifier = this.identifier.replace(";", "");
  this.shortIdentifier = identifier.substring(definingClass.lastIndexOf("/")+1);
}

代码示例来源:origin: JesusFreke/smali

final String classContext;
if (methodDef.classDef.options.implicitReferences) {
  classContext = methodDef.method.getDefiningClass();
} else {
  classContext = null;

代码示例来源:origin: KB5201314/ZjDroid

private boolean canAccess(@Nonnull Method virtualMethod) {
  if (!methodIsPackagePrivate(virtualMethod.getAccessFlags())) {
    return true;
  }
  String otherPackage = getPackage(virtualMethod.getDefiningClass());
  String ourPackage = getPackage(getClassDef().getType());
  return otherPackage.equals(ourPackage);
}

代码示例来源:origin: com.taobao.android/dex_patch

private static MethodImplementation modifyMethodAndFix(@Nonnull MethodImplementation implementation, Method method) {
  MutableMethodImplementation mutableImplementation = new MutableMethodImplementation(implementation);
  System.out.println(mutableImplementation.getRegisterCount());
  List<BuilderInstruction> instructions = mutableImplementation.getInstructions();
  mutableImplementation.addInstruction(0,
      new BuilderInstruction21c(Opcode.CONST_STRING, 0,
          new ImmutableStringReference("AndFix:" + method.getDefiningClass().replace("/", "."))));
  mutableImplementation.addInstruction(1,
      new BuilderInstruction35c(Opcode.INVOKE_STATIC, 1,
          0, 0, 0, 0, 0,
          new ImmutableMethodReference("Landroid/util/Log;", "e",
              Lists.newArrayList("Ljava/lang/String;", "Ljava/lang/String;"), "I")));
  return mutableImplementation;
}

代码示例来源:origin: testwhat/SmaliEx

public static ImmutableMethod of(Method method) {
  if (method instanceof ImmutableMethod) {
    return (ImmutableMethod)method;
  }
  return new ImmutableMethod(
      method.getDefiningClass(),
      method.getName(),
      method.getParameters(),
      method.getReturnType(),
      method.getAccessFlags(),
      method.getAnnotations(),
      method.getImplementation());
}

代码示例来源:origin: KB5201314/ZjDroid

public static ImmutableMethod of(Method method) {
  if (method instanceof ImmutableMethod) {
    return (ImmutableMethod)method;
  }
  return new ImmutableMethod(
      method.getDefiningClass(),
      method.getName(),
      method.getParameters(),
      method.getReturnType(),
      method.getAccessFlags(),
      method.getAnnotations(),
      method.getImplementation());
}

相关文章