本文整理汇总了Java中org.jf.dexlib2.iface.instruction.formats.Instruction22c类的典型用法代码示例。如果您正苦于以下问题:Java Instruction22c类的具体用法?Java Instruction22c怎么用?Java Instruction22c使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Instruction22c类属于org.jf.dexlib2.iface.instruction.formats包,在下文中一共展示了Instruction22c类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
public void jimplify (DexBody body) {
Instruction22c i = (Instruction22c)instruction;
int dest = i.getRegisterA();
int source = i.getRegisterB();
Type t = DexType.toSoot((TypeReference)(i.getReference()));
InstanceOfExpr e = Jimple.v().newInstanceOfExpr(body.getRegisterLocal(source), t);
assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), e);
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
int op = (int)instruction.getOpcode().value;
//DalvikTyper.v().?
}
}
示例2: rewrite
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
@Nonnull
@Override
public Instruction rewrite(@Nonnull Instruction instruction) {
if (instruction instanceof ReferenceInstruction) {
switch (instruction.getOpcode().format) {
case Format20bc:
return new RewrittenInstruction20bc((Instruction20bc) instruction);
case Format21c:
return new RewrittenInstruction21c((Instruction21c) instruction);
case Format22c:
return new RewrittenInstruction22c((Instruction22c) instruction);
case Format31c:
return new RewrittenInstruction31c((Instruction31c) instruction);
case Format35c:
return new RewrittenInstruction35c((Instruction35c) instruction);
case Format3rc:
return new RewrittenInstruction3rc((Instruction3rc) instruction);
default:
throw new IllegalArgumentException();
}
}
return instruction;
}
示例3: newBuilderInstruction22c
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
@Nonnull
private BuilderInstruction22c newBuilderInstruction22c(@Nonnull Instruction22c instruction) {
return new BuilderInstruction22c(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB(),
convertReference(instruction.getReference()));
}
示例4: of
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
public static ImmutableInstruction22c of(Instruction22c instruction) {
if (instruction instanceof ImmutableInstruction22c) {
return (ImmutableInstruction22c)instruction;
}
return new ImmutableInstruction22c(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB(),
instruction.getReference());
}
示例5: sourceRegister
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
/**
* Return the source register for this instruction.
*/
private int sourceRegister() {
// I hate smali's API ..
if (instruction instanceof Instruction23x)
return ((Instruction23x) instruction).getRegisterA();
else if (instruction instanceof Instruction22c)
return ((Instruction22c) instruction).getRegisterA();
else if (instruction instanceof Instruction21c)
return ((Instruction21c) instruction).getRegisterA();
else throw new RuntimeException("Instruction is not a instance, array or static op");
}
示例6: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction22c))
throw new IllegalArgumentException("Expected Instruction22c but got: "+instruction.getClass());
Instruction22c newArray = (Instruction22c)instruction;
int dest = newArray.getRegisterA();
Value size = body.getRegisterLocal(newArray.getRegisterB());
Type t = DexType.toSoot((TypeReference) newArray.getReference());
// NewArrayExpr needs the ElementType as it increases the array dimension by 1
Type arrayType = ((ArrayType) t).getElementType();
Debug.printDbg("new array element type: ", arrayType);
NewArrayExpr newArrayExpr = Jimple.v().newNewArrayExpr(arrayType, size);
Local l = body.getRegisterLocal(dest);
assign = Jimple.v().newAssignStmt(l, newArrayExpr);
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
int op = (int)instruction.getOpcode().value;
DalvikTyper.v().setType(newArrayExpr.getSizeBox(), IntType.v(), true);
DalvikTyper.v().setType(assign.getLeftOpBox(), newArrayExpr.getType(), false);
}
}
示例7: of
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
public static ImmutableInstruction22c of(Instruction22c instruction) {
if (instruction instanceof ImmutableInstruction22c) {
return (ImmutableInstruction22c) instruction;
}
return new ImmutableInstruction22c(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB(),
instruction.getReference());
}
示例8: write
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
public void write(@Nonnull Instruction22c instruction) {
try {
writer.write(instruction.getOpcode().value);
writer.write(packNibbles(instruction.getRegisterA(), instruction.getRegisterB()));
writer.writeUshort(getReferenceIndex(instruction));
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
示例9: newBuilderInstruction22c
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
@Nonnull
private BuilderInstruction22c newBuilderInstruction22c(@Nonnull Instruction22c instruction) {
return new BuilderInstruction22c(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB(),
instruction.getReference());
}
示例10: RewrittenInstruction22c
import org.jf.dexlib2.iface.instruction.formats.Instruction22c; //导入依赖的package包/类
public RewrittenInstruction22c(@Nonnull Instruction22c instruction) {
super(instruction);
}