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

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

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

Method.getAccessFlags介绍

[英]Gets the access flags for this method. This will be a combination of the AccessFlags.* flags that are marked as compatible for use with a method.
[中]获取此方法的访问标志。这将是AccessFlags的组合。*标记为与方法兼容的标志。

代码示例

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

@Override public int getAccessFlags() {
  return method.getAccessFlags();
}

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

if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
    ClassProto existingInterface = (ClassProto)classPath.getClass(
        defaultMethods.get(defaultMethodIndex).getDefiningClass());
  if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
  if (oldVtableMethod != null) {
    if (!interfaceMethodOverrides(interfaceMethod, oldVtableMethod)) {

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

if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
    ClassProto existingInterface = (ClassProto)classPath.getClass(
        defaultMethods.get(defaultMethodIndex).getDefiningClass());
  if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
if (!AccessFlags.ABSTRACT.isSet(interfaceMethod.getAccessFlags())) {
  defaultMethods.add(interfaceMethod);
  methodOrder.put(interfaceMethod, methodOrder.size());

代码示例来源:origin: Sable/soot

@Override
public void jimplify(DexBody body) {
 int acccessFlags = targetMethod.getAccessFlags();
 if (AccessFlags.STATIC.isSet(acccessFlags)) {
  jimplifyStatic(body);
 } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
  jimplifySpecial(body);
 } else {
  jimplifyVirtual(body);
 }
}

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

private void analyzeExecuteInlineRange(@Nonnull AnalyzedInstruction analyzedInstruction) {
  if (inlineResolver == null) {
    throw new AnalysisException("Cannot analyze an odexed instruction unless we are deodexing");
  }
  Instruction3rmi instruction = (Instruction3rmi)analyzedInstruction.instruction;
  Method resolvedMethod = inlineResolver.resolveExecuteInline(analyzedInstruction);
  Opcode deodexedOpcode;
  int acccessFlags = resolvedMethod.getAccessFlags();
  if (AccessFlags.STATIC.isSet(acccessFlags)) {
    deodexedOpcode = Opcode.INVOKE_STATIC_RANGE;
  } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
    deodexedOpcode = Opcode.INVOKE_DIRECT_RANGE;
  } else {
    deodexedOpcode = Opcode.INVOKE_VIRTUAL_RANGE;
  }
  Instruction3rc deodexedInstruction = new ImmutableInstruction3rc(deodexedOpcode, instruction.getStartRegister(),
      instruction.getRegisterCount(), resolvedMethod);
  analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
  analyzeInstruction(analyzedInstruction);
}

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

method.getParameters(),
method.getReturnType(),
method.getAccessFlags(),
method.getAnnotations(),
methodImpl

代码示例来源:origin: Sable/soot

isStatic = Modifier.isStatic(method.getAccessFlags());
numRegisters = code.getRegisterCount();
numParameterRegisters = MethodUtil.getParameterRegisterCount(method);

代码示例来源:origin: CalebFenton/simplify

boolean hasDefaultConstructor = false;
for (Method method : methods) {
  int access = method.getAccessFlags();
  String name = method.getName();
  String desc = buildDescriptor(method);

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

private void analyzeExecuteInline(@Nonnull AnalyzedInstruction analyzedInstruction) {
  if (inlineResolver == null) {
    throw new AnalysisException("Cannot analyze an odexed instruction unless we are deodexing");
  }
  Instruction35mi instruction = (Instruction35mi)analyzedInstruction.instruction;
  Method resolvedMethod = inlineResolver.resolveExecuteInline(analyzedInstruction);
  Opcode deodexedOpcode;
  int acccessFlags = resolvedMethod.getAccessFlags();
  if (AccessFlags.STATIC.isSet(acccessFlags)) {
    deodexedOpcode = Opcode.INVOKE_STATIC;
  } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
    deodexedOpcode = Opcode.INVOKE_DIRECT;
  } else {
    deodexedOpcode = Opcode.INVOKE_VIRTUAL;
  }
  Instruction35c deodexedInstruction = new ImmutableInstruction35c(deodexedOpcode, instruction.getRegisterCount(),
      instruction.getRegisterC(), instruction.getRegisterD(), instruction.getRegisterE(),
      instruction.getRegisterF(), instruction.getRegisterG(), resolvedMethod);
  analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
  analyzeInstruction(analyzedInstruction);
}

代码示例来源:origin: Sable/soot

/**
 * Retrieve the SootMethod equivalent of this method
 *
 * @return the SootMethod of this method
 */
public SootMethod makeSootMethod(final Method method) {
 int accessFlags = method.getAccessFlags();
 // get the name of the method
 String name = method.getName();
 List<SootClass> thrownExceptions = getThrownExceptions(method);
 List<Type> parameterTypes = getParameterTypes(method);
 // retrieve the return type of this method
 Type returnType = DexType.toSoot(method.getReturnType());
 // Build soot method by all available parameters
 SootMethod sm = declaringClass.getMethodUnsafe(name, parameterTypes, returnType);
 if (sm == null) {
  sm = Scene.v().makeSootMethod(name, parameterTypes, returnType, accessFlags, thrownExceptions);
 }
 // if the method is abstract or native, no code needs to be transformed
 int flags = method.getAccessFlags();
 if (Modifier.isAbstract(flags) || Modifier.isNative(flags)) {
  return sm;
 }
 if (Options.v().oaat() && declaringClass.resolvingLevel() <= SootClass.SIGNATURES) {
  return sm;
 }
 // sets the method source by adding its body as the active body
 sm.setSource(createMethodSource(method));
 return sm;
}

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

private static void writeParameters(IndentingWriter writer, Method method,
                  List<? extends MethodParameter> parameters,
                  BaksmaliOptions options) throws IOException {
  boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
  int registerNumber = isStatic?0:1;
  for (MethodParameter parameter: parameters) {

代码示例来源: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

public void writeTo(IndentingWriter writer) throws IOException {
  int parameterRegisterCount = 0;
  if (!AccessFlags.STATIC.isSet(method.getAccessFlags())) {
    parameterRegisterCount++;
  writeAccessFlags(writer, method.getAccessFlags());
  writer.write(method.getName());
  writer.write("(");

代码示例来源:origin: wala/WALA

@Override
public boolean isNative() {
  return (eMethod.getAccessFlags() & NATIVE.getValue()) != 0;
}

代码示例来源:origin: wala/WALA

@Override
public boolean isProtected() {
  return (eMethod.getAccessFlags() & PROTECTED.getValue()) != 0;
}

代码示例来源:origin: com.ibm.wala/com.ibm.wala.dalvik

@Override
public boolean isBridge() {
  return (eMethod.getAccessFlags() & BRIDGE.getValue()) != 0;
}

代码示例来源:origin: wala/WALA

@Override
public boolean isAbstract() {
  return (eMethod.getAccessFlags() & ABSTRACT.getValue()) != 0;
}

代码示例来源:origin: wala/WALA

@Override
public boolean isBridge() {
  return (eMethod.getAccessFlags() & BRIDGE.getValue()) != 0;
}

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

public static boolean isPackagePrivate(@Nonnull Method method) {
  return (method.getAccessFlags() & (AccessFlags.PRIVATE.getValue() |
      AccessFlags.PROTECTED.getValue() |
      AccessFlags.PUBLIC.getValue())) == 0;
}

代码示例来源: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());
}

相关文章