From fe42130f05389b8ca60a958059e4b0171170f99b Mon Sep 17 00:00:00 2001 From: edwardxwu Date: Thu, 28 Aug 2014 13:57:45 -0700 Subject: [PATCH] Fixed the bug of not setting the location field of the instruction in addInstruction(i,instruction) method --- .../org/jf/dexlib2/builder/MutableMethodImplementation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brut.apktool.smali/dexlib2/src/main/java/org/jf/dexlib2/builder/MutableMethodImplementation.java b/brut.apktool.smali/dexlib2/src/main/java/org/jf/dexlib2/builder/MutableMethodImplementation.java index d536451f..f734e018 100644 --- a/brut.apktool.smali/dexlib2/src/main/java/org/jf/dexlib2/builder/MutableMethodImplementation.java +++ b/brut.apktool.smali/dexlib2/src/main/java/org/jf/dexlib2/builder/MutableMethodImplementation.java @@ -213,8 +213,10 @@ public class MutableMethodImplementation implements MethodImplementation { return; } int codeAddress = instructionList.get(index).getCodeAddress(); + MethodLocation newLoc = new MethodLocation(instruction, codeAddress, index); + instructionList.add(index, newLoc); + instruction.location = newLoc; - instructionList.add(index, new MethodLocation(instruction, codeAddress, index)); codeAddress += instruction.getCodeUnits(); for (int i=index+1; i