当前位置: 首页>>代码示例>>Java>>正文


Java Reference类代码示例

本文整理汇总了Java中org.jf.dexlib2.iface.reference.Reference的典型用法代码示例。如果您正苦于以下问题:Java Reference类的具体用法?Java Reference怎么用?Java Reference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Reference类属于org.jf.dexlib2.iface.reference包,在下文中一共展示了Reference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeReference

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public static void writeReference(IndentingWriter writer, int referenceType,
                                  Reference reference) throws IOException {
    switch (referenceType) {
        case ReferenceType.STRING:
            writeStringReference(writer, ((StringReference)reference).getString());
            return;
        case ReferenceType.TYPE:
            writer.write(((TypeReference)reference).getType());
            return;
        case ReferenceType.METHOD:
            ReferenceUtil.writeMethodDescriptor(writer, (MethodReference) reference);
            return;
        case ReferenceType.FIELD:
            ReferenceUtil.writeFieldDescriptor(writer, (FieldReference)reference);
            return;
        default:
            throw new IllegalStateException("Unknown reference type");
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:20,代码来源:ReferenceFormatter.java

示例2: ImmutableInstruction35c

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public ImmutableInstruction35c(@Nonnull Opcode opcode,
                               int registerCount,
                               int registerC,
                               int registerD,
                               int registerE,
                               int registerF,
                               int registerG,
                               @Nonnull Reference reference) {
    super(opcode);
    this.registerCount = Preconditions.check35cRegisterCount(registerCount);
    this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
    this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
    this.registerE = (registerCount>2) ? Preconditions.checkNibbleRegister(registerE) : 0;
    this.registerF = (registerCount>3) ? Preconditions.checkNibbleRegister(registerF) : 0;
    this.registerG = (registerCount>4) ? Preconditions.checkNibbleRegister(registerG) : 0;
    this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:18,代码来源:ImmutableInstruction35c.java

示例3: analyzeMoveResult

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
private void analyzeMoveResult(@Nonnull AnalyzedInstruction analyzedInstruction) {
    AnalyzedInstruction previousInstruction = analyzedInstructions.valueAt(analyzedInstruction.instructionIndex-1);
    if (!previousInstruction.instruction.getOpcode().setsResult()) {
        throw new AnalysisException(analyzedInstruction.instruction.getOpcode().name + " must occur after an " +
                "invoke-*/fill-new-array instruction");
    }

    RegisterType resultRegisterType;
    ReferenceInstruction invokeInstruction = (ReferenceInstruction)previousInstruction.instruction;
    Reference reference = invokeInstruction.getReference();

    if (reference instanceof MethodReference) {
        resultRegisterType = RegisterType.getRegisterType(classPath, ((MethodReference)reference).getReturnType());
    } else {
        resultRegisterType = RegisterType.getRegisterType(classPath, (TypeReference)reference);
    }

    setDestinationRegisterTypeAndPropagateChanges(analyzedInstruction, resultRegisterType);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:20,代码来源:MethodAnalyzer.java

示例4: BuilderInstruction35c

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public BuilderInstruction35c(@Nonnull Opcode opcode,
                             int registerCount,
                             int registerC,
                             int registerD,
                             int registerE,
                             int registerF,
                             int registerG,
                             @Nonnull Reference reference) {
    super(opcode);
    this.registerCount = Preconditions.check35cRegisterCount(registerCount);
    this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
    this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
    this.registerE = (registerCount>2) ? Preconditions.checkNibbleRegister(registerE) : 0;
    this.registerF = (registerCount>3) ? Preconditions.checkNibbleRegister(registerF) : 0;
    this.registerG = (registerCount>4) ? Preconditions.checkNibbleRegister(registerG) : 0;
    this.reference = reference;
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:18,代码来源:BuilderInstruction35c.java

示例5: ImmutableInstruction35c

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public ImmutableInstruction35c( Opcode opcode,
                               int registerCount,
                               int registerC,
                               int registerD,
                               int registerE,
                               int registerF,
                               int registerG,
                                Reference reference) {
    super(opcode);
    this.registerCount = Preconditions.check35cAnd45ccRegisterCount(registerCount);
    this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
    this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
    this.registerE = (registerCount>2) ? Preconditions.checkNibbleRegister(registerE) : 0;
    this.registerF = (registerCount>3) ? Preconditions.checkNibbleRegister(registerF) : 0;
    this.registerG = (registerCount>4) ? Preconditions.checkNibbleRegister(registerG) : 0;
    this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:18,代码来源:ImmutableInstruction35c.java

示例6: getReferenceIndex

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
private int getReferenceIndex(int referenceType, Reference reference) {
    switch (referenceType) {
        case ReferenceType.FIELD:
            return fieldSection.getItemIndex((FieldRefKey) reference);
        case ReferenceType.METHOD:
            return methodSection.getItemIndex((MethodRefKey) reference);
        case ReferenceType.STRING:
            return stringSection.getItemIndex((StringRef) reference);
        case ReferenceType.TYPE:
            return typeSection.getItemIndex((TypeRef) reference);
        case ReferenceType.METHOD_PROTO:
            return protoSection.getItemIndex((ProtoRefKey) reference);
        default:
            throw new ExceptionWithContext("Unknown reference type: %d",  referenceType);
    }
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:17,代码来源:InstructionWriter.java

示例7: analyzeMoveResult

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
private void analyzeMoveResult( AnalyzedInstruction analyzedInstruction) {
    AnalyzedInstruction previousInstruction = null;
    if (analyzedInstruction.instructionIndex > 0) {
        previousInstruction = analyzedInstructions.valueAt(analyzedInstruction.instructionIndex-1);
    }
    if (previousInstruction == null || !previousInstruction.instruction.getOpcode().setsResult()) {
        throw new AnalysisException(analyzedInstruction.instruction.getOpcode().name + " must occur after an " +
                "invoke-*/fill-new-array instruction");
    }

    RegisterType resultRegisterType;
    ReferenceInstruction invokeInstruction = (ReferenceInstruction)previousInstruction.instruction;
    Reference reference = invokeInstruction.getReference();

    if (reference instanceof MethodReference) {
        resultRegisterType = RegisterType.getRegisterType(classPath, ((MethodReference)reference).getReturnType());
    } else {
        resultRegisterType = RegisterType.getRegisterType(classPath, (TypeReference)reference);
    }

    setDestinationRegisterTypeAndPropagateChanges(analyzedInstruction, resultRegisterType);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:23,代码来源:MethodAnalyzer.java

示例8: canNarrowAfterInstanceOf

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
static boolean canNarrowAfterInstanceOf(AnalyzedInstruction analyzedInstanceOfInstruction,
                                        AnalyzedInstruction analyzedIfInstruction, ClassPath classPath) {
    if (!classPath.isArt()) {
        return false;
    }

    Instruction ifInstruction = analyzedIfInstruction.instruction;
    if (((Instruction21t)ifInstruction).getRegisterA() == analyzedInstanceOfInstruction.getDestinationRegister()) {
        Reference reference = ((Instruction22c)analyzedInstanceOfInstruction.getInstruction()).getReference();
        RegisterType registerType = RegisterType.getRegisterType(classPath, (TypeReference)reference);

        try {
            if (registerType.type != null && !registerType.type.isInterface()) {
                int objectRegister = ((TwoRegisterInstruction)analyzedInstanceOfInstruction.getInstruction())
                        .getRegisterB();

                RegisterType originalType = analyzedIfInstruction.getPreInstructionRegisterType(objectRegister);

                return isNarrowingConversion(originalType, registerType);
            }
        } catch (UnresolvedClassException ex) {
            return false;
        }
    }
    return false;
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:27,代码来源:MethodAnalyzer.java

示例9: makeReference

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public static Reference makeReference( DexBackedDexFile dexFile, int referenceType, int referenceIndex) {
    switch (referenceType) {
        case ReferenceType.STRING:
            return new DexBackedStringReference(dexFile, referenceIndex);
        case ReferenceType.TYPE:
            return new DexBackedTypeReference(dexFile, referenceIndex);
        case ReferenceType.METHOD:
            return new DexBackedMethodReference(dexFile, referenceIndex);
        case ReferenceType.FIELD:
            return new DexBackedFieldReference(dexFile, referenceIndex);
        case ReferenceType.METHOD_PROTO:
            return new DexBackedMethodProtoReference(dexFile, referenceIndex);
        default:
            throw new ExceptionWithContext("Invalid reference type: %d", referenceType);
    }
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:17,代码来源:DexBackedReference.java

示例10: BuilderInstruction35c

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public BuilderInstruction35c( Opcode opcode,
                             int registerCount,
                             int registerC,
                             int registerD,
                             int registerE,
                             int registerF,
                             int registerG,
                              Reference reference) {
    super(opcode);
    this.registerCount = Preconditions.check35cAnd45ccRegisterCount(registerCount);
    this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
    this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
    this.registerE = (registerCount>2) ? Preconditions.checkNibbleRegister(registerE) : 0;
    this.registerF = (registerCount>3) ? Preconditions.checkNibbleRegister(registerF) : 0;
    this.registerG = (registerCount>4) ? Preconditions.checkNibbleRegister(registerG) : 0;
    this.reference = reference;
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:18,代码来源:BuilderInstruction35c.java

示例11: analyzeMoveResult

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
private void analyzeMoveResult(@Nonnull AnalyzedInstruction analyzedInstruction) {
    AnalyzedInstruction previousInstruction = null;
    if (analyzedInstruction.instructionIndex > 0) {
        previousInstruction = analyzedInstructions.valueAt(analyzedInstruction.instructionIndex-1);
    }
    if (previousInstruction == null || !previousInstruction.instruction.getOpcode().setsResult()) {
        throw new AnalysisException(analyzedInstruction.instruction.getOpcode().name + " must occur after an " +
                "invoke-*/fill-new-array instruction");
    }

    RegisterType resultRegisterType;
    ReferenceInstruction invokeInstruction = (ReferenceInstruction)previousInstruction.instruction;
    Reference reference = invokeInstruction.getReference();

    if (reference instanceof MethodReference) {
        resultRegisterType = RegisterType.getRegisterType(classPath, ((MethodReference)reference).getReturnType());
    } else {
        resultRegisterType = RegisterType.getRegisterType(classPath, (TypeReference)reference);
    }

    setDestinationRegisterTypeAndPropagateChanges(analyzedInstruction, resultRegisterType);
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:23,代码来源:MethodAnalyzer.java

示例12: convertReference

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
private Reference convertReference(@Nonnull Reference reference) {
    if (reference != null && this.dexBuilder != null) {
        return this.dexBuilder.internReference(reference);
    } else {
        return reference;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:BuilderMutableMethodImplementation.java

示例13: ImmutableInstruction21c

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public ImmutableInstruction21c(@Nonnull Opcode opcode,
                                  int registerA,
                                  @Nonnull Reference reference) {
    super(opcode);
    this.registerA = Preconditions.checkByteRegister(registerA);
    this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:8,代码来源:ImmutableInstruction21c.java

示例14: makeInstruction35c

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public ImmutableInstruction35c makeInstruction35c(@Nonnull Opcode opcode,
                                                  int registerCount,
                                                  int registerC,
                                                  int registerD,
                                                  int registerE,
                                                  int registerF,
                                                  int registerG,
                                                  @Nonnull Reference reference) {
    return new ImmutableInstruction35c(opcode, registerCount, registerC, registerD, registerE, registerF, registerG,
            reference);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:12,代码来源:ImmutableInstructionFactory.java

示例15: ImmutableInstruction22c

import org.jf.dexlib2.iface.reference.Reference; //导入依赖的package包/类
public ImmutableInstruction22c(@Nonnull Opcode opcode,
                               int registerA,
                               int registerB,
                               @Nonnull Reference reference) {
    super(opcode);
    this.registerA = Preconditions.checkNibbleRegister(registerA);
    this.registerB = Preconditions.checkNibbleRegister(registerB);
    this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:10,代码来源:ImmutableInstruction22c.java


注:本文中的org.jf.dexlib2.iface.reference.Reference类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。