use of com.android.dx.io.instructions.DecodedInstruction in project jadx by skylot.
the class InsnDecoder method process.
public InsnNode[] process() throws DecodeException {
InsnNode[] instructions = new InsnNode[insnArr.length];
for (int i = 0; i < insnArr.length; i++) {
DecodedInstruction rawInsn = insnArr[i];
if (rawInsn != null) {
InsnNode insn = decode(rawInsn, i);
if (insn != null) {
insn.setOffset(i);
}
instructions[i] = insn;
} else {
instructions[i] = null;
}
}
insnArr = null;
return instructions;
}
use of com.android.dx.io.instructions.DecodedInstruction in project jadx by skylot.
the class InsnDecoder method decodeInsns.
public void decodeInsns(Code mthCode) throws DecodeException {
short[] encodedInstructions = mthCode.getInstructions();
int size = encodedInstructions.length;
DecodedInstruction[] decoded = new DecodedInstruction[size];
ShortArrayCodeInput in = new ShortArrayCodeInput(encodedInstructions);
try {
while (in.hasMore()) {
decoded[in.cursor()] = DecodedInstruction.decode(in);
}
} catch (Exception e) {
throw new DecodeException(method, "", e);
}
insnArr = decoded;
}
use of com.android.dx.io.instructions.DecodedInstruction in project buck by facebook.
the class InstructionTransformer method transform.
public short[] transform(IndexMap indexMap, short[] encodedInstructions) throws DexException {
DecodedInstruction[] decodedInstructions = DecodedInstruction.decodeAll(encodedInstructions);
int size = decodedInstructions.length;
this.indexMap = indexMap;
mappedInstructions = new DecodedInstruction[size];
mappedAt = 0;
reader.visitAll(decodedInstructions);
ShortArrayCodeOutput out = new ShortArrayCodeOutput(size);
for (DecodedInstruction instruction : mappedInstructions) {
if (instruction != null) {
instruction.encode(out);
}
}
this.indexMap = null;
return out.getArray();
}
use of com.android.dx.io.instructions.DecodedInstruction in project J2ME-Loader by nikita36078.
the class CodeReader method visitAll.
public void visitAll(DecodedInstruction[] decodedInstructions) throws DexException {
int size = decodedInstructions.length;
for (int i = 0; i < size; i++) {
DecodedInstruction one = decodedInstructions[i];
if (one == null) {
continue;
}
callVisit(decodedInstructions, one);
}
}
use of com.android.dx.io.instructions.DecodedInstruction in project J2ME-Loader by nikita36078.
the class InstructionTransformer method transform.
public short[] transform(IndexMap indexMap, short[] encodedInstructions) throws DexException {
DecodedInstruction[] decodedInstructions = DecodedInstruction.decodeAll(encodedInstructions);
int size = decodedInstructions.length;
this.indexMap = indexMap;
mappedInstructions = new DecodedInstruction[size];
mappedAt = 0;
reader.visitAll(decodedInstructions);
ShortArrayCodeOutput out = new ShortArrayCodeOutput(size);
for (DecodedInstruction instruction : mappedInstructions) {
if (instruction != null) {
instruction.encode(out);
}
}
this.indexMap = null;
return out.getArray();
}
Aggregations