org.jf.dexlib2.AccessFlags.isSet()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(121)

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

AccessFlags.isSet介绍

暂无

代码示例

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

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: JesusFreke/smali

method_stack.peek().isStatic = AccessFlags.STATIC.isSet(accessFlags);
method_stack.peek().methodParameterRegisters =
    MethodUtil.getParameterRegisterCount((method_name_and_prototype69!=null?((smaliTreeWalker.method_name_and_prototype_return)method_name_and_prototype69).parameters:null), method_stack.peek().isStatic);

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

boolean isStatic = AccessFlags.STATIC.isSet(classSection.getMethodAccessFlags(methodKey));
Collection<? extends TypeKey> parameters = typeListSection.getTypes(
    protoSection.getParameters(methodSection.getPrototype(methodKey)));

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

if (!AccessFlags.STATIC.isSet(accessFlags) && field_initial_value19 != null) {
  throw new SemanticException(input, "Initial field values can only be specified for static fields.");

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

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

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

public static boolean isStatic(@Nonnull Field field) {
  return AccessFlags.STATIC.isSet(field.getAccessFlags());
}

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

public static boolean isStatic(@Nonnull Field field) {
  return AccessFlags.STATIC.isSet(field.getAccessFlags());
}

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

public static boolean isStatic(@Nonnull Method method) {
  return AccessFlags.STATIC.isSet(method.getAccessFlags());
}

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

public static boolean isStatic(@Nonnull Field field) {
  return AccessFlags.STATIC.isSet(field.getAccessFlags());
}

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

public static boolean isStatic(@Nonnull Method method) {
  return AccessFlags.STATIC.isSet(method.getAccessFlags());
}

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

public static boolean isStatic(@Nonnull Method method) {
  return AccessFlags.STATIC.isSet(method.getAccessFlags());
}

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

public static boolean canAccessClass(@Nonnull String accessorType, @Nonnull ClassDef accesseeClassDef) {
  if (AccessFlags.PUBLIC.isSet(accesseeClassDef.getAccessFlags())) {
    return true;
  }
  // Classes can only be public or package private. Any private or protected inner classes are actually
  // package private.
  return getPackage(accesseeClassDef.getType()).equals(getPackage(accessorType));
}

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

public static boolean canAccessClass(@Nonnull String accessorType, @Nonnull ClassDef accesseeClassDef) {
  if (AccessFlags.PUBLIC.isSet(accesseeClassDef.getAccessFlags())) {
    return true;
  }
  // Classes can only be public or package private. Any private or protected inner classes are actually
  // package private.
  return getPackage(accesseeClassDef.getType()).equals(getPackage(accessorType));
}

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

private boolean canAccessClass(@Nonnull ClassDef accessorClassDef, @Nonnull ClassDef accesseeClassDef) {
  if (AccessFlags.PUBLIC.isSet(accesseeClassDef.getAccessFlags())) {
    return true;
  }
  // Classes can only be public or package private. Any private or protected inner classes are actually
  // package private.
  return getPackage(accesseeClassDef.getType()).equals(getPackage(accessorClassDef.getType()));
}

代码示例来源:origin: tmurakami/dexopener

@Test
public void should_remove_final_modifier_from_the_given_class() throws IOException {
  ImmutableClassDef def = new ImmutableClassDef("Lfoo/Bar;",
                         AccessFlags.FINAL.getValue(),
                         "Ljava/lang/Object;",
                         null, null, null, null, null);
  byte[] bytecode = DexPoolUtils.toBytecode(new ImmutableDexFile(Opcodes.getDefault(),
                                  Collections.singleton(def)));
  DexRewriter rewriter = new DexRewriter(new FinalModifierRemoverModule());
  ClassDef out = rewriter.getClassDefRewriter()
              .rewrite(new DexBackedDexFile(null, bytecode)
                      .getClasses()
                      .iterator()
                      .next());
  assertFalse(AccessFlags.FINAL.isSet(out.getAccessFlags()));
}

相关文章