本文整理汇总了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");
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}